|
|
|
|
@@ -161,7 +161,7 @@ public class StableDataServiceImpl implements StableDataService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EleEpdPqd data = epdFeignClient.selectById(commonStatisticalQueryParam.getStatisticalId()).getData();
|
|
|
|
|
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.ELEEPDPQD_DATA_ERROR));
|
|
|
|
|
Optional.ofNullable(data).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.ELEEPDPQD_DATA_ERROR));
|
|
|
|
|
String frequency = Optional.ofNullable(commonStatisticalQueryParam.getFrequency()).orElse("");
|
|
|
|
|
|
|
|
|
|
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtData(collect, data.getClassId(), data.getName()+frequency, data.getPhase(), commonStatisticalQueryParam.getValueType());
|
|
|
|
|
@@ -189,7 +189,35 @@ public class StableDataServiceImpl implements StableDataService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EleEpdPqd data = epdFeignClient.selectById(commonStatisticalQueryParam.getStatisticalId()).getData();
|
|
|
|
|
List<CsLinePO> csLinePOList1 = Optional.ofNullable(csLinePOList).orElseThrow(() -> new BusinessException(AlgorithmResponseEnum.ELEEPDPQD_DATA_ERROR));
|
|
|
|
|
Optional.ofNullable(data).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.ELEEPDPQD_DATA_ERROR));
|
|
|
|
|
|
|
|
|
|
String frequency = Optional.ofNullable(commonStatisticalQueryParam.getFrequency()).orElse("");
|
|
|
|
|
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(collect, data.getClassId(), data.getName()+frequency, data.getPhase(), commonStatisticalQueryParam.getValueType(),commonStatisticalQueryParam.getStartTime(),commonStatisticalQueryParam.getEndTime());
|
|
|
|
|
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
|
|
|
|
ThdDataVO vo = new ThdDataVO();
|
|
|
|
|
vo.setLineId(temp.getLineId());
|
|
|
|
|
vo.setPhase(temp.getPhaseType());
|
|
|
|
|
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
|
|
|
|
vo.setPosition(position);
|
|
|
|
|
vo.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime());
|
|
|
|
|
vo.setStatMethod(temp.getValueType());
|
|
|
|
|
vo.setStatisticalData(BigDecimal.valueOf(temp.getValue()).setScale(4, RoundingMode.UP).doubleValue());
|
|
|
|
|
vo.setStatisticalIndex(data.getId());
|
|
|
|
|
return vo;
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
return collect1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<ThdDataVO> queryLineCommonStatistical(CommonStatisticalQueryParam commonStatisticalQueryParam) {
|
|
|
|
|
List<CsLinePO> csLinePOList = csLineFeignClient.queryLineById(commonStatisticalQueryParam.getLineList()).getData();
|
|
|
|
|
Optional.ofNullable(csLinePOList).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.LINE_DATA_ERROR));
|
|
|
|
|
List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EleEpdPqd data = epdFeignClient.selectById(commonStatisticalQueryParam.getStatisticalId()).getData();
|
|
|
|
|
Optional.ofNullable(data).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.ELEEPDPQD_DATA_ERROR));
|
|
|
|
|
|
|
|
|
|
String frequency = Optional.ofNullable(commonStatisticalQueryParam.getFrequency()).orElse("");
|
|
|
|
|
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(collect, data.getClassId(), data.getName()+frequency, data.getPhase(), commonStatisticalQueryParam.getValueType(),commonStatisticalQueryParam.getStartTime(),commonStatisticalQueryParam.getEndTime());
|
|
|
|
|
|