diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsLedgerVO.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsLedgerVO.java index 998f6e2..2496101 100644 --- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsLedgerVO.java +++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsLedgerVO.java @@ -45,6 +45,9 @@ public class CsLedgerVO implements Serializable { @ApiModelProperty(name = "nDid",value = "nDid") private String nDId; + @ApiModelProperty(name = "type",value = "类型 项目 工程 装置 监测点") + private String type; + @ApiModelProperty(name = "children",value = "子节点") private List children = new ArrayList<>(); diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsLedgerServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsLedgerServiceImpl.java index beff072..d320389 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsLedgerServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsLedgerServiceImpl.java @@ -83,10 +83,15 @@ public class CsLedgerServiceImpl extends ServiceImpl i temp->{ CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(temp.getId()); temp.setComFlag(csEquipmentDeliveryPO.getRunStatus()); + temp.setType("device"); } ). sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); - List finalLineList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.LINE_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); + List finalLineList = allList.stream() + .filter(item -> item.getLevel().equals(LineBaseEnum.LINE_LEVEL.getCode())) + .sorted(Comparator.comparing(CsLedgerVO::getSort)) + .peek(item -> item.setType("line")) + .collect(Collectors.toList()); checkDevSetData(deviceList); deviceList.forEach(dev -> dev.setChildren(getChildren(dev, finalLineList))); projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList))); @@ -103,6 +108,7 @@ public class CsLedgerServiceImpl extends ServiceImpl i CsEquipmentDeliveryPO po = csEquipmentDeliveryMapper.selectById(c.getId()); c.setComFlag(po.getRunStatus()); c.setNDId(po.getNdid()); + c.setType("device"); } portables.forEach(dev -> dev.setChildren(getChildren(dev, finalLineList))); checkDevSetData(portables); @@ -167,9 +173,11 @@ public class CsLedgerServiceImpl extends ServiceImpl i CsEquipmentDeliveryPO po = csEquipmentDeliveryMapper.selectById(temp.getId()); temp.setComFlag(po.getRunStatus()); temp.setNDId(po.getNdid()); + temp.setType("device"); } ). - 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))); engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList))); @@ -187,6 +195,7 @@ public class CsLedgerServiceImpl extends ServiceImpl i CsEquipmentDeliveryPO po = csEquipmentDeliveryMapper.selectById(c.getId()); c.setComFlag(po.getRunStatus()); c.setNDId(po.getNdid()); + c.setType("device"); } portable.setChildren(portables);