|
@@ -82,19 +82,12 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
|
|
|
}else {
|
|
|
textdict = new ArrayList<>();
|
|
|
}
|
|
|
- }else{
|
|
|
- textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
|
|
|
- }
|
|
|
- if (textdict != null && !keys.isEmpty()) {
|
|
|
- for (TextdictInfoVO vo : textdict) {
|
|
|
- if (!(privateInfo.getPKeyId() + "").equals(vo.getTabId())) {
|
|
|
- vo.setIsSystem(1);
|
|
|
- }
|
|
|
- keys.remove(vo.getColKey());
|
|
|
- }
|
|
|
- if (Func.isNotEmpty(keys)) {
|
|
|
+ if (!keys.isEmpty()) {
|
|
|
// 查询系统级电签配置
|
|
|
- TextdictInfoVO temp = textdict.stream().findFirst().orElse(null);
|
|
|
+ TextdictInfoVO temp = null;
|
|
|
+ if (textdict != null && !textdict.isEmpty()) {
|
|
|
+ temp = textdict.get(0);
|
|
|
+ }
|
|
|
if (temp == null) {
|
|
|
temp = new TextdictInfoVO();
|
|
|
temp.setProjectId(privateInfo.getProjectId());
|
|
@@ -103,8 +96,26 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
|
|
|
temp.setType(2);
|
|
|
}
|
|
|
List<TextdictInfoVO> textdictList = iSignConfigService.hasSignConfig(privateInfo.getInitTableName(), keys, temp);
|
|
|
- textdict.addAll(textdictList);
|
|
|
+ if (textdict == null || textdict.isEmpty()) {
|
|
|
+ textdict = textdictList;
|
|
|
+ } else {
|
|
|
+ Map<String, TextdictInfoVO> map = textdict.stream().collect(Collectors.toMap(TextdictInfoVO::getColKey, TextdictInfoVO -> TextdictInfoVO, (v1, v2) -> v1));
|
|
|
+ List<TextdictInfoVO> collect = textdictList.stream().filter(textdictInfoVO -> {
|
|
|
+ TextdictInfoVO vo = map.get(textdictInfoVO.getColKey());
|
|
|
+ if (vo != null && vo.getSigRoleId() != null && !vo.getSigRoleId().isEmpty()) {
|
|
|
+ List<String> projectRoleIds = Arrays.asList(vo.getSigRoleId().split(","));
|
|
|
+ List<String> systemRoleIds = new ArrayList<>(Arrays.asList(textdictInfoVO.getSigRoleId().split(",")));
|
|
|
+ // 如果 projectRoleIds 包含所有 systemRoleIds,则返回 false
|
|
|
+ systemRoleIds.removeAll(projectRoleIds);
|
|
|
+ return !systemRoleIds.isEmpty();
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ textdict.addAll(collect);
|
|
|
+ }
|
|
|
}
|
|
|
+ }else{
|
|
|
+ textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|