1.专项分析-指标总览算法修改

This commit is contained in:
wr
2024-03-06 18:47:17 +08:00
parent 3782ac6900
commit cf0324bff5
6 changed files with 36 additions and 25 deletions

View File

@@ -53,6 +53,11 @@ public class RStatHarmonicOrgM implements Serializable {
* 数据类型,字典表01主网测点 02配网测点
*/
private String dataType;
public void setOverLimitMeasurementAverage(Float overLimitMeasurementAverage) {
this.overLimitMeasurementAverage = NumberUtil.round(overLimitMeasurementAverage*100,2).floatValue();;
}
public void setOverLimitMeasurementRatioAverage(Float overLimitMeasurementRatioAverage) {
this.overLimitMeasurementRatioAverage = NumberUtil.round(overLimitMeasurementRatioAverage*100,2).floatValue();
}

View File

@@ -53,6 +53,9 @@ public class RStatHarmonicOrgQ implements Serializable {
* 数据类型,字典表01主网测点 02配网测点
*/
private String dataType;
public void setOverLimitMeasurementAverage(Float overLimitMeasurementAverage) {
this.overLimitMeasurementAverage = NumberUtil.round(overLimitMeasurementAverage*100,2).floatValue();;
}
public void setOverLimitMeasurementRatioAverage(Float overLimitMeasurementRatioAverage) {
this.overLimitMeasurementRatioAverage = NumberUtil.round(overLimitMeasurementRatioAverage*100,2).floatValue();
}

View File

@@ -54,6 +54,9 @@ public class RStatHarmonicOrgY implements Serializable {
*/
private String dataType;
public void setOverLimitMeasurementAverage(Float overLimitMeasurementAverage) {
this.overLimitMeasurementAverage = NumberUtil.round(overLimitMeasurementAverage*100,2).floatValue();;
}
public void setOverLimitMeasurementRatioAverage(Float overLimitMeasurementRatioAverage) {
this.overLimitMeasurementRatioAverage = NumberUtil.round(overLimitMeasurementRatioAverage*100,2).floatValue();
}

View File

@@ -43,6 +43,6 @@ public class WindFarmIndexOverviewPO implements Serializable {
/**
* 平均超标天数
*/
private Integer avgExcessiveDays;
private Double avgExcessiveDays;
}

View File

@@ -114,8 +114,8 @@ public class WindFarmIndexOverviewServiceImpl implements WindFarmIndexOverview {
RStatOrgWfIndexOverviewVO vo = new RStatOrgWfIndexOverviewVO();
vo.setMonitorNum(po.getMonitorNum());
vo.setType(dataMap.get(po.getOrgNo()));
vo.setHistograms(po.getAvgExcessiveDays().toString());
vo.setLineCharts(po.getMonitorNum().toString());
vo.setHistograms(po.getProportionOfExcessPoints().toString());
vo.setLineCharts(po.getAvgExcessiveDays().toString());
vo.setMonitorTag(po.getMonitorTag());
return vo;
}).collect(Collectors.toList());

View File

@@ -62,7 +62,6 @@ public class SpecialAnalysisIndexOverviewServiceImpl implements SpecialAnalysisI
Date date = DateUtil.parse(jobParam.getDataDate());
for (DeptGetChildrenMoreDTO deptGetChildrenMoreDTO : data1) {
Map<String, List<String>> lineBaseMap = new HashMap<>();
List<LineDevGetDTO> lineBaseList = new ArrayList<>();
if(CollUtil.isNotEmpty(deptGetChildrenMoreDTO.getLineBaseList())){
@@ -92,10 +91,11 @@ public class SpecialAnalysisIndexOverviewServiceImpl implements SpecialAnalysisI
List<String> collect1 = v.stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
List<RStatLimitRateDPO> rStatLimitRateMS = rStatLimitRateDMapper.selectList(new LambdaQueryWrapper<RStatLimitRateDPO>().
in(RStatLimitRateDPO::getLineId, collect1).
ge(StrUtil.isNotBlank(jobParam.getBeginTime()), RStatLimitRateDPO::getTime, DateUtil.beginOfDay(DateUtil.parse(jobParam.getBeginTime()))).
le(StrUtil.isNotBlank(jobParam.getEndTime()), RStatLimitRateDPO::getTime, DateUtil.endOfDay(DateUtil.parse(jobParam.getEndTime()))));
List<RStatLimitRateDPO> rStatLimitRateMS = rStatLimitRateDMapper.selectList(new LambdaQueryWrapper<RStatLimitRateDPO>()
.eq(RStatLimitRateDPO::getPhasicType, "T")
.in(RStatLimitRateDPO::getLineId, collect1)
.ge(StrUtil.isNotBlank(jobParam.getBeginTime()), RStatLimitRateDPO::getTime, DateUtil.beginOfDay(DateUtil.parse(jobParam.getBeginTime())))
.le(StrUtil.isNotBlank(jobParam.getEndTime()), RStatLimitRateDPO::getTime, DateUtil.endOfDay(DateUtil.parse(jobParam.getEndTime()))));
if (CollectionUtils.isEmpty(rStatLimitRateMS)){
//单位下没数据不补0,0,0的数据
return;
@@ -144,17 +144,17 @@ public class SpecialAnalysisIndexOverviewServiceImpl implements SpecialAnalysisI
vIndexCount.getAndIncrement();
}
collect3.forEach((day, temp) -> {
if(isOverLimit(rStatLimitRateDPOList,1)){
if(isOverLimit(temp,1)){
iDayCount.getAndIncrement();
}
if(isOverLimit(rStatLimitRateDPOList,2)){
iDayCount.getAndIncrement();
if(isOverLimit(temp,2)){
vDayCount.getAndIncrement();
}
if(isOverLimit(rStatLimitRateDPOList,3)){
iDayCount.getAndIncrement();
if(isOverLimit(temp,3)){
iDayIndexCount.getAndIncrement();
}
if(isOverLimit(rStatLimitRateDPOList,4)){
iDayCount.getAndIncrement();
if(isOverLimit(temp,4)){
vDayIndexCount.getAndIncrement();
}
});
@@ -167,29 +167,29 @@ public class SpecialAnalysisIndexOverviewServiceImpl implements SpecialAnalysisI
specialAnalysisIndexOverviewPO.setVoltageIndexExceedsNum(vIndexCount.get());
specialAnalysisIndexOverviewDetailedPO.setMonitorHarmonicElectricExceedsProportion(
this.divideAndKeepTwoDecimalPlaces(iCount.get(),collect2.size())
this.divideAndKeepTwoDecimalPlaces(iCount.get()*100.0,rStatLimitRateMS.size())
);
specialAnalysisIndexOverviewDetailedPO.setMonitorHarmonicElectricExceedsAvgDays(
this.divideAndKeepTwoDecimalPlaces(iDayCount.get(),iCount.get())
this.divideAndKeepTwoDecimalPlaces(iDayCount.get()*1.0,iCount.get())
);
specialAnalysisIndexOverviewDetailedPO.setMonitorHarmonicVoltageContentExceedsProportion(
this.divideAndKeepTwoDecimalPlaces(vCount.get(),collect2.size())
this.divideAndKeepTwoDecimalPlaces(vCount.get()*100.0,rStatLimitRateMS.size())
);
specialAnalysisIndexOverviewDetailedPO.setMonitorHarmonicVoltageContentExceedsAvgDays(
this.divideAndKeepTwoDecimalPlaces(vDayCount.get(),vCount.get())
this.divideAndKeepTwoDecimalPlaces(vDayCount.get()*1.0,vCount.get())
);
specialAnalysisIndexOverviewDetailedPO.setElectricIndexExceedsProportion(
this.divideAndKeepTwoDecimalPlaces(iIndexCount.get(),collect2.size())
this.divideAndKeepTwoDecimalPlaces(iIndexCount.get()*100.0,rStatLimitRateMS.size())
);
specialAnalysisIndexOverviewDetailedPO.setElectricIndexExceedsAvgDays(
this.divideAndKeepTwoDecimalPlaces(iCount.get(),iIndexCount.get())
this.divideAndKeepTwoDecimalPlaces(iDayIndexCount.get()*1.0,iIndexCount.get())
);
specialAnalysisIndexOverviewDetailedPO.setVoltageIndexExceedsProportion(
this.divideAndKeepTwoDecimalPlaces(iDayIndexCount.get(),collect2.size())
this.divideAndKeepTwoDecimalPlaces(vDayIndexCount.get()*100.0,rStatLimitRateMS.size())
);
specialAnalysisIndexOverviewDetailedPO.setVoltageIndexExceedsAvgDays(
this.divideAndKeepTwoDecimalPlaces(vDayIndexCount.get(),vIndexCount.get())
this.divideAndKeepTwoDecimalPlaces(vDayIndexCount.get()*1.0,vIndexCount.get())
);
specialAnalysisIndexOverviewPOList.add(specialAnalysisIndexOverviewPO);
@@ -381,11 +381,11 @@ public class SpecialAnalysisIndexOverviewServiceImpl implements SpecialAnalysisI
* @Author: clam
* @Date: 2023/11/2
*/
public double divideAndKeepTwoDecimalPlaces(int a, int b) {
public double divideAndKeepTwoDecimalPlaces(double a, int b) {
if (b == 0) {
return 0.00;
}
double result = (double) a / b;
double result = a / b;
DecimalFormat df = new DecimalFormat("#.00");
return Double.parseDouble(df.format(result));
}