|
@@ -21,6 +21,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
+import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -263,9 +264,9 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
plannedValueQnSum = 0;
|
|
|
completeValueWnSum = 0;
|
|
|
} else {
|
|
|
- plannedValueWnSum = 0;
|
|
|
- plannedValueQnSum = 0;
|
|
|
- completeValueWnSum = 0;
|
|
|
+ plannedValueWnSum = completeValueSum;
|
|
|
+ plannedValueQnSum = -1;
|
|
|
+ completeValueWnSum = -1;
|
|
|
}
|
|
|
pbiGroup.getPbis().forEach(PerformanceBenchmarkInfo -> {
|
|
|
double A = yearIndexRecommendedValueA(completeValueSum, installCapacitySum, PerformanceBenchmarkInfo.getInstallCapacity());
|
|
@@ -296,9 +297,9 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
//当前年pbiGroup.getIndexName()指标全数据
|
|
|
double dnPlannedValueSum = pbiGroup.getPbis().stream().filter(obj -> obj.getPlannedValue() >= 0).mapToDouble(PerformanceBenchmarkInfo::getPlannedValue).sum();
|
|
|
if ("JDKP".equals(checkCycle)) {
|
|
|
- zb = (dnPlannedValueSum / 3) / dnPlannedValueSum;
|
|
|
+ zb = (3 / dnPlannedValueSum) * dnPlannedValueSum;
|
|
|
} else {
|
|
|
- zb = (dnPlannedValueSum / 12) / dnPlannedValueSum;
|
|
|
+ zb = (12 / dnPlannedValueSum) * dnPlannedValueSum;
|
|
|
}
|
|
|
}
|
|
|
double finalZb = zb;
|
|
@@ -356,17 +357,21 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
private void db(String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth) {
|
|
|
List<BenchmarkingRecord> benchmarkingRecordList = benchmarkingRecordService.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth, "达标");
|
|
|
if (benchmarkingRecordList.size() == 0) {
|
|
|
+ boolean flag = false;
|
|
|
List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = baseMapper.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth);
|
|
|
for (PerformanceBenchmarkInfo performanceBenchmarkInfo : performanceBenchmarkInfoList) {
|
|
|
if (null != performanceBenchmarkInfo.getCompleteValue() && null != performanceBenchmarkInfo.getScalingValue()) {
|
|
|
if (performanceBenchmarkInfo.getCompleteValue() >= performanceBenchmarkInfo.getScalingValue()) {
|
|
|
performanceBenchmarkInfo.setIsDb(1);
|
|
|
performanceBenchmarkInfo.setDbVal(performanceBenchmarkInfo.getCompleteValue() - performanceBenchmarkInfo.getScalingValue());
|
|
|
+ flag = true;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ flag = false;
|
|
|
}
|
|
|
}
|
|
|
super.updateBatchById(performanceBenchmarkInfoList);
|
|
|
- if (performanceBenchmarkInfoList.size() > 0) {
|
|
|
+ if (performanceBenchmarkInfoList.size() > 0 && flag) {
|
|
|
addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "达标");
|
|
|
}
|
|
|
}
|
|
@@ -384,16 +389,20 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
List<BenchmarkingRecord> benchmarkingRecordList = benchmarkingRecordService.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth, "超标");
|
|
|
if (benchmarkingRecordList.size() == 0) {
|
|
|
List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = baseMapper.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth);
|
|
|
+ AtomicBoolean flag = new AtomicBoolean(false);
|
|
|
performanceBenchmarkInfoList.stream().filter(p -> p.getIsBg().equals(1)).findFirst().ifPresent(performanceBenchmarkInfo -> performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
|
|
|
if (null != PerformanceBenchmarkInfo.getCompleteValue() && null != performanceBenchmarkInfo.getScalingValue()) {
|
|
|
if (PerformanceBenchmarkInfo.getCompleteValue() > performanceBenchmarkInfo.getScalingValue()) {
|
|
|
PerformanceBenchmarkInfo.setIsCb(1);
|
|
|
PerformanceBenchmarkInfo.setCbVal(PerformanceBenchmarkInfo.getCompleteValue() - performanceBenchmarkInfo.getScalingValue());
|
|
|
+ flag.set(true);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ flag.set(false);
|
|
|
}
|
|
|
}));
|
|
|
super.updateBatchById(performanceBenchmarkInfoList);
|
|
|
- if (performanceBenchmarkInfoList.size() > 0) {
|
|
|
+ if (performanceBenchmarkInfoList.size() > 0 && flag.get()) {
|
|
|
addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "超标");
|
|
|
}
|
|
|
}
|
|
@@ -411,7 +420,9 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
*/
|
|
|
private Double yearIndexRecommendedValueB(double a, double b, double c) {
|
|
|
double B;
|
|
|
- if (b == 0) {
|
|
|
+ if (b == -1) {
|
|
|
+ B = a;
|
|
|
+ } else if (b == 0) {
|
|
|
B = a + (a * 0.02);
|
|
|
} else {
|
|
|
B = (a / b) * c;
|