From 9497335f6382d56bf0420c29312db462d46fc928 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Thu, 9 Nov 2023 15:02:58 +0800 Subject: [PATCH] =?UTF-8?q?bug78243:=20=E6=94=BF=E7=AD=96=E6=B3=95?= =?UTF-8?q?=E8=A7=84=E8=B5=84=E6=96=99=E5=9C=A8=E5=AD=90=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E4=B8=8B=E5=88=9B=E5=BB=BA=E7=9A=84=E6=95=B0=E6=8D=AE=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=98=BE=E7=A4=BA=E5=9C=A8=E7=88=B6=E7=BA=A7=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E4=B8=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/SarLawsInformation.java | 3 +++ .../impl/SarLawsInformationServiceImpl.java | 6 ++++++ .../SarLawsInformationCenterTreeService.java | 2 ++ .../SarLawsInformationCenterTreeServiceImpl.java | 14 ++++++++++++++ .../SarLawsInformationMapper.xml | 7 +++++-- 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java index c3d40cb8..f78cf242 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java @@ -248,4 +248,7 @@ public class SarLawsInformation extends BasePage implements Serializable { private Date uploadTimeBegin; @TableField(exist = false) private Date uploadTimeEnd; + // 查询使用 所有子节点列表 + @TableField(exist = false) + private List treeNodeIdList; } \ No newline at end of file diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java index d545cdaf..cece0095 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java @@ -114,6 +114,12 @@ public class SarLawsInformationServiceImpl extends ServiceImpl treeNodeIdList = new ArrayList<>(); + treeService.querySubordinateTreeNode(treeNodeIdList, page.getTreeNodeId()); + page.setTreeNodeIdList(treeNodeIdList); + } Integer rowCount = this.baseMapper.queryByPageCount(page); page.getPager().setRowCount(rowCount); List sarLawsInformationList = this.baseMapper.queryByPage(page); diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/SarLawsInformationCenterTreeService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/SarLawsInformationCenterTreeService.java index a511b834..4ff24cac 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/SarLawsInformationCenterTreeService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/SarLawsInformationCenterTreeService.java @@ -22,4 +22,6 @@ public interface SarLawsInformationCenterTreeService extends IService getTree(); boolean updateTreeNode(SarLawsInformationCenterTree informationCenterTree); + + void querySubordinateTreeNode(List treeNodeIdList, String treeNodeId); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/impl/SarLawsInformationCenterTreeServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/impl/SarLawsInformationCenterTreeServiceImpl.java index 016db49c..36d19867 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/impl/SarLawsInformationCenterTreeServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/impl/SarLawsInformationCenterTreeServiceImpl.java @@ -101,6 +101,20 @@ public class SarLawsInformationCenterTreeServiceImpl extends ServiceImpl 0; } + // 递归查询所有子节点 + @Override + public void querySubordinateTreeNode(List treeNodeIdList, String treeNodeId) { + treeNodeIdList.add(treeNodeId); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SarLawsInformationCenterTree::getParentId, treeNodeId); + List list = list(wrapper); + if (list.size()>0) { + for (SarLawsInformationCenterTree sarLawsInformationCenterTree : list) { + querySubordinateTreeNode(treeNodeIdList,sarLawsInformationCenterTree.getId()); + } + } + } + @Transactional @Override public void setResource(SarLawsInformationCenterTree informationCenterTree) { diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml index 6c20578d..6d04fe9e 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml @@ -59,8 +59,11 @@ and UPLOAD_TIME between #{uploadTimeBegin} and ${uploadTimeEnd} - - and TREE_NODE_ID = #{treeNodeId} + + and TREE_NODE_ID in + + #{treeNodeId} +