|
|
@ -280,14 +280,18 @@ public class HwMonitorUnitServiceImpl implements IHwMonitorUnitService
|
|
|
|
public List<HwMonitorUnit> selectTreeList(List<HwMonitorUnit> hwMonitorUnits) {
|
|
|
|
public List<HwMonitorUnit> selectTreeList(List<HwMonitorUnit> hwMonitorUnits) {
|
|
|
|
List<HwMonitorUnit> returnList = new ArrayList<>();
|
|
|
|
List<HwMonitorUnit> returnList = new ArrayList<>();
|
|
|
|
List<Long> tempList = hwMonitorUnits.stream().map(HwMonitorUnit::getMonitorUnitId).collect(Collectors.toList());
|
|
|
|
List<Long> tempList = hwMonitorUnits.stream().map(HwMonitorUnit::getMonitorUnitId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
List<HwMonitorUnit> treeList = new ArrayList<>();
|
|
|
|
for (HwMonitorUnit hwMonitorUnit:hwMonitorUnits){
|
|
|
|
for (HwMonitorUnit hwMonitorUnit:hwMonitorUnits){
|
|
|
|
if (!tempList.contains(hwMonitorUnit.getParentId()))
|
|
|
|
if (!tempList.contains(hwMonitorUnit.getParentId()))
|
|
|
|
recursionFn(hwMonitorUnits,hwMonitorUnit);
|
|
|
|
recursionFn(hwMonitorUnits,hwMonitorUnit);
|
|
|
|
returnList.add(hwMonitorUnit);
|
|
|
|
returnList.add(hwMonitorUnit);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < returnList.size(); i++){
|
|
|
|
return returnList;
|
|
|
|
if (returnList.get(i).getParentId()==null){
|
|
|
|
|
|
|
|
treeList.add(returnList.get(i));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return treeList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private void recursionFn(List<HwMonitorUnit> list, HwMonitorUnit t)
|
|
|
|
private void recursionFn(List<HwMonitorUnit> list, HwMonitorUnit t)
|
|
|
|
{
|
|
|
|
{
|
|
|
|