Browse Source

2023/6/16 显示字段列表以登录人为单位不以专题库为单位设置以及显示/显示字段列表以登录人为单位不以专题库为单位设置以及显示

lwhhszx 2 years ago
parent
commit
81ebd42428

+ 6 - 6
PAS/src/main/java/cn/cslg/pas/common/utils/CacheUtils.java

@@ -123,18 +123,18 @@ public class CacheUtils {
         return uuid;
     }
 
-    public void deleteUserSystemFieldSetting(Integer projectId, String type, String view, Integer userId) {
-        String key = SecureUtil.md5(projectId + RedisConf.SYMBOL_COLON + type + RedisConf.SYMBOL_COLON + view + RedisConf.SYMBOL_COLON + userId);
+    public void deleteUserSystemFieldSetting(Integer projectId, String type, String view, Integer userId,Integer createId) {
+        String key = SecureUtil.md5(projectId + RedisConf.SYMBOL_COLON + type + RedisConf.SYMBOL_COLON + view + RedisConf.SYMBOL_COLON + userId+createId);
         redisUtil.delete(RedisConf.USER_FIELD + RedisConf.SYMBOL_COLON + key);
     }
 
-    public void setUserSystemFieldSetting(Integer projectId, String type, String view, Integer userId, List<PatentField> defaultField) {
-        String key = SecureUtil.md5(projectId + RedisConf.SYMBOL_COLON + type + RedisConf.SYMBOL_COLON + view + RedisConf.SYMBOL_COLON + userId);
+    public void setUserSystemFieldSetting(Integer projectId, String type, String view, Integer userId, List<PatentField> defaultField,Integer createId) {
+        String key = SecureUtil.md5(projectId + RedisConf.SYMBOL_COLON + type + RedisConf.SYMBOL_COLON + view + RedisConf.SYMBOL_COLON + userId+createId);
         redisUtil.set(RedisConf.USER_FIELD + RedisConf.SYMBOL_COLON + key, JsonUtils.objectToJson(defaultField));
     }
 
-    public List<PatentField> getUserSystemFieldSetting(Integer projectId, String type, String view, Integer userId) {
-        String key = SecureUtil.md5(projectId + RedisConf.SYMBOL_COLON + type + RedisConf.SYMBOL_COLON + view + RedisConf.SYMBOL_COLON + userId);
+    public List<PatentField> getUserSystemFieldSetting(Integer projectId, String type, String view, Integer userId,Integer createId) {
+        String key = SecureUtil.md5(projectId + RedisConf.SYMBOL_COLON + type + RedisConf.SYMBOL_COLON + view + RedisConf.SYMBOL_COLON + userId+createId);
         String json = redisUtil.get(RedisConf.USER_FIELD + RedisConf.SYMBOL_COLON + key);
         if (StringUtils.isNotEmpty(json)) {
             return JsonUtils.jsonToList(json, PatentField.class);

+ 2 - 2
PAS/src/main/java/cn/cslg/pas/controller/PatentController.java

@@ -138,7 +138,7 @@ public class PatentController {
     }
 
     @checkAuth(FunId = "/workspace/folder/batchOperation/batchIndexing")
-    @Permission(roles = {2})
+    @Permission(roles = {1,2})
     @PostMapping("/batch/index")
     @Operation(summary = "批量批量专利标引")
     public String patentBatchIndex(@RequestBody PatentBatchIndexVO params) {
@@ -159,7 +159,7 @@ public class PatentController {
     }
 
     @checkAuth(FunId = "/workspace/details/indexing")
-    @Permission(roles = {2})
+    @Permission(roles = {1,2})
     @PostMapping("/index/setting")
     @Operation(summary = "修改专利标引")
     public String updatePatentIndexSetting(@RequestBody PatentIndexSettingVO params) {

+ 8 - 5
PAS/src/main/java/cn/cslg/pas/service/PatentFieldService.java

@@ -1,6 +1,7 @@
 package cn.cslg.pas.service;
 
 import cn.cslg.pas.common.utils.Response;
+import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
 import cn.cslg.pas.domain.PatentField;
 import cn.cslg.pas.domain.ProjectField;
 import cn.cslg.pas.common.core.base.Constants;
@@ -36,7 +37,7 @@ public class PatentFieldService {
     private final List<String> finalDefaultList = Arrays.asList("name", "ipcList", "applicationNo", "applicationDate", "applicant2", "applicant4");
     private final List<String> finalDefaultQuery = Arrays.asList("13", "18-6", "19-6", "25-12");
     private final List<String> finalProjectField = Arrays.asList("clientName", "scenarioid", "typeid", "technicalTheme");
-
+    private final LoginUtils loginUtils;
     public List<PatentField> getUserFieldDataList(Integer projectId, String from) {
         List<PatentField> patentFieldList = this.getList(from);
         List<ProjectField> projectField = projectFieldService.getProjectFieldByProjectId(projectId);
@@ -55,11 +56,12 @@ public class PatentFieldService {
 
 
     public List<PatentField> getUserSetting(SystemFieldVO params) {
+        Integer createId =loginUtils.getId();
         if (params.getRefresh() != null && params.getRefresh()) {
-            cacheUtils.deleteUserSystemFieldSetting(params.getProjectId(), params.getType(), params.getView(), 3);
+            cacheUtils.deleteUserSystemFieldSetting(params.getProjectId(), params.getType(), params.getView(), 3,createId);
         }
         List<PatentField> dataList = this.getUserFieldDataList(params.getProjectId(), params.getType());
-        List<PatentField> userSetting = cacheUtils.getUserSystemFieldSetting(params.getProjectId(), params.getType(), params.getView(), 3);
+        List<PatentField> userSetting = cacheUtils.getUserSystemFieldSetting(params.getProjectId(), params.getType(), params.getView(), 3,createId);
         if (userSetting == null || userSetting.size() == 0) {
             List<PatentField> defaultList = new ArrayList<>();
             List<PatentField> patentFieldList = this.getList(params.getType());
@@ -74,7 +76,7 @@ public class PatentFieldService {
                     defaultList = patentFieldList.stream().filter(item -> finalProjectField.contains(item.getKey())).collect(Collectors.toList());
                     break;
             }
-            cacheUtils.setUserSystemFieldSetting(params.getProjectId(), params.getType(), params.getView(), 3, defaultList);
+            cacheUtils.setUserSystemFieldSetting(params.getProjectId(), params.getType(), params.getView(), 3, defaultList,createId);
             userSetting = defaultList;
         }
         List<PatentField> finalUserSetting = userSetting;
@@ -92,7 +94,8 @@ public class PatentFieldService {
             patentFieldList.get(i).setHidden(null);
             patentFieldList.get(i).setOrder(i);
         }
-        cacheUtils.setUserSystemFieldSetting(params.getProjectId(), params.getType(), params.getView(), 3, patentFieldList);
+        Integer createId =loginUtils.getId();
+        cacheUtils.setUserSystemFieldSetting(params.getProjectId(), params.getType(), params.getView(), 3, patentFieldList,createId);
         params.setRefresh(false);
         return this.getUserSetting(params);
     }