设备统计问题,由于和便携式设备合并树导致的问题
This commit is contained in:
@@ -162,7 +162,13 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<CsLedgerVO> deviceTree = iCsLedgerService.getDeviceTree();
|
List<CsLedgerVO> deviceTree = iCsLedgerService.getDeviceTree();
|
||||||
List<String> collect1 = deviceTree.stream().filter(temp -> temp.getId().equals(id)).map(CsLedgerVO::getChildren).flatMap(Collection::stream).map(CsLedgerVO::getChildren).flatMap(Collection::stream).map(CsLedgerVO::getId).collect(Collectors.toList());
|
//由于多加了一程便携式设备
|
||||||
|
List<String> collect1 = deviceTree.stream()
|
||||||
|
.map(CsLedgerVO::getChildren).flatMap(Collection::stream)
|
||||||
|
.filter(temp -> temp.getId().equals(id))
|
||||||
|
.map(CsLedgerVO::getChildren).flatMap(Collection::stream)
|
||||||
|
.map(CsLedgerVO::getChildren).flatMap(Collection::stream)
|
||||||
|
.map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||||
//求交集
|
//求交集
|
||||||
device.retainAll(collect1);
|
device.retainAll(collect1);
|
||||||
if(CollectionUtils.isEmpty(device)){
|
if(CollectionUtils.isEmpty(device)){
|
||||||
|
|||||||
@@ -194,10 +194,35 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
}
|
}
|
||||||
).
|
).
|
||||||
sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
|
||||||
|
checkDevSetData(deviceList);
|
||||||
projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
|
||||||
engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList)));
|
engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList)));
|
||||||
return engineeringList;
|
//整理整个树并新增便携式设备树
|
||||||
|
CsLedgerVO portable = new CsLedgerVO();
|
||||||
|
portable.setLevel(0);
|
||||||
|
portable.setName(DataParam.portableDev);
|
||||||
|
portable.setPid("0");
|
||||||
|
portable.setId(IdUtil.simpleUUID());
|
||||||
|
List<CsLedgerVO> portables = wlRecordMapper.getAll();
|
||||||
|
checkDevSetData(portables);
|
||||||
|
for(CsLedgerVO c : portables){
|
||||||
|
c.setPid(portable.getId());
|
||||||
|
CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(c.getId());
|
||||||
|
c.setComFlag(Integer.parseInt(csEquipmentDeliveryPO.getStatus()));
|
||||||
|
}
|
||||||
|
portable.setChildren(portables);
|
||||||
|
|
||||||
|
CsLedgerVO government = new CsLedgerVO();
|
||||||
|
government.setLevel(0);
|
||||||
|
government.setName(DataParam.governmentDev);
|
||||||
|
government.setPid("0");
|
||||||
|
government.setId(IdUtil.simpleUUID());
|
||||||
|
government.setChildren(engineeringList);
|
||||||
|
List<CsLedgerVO> tree = new ArrayList<>();
|
||||||
|
tree.add(portable);
|
||||||
|
tree.add(government);
|
||||||
|
return tree;
|
||||||
|
//return engineeringList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user