Browse Source

电签配置过滤重复位置重复角色记录

lvy 1 month ago
parent
commit
04e3867375

+ 12 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java

@@ -27,6 +27,7 @@ import org.jsoup.select.Elements;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.common.utils.SystemUtils;
 import org.springblade.core.tool.utils.*;
 import org.springblade.manager.entity.TextdictInfo;
 import org.springblade.manager.entity.WbsTreePrivate;
@@ -96,9 +97,12 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
                         }
                         addSign(textdict, doc, privateInfo, dqid);
                     } else if (textdictList != null && !textdictList.isEmpty()) {
-                        Map<String, Map<String, TextdictInfoVO>> map = textdict.stream().collect(Collectors.groupingBy(TextdictInfoVO::getColKey, Collectors.toMap(TextdictInfoVO::getSigRoleId, v -> v, (v1, v2) -> v1)));
+                        Map<String, Map<String, TextdictInfoVO>> map = textdict.stream().filter(vo -> vo.getColKey() != null && vo.getColKey().contains("__")).collect(Collectors.groupingBy(vo -> vo.getColKey().split("__")[1], Collectors.toMap(TextdictInfoVO::getSigRoleId, v -> v, (v1, v2) -> v1)));
                         List<TextdictInfoVO> collect = textdictList.stream().filter(textdictInfoVO -> {
-                            Map<String, TextdictInfoVO> voMap = map.get(textdictInfoVO.getColKey());
+                            if (textdictInfoVO.getColKey() == null || !textdictInfoVO.getColKey().contains("__")) {
+                                return true;
+                            }
+                            Map<String, TextdictInfoVO> voMap = map.get(textdictInfoVO.getColKey().split("__")[1]);
                             textdictInfoVO.setIsSystem(2);
                             if (voMap != null && !voMap.isEmpty() ) {
                                 return voMap.get(textdictInfoVO.getSigRoleId()) == null;
@@ -125,9 +129,12 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
                         if (textdict == null || textdict.isEmpty()) {
                             textdict = textdictConfigList;
                         } else {
-                            Map<String, Map<String, TextdictInfoVO>> map = textdict.stream().collect(Collectors.groupingBy(TextdictInfoVO::getColKey, Collectors.toMap(TextdictInfoVO::getSigRoleId, v -> v, (v1, v2) -> v1)));
+                            Map<String, Map<String, TextdictInfoVO>> map = textdict.stream().filter(vo -> vo.getColKey() != null && vo.getColKey().contains("__")).collect(Collectors.groupingBy(TextdictInfoVO::getColKey, Collectors.toMap(TextdictInfoVO::getSigRoleId, v -> v, (v1, v2) -> v1)));
                             List<TextdictInfoVO> collect = textdictConfigList.stream().filter(textdictInfoVO -> {
-                                Map<String, TextdictInfoVO> voMap = map.get(textdictInfoVO.getColKey());
+                                if (textdictInfoVO.getColKey() == null || !textdictInfoVO.getColKey().contains("__")) {
+                                    return true;
+                                }
+                                Map<String, TextdictInfoVO> voMap = map.get(textdictInfoVO.getColKey().split("__")[1]);
                                 if (voMap != null && !voMap.isEmpty() ) {
                                     return voMap.get(textdictInfoVO.getSigRoleId()) == null;
                                 }
@@ -184,7 +191,7 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
                 isUpdate.set(true);
             }
         });
-        if (!isUpdate.get()) {
+        if (!isUpdate.get() || !SystemUtils.isLinux()) {
             return;
         }
         String file_path = FileUtils.getSysLocalFileUrl();