|
@@ -48,7 +48,7 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
private IOrganizationEvaluationInfoService organizationEvaluationInfoService;
|
|
|
|
|
|
@Override
|
|
|
- public IPage<PerformanceBenchmarkInfo> listPage(Integer pageNum, Integer pageSize, String toolCategory, String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth) {
|
|
|
+ public IPage<PerformanceBenchmarkInfo> listPage(Integer pageNum, Integer pageSize, String toolCategory, String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth, String indexName) {
|
|
|
if (null == pageNum || null == pageSize) {
|
|
|
throw new RuntimeException("分页参数为空");
|
|
|
}
|
|
@@ -71,7 +71,7 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
}
|
|
|
//构造分页构造器
|
|
|
Page<PerformanceBenchmarkInfo> page = new Page<>(pageNum, pageSize);
|
|
|
- return baseMapper.selectListPage(page, manageCategory, checkCycle, degreeYear, quarterlyMonth, isBg, isDb, isCb);
|
|
|
+ return baseMapper.selectListPage(page, manageCategory, checkCycle, degreeYear, quarterlyMonth, indexName, isBg, isDb, isCb);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -330,16 +330,19 @@ 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);
|
|
|
- performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
|
|
|
- if (null != PerformanceBenchmarkInfo.getInstallCapacity() && null != PerformanceBenchmarkInfo.getCompleteValue() && 0 != PerformanceBenchmarkInfo.getCompleteValue()) {
|
|
|
- PerformanceBenchmarkInfo.setBgVal(PerformanceBenchmarkInfo.getInstallCapacity() / PerformanceBenchmarkInfo.getCompleteValue());
|
|
|
+ Map<String, List<PerformanceBenchmarkInfo>> grouped = performanceBenchmarkInfoList.stream().collect(Collectors.groupingBy(PerformanceBenchmarkInfo::getIndexName));
|
|
|
+ grouped.forEach((indexName, performanceBenchmarkInfos) -> {
|
|
|
+ performanceBenchmarkInfos.forEach(PerformanceBenchmarkInfo -> {
|
|
|
+ if (null != PerformanceBenchmarkInfo.getInstallCapacity() && null != PerformanceBenchmarkInfo.getCompleteValue() && 0 != PerformanceBenchmarkInfo.getCompleteValue()) {
|
|
|
+ PerformanceBenchmarkInfo.setBgVal(PerformanceBenchmarkInfo.getInstallCapacity() / PerformanceBenchmarkInfo.getCompleteValue());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ performanceBenchmarkInfos.sort(Comparator.comparingDouble(PerformanceBenchmarkInfo::getBgVal).reversed());
|
|
|
+ if (!performanceBenchmarkInfos.isEmpty() && performanceBenchmarkInfos.get(0).getBgVal() != 0) {
|
|
|
+ performanceBenchmarkInfos.get(0).setIsBg(1);
|
|
|
}
|
|
|
+ super.updateBatchById(performanceBenchmarkInfos);
|
|
|
});
|
|
|
- performanceBenchmarkInfoList.sort(Comparator.comparingDouble(PerformanceBenchmarkInfo::getBgVal).reversed());
|
|
|
- if (!performanceBenchmarkInfoList.isEmpty() && performanceBenchmarkInfoList.get(0).getBgVal() != 0) {
|
|
|
- performanceBenchmarkInfoList.get(0).setIsBg(1);
|
|
|
- }
|
|
|
- super.updateBatchById(performanceBenchmarkInfoList);
|
|
|
if (performanceBenchmarkInfoList.size() > 0) {
|
|
|
addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "标杆");
|
|
|
}
|
|
@@ -389,19 +392,22 @@ 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);
|
|
|
+ Map<String, List<PerformanceBenchmarkInfo>> grouped = performanceBenchmarkInfoList.stream().collect(Collectors.groupingBy(PerformanceBenchmarkInfo::getIndexName));
|
|
|
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);
|
|
|
+ grouped.forEach((indexName, performanceBenchmarkInfos) -> {
|
|
|
+ performanceBenchmarkInfos.stream().filter(p -> p.getIsBg().equals(1)).findFirst().ifPresent(performanceBenchmarkInfo -> performanceBenchmarkInfos.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);
|
|
|
}
|
|
|
- } else {
|
|
|
- flag.set(false);
|
|
|
- }
|
|
|
- }));
|
|
|
- super.updateBatchById(performanceBenchmarkInfoList);
|
|
|
+ }));
|
|
|
+ super.updateBatchById(performanceBenchmarkInfos);
|
|
|
+ });
|
|
|
if (performanceBenchmarkInfoList.size() > 0 && flag.get()) {
|
|
|
addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "超标");
|
|
|
}
|