|
@@ -241,30 +241,30 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
List<PbiGroup> pbiGroupList = grouped.entrySet().stream().map(obj -> new PbiGroup(obj.getKey(), obj.getValue())).collect(Collectors.toList());
|
|
|
for (PbiGroup pbiGroup : pbiGroupList) {
|
|
|
//指标完成值求和
|
|
|
- double completeValueSum = pbiGroup.getPbis().stream().filter(obj -> obj.getCompleteValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getCompleteValue).sum();
|
|
|
+ double completeValueSum = pbiGroup.getPbis().stream().filter(obj -> obj.getCompleteValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getCompleteValue).average().orElse(0.0);
|
|
|
//装机容量求和
|
|
|
- double installCapacitySum = pbiGroup.getPbis().stream().filter(obj -> obj.getInstallCapacity() >= 0).mapToDouble(PerformanceBenchmarkInfo::getInstallCapacity).sum();
|
|
|
- //往年全年pbiGroup.getIndexName()指标数据
|
|
|
+ double installCapacitySum = pbiGroup.getPbis().stream().filter(obj -> obj.getInstallCapacity() >= 0).mapToDouble(PerformanceBenchmarkInfo::getInstallCapacity).average().orElse(0.0);
|
|
|
+ //去年全年指标数据
|
|
|
List<PerformanceBenchmarkInfo> wnData = baseMapper.selectListByIndexName(manageCategory, checkCycle, degreeYear - 1, null, pbiGroup.getIndexName());
|
|
|
- //前年全年pbiGroup.getIndexName()指标数据
|
|
|
+ //前年全年指标数据
|
|
|
List<PerformanceBenchmarkInfo> qnData = baseMapper.selectListByIndexName(manageCategory, checkCycle, degreeYear - 2, null, pbiGroup.getIndexName());
|
|
|
double plannedValueWnSum;
|
|
|
double plannedValueQnSum;
|
|
|
double completeValueWnSum;
|
|
|
if (qnData.size() > 0 && wnData.size() > 0) {
|
|
|
- //往年计划值
|
|
|
- plannedValueWnSum = wnData.stream().filter(obj -> obj.getPlannedValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getPlannedValue).sum();
|
|
|
- //往年实际完成值
|
|
|
- completeValueWnSum = wnData.stream().filter(obj -> obj.getCompleteValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getCompleteValue).sum();
|
|
|
+ //去年计划值
|
|
|
+ plannedValueWnSum = wnData.stream().filter(obj -> obj.getPlannedValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getPlannedValue).average().orElse(0.0);
|
|
|
//前年计划值
|
|
|
- plannedValueQnSum = qnData.stream().filter(obj -> obj.getPlannedValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getPlannedValue).sum();
|
|
|
+ plannedValueQnSum = qnData.stream().filter(obj -> obj.getPlannedValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getPlannedValue).average().orElse(0.0);
|
|
|
+ //去年实际完成值
|
|
|
+ completeValueWnSum = wnData.stream().filter(obj -> obj.getCompleteValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getCompleteValue).average().orElse(0.0);
|
|
|
} else if (wnData.size() > 0) {
|
|
|
- //往年计划值
|
|
|
- plannedValueWnSum = wnData.stream().filter(obj -> obj.getPlannedValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getPlannedValue).sum();
|
|
|
+ //去年计划值
|
|
|
+ plannedValueWnSum = wnData.stream().filter(obj -> obj.getPlannedValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getPlannedValue).average().orElse(0.0);
|
|
|
plannedValueQnSum = 0;
|
|
|
completeValueWnSum = 0;
|
|
|
} else {
|
|
|
- plannedValueWnSum = completeValueSum;
|
|
|
+ plannedValueWnSum = completeValueSum / pbiGroup.getPbis().size();
|
|
|
plannedValueQnSum = -1;
|
|
|
completeValueWnSum = -1;
|
|
|
}
|
|
@@ -282,30 +282,30 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
//Map转List
|
|
|
List<PbiGroup> pbiGroupList = grouped.entrySet().stream().map(entry -> new PbiGroup(entry.getKey(), entry.getValue())).collect(Collectors.toList());
|
|
|
for (PbiGroup pbiGroup : pbiGroupList) {
|
|
|
- //往年当前季/月pbiGroup.getIndexName()指标数据
|
|
|
+ //去年1季/月度指标数据
|
|
|
List<PerformanceBenchmarkInfo> wnfData = baseMapper.selectListByIndexName(manageCategory, checkCycle, degreeYear - 1, quarterlyMonth, pbiGroup.getIndexName());
|
|
|
double zb;
|
|
|
if (wnfData.size() > 0) {
|
|
|
- //往年全年pbiGroup.getIndexName()指标数据
|
|
|
+ //去年全年指标数据
|
|
|
List<PerformanceBenchmarkInfo> wnhData = baseMapper.selectListByIndexName(manageCategory, checkCycle, degreeYear - 1, null, pbiGroup.getIndexName());
|
|
|
- //往年全年计划值总和
|
|
|
- double wnhPlannedValueSum = wnhData.stream().filter(obj -> obj.getPlannedValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getPlannedValue).sum();
|
|
|
- //往年当前季/月计划值总和
|
|
|
- double wnfPlannedValueSum = wnfData.stream().filter(obj -> obj.getPlannedValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getPlannedValue).sum();
|
|
|
- zb = wnfPlannedValueSum / wnhPlannedValueSum;
|
|
|
+ //去年全年发电量总和
|
|
|
+ double wnhCompleteValueSum = wnhData.stream().filter(obj -> obj.getCompleteValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getCompleteValue).sum();
|
|
|
+ //去年1季/月度发电量总和
|
|
|
+ double wnfCompleteValueSum = wnfData.stream().filter(obj -> obj.getCompleteValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getCompleteValue).sum();
|
|
|
+ //每月占比
|
|
|
+ zb = wnfCompleteValueSum / wnhCompleteValueSum;
|
|
|
} else {
|
|
|
- //当前年pbiGroup.getIndexName()指标全数据
|
|
|
- double dnPlannedValueSum = pbiGroup.getPbis().stream().filter(obj -> obj.getPlannedValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getPlannedValue).sum();
|
|
|
- if ("JDKP".equals(checkCycle)) {
|
|
|
- zb = (3 / dnPlannedValueSum) * dnPlannedValueSum;
|
|
|
- } else {
|
|
|
- zb = (12 / dnPlannedValueSum) * dnPlannedValueSum;
|
|
|
- }
|
|
|
+ //当年全年指标数据
|
|
|
+ List<PerformanceBenchmarkInfo> dnhData = baseMapper.selectListByIndexName(manageCategory, checkCycle, degreeYear, null, pbiGroup.getIndexName());
|
|
|
+ //当年全年计划值总和
|
|
|
+ double dnhCompleteValueSum = dnhData.stream().filter(obj -> obj.getCompleteValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getCompleteValue).sum();
|
|
|
+ //当年1季/月度计划值总和
|
|
|
+ double dnfCompleteValueSum = pbiGroup.getPbis().stream().filter(obj -> obj.getCompleteValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getCompleteValue).sum();
|
|
|
+ zb = dnfCompleteValueSum / dnhCompleteValueSum;
|
|
|
}
|
|
|
- double finalZb = zb;
|
|
|
performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
|
|
|
if (null != PerformanceBenchmarkInfo.getPlannedValue()) {
|
|
|
- PerformanceBenchmarkInfo.setRecommendedValue(quarterlyMonthIndexRecommendedValue(PerformanceBenchmarkInfo.getPlannedValue(), finalZb));
|
|
|
+ PerformanceBenchmarkInfo.setRecommendedValue(quarterlyMonthIndexRecommendedValue(PerformanceBenchmarkInfo.getPlannedValue(), zb));
|
|
|
updateList.add(PerformanceBenchmarkInfo);
|
|
|
}
|
|
|
});
|