fix:88259

This commit is contained in:
梁琦涛
2024-08-07 20:22:50 +08:00
parent b687b6efd1
commit 45c46965e6
@@ -2136,6 +2136,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
idSet.addAll(systemList.stream().map(LawsNodeRelation::getUniqueRelationFlag).collect(Collectors.toSet()));
parameterMap.remove(FieldCommon.STANDARD_SYSTEM);
}
Set<String> listIntersection = new HashSet<>();
// 代替标准号
String replaceStandard = (String) parameterMap.get(FieldCommon.REPLACED_STANDARD);
if (StrUtil.isNotBlank(replaceStandard)) {
@@ -2144,7 +2145,15 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
lambdaQueryWrapper.like(LawsReplacedStandard::getReplaced, replaceStandard);
lambdaQueryWrapper.eq(LawsReplacedStandard::getType, "1");
List<LawsReplacedStandard> replacedStandardList = lawsReplacedStandardService.list(lambdaQueryWrapper);
snSet.addAll(replacedStandardList.stream().map(LawsReplacedStandard::getReplacedBy).collect(Collectors.toSet()));
Set<String> setSub = replacedStandardList.stream().map(LawsReplacedStandard::getReplacedBy).collect(Collectors.toSet());
if(CollectionUtils.isEmpty(listIntersection)){
listIntersection.addAll(setSub);
}else{
listIntersection = listIntersection.stream()
.filter(setSub::contains)
.collect(Collectors.toSet());
}
// snSet.addAll(replacedStandardList.stream().map(LawsReplacedStandard::getReplacedBy).collect(Collectors.toSet()));
parameterMap.remove(FieldCommon.REPLACED_STANDARD);
}
// 被代替标准号
@@ -2155,14 +2164,30 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
lambdaQueryWrapper.like(LawsReplacedStandard::getReplacedBy, replacedByStandard);
lambdaQueryWrapper.eq(LawsReplacedStandard::getType, "1");
List<LawsReplacedStandard> standardList = lawsReplacedStandardService.list(lambdaQueryWrapper);
snSet.addAll(standardList.stream().map(s -> {
Set<String> setSub = standardList.stream().map(s -> {
// 如果有书名号则只取书名号的前半部分
if (s.getReplaced().contains("")) {
return s.getReplaced().substring(0, s.getReplaced().indexOf(""));
} else {
return s.getReplaced();
}
}).collect(Collectors.toSet()));
}).collect(Collectors.toSet());
if(CollectionUtils.isEmpty(listIntersection)){
listIntersection.addAll(setSub);
}else{
listIntersection = listIntersection.stream()
.filter(setSub::contains)
.collect(Collectors.toSet());
}
// snSet.addAll(standardList.stream().map(s -> {
// // 如果有书名号则只取书名号的前半部分
// if (s.getReplaced().contains("《")) {
// return s.getReplaced().substring(0, s.getReplaced().indexOf("《"));
// } else {
// return s.getReplaced();
// }
// }).collect(Collectors.toSet()));
parameterMap.remove(FieldCommon.REPLACED_BY_STANDARD);
}
// 引用标准号
@@ -2173,7 +2198,15 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
lambdaQueryWrapper.like(LawsReplacedStandard::getReplaced, referenceStandard);
lambdaQueryWrapper.eq(LawsReplacedStandard::getType, "2");
List<LawsReplacedStandard> replacedStandardList = lawsReplacedStandardService.list(lambdaQueryWrapper);
snSet.addAll(replacedStandardList.stream().map(LawsReplacedStandard::getReplacedBy).collect(Collectors.toSet()));
Set<String> setSub = replacedStandardList.stream().map(LawsReplacedStandard::getReplacedBy).collect(Collectors.toSet());
if(CollectionUtils.isEmpty(listIntersection)){
listIntersection.addAll(setSub);
}else{
listIntersection = listIntersection.stream()
.filter(setSub::contains)
.collect(Collectors.toSet());
}
// snSet.addAll(replacedStandardList.stream().map(LawsReplacedStandard::getReplacedBy).collect(Collectors.toSet()));
parameterMap.remove(FieldCommon.REFERENCE_STANDARD);
}
// 被引用标准号
@@ -2184,16 +2217,34 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
lambdaQueryWrapper.like(LawsReplacedStandard::getReplacedBy, referencedStandard);
lambdaQueryWrapper.eq(LawsReplacedStandard::getType, "2");
List<LawsReplacedStandard> standardList = lawsReplacedStandardService.list(lambdaQueryWrapper);
snSet.addAll(standardList.stream().map(s -> {
Set<String> setSub = standardList.stream().map(s -> {
// 如果有书名号则只取书名号的前半部分
if (s.getReplaced().contains("")) {
return s.getReplaced().substring(0, s.getReplaced().indexOf(""));
} else {
return s.getReplaced();
}
}).collect(Collectors.toSet()));
}).collect(Collectors.toSet());
if(CollectionUtils.isEmpty(listIntersection)){
listIntersection.addAll(setSub);
}else{
listIntersection = listIntersection.stream()
.filter(setSub::contains)
.collect(Collectors.toSet());
}
// snSet.addAll(standardList.stream().map(s -> {
// // 如果有书名号则只取书名号的前半部分
// if (s.getReplaced().contains("《")) {
// return s.getReplaced().substring(0, s.getReplaced().indexOf("《"));
// } else {
// return s.getReplaced();
// }
// }).collect(Collectors.toSet()));
parameterMap.remove(FieldCommon.REFERENCED_STANDARD);
}
if(!CollectionUtils.isEmpty(listIntersection)){
snSet.addAll(listIntersection);
}
// 零部件名称
String partName = (String) parameterMap.get(FieldCommon.PART_NAME);
if (StrUtil.isNotBlank(partName)) {