设备统计问题,数据查询问题

This commit is contained in:
hzj
2024-08-01 15:12:33 +08:00
parent fde625de7e
commit 8c7ea7e997
2 changed files with 6 additions and 29 deletions

View File

@@ -155,7 +155,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
EleEpdPqd eleEpdPqd = epdFeignClient.selectById(item.getDataId()).getData();
vo.setClassId(eleEpdPqd.getClassId());
vo.setUnit(eleEpdPqd.getUnit());
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,eleEpdPqd.getClassId(),item.getName(),item.getPhase(),item.getStatMethod(),clDid);
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,getTableNameByClassId(eleEpdPqd.getClassId()),item.getName(),item.getPhase(),item.getStatMethod(),clDid);
if (!Objects.isNull(statisticalDataDTO)){
vo.setTime(statisticalDataDTO.getTime());
vo.setDataValue(BigDecimal.valueOf(statisticalDataDTO.getValue()).setScale(4, RoundingMode.UP).doubleValue());
@@ -211,7 +211,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
EleEpdPqd eleEpdPqd = epdFeignClient.selectById(item.getDataId()).getData();
vo.setClassId(eleEpdPqd.getClassId());
vo.setUnit(eleEpdPqd.getUnit());
StatisticalDataDTO statisticalDataDTO = commonService.getLineHistoryData(energyBaseParam.getLineId(),eleEpdPqd.getClassId(),item.getName(),energyBaseParam.getStartTime(),energyBaseParam.getEndTime(),clDid);
StatisticalDataDTO statisticalDataDTO = commonService.getLineHistoryData(energyBaseParam.getLineId(),getTableNameByClassId(eleEpdPqd.getClassId()),item.getName(),energyBaseParam.getStartTime(),energyBaseParam.getEndTime(),clDid);
if (!Objects.isNull(statisticalDataDTO)){
vo.setMaxValue(BigDecimal.valueOf(statisticalDataDTO.getMaxValue()).setScale(4, RoundingMode.UP).doubleValue());
vo.setMinValue(BigDecimal.valueOf(statisticalDataDTO.getMinValue()).setScale(4, RoundingMode.UP).doubleValue());
@@ -700,4 +700,6 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
return result;
}
}

View File

@@ -194,35 +194,10 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
}
).
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)));
//整理整个树并新增便携式设备树
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;
return engineeringList;
}
@Override