Browse Source

电签角色库优先级修改

lvy 1 month ago
parent
commit
342aaa3325

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

@@ -93,6 +93,21 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
                     }else {
                         textdict = new ArrayList<>();
                     }
+                    List<TextdictInfoVO> textdictList= baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
+                    if (textdict == null || textdict.isEmpty()) {
+                        textdict = textdictList;
+                    } 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)));
+                        List<TextdictInfoVO> collect = textdictList.stream().filter(textdictInfoVO -> {
+                            Map<String, TextdictInfoVO> voMap = map.get(textdictInfoVO.getColKey());
+                            textdictInfoVO.setIsSystem(2);
+                            if (voMap != null && !voMap.isEmpty() ) {
+                                return voMap.get(textdictInfoVO.getSigRoleId()) == null;
+                            }
+                            return true;
+                        }).collect(Collectors.toList());
+                        textdict.addAll(collect);
+                    }
                     if (!keys.isEmpty()) {
                         TextdictInfoVO temp = null;
                         if (textdict != null && !textdict.isEmpty()) {
@@ -106,12 +121,12 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
                             temp.setType(2);
                         }
                         // 查询电签库配置
-                        List<TextdictInfoVO> textdictList = iSignConfigService.hasSignConfig(privateInfo.getInitTableName(), keys, temp);
+                        List<TextdictInfoVO> textdictConfigList = iSignConfigService.hasSignConfig(privateInfo.getInitTableName(), keys, temp);
                         if (textdict == null || textdict.isEmpty()) {
-                            textdict = textdictList;
+                            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)));
-                            List<TextdictInfoVO> collect = textdictList.stream().filter(textdictInfoVO -> {
+                            List<TextdictInfoVO> collect = textdictConfigList.stream().filter(textdictInfoVO -> {
                                 Map<String, TextdictInfoVO> voMap = map.get(textdictInfoVO.getColKey());
                                 if (voMap != null && !voMap.isEmpty() ) {
                                     return voMap.get(textdictInfoVO.getSigRoleId()) == null;
@@ -121,21 +136,6 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
                             textdict.addAll(collect);
                         }
                     }
-                    List<TextdictInfoVO> textdictList= baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
-                    if (textdict == null || textdict.isEmpty()) {
-                        textdict = textdictList;
-                    } 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)));
-                        List<TextdictInfoVO> collect = textdictList.stream().filter(textdictInfoVO -> {
-                            Map<String, TextdictInfoVO> voMap = map.get(textdictInfoVO.getColKey());
-                            textdictInfoVO.setIsSystem(2);
-                            if (voMap != null && !voMap.isEmpty() ) {
-                                return voMap.get(textdictInfoVO.getSigRoleId()) == null;
-                            }
-                            return true;
-                        }).collect(Collectors.toList());
-                        textdict.addAll(collect);
-                    }
                 }else{
                     textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
                 }