bug调整

This commit is contained in:
xy
2024-10-31 15:44:14 +08:00
parent 86c6c95777
commit c3d87eca34
2 changed files with 16 additions and 9 deletions

View File

@@ -331,7 +331,6 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
vo.setTime(temp.getTime());
vo.setStatMethod(temp.getValueType());
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
vo.setUnit(epdPqd.getUnit());
if(temp.getValue()!=null) {
double re;
if (Objects.equals("Primary",commonStatisticalQueryParam.getDataLevel())) {
@@ -343,6 +342,9 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
re = DataChangeUtil.secondaryToPrimary(epdPqd.getPrimaryFormula(), temp.getValue(), pt, ct) / 1000;
vo.setStatisticalData(Double.valueOf(df.format(re)));
vo.setUnit("k" + epdPqd.getUnit());
} else {
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
vo.setUnit(epdPqd.getUnit());
}
}
} else {
@@ -350,6 +352,9 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
if (HarmonicConstant.POWER_LIST.contains(epdPqd.getShowName())) {
re = DataChangeUtil.primaryToSecondary(epdPqd.getPrimaryFormula(), temp.getValue(), pt, ct);
vo.setStatisticalData(Double.valueOf(df.format(re)));
} else {
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
vo.setUnit(epdPqd.getUnit());
}
} else {
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));

View File

@@ -407,23 +407,21 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
}
//格式化前端参数
formatQueryParamList(commonStatisticalQueryParam);
if(commonStatisticalQueryParam.getList() != null && commonStatisticalQueryParam.getList().size() > 0){
if(commonStatisticalQueryParam.getList() != null && !commonStatisticalQueryParam.getList().isEmpty()){
for (CommonStatisticalQueryParam param : commonStatisticalQueryParam.getList()){
if(param.getStatisticalId() == null){
continue;
}
List<EleEpdPqd> eleEpdPqds = csStatisticalSetFeignClient.queryStatisticalSelect(param.getStatisticalId()).getData();
for(WlRecord wl : data){
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(Arrays.asList(wl.getLineId())).getData();
CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper<CsDataSet>().eq(CsDataSet::getId,finalCsLinePOList.get(0).getDataSetId()));
if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){
if(StrUtil.isBlank(csDataSet.getDataLevel())){
throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)");
}
Double ct = Double.valueOf(wlRecord.getCt())/wlRecord.getCt1();
Double pt =Double.valueOf(wlRecord.getPt())/wlRecord.getPt1();
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(wl.getDevId()).collect(Collectors.toList())).getData();
eleEpdPqds.forEach(epdPqd->{
List<CommonQueryParam> commonQueryParams = finalCsLinePOList.stream().map(temp -> {
@@ -443,7 +441,6 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
//此处设空时为了有多段时将线条断开前端显示
if(!CollectionUtils.isEmpty(deviceRtData)){
deviceRtData.get(deviceRtData.size()-1).setValue(null);
}
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
ThdDataVO vo = new ThdDataVO();
@@ -453,7 +450,6 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
vo.setPosition(position);
vo.setTime(temp.getTime());
vo.setStatMethod(temp.getValueType());
vo.setUnit(epdPqd.getUnit());
if(temp.getValue()!=null) {
double re;
if (Objects.equals("Primary",commonStatisticalQueryParam.getDataLevel())) {
@@ -465,6 +461,9 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
re = DataChangeUtil.secondaryToPrimary(epdPqd.getPrimaryFormula(), temp.getValue(), pt, ct) / 1000;
vo.setStatisticalData(Double.valueOf(df.format(re)));
vo.setUnit("k" + epdPqd.getUnit());
} else {
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
vo.setUnit(epdPqd.getUnit());
}
}
} else {
@@ -472,6 +471,9 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
if (HarmonicConstant.POWER_LIST.contains(epdPqd.getShowName())) {
re = DataChangeUtil.primaryToSecondary(epdPqd.getPrimaryFormula(), temp.getValue(), pt, ct);
vo.setStatisticalData(Double.valueOf(df.format(re)));
} else {
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
vo.setUnit(epdPqd.getUnit());
}
} else {
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));