bug调整
This commit is contained in:
@@ -32,6 +32,7 @@ public class RMpMonitorAlarmCountM implements Serializable {
|
||||
/**
|
||||
* 数据类型(0:主网 1:配网)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
|
||||
@@ -109,8 +109,7 @@ implements RMpMonitorAlarmCountMService {
|
||||
LambdaQueryWrapper<RMpMonitorAlarmCountM> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(RMpMonitorAlarmCountM::getMeasurementPointId, monitorIdList)
|
||||
.ge(RMpMonitorAlarmCountM::getDataDate, startTime)
|
||||
.le(RMpMonitorAlarmCountM::getDataDate, endTime)
|
||||
.eq(RMpMonitorAlarmCountM::getDataType, dataType);
|
||||
.le(RMpMonitorAlarmCountM::getDataDate, endTime);
|
||||
List<RMpMonitorAlarmCountM> alarmCountMList = this.list(lambdaQueryWrapper);
|
||||
List<RMpMonitorAlarmCountMVO> resultList;
|
||||
if (CollUtil.isNotEmpty(alarmCountMList)) {
|
||||
@@ -119,7 +118,7 @@ implements RMpMonitorAlarmCountMService {
|
||||
RMpMonitorAlarmCountMVO rMpMonitorAlarmCountMVO = new 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.setMonitorTypeName(monitorTypeMap.get(monitorMap.get(item.getMeasurementPointId()).getMonitorType()));//监测点类型名称
|
||||
|
||||
@@ -99,17 +99,20 @@ implements RStatZwAlarmCountWService {
|
||||
BeanUtils.copyProperties(item, rStatZwAlarmCountWVO);
|
||||
//单位名称
|
||||
rStatZwAlarmCountWVO.setOrgName(deptDTOMap.get(rStatZwAlarmCountWVO.getOrgNo()).getName());
|
||||
DecimalFormat df = new DecimalFormat("###.00");
|
||||
// DecimalFormat df = new DecimalFormat("###.00");
|
||||
//获取有效监测点数量
|
||||
Integer monitorEffectiveCount = item.getMonitorEffectiveCount();
|
||||
if (monitorEffectiveCount == null || monitorEffectiveCount <= 0) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "有效监测点数量异常");
|
||||
}
|
||||
//todo 有效监测点数量在实际环境中是可能为0的,不需要做异常处理
|
||||
// if (monitorEffectiveCount == null || monitorEffectiveCount <= 0) {
|
||||
// throw new BusinessException(CommonResponseEnum.NO_DATA, "有效监测点数量异常");
|
||||
// }
|
||||
//计算告警四次及以上监测点占比( * 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);
|
||||
//级别'较差'监测点占比( * 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);
|
||||
|
||||
return rStatZwAlarmCountWVO;
|
||||
|
||||
@@ -24,15 +24,15 @@
|
||||
org_no,
|
||||
load_type,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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
|
||||
r_stat_load_type_m
|
||||
<where>
|
||||
|
||||
@@ -224,10 +224,11 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
rIconVO.setOverLimitMeasurementAverage(value.getOverLimitMeasurementAverage());
|
||||
rIconVO.setOverLimitMeasurementRatioAccrued(value.getOverLimitMeasurementRatioAccrued());
|
||||
rIconVO.setOverLimitMeasurementRatioAverage(value.getOverLimitMeasurementRatioAverage());
|
||||
DecimalFormat df = new DecimalFormat("###.00");
|
||||
Float averageOverDay = Float.parseFloat(
|
||||
df.format(value.getOverDay() / (value.getOverLimitMeasurementAccrued() * 1.0)));
|
||||
rIconVO.setAverageOverDay(averageOverDay);
|
||||
// DecimalFormat df = new DecimalFormat("###.00");
|
||||
// Float averageOverDay = Float.parseFloat(
|
||||
// df.format(value.getOverDay() / (value.getOverLimitMeasurementAccrued() * 1.0)));
|
||||
Float averageOverDay = (float)value.getOverDay()/value.getOverLimitMeasurementAccrued();
|
||||
rIconVO.setAverageOverDay(Float.parseFloat(String.format("%.2f", averageOverDay)));
|
||||
arrayVOList.add(rIconVO);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user