历史趋势图添加二次值
This commit is contained in:
@@ -322,6 +322,12 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
||||
List<ThdDataVO> result = new ArrayList();
|
||||
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(commonStatisticalQueryParam.getDevId()).collect(Collectors.toList())).getData();
|
||||
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(Arrays.asList(commonStatisticalQueryParam.getLineId())).getData();
|
||||
CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper<CsDataSet>().eq(CsDataSet::getId,finalCsLinePOList.get(0).getDataSetId()));
|
||||
if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){
|
||||
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
|
||||
}
|
||||
Double ct = finalCsLinePOList.get(0).getCtRatio();
|
||||
Double pt = finalCsLinePOList.get(0).getPtRatio();
|
||||
if(CollectionUtil.isNotEmpty(commonStatisticalQueryParam.getList())){
|
||||
for (CommonStatisticalQueryParam param : commonStatisticalQueryParam.getList()){
|
||||
|
||||
@@ -353,6 +359,17 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
||||
vo.setTime(temp.getTime());
|
||||
vo.setStatMethod(temp.getValueType());
|
||||
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||
if (ObjectUtil.isNotNull(epdPqd.getPrimaryFormula()) && !Objects.equals(csDataSet.getDataLevel(), commonStatisticalQueryParam.getDataLevel())) {
|
||||
Double re;
|
||||
if ("Primary".equals(csDataSet.getDataLevel())) {
|
||||
re = DataChangeUtil.primaryToSecondary(epdPqd.getPrimaryFormula(), temp.getValue(), pt, ct);
|
||||
} else {
|
||||
re = DataChangeUtil.secondaryToPrimary(epdPqd.getPrimaryFormula(), temp.getValue(), pt, ct);
|
||||
}
|
||||
vo.setStatisticalData(Double.valueOf(df.format(re)));
|
||||
} else {
|
||||
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
|
||||
}
|
||||
vo.setStatisticalIndex(epdPqd.getId());
|
||||
vo.setUnit(epdPqd.getUnit());
|
||||
vo.setStatisticalName(epdPqd.getName());
|
||||
|
||||
Reference in New Issue
Block a user