修改树遍历
This commit is contained in:
@@ -547,7 +547,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
||||
cycleNum = rSurveyCyclePOS.get (0).getSurveyCycle ( );
|
||||
}
|
||||
LocalDate enddate = LocalDate.now ( ).plusYears (cycleNum);
|
||||
rSurveyCyclePO = new RSurveyCyclePO();
|
||||
rSurveyCyclePO = new RSurveyCyclePO ( );
|
||||
rSurveyCyclePO.setStartYear (LocalDate.now ( ));
|
||||
rSurveyCyclePO.setEndYear (enddate);
|
||||
rSurveyCyclePO.setSurveyCycle (cycleNum);
|
||||
@@ -556,7 +556,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
||||
|
||||
LambdaQueryWrapper<RGeneralSurveyPlanPO> 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<RGeneralSurveyPlanPO> rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectList (queryWrapper1);
|
||||
List<String> planIds = rGeneralSurveyPlanPOS.stream ( ).map (RGeneralSurveyPlanPO::getPlanNo).collect (Collectors.toList ( ));
|
||||
List<String> subIds = new ArrayList<> ( );
|
||||
@@ -614,7 +614,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
||||
}
|
||||
}
|
||||
|
||||
result = recursion(result,orgdid);
|
||||
result = recursion (result.get (0), orgdid);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -641,25 +641,29 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
|
||||
} else {
|
||||
flag = false;
|
||||
}
|
||||
RSurveyCycleVO rSurveyCycleVO = new RSurveyCycleVO();
|
||||
RSurveyCycleVO rSurveyCycleVO = new RSurveyCycleVO ( );
|
||||
BeanUtils.copyProperties (rSurveyCyclePO, rSurveyCycleVO);
|
||||
rSurveyCycleVO.setFlag (flag);
|
||||
return rSurveyCycleVO;
|
||||
}
|
||||
|
||||
public List<DeptSubstationVO> recursion ( List<DeptSubstationVO> result,String orgdid){
|
||||
public List<DeptSubstationVO> recursion(DeptSubstationVO result, String orgdid) {
|
||||
List<DeptSubstationVO> deptSubstationVOList = new ArrayList<> ( );
|
||||
if (Objects.equals (result.getId ( ), orgdid)) {
|
||||
deptSubstationVOList.add (result);
|
||||
return deptSubstationVOList;
|
||||
|
||||
List<DeptSubstationVO> finalResult = new ArrayList<> ();
|
||||
for (DeptSubstationVO deptSubstationVO : result) {
|
||||
if(Objects.equals (deptSubstationVO.getId (),orgdid)){
|
||||
finalResult.add (deptSubstationVO);
|
||||
return finalResult;
|
||||
}else {
|
||||
List<DeptSubstationVO> recursion = recursion (deptSubstationVO.getChildren ( ), orgdid);
|
||||
} else {
|
||||
for (DeptSubstationVO deptSubstationVO : result.getChildren ( )) {
|
||||
|
||||
List<DeptSubstationVO> recursion = recursion (deptSubstationVO, orgdid);
|
||||
if(recursion.size ()>0){
|
||||
return recursion;
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return deptSubstationVOList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user