feat(标准解读流程): 导入完善

This commit is contained in:
yjz
2024-07-12 19:25:22 +08:00
parent 5ae4365262
commit dc550533d1
@@ -968,23 +968,16 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
if (StringUtils.isNotBlank(keywords)){
boolean flag = true;
List<String> list = new ArrayList<>();
List<PartName> partNames = lawsPartNameService.list(new LambdaQueryWrapper<PartName>()
.ne(PartName::getCode, "Part"));
List<PartName> partNameList = partNameGetLevelPath(partNames);
List<PartName> partNames = lawsPartNameService.list();
for (String str : keywords.split(",")) {
List<PartName> path =
partNameList.stream().filter(o -> str.equals(o.getLevelPath()))
.collect(Collectors.toList());
if (path.size() > 1){
errorList.add("涉及系统/部件 中 " + str + "存在多个!");
flag = false;
break;
}else if (path.size() == 1){
list.add(path.get(0).getId());
}else {
Optional<PartName> optionalPartName =
partNames.stream().filter(o -> str.equals(o.getCode())).findFirst();
if (!optionalPartName.isPresent()){
errorList.add("涉及系统/部件不存在!");
flag = false;
break;
}else {
data.setKeywords(optionalPartName.get().getCode());
}
}
if (flag){
@@ -1024,10 +1017,10 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
errorList.add("标准编号/条款号不能为空!");
exist = false;
}
if (StringUtils.isBlank(itemTitle)){
errorList.add("标准名称/条款标题不能为空!");
exist = false;
}
// if (StringUtils.isBlank(itemTitle)){
// errorList.add("标准名称/条款标题不能为空!");
// exist = false;
// }
if (i == 0 && exist){
// 第一行校验
String standardNumber = lawsDomesticStandard.getStandardNumber();
@@ -1042,10 +1035,9 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
LawsDocumentSplit lawsDocumentSplits = documentSplitMapper.selectOne(
new LambdaQueryWrapper<LawsDocumentSplit>()
.eq(LawsDocumentSplit::getInfoId, splitInfoId)
.eq(LawsDocumentSplit::getItemNum, itemNum)
.eq(LawsDocumentSplit::getItemTitle, itemTitle));
.eq(LawsDocumentSplit::getItemNum, itemNum));
if (Objects.isNull(lawsDocumentSplits)){
errorList.add("不存在条号为:" + itemNum + ",条款标题为:" + itemTitle + "的条款!");
errorList.add("不存在条号为:" + itemNum + "的条款!");
}else {
data.setClauseId(lawsDocumentSplits.getId());
data.setItemContent(lawsDocumentSplits.getItemContent());