超高压-综合分析代码调整
This commit is contained in:
@@ -28,7 +28,12 @@ public class AreaDTO {
|
||||
private Double averageOverDay = 0.0;
|
||||
|
||||
/**
|
||||
* 占比
|
||||
* 符合性占比
|
||||
*/
|
||||
private Double ratio = 0.0;
|
||||
|
||||
/**
|
||||
* 监测点超标占比
|
||||
*/
|
||||
private Double lineRatio = 0.0;
|
||||
}
|
||||
|
||||
@@ -32,12 +32,15 @@ public class HarmonicDeptVO implements Serializable {
|
||||
@ApiModelProperty("超标监测点数")
|
||||
private Integer overLineCount = 0;
|
||||
|
||||
/**
|
||||
* 占比
|
||||
*/
|
||||
@ApiModelProperty("超标占比")
|
||||
@ApiModelProperty("符合性占比")
|
||||
private Double ratio = -1.0;
|
||||
|
||||
/**
|
||||
* 监测点超标占比
|
||||
*/
|
||||
@ApiModelProperty("监测点超标占比")
|
||||
private Double lineRatio;
|
||||
|
||||
/**
|
||||
* 平均超标天数
|
||||
*/
|
||||
|
||||
@@ -446,6 +446,9 @@ public class HarmonicServiceImpl implements IHarmonicService {
|
||||
//平均超标天数
|
||||
areaDTO.setAverageOverDay(avgOverDay);
|
||||
areaDTO.setRatio(Math.min(ratio,100.0));
|
||||
//月监测点超标占比
|
||||
Double lineRatio = BigDecimal.valueOf(overLineCount*100/onlineCount).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
areaDTO.setLineRatio(lineRatio);
|
||||
return areaDTO;
|
||||
}
|
||||
|
||||
@@ -517,12 +520,15 @@ public class HarmonicServiceImpl implements IHarmonicService {
|
||||
} else {
|
||||
avgOverDay = overLineCount == 0?0.0:BigDecimal.valueOf(overCountByDay*1.0/overLineCount).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
}
|
||||
//月监测点超标占比
|
||||
//月监测点符合性超标占比
|
||||
ratio = map.size() == 0?-1.0:BigDecimal.valueOf(ratio*100/map.size()).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
areaDTO.setOnlineCount(onlineCount);
|
||||
areaDTO.setOverLineCount(overLineCount);
|
||||
areaDTO.setAverageOverDay(avgOverDay);
|
||||
areaDTO.setRatio(Math.min(ratio,100.0));
|
||||
//月监测点超标占比
|
||||
Double lineRatio = BigDecimal.valueOf(overLineCount*100/onlineCount).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
areaDTO.setLineRatio(lineRatio);
|
||||
return areaDTO;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user