update 删除节点同时删除关联

This commit is contained in:
liao
2023-09-27 10:40:08 +08:00
parent 3332633a39
commit b2cadd8134
2 changed files with 3 additions and 2 deletions
@@ -155,7 +155,8 @@ public class LawsNodeRelationServiceImpl extends ServiceImpl<LawsNodeRelationMap
nodeRelation.setNodeName(nodeList.get(0).getNodeName());
}
});
return nodeRelationList;
return nodeRelationList.stream().filter(nodeRelation ->
StringUtils.isNotBlank(nodeRelation.getNodeName())).collect(Collectors.toList());
}
}
@@ -152,7 +152,7 @@ public class LawsTreeNodeServiceImpl extends ServiceImpl<LawsTreeNodeMapper, Law
this.checkChildrenExists(id, idList);
boolean ok = this.removeByIds(idList);
// 根据节点code删除标准关联
lawsNodeRelationMapper.delete(new LambdaQueryWrapper<LawsNodeRelation>().in(LawsNodeRelation::getNodeId, codeList));
lawsNodeRelationMapper.delete(new LambdaQueryWrapper<LawsNodeRelation>().in(LawsNodeRelation::getNodeId, idList));
return ok;
}