From a99d9febaa2ba0c1478bc829f122dff6228d26ca Mon Sep 17 00:00:00 2001 From: huangzj <826100833@qq.com> Date: Mon, 20 Mar 2023 15:31:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=91=E9=81=8D=E5=8E=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/RGeneralSurveyPlanPOServiceImpl.java | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java index 62db8afd2..f0fb43cd8 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java @@ -547,7 +547,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl queryWrapper1 = new LambdaQueryWrapper<> ( ); queryWrapper1.eq (RGeneralSurveyPlanPO::getCycleId, rSurveyCyclePO.getId ( )); - queryWrapper1.in(RGeneralSurveyPlanPO::getStatus,Stream.of (3,4).collect(Collectors.toList())); + queryWrapper1.in (RGeneralSurveyPlanPO::getStatus, Stream.of (3, 4).collect (Collectors.toList ( ))); List rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectList (queryWrapper1); List planIds = rGeneralSurveyPlanPOS.stream ( ).map (RGeneralSurveyPlanPO::getPlanNo).collect (Collectors.toList ( )); List subIds = new ArrayList<> ( ); @@ -614,7 +614,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl recursion ( List result,String orgdid){ + public List recursion(DeptSubstationVO result, String orgdid) { + List deptSubstationVOList = new ArrayList<> ( ); + if (Objects.equals (result.getId ( ), orgdid)) { + deptSubstationVOList.add (result); + return deptSubstationVOList; + + } else { + for (DeptSubstationVO deptSubstationVO : result.getChildren ( )) { + + List recursion = recursion (deptSubstationVO, orgdid); + if(recursion.size ()>0){ + return recursion; + } - List finalResult = new ArrayList<> (); - for (DeptSubstationVO deptSubstationVO : result) { - if(Objects.equals (deptSubstationVO.getId (),orgdid)){ - finalResult.add (deptSubstationVO); - return finalResult; - }else { - List recursion = recursion (deptSubstationVO.getChildren ( ), orgdid); - return recursion; } } - return null; + return deptSubstationVOList; } }