条款导入拆分结果标准结构树查询子集数据

This commit is contained in:
梁琦涛
2024-09-10 17:53:20 +08:00
parent fd66369065
commit cd696c36da
@@ -1288,12 +1288,25 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
public IPage<ManyStandardSelectionBox> getManyStandardSelectionBox(ManyStandardSelectionBoxVO selectionBoxVO, Integer pageNo, Integer pageSize) {
if (StringUtils.isNotBlank(selectionBoxVO.getStandardSystem())) {
List<String> list = Arrays.asList(selectionBoxVO.getStandardSystem().split(","));
List<LawsNodeRelation> lawsNodeRelationList = lawsNodeRelationService.list(
new LambdaQueryWrapper<LawsNodeRelation>().in(LawsNodeRelation::getNodeId, list));
if (CollectionUtils.isNotEmpty(lawsNodeRelationList)) {
String ids = lawsNodeRelationList.stream()
.map(LawsNodeRelation::getUniqueRelationFlag).collect(Collectors.joining(","));
selectionBoxVO.setIds(ids);
List<LawsTreeNode> lawsTreeNodeList = lawsTreeNodeService.listByIds(list);
if (!CollectionUtils.isEmpty(lawsTreeNodeList)) {
List<String> nodeCode = lawsTreeNodeList.stream()
.map(LawsTreeNode::getNodeCode).collect(Collectors.toList());
LambdaQueryWrapper<LawsNodeRelation> query = new LambdaQueryWrapper<>();
query.and(o->{
for (int i = 0; i < nodeCode.size(); i++) {
o.likeRight(LawsNodeRelation::getNodeCode, nodeCode.get(i));
if(i != (nodeCode.size() - 1)){
o.or();
}
}
});
List<LawsNodeRelation> lawsNodeRelationListAll = lawsNodeRelationService.list(query);
if(!CollectionUtils.isEmpty(lawsNodeRelationListAll)){
String ids = lawsNodeRelationListAll.stream().map(LawsNodeRelation::getUniqueRelationFlag)
.collect(Collectors.joining(","));
selectionBoxVO.setIds(ids);
}
} else {
return new Page<>();
}