bug调整

This commit is contained in:
2023-11-21 14:23:49 +08:00
parent 23a47892d0
commit 41a0e62953
5 changed files with 22 additions and 18 deletions

View File

@@ -32,6 +32,7 @@ public class RMpMonitorAlarmCountM implements Serializable {
/** /**
* 数据类型(0:主网 1:配网) * 数据类型(0:主网 1:配网)
*/ */
@TableField(exist = false)
private String dataType; private String dataType;
/** /**

View File

@@ -109,8 +109,7 @@ implements RMpMonitorAlarmCountMService {
LambdaQueryWrapper<RMpMonitorAlarmCountM> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<RMpMonitorAlarmCountM> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(RMpMonitorAlarmCountM::getMeasurementPointId, monitorIdList) lambdaQueryWrapper.in(RMpMonitorAlarmCountM::getMeasurementPointId, monitorIdList)
.ge(RMpMonitorAlarmCountM::getDataDate, startTime) .ge(RMpMonitorAlarmCountM::getDataDate, startTime)
.le(RMpMonitorAlarmCountM::getDataDate, endTime) .le(RMpMonitorAlarmCountM::getDataDate, endTime);
.eq(RMpMonitorAlarmCountM::getDataType, dataType);
List<RMpMonitorAlarmCountM> alarmCountMList = this.list(lambdaQueryWrapper); List<RMpMonitorAlarmCountM> alarmCountMList = this.list(lambdaQueryWrapper);
List<RMpMonitorAlarmCountMVO> resultList; List<RMpMonitorAlarmCountMVO> resultList;
if (CollUtil.isNotEmpty(alarmCountMList)) { if (CollUtil.isNotEmpty(alarmCountMList)) {
@@ -119,7 +118,7 @@ implements RMpMonitorAlarmCountMService {
RMpMonitorAlarmCountMVO rMpMonitorAlarmCountMVO = new RMpMonitorAlarmCountMVO(); RMpMonitorAlarmCountMVO rMpMonitorAlarmCountMVO = new RMpMonitorAlarmCountMVO();
BeanUtils.copyProperties(item, rMpMonitorAlarmCountMVO); BeanUtils.copyProperties(item, rMpMonitorAlarmCountMVO);
//单位信息 //单位信息
rMpMonitorAlarmCountMVO.setOrgName(deptDTOMap.get(item.getOrgNo()).getName()); //所属单位名称 rMpMonitorAlarmCountMVO.setOrgName(deptDTOMap.get(monitorMap.get(item.getMeasurementPointId()).getOrgId()).getName()); //所属单位名称
//监测点信息 //监测点信息
rMpMonitorAlarmCountMVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getName());//监测点名称 rMpMonitorAlarmCountMVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getName());//监测点名称
rMpMonitorAlarmCountMVO.setMonitorTypeName(monitorTypeMap.get(monitorMap.get(item.getMeasurementPointId()).getMonitorType()));//监测点类型名称 rMpMonitorAlarmCountMVO.setMonitorTypeName(monitorTypeMap.get(monitorMap.get(item.getMeasurementPointId()).getMonitorType()));//监测点类型名称

View File

@@ -99,17 +99,20 @@ implements RStatZwAlarmCountWService {
BeanUtils.copyProperties(item, rStatZwAlarmCountWVO); BeanUtils.copyProperties(item, rStatZwAlarmCountWVO);
//单位名称 //单位名称
rStatZwAlarmCountWVO.setOrgName(deptDTOMap.get(rStatZwAlarmCountWVO.getOrgNo()).getName()); rStatZwAlarmCountWVO.setOrgName(deptDTOMap.get(rStatZwAlarmCountWVO.getOrgNo()).getName());
DecimalFormat df = new DecimalFormat("###.00"); // DecimalFormat df = new DecimalFormat("###.00");
//获取有效监测点数量 //获取有效监测点数量
Integer monitorEffectiveCount = item.getMonitorEffectiveCount(); Integer monitorEffectiveCount = item.getMonitorEffectiveCount();
if (monitorEffectiveCount == null || monitorEffectiveCount <= 0) { //todo 有效监测点数量在实际环境中是可能为0的,不需要做异常处理
throw new BusinessException(CommonResponseEnum.NO_DATA, "有效监测点数量异常"); // if (monitorEffectiveCount == null || monitorEffectiveCount <= 0) {
} // throw new BusinessException(CommonResponseEnum.NO_DATA, "有效监测点数量异常");
// }
//计算告警四次及以上监测点占比( * 100 是直接取到百分比) //计算告警四次及以上监测点占比( * 100 是直接取到百分比)
Double warnMonitorRate = Double.parseDouble(df.format(item.getWarnMonitorCount() / (monitorEffectiveCount * 1.0) * 100)); // Double warnMonitorRate = Double.parseDouble(df.format(item.getWarnMonitorCount() / (monitorEffectiveCount * 1.0) * 100));
Double warnMonitorRate = monitorEffectiveCount<=0 ? 0.0 : Double.parseDouble(String.format("%.2f",item.getWarnMonitorCount() / (monitorEffectiveCount * 1.0) * 100));
rStatZwAlarmCountWVO.setWarnMonitorRate(warnMonitorRate); rStatZwAlarmCountWVO.setWarnMonitorRate(warnMonitorRate);
//级别'较差'监测点占比( * 100 是直接取到百分比) //级别'较差'监测点占比( * 100 是直接取到百分比)
Double monitorGradeRate = Double.parseDouble(df.format(item.getMonitorGradeCount() / (monitorEffectiveCount * 1.0) * 100)); // Double monitorGradeRate = Double.parseDouble(df.format(item.getMonitorGradeCount() / (monitorEffectiveCount * 1.0) * 100));
Double monitorGradeRate = monitorEffectiveCount<=0 ? 0.0 : Double.parseDouble(String.format("%.2f",item.getMonitorGradeCount() / (monitorEffectiveCount * 1.0) * 100));
rStatZwAlarmCountWVO.setMonitorGradeRate(monitorGradeRate); rStatZwAlarmCountWVO.setMonitorGradeRate(monitorGradeRate);
return rStatZwAlarmCountWVO; return rStatZwAlarmCountWVO;

View File

@@ -24,15 +24,15 @@
org_no, org_no,
load_type, load_type,
v_average, v_average,
ROUND( v_count / effective_measurement, 2 ) AS vAccrued, (case when effective_measurement = 0 then 0 else ROUND( v_count / effective_measurement, 2 ) end) as vAccrued,
i_average, i_average,
ROUND( i_count / effective_measurement, 2 ) AS iAccrued, (case when effective_measurement = 0 then 0 else ROUND( i_count / effective_measurement, 2 ) end) as iAccrued,
unbalance_average, unbalance_average,
ROUND( unbalance_count / effective_measurement, 2 ) AS unbalanceAccrued, (case when effective_measurement = 0 then 0 else ROUND( unbalance_count / effective_measurement, 2 ) end) as unbalanceAccrued,
i_neg_average, i_neg_average,
ROUND( i_neg_count / effective_measurement, 2 ) AS iNegAccrued, (case when effective_measurement = 0 then 0 else ROUND( i_neg_count / effective_measurement, 2 ) end) as iNegAccrued,
flicker_average, flicker_average,
ROUND( flicker_count / effective_measurement, 2 ) AS flickerAccrued (case when effective_measurement = 0 then 0 else ROUND( flicker_count / effective_measurement, 2 ) end) as flickerAccrued
from from
r_stat_load_type_m r_stat_load_type_m
<where> <where>

View File

@@ -224,10 +224,11 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
rIconVO.setOverLimitMeasurementAverage(value.getOverLimitMeasurementAverage()); rIconVO.setOverLimitMeasurementAverage(value.getOverLimitMeasurementAverage());
rIconVO.setOverLimitMeasurementRatioAccrued(value.getOverLimitMeasurementRatioAccrued()); rIconVO.setOverLimitMeasurementRatioAccrued(value.getOverLimitMeasurementRatioAccrued());
rIconVO.setOverLimitMeasurementRatioAverage(value.getOverLimitMeasurementRatioAverage()); rIconVO.setOverLimitMeasurementRatioAverage(value.getOverLimitMeasurementRatioAverage());
DecimalFormat df = new DecimalFormat("###.00"); // DecimalFormat df = new DecimalFormat("###.00");
Float averageOverDay = Float.parseFloat( // Float averageOverDay = Float.parseFloat(
df.format(value.getOverDay() / (value.getOverLimitMeasurementAccrued() * 1.0))); // df.format(value.getOverDay() / (value.getOverLimitMeasurementAccrued() * 1.0)));
rIconVO.setAverageOverDay(averageOverDay); Float averageOverDay = (float)value.getOverDay()/value.getOverLimitMeasurementAccrued();
rIconVO.setAverageOverDay(Float.parseFloat(String.format("%.2f", averageOverDay)));
arrayVOList.add(rIconVO); arrayVOList.add(rIconVO);
} }
}); });