|
@@ -32,6 +32,7 @@ import vip.xiaonuo.common.pojo.CommonValidList;
|
|
|
import vip.xiaonuo.common.util.PinyinUtils;
|
|
import vip.xiaonuo.common.util.PinyinUtils;
|
|
|
import vip.xiaonuo.disk.domain.CourseAuditRecord;
|
|
import vip.xiaonuo.disk.domain.CourseAuditRecord;
|
|
|
import vip.xiaonuo.disk.domain.KeyWord;
|
|
import vip.xiaonuo.disk.domain.KeyWord;
|
|
|
|
|
+import vip.xiaonuo.disk.domain.ResourceRecordUserRelate;
|
|
|
import vip.xiaonuo.disk.dto.courseauditrecord.CourseAuditRecordAddParam;
|
|
import vip.xiaonuo.disk.dto.courseauditrecord.CourseAuditRecordAddParam;
|
|
|
import vip.xiaonuo.disk.dto.courseauditrecord.CourseAuditRecordEditParam;
|
|
import vip.xiaonuo.disk.dto.courseauditrecord.CourseAuditRecordEditParam;
|
|
|
import vip.xiaonuo.disk.dto.courseauditrecord.CourseAuditRecordIdParam;
|
|
import vip.xiaonuo.disk.dto.courseauditrecord.CourseAuditRecordIdParam;
|
|
@@ -72,6 +73,9 @@ public class ResourceRecordController {
|
|
|
@Resource
|
|
@Resource
|
|
|
private KeyWordService keyWordService;
|
|
private KeyWordService keyWordService;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private ResourceRecordUserRelateService resourceRecordUserRelateService;
|
|
|
|
|
+
|
|
|
@Resource
|
|
@Resource
|
|
|
private CourseInfoService courseInfoService;
|
|
private CourseInfoService courseInfoService;
|
|
|
|
|
|
|
@@ -160,7 +164,12 @@ public class ResourceRecordController {
|
|
|
String queryInfoPinyin=StringUtils.deleteWhitespace(pinyinUtils.toPinyin(queryInfo));
|
|
String queryInfoPinyin=StringUtils.deleteWhitespace(pinyinUtils.toPinyin(queryInfo));
|
|
|
param.put("queryInfoPinyin", queryInfoPinyin);
|
|
param.put("queryInfoPinyin", queryInfoPinyin);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ //私密权限私可见资源
|
|
|
|
|
+ Map privacyParam=new HashMap();
|
|
|
|
|
+ privacyParam.put("userId", StpLoginUserUtil.getLoginUser().getId());
|
|
|
|
|
+ List<ResourceRecordUserRelate> userRelateList=resourceRecordUserRelateService.allList(privacyParam);
|
|
|
|
|
+ List<String> privacyList=userRelateList.stream().map(ResourceRecordUserRelate::getResourceRecord).collect(Collectors.toList());
|
|
|
|
|
+ param.put("privacyList",privacyList );
|
|
|
param.put("collegeId", req.getParameter("collegeId"));
|
|
param.put("collegeId", req.getParameter("collegeId"));
|
|
|
param.put("collegeTwoId", req.getParameter("collegeTwoId"));
|
|
param.put("collegeTwoId", req.getParameter("collegeTwoId"));
|
|
|
param.put("collegeThreeId", req.getParameter("collegeThreeId"));
|
|
param.put("collegeThreeId", req.getParameter("collegeThreeId"));
|
|
@@ -185,6 +194,10 @@ public class ResourceRecordController {
|
|
|
public CommonResult<String> add(@RequestBody @Valid CourseAuditRecordAddParam courseAuditRecordAddParam) {
|
|
public CommonResult<String> add(@RequestBody @Valid CourseAuditRecordAddParam courseAuditRecordAddParam) {
|
|
|
//生成统一的上传批次号
|
|
//生成统一的上传批次号
|
|
|
String uploadBatchNum = UUID.randomUUID().toString();
|
|
String uploadBatchNum = UUID.randomUUID().toString();
|
|
|
|
|
+ if("1".equals(courseAuditRecordAddParam.getAuthType()))
|
|
|
|
|
+ {
|
|
|
|
|
+ if(StringUtils.isEmpty(courseAuditRecordAddParam.getUserRelateIds()))return CommonResult.error("私密权限关联用户不能为空");
|
|
|
|
|
+ }
|
|
|
//该次上传附件信息
|
|
//该次上传附件信息
|
|
|
String userFileIdsStr=courseAuditRecordAddParam.getUserfileIds();
|
|
String userFileIdsStr=courseAuditRecordAddParam.getUserfileIds();
|
|
|
String[] userFileIdList = userFileIdsStr.split(",");
|
|
String[] userFileIdList = userFileIdsStr.split(",");
|
|
@@ -199,8 +212,25 @@ public class ResourceRecordController {
|
|
|
courseAuditRecord.setUploadBatchNum(uploadBatchNum);
|
|
courseAuditRecord.setUploadBatchNum(uploadBatchNum);
|
|
|
if(StringUtils.isNotEmpty(courseAuditRecordAddParam.getKeywordValue()))courseAuditRecord.setKeywordPinyin(StringUtils.deleteWhitespace(pinyinUtils.toPinyin(courseAuditRecordAddParam.getKeywordValue(),false)));
|
|
if(StringUtils.isNotEmpty(courseAuditRecordAddParam.getKeywordValue()))courseAuditRecord.setKeywordPinyin(StringUtils.deleteWhitespace(pinyinUtils.toPinyin(courseAuditRecordAddParam.getKeywordValue(),false)));
|
|
|
courseAuditRecordList.add(courseAuditRecord);
|
|
courseAuditRecordList.add(courseAuditRecord);
|
|
|
|
|
+ courseAuditRecord=courseAuditRecordService.addOne(courseAuditRecord);
|
|
|
|
|
+ //存储私密权限下关联的用户
|
|
|
|
|
+ if("1".equals(courseAuditRecordAddParam.getAuthType()))
|
|
|
|
|
+ {
|
|
|
|
|
+ String userRelateIdsStr=courseAuditRecordAddParam.getUserRelateIds();
|
|
|
|
|
+ String[] userRelateIdList = userRelateIdsStr.split(",");
|
|
|
|
|
+ List<ResourceRecordUserRelate> resourceRecordUserRelateList = new ArrayList<>();
|
|
|
|
|
+ for(String userRelateId:userRelateIdList)
|
|
|
|
|
+ {
|
|
|
|
|
+ ResourceRecordUserRelate resourceRecordUserRelate=new ResourceRecordUserRelate();
|
|
|
|
|
+ resourceRecordUserRelate.setUserId(userRelateId);
|
|
|
|
|
+ resourceRecordUserRelate.setResourceRecord(courseAuditRecord.getId());
|
|
|
|
|
+ resourceRecordUserRelateList.add(resourceRecordUserRelate);
|
|
|
|
|
+ }
|
|
|
|
|
+ resourceRecordUserRelateService.addBatch(resourceRecordUserRelateList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
- courseAuditRecordService.addBatch(courseAuditRecordList);
|
|
|
|
|
|
|
+// courseAuditRecordService.addBatch(courseAuditRecordList);
|
|
|
return CommonResult.ok();
|
|
return CommonResult.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -217,9 +247,42 @@ public class ResourceRecordController {
|
|
|
@PostMapping("/disk/courseauditrecord/edit")
|
|
@PostMapping("/disk/courseauditrecord/edit")
|
|
|
public CommonResult<String> edit(@RequestBody @Valid CourseAuditRecordEditParam courseAuditRecordEditParam) {
|
|
public CommonResult<String> edit(@RequestBody @Valid CourseAuditRecordEditParam courseAuditRecordEditParam) {
|
|
|
if(StringUtils.isEmpty(courseAuditRecordEditParam.getId()))return CommonResult.error("id不能为空");
|
|
if(StringUtils.isEmpty(courseAuditRecordEditParam.getId()))return CommonResult.error("id不能为空");
|
|
|
|
|
+ if(StringUtils.isNotEmpty(courseAuditRecordEditParam.getAuthType()))
|
|
|
|
|
+ {
|
|
|
|
|
+ if("1".equals(courseAuditRecordEditParam.getAuthType()))
|
|
|
|
|
+ {
|
|
|
|
|
+ if(StringUtils.isEmpty(courseAuditRecordEditParam.getUserRelateIds()))return CommonResult.error("私密权限关联用户不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
CourseAuditRecord courseAuditRecord = BeanUtil.toBean(courseAuditRecordEditParam, CourseAuditRecord.class);
|
|
CourseAuditRecord courseAuditRecord = BeanUtil.toBean(courseAuditRecordEditParam, CourseAuditRecord.class);
|
|
|
if(StringUtils.isNotEmpty(courseAuditRecordEditParam.getKeywordValue()))courseAuditRecord.setKeywordPinyin(StringUtils.deleteWhitespace(pinyinUtils.toPinyin(courseAuditRecordEditParam.getKeywordValue(),false)));
|
|
if(StringUtils.isNotEmpty(courseAuditRecordEditParam.getKeywordValue()))courseAuditRecord.setKeywordPinyin(StringUtils.deleteWhitespace(pinyinUtils.toPinyin(courseAuditRecordEditParam.getKeywordValue(),false)));
|
|
|
courseAuditRecordService.editOne(courseAuditRecord);
|
|
courseAuditRecordService.editOne(courseAuditRecord);
|
|
|
|
|
+ //删除旧私密权限下关联的用户
|
|
|
|
|
+ Map deleteRelateParam=new HashMap();
|
|
|
|
|
+ deleteRelateParam.put("resourceRecord", courseAuditRecord.getId());
|
|
|
|
|
+ List<ResourceRecordUserRelate> deleteRelateList=resourceRecordUserRelateService.allList(deleteRelateParam);
|
|
|
|
|
+ List<String> deleteRelateIdList=deleteRelateList.stream().map(ResourceRecordUserRelate::getId).collect(Collectors.toList());
|
|
|
|
|
+ resourceRecordUserRelateService.deleteByIds(deleteRelateIdList);
|
|
|
|
|
+ if(StringUtils.isNotEmpty(courseAuditRecordEditParam.getAuthType()))
|
|
|
|
|
+ {
|
|
|
|
|
+ //存储私密权限下关联的用户
|
|
|
|
|
+ if("1".equals(courseAuditRecordEditParam.getAuthType()))
|
|
|
|
|
+ {
|
|
|
|
|
+ String userRelateIdsStr=courseAuditRecordEditParam.getUserRelateIds();
|
|
|
|
|
+ String[] userRelateIdList = userRelateIdsStr.split(",");
|
|
|
|
|
+ List<ResourceRecordUserRelate> resourceRecordUserRelateList = new ArrayList<>();
|
|
|
|
|
+ for(String userRelateId:userRelateIdList)
|
|
|
|
|
+ {
|
|
|
|
|
+ ResourceRecordUserRelate resourceRecordUserRelate=new ResourceRecordUserRelate();
|
|
|
|
|
+ resourceRecordUserRelate.setUserId(userRelateId);
|
|
|
|
|
+ resourceRecordUserRelate.setResourceRecord(courseAuditRecord.getId());
|
|
|
|
|
+ resourceRecordUserRelateList.add(resourceRecordUserRelate);
|
|
|
|
|
+ }
|
|
|
|
|
+ resourceRecordUserRelateService.addBatch(resourceRecordUserRelateList);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return CommonResult.ok();
|
|
return CommonResult.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -367,6 +430,18 @@ public class ResourceRecordController {
|
|
|
List<KeyWord> keywordList=keyWordService.selectByIds(keywordIdList);
|
|
List<KeyWord> keywordList=keyWordService.selectByIds(keywordIdList);
|
|
|
result.put("keywordList",keywordList);
|
|
result.put("keywordList",keywordList);
|
|
|
}
|
|
}
|
|
|
|
|
+ //获取私密权限下关联的用户
|
|
|
|
|
+ param.clear();
|
|
|
|
|
+ if(StringUtils.isNotEmpty(String.valueOf(result.get("authType"))))
|
|
|
|
|
+ {
|
|
|
|
|
+ if("1".equals(String.valueOf(result.get("authType"))))
|
|
|
|
|
+ {
|
|
|
|
|
+ param.put("resourceRecord", req.getParameter("id"));
|
|
|
|
|
+ List<ResourceRecordUserRelate> userRelateList=resourceRecordUserRelateService.allList(param);
|
|
|
|
|
+ result.put("userRelateList",userRelateList);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return CommonResult.data(result);
|
|
return CommonResult.data(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -409,6 +484,38 @@ public class ResourceRecordController {
|
|
|
return CommonResult.data(result);
|
|
return CommonResult.data(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 资源中心-资源是否有查看权限
|
|
|
|
|
+ *
|
|
|
|
|
+ * @author honorfire
|
|
|
|
|
+ * @date 2025/06/20 14:58
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
|
|
+ @ApiOperation("资源中心-资源是否有查看权限")
|
|
|
|
|
+ @GetMapping("/disk/resourcecentre/isHaveAuth")
|
|
|
|
|
+ public CommonResult<Map<String,Object>> isHaveAuth(@Valid CourseAuditRecordIdParam courseAuditRecordIdParam, HttpServletRequest req) {
|
|
|
|
|
+ Map param =new HashMap();
|
|
|
|
|
+ String isHaveAuth="0";
|
|
|
|
|
+ param.put("id", req.getParameter("id"));
|
|
|
|
|
+ Map result=new HashMap();
|
|
|
|
|
+ Map<String,Object> resourceResult=courseAuditRecordService.queryInfo(param);
|
|
|
|
|
+ //如果资源是公开的,直接放行
|
|
|
|
|
+ if("0".equals(resourceResult.get("authType")))
|
|
|
|
|
+ {
|
|
|
|
|
+ isHaveAuth="1";
|
|
|
|
|
+ }
|
|
|
|
|
+ else if("1".equals(resourceResult.get("authType")))//如果是私密的,检查是否有权限
|
|
|
|
|
+ {
|
|
|
|
|
+ param.put("resourceRecord", req.getParameter("id"));
|
|
|
|
|
+ param.put("userId", StpLoginUserUtil.getLoginUser().getId());
|
|
|
|
|
+ List<ResourceRecordUserRelate> userRelateList=resourceRecordUserRelateService.allList(param);
|
|
|
|
|
+ if(userRelateList.size()>0)isHaveAuth="1";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ result.put("isHaveAuth",isHaveAuth);
|
|
|
|
|
+ return CommonResult.data(result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 资源管理-查询最近一次信息
|
|
* 资源管理-查询最近一次信息
|
|
|
*
|
|
*
|
|
@@ -436,6 +543,18 @@ public class ResourceRecordController {
|
|
|
List<KeyWord> keywordList=keyWordService.selectByIds(keywordIdList);
|
|
List<KeyWord> keywordList=keyWordService.selectByIds(keywordIdList);
|
|
|
result.put("keywordList",keywordList);
|
|
result.put("keywordList",keywordList);
|
|
|
}
|
|
}
|
|
|
|
|
+ //获取私密权限下关联的用户
|
|
|
|
|
+ param.clear();
|
|
|
|
|
+ if(StringUtils.isNotEmpty(String.valueOf(result.get("authType"))))
|
|
|
|
|
+ {
|
|
|
|
|
+ if("1".equals(String.valueOf(result.get("authType"))))
|
|
|
|
|
+ {
|
|
|
|
|
+ param.put("resourceRecord", req.getParameter("id"));
|
|
|
|
|
+ List<ResourceRecordUserRelate> userRelateList=resourceRecordUserRelateService.allList(param);
|
|
|
|
|
+ result.put("userRelateList",userRelateList);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return CommonResult.data(result);
|
|
return CommonResult.data(result);
|
|
|
}
|
|
}
|
|
|
|
|
|