|
@@ -76,14 +76,14 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
|
Elements table = doc.getElementsByAttribute("dqid");
|
|
|
List<String> dqid = new ArrayList<>();
|
|
|
- List<String> keys = new ArrayList<>();
|
|
|
+ Map<String, String> keys = new HashMap<>();
|
|
|
for(Element ek:table){
|
|
|
dqid.addAll(Func.toStrList("\\|\\|",ek.attr("dqid")));
|
|
|
}
|
|
|
Elements keyNames = doc.getElementsByAttribute("keyname");
|
|
|
if(Func.isNotEmpty(keyNames)){
|
|
|
for(Element keyName:keyNames){
|
|
|
- keys.add(keyName.attr("keyname"));
|
|
|
+ keys.put(keyName.attr("keyname"), keyName.attr("placeholder"));
|
|
|
}
|
|
|
}
|
|
|
if(Func.isNotEmpty(textdictInfo.getShowType()) && textdictInfo.getShowType() == 1){
|
|
@@ -92,30 +92,36 @@ 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;
|
|
|
- if (textdict != null) {
|
|
|
- textdict.forEach(textdictInfoVO -> textdictInfoVO.setIsSystem(2));
|
|
|
+ if (!keys.isEmpty()) {
|
|
|
+ // 根据excel_id 和col_key 查询
|
|
|
+ List<TextdictInfoVO> textdictList= baseMapper.selectTextdictInfoByExcelIdAndColKey(textdictInfo.getExcelId(),keys.keySet());
|
|
|
+ if (textdictList != null) {
|
|
|
+ Map<String, TextdictInfoVO> map = textdictList.stream().filter(vo -> vo.getColName() != null && vo.getColName().equals(keys.get(vo.getColKey()))).collect(Collectors.toMap(vo -> vo.getColKey() + vo.getSigRoleId(), v -> v, (v1, v2) -> v1));
|
|
|
+ textdictList = new ArrayList<>(map.values());
|
|
|
}
|
|
|
- addSign(textdict, doc, privateInfo, dqid, textdict);
|
|
|
- } else if (textdictList != null && !textdictList.isEmpty()) {
|
|
|
- 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 -> {
|
|
|
- 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;
|
|
|
+ if (textdict == null || textdict.isEmpty()) {
|
|
|
+ textdict = textdictList;
|
|
|
+ if (textdict != null) {
|
|
|
+ textdict.forEach(textdictInfoVO -> textdictInfoVO.setIsSystem(2));
|
|
|
}
|
|
|
- return true;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- textdict.addAll(collect);
|
|
|
- addSign(collect, doc, privateInfo, dqid,textdict);
|
|
|
- }
|
|
|
- if (!keys.isEmpty()) {
|
|
|
+ addSign(textdict, doc, privateInfo, dqid, textdict);
|
|
|
+ } else if (textdictList != null && !textdictList.isEmpty()) {
|
|
|
+ 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 -> {
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ textdict.addAll(collect);
|
|
|
+ addSign(collect, doc, privateInfo, dqid,textdict);
|
|
|
+ }
|
|
|
+
|
|
|
TextdictInfoVO temp = null;
|
|
|
if (textdict != null && !textdict.isEmpty()) {
|
|
|
temp = textdict.get(0);
|
|
@@ -128,7 +134,7 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
|
|
|
temp.setType(2);
|
|
|
}
|
|
|
// 查询电签库配置
|
|
|
- List<TextdictInfoVO> textdictConfigList = iSignConfigService.hasSignConfig(privateInfo.getInitTableName(), keys, temp);
|
|
|
+ List<TextdictInfoVO> textdictConfigList = iSignConfigService.hasSignConfig(privateInfo.getInitTableName(), keys.keySet(), temp);
|
|
|
if (textdict == null || textdict.isEmpty()) {
|
|
|
textdict = textdictConfigList;
|
|
|
} else {
|
|
@@ -147,7 +153,15 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
- textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
|
|
|
+ if (!keys.isEmpty()) {
|
|
|
+ // 根据excel_id 和col_key 查询
|
|
|
+ List<TextdictInfoVO> textdictList= baseMapper.selectTextdictInfoByExcelIdAndColKey(textdictInfo.getExcelId(),keys.keySet());
|
|
|
+ if (textdictList != null) {
|
|
|
+ Map<String, TextdictInfoVO> map = textdictList.stream().filter(vo -> vo.getColName() != null && vo.getColName().equals(keys.get(vo.getColKey())))
|
|
|
+ .collect(Collectors.toMap(vo -> vo.getColKey() + vo.getSigRoleId(), v -> v, (v1, v2) -> v1));
|
|
|
+ textdict = new ArrayList<>(map.values());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|