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; } }