|
@@ -8,12 +8,21 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ims.eval.dao.PerformanceBenchmarkInfoMapper;
|
|
|
import com.ims.eval.entity.*;
|
|
|
import com.ims.eval.service.*;
|
|
|
+import lombok.Data;
|
|
|
+import org.apache.poi.ss.usermodel.Cell;
|
|
|
+import org.apache.poi.ss.usermodel.Row;
|
|
|
+import org.apache.poi.ss.usermodel.Sheet;
|
|
|
+import org.apache.poi.ss.usermodel.Workbook;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Comparator;
|
|
|
-import java.util.List;
|
|
|
+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;
|
|
|
|
|
|
/**
|
|
|
* @author hlf
|
|
@@ -65,6 +74,89 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
return baseMapper.selectListPage(page, manageCategory, checkCycle, degreeYear, quarterlyMonth, isBg, isDb, isCb);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void exportExcel(String toolCategory, String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth, HttpServletResponse response) throws IOException {
|
|
|
+ // 设置响应头信息,以附件形式下载
|
|
|
+ response.setHeader("Content-Disposition", "attachment; filename=performance_benchmark_data.xlsx");
|
|
|
+ response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
+
|
|
|
+ // 创建新的Excel工作簿
|
|
|
+ Workbook workbook = new XSSFWorkbook();
|
|
|
+
|
|
|
+ // 创建新的工作表
|
|
|
+ Sheet sheet = workbook.createSheet("Sheet1");
|
|
|
+
|
|
|
+ // 创建表头
|
|
|
+ Row headerRow = sheet.createRow(0);
|
|
|
+ List<String> headers = Arrays.asList("ID", "序号", "单位", "装机容量", "指标", "计划值", "实际完成值", "推荐值", "定标值", "是否标杆");
|
|
|
+ for (int i = 0; i < headers.size(); i++) {
|
|
|
+ Cell cell = headerRow.createCell(i);
|
|
|
+ cell.setCellValue(headers.get(i));
|
|
|
+ }
|
|
|
+
|
|
|
+ //行数据
|
|
|
+ int isBg = 0;
|
|
|
+ int isDb = 0;
|
|
|
+ int isCb = 0;
|
|
|
+ if ("标杆".equals(toolCategory)) {
|
|
|
+ isBg = 1;
|
|
|
+ } else if ("达标".equals(toolCategory)) {
|
|
|
+ isDb = 2;
|
|
|
+ } else if ("超标".equals(toolCategory)) {
|
|
|
+ isCb = 3;
|
|
|
+ }
|
|
|
+ List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = baseMapper.getExportExcelData(manageCategory, checkCycle, degreeYear, quarterlyMonth, isBg, isDb, isCb);
|
|
|
+
|
|
|
+ // 填充数据到工作表
|
|
|
+ int rowIndex = 1; // 从第二行开始填充数据(第一行是表头)
|
|
|
+ for (PerformanceBenchmarkInfo performanceBenchmarkInfo : performanceBenchmarkInfoList) {
|
|
|
+ Row row = sheet.createRow(rowIndex++);
|
|
|
+
|
|
|
+ // 设置ID
|
|
|
+ row.createCell(0).setCellValue(performanceBenchmarkInfo.getId());
|
|
|
+
|
|
|
+ // 设置序号
|
|
|
+ row.createCell(1).setCellValue(rowIndex - 1);
|
|
|
+
|
|
|
+ // 设置其他数据
|
|
|
+ row.createCell(2).setCellValue(performanceBenchmarkInfo.getCompanyShort());
|
|
|
+ if (null != performanceBenchmarkInfo.getInstallCapacity()) {
|
|
|
+ row.createCell(3).setCellValue(performanceBenchmarkInfo.getInstallCapacity());
|
|
|
+ }
|
|
|
+ row.createCell(4).setCellValue(performanceBenchmarkInfo.getIndexName());
|
|
|
+ if (null != performanceBenchmarkInfo.getPlannedValue()) {
|
|
|
+ row.createCell(5).setCellValue(performanceBenchmarkInfo.getPlannedValue());
|
|
|
+ }
|
|
|
+ if (null != performanceBenchmarkInfo.getCompleteValue()) {
|
|
|
+ row.createCell(6).setCellValue(performanceBenchmarkInfo.getCompleteValue());
|
|
|
+ }
|
|
|
+ if (null != performanceBenchmarkInfo.getRecommendedValue()) {
|
|
|
+ row.createCell(7).setCellValue(performanceBenchmarkInfo.getRecommendedValue());
|
|
|
+ }
|
|
|
+ if (null != performanceBenchmarkInfo.getScalingValue()) {
|
|
|
+ row.createCell(8).setCellValue(performanceBenchmarkInfo.getScalingValue());
|
|
|
+ }
|
|
|
+ if (1 == performanceBenchmarkInfo.getIsBg()) {
|
|
|
+ row.createCell(9).setCellValue("是");
|
|
|
+ } else if (0 == performanceBenchmarkInfo.getIsBg()) {
|
|
|
+ row.createCell(9).setCellValue("否");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 隐藏第一列(ID列)
|
|
|
+ sheet.setColumnHidden(0, true);
|
|
|
+
|
|
|
+ // 将工作簿写入到输出流
|
|
|
+ try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
|
|
|
+ workbook.write(outputStream);
|
|
|
+ response.getOutputStream().write(outputStream.toByteArray());
|
|
|
+ response.getOutputStream().flush();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 关闭工作簿
|
|
|
+ workbook.close();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 寻标
|
|
|
*
|
|
@@ -110,8 +202,11 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
performanceBenchmarkInfo.setPlannedValue(jhzObj.getQuantifiedValue());
|
|
|
performanceBenchmarkInfo.setCompleteValue(wczObj.getQuantifiedValue());
|
|
|
performanceBenchmarkInfo.setIsBg(0);
|
|
|
+ performanceBenchmarkInfo.setBgVal((double) 0);
|
|
|
performanceBenchmarkInfo.setIsDb(0);
|
|
|
+ performanceBenchmarkInfo.setDbVal((double) 0);
|
|
|
performanceBenchmarkInfo.setIsCb(0);
|
|
|
+ performanceBenchmarkInfo.setCbVal((double) 0);
|
|
|
performanceBenchmarkInfoList.add(performanceBenchmarkInfo);
|
|
|
}
|
|
|
}
|
|
@@ -120,7 +215,9 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
}
|
|
|
}
|
|
|
super.saveBatch(performanceBenchmarkInfoList);
|
|
|
- addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "寻标");
|
|
|
+ if (performanceBenchmarkInfoList.size() > 0) {
|
|
|
+ addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "寻标");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -133,25 +230,91 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
* @param quarterlyMonth 季/月度
|
|
|
*/
|
|
|
private void lb(String manageCategory, String checkCycle, Integer degreeYear, Integer quarterlyMonth) {
|
|
|
+ List<PerformanceBenchmarkInfo> updateList = new ArrayList<>();
|
|
|
List<BenchmarkingRecord> benchmarkingRecordList = benchmarkingRecordService.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth, "立标");
|
|
|
if (benchmarkingRecordList.size() == 0) {
|
|
|
if ("NDKP".equals(checkCycle)) {
|
|
|
List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = baseMapper.selectList(manageCategory, checkCycle, degreeYear, null);
|
|
|
- double completeValueSum = performanceBenchmarkInfoList.stream().mapToDouble(PerformanceBenchmarkInfo::getCompleteValue).sum();
|
|
|
- double installCapacitySum = performanceBenchmarkInfoList.stream().mapToDouble(PerformanceBenchmarkInfo::getInstallCapacity).sum();
|
|
|
- List<PerformanceBenchmarkInfo> updateList = new ArrayList<>();
|
|
|
- performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
|
|
|
- PerformanceBenchmarkInfo.setRecommendedValue(yearIndexRecommendedValueA(completeValueSum, installCapacitySum, PerformanceBenchmarkInfo.getInstallCapacity()));
|
|
|
- updateList.add(PerformanceBenchmarkInfo);
|
|
|
- });
|
|
|
- super.updateBatchById(updateList);
|
|
|
+ //Map分组
|
|
|
+ Map<String, List<PerformanceBenchmarkInfo>> grouped = performanceBenchmarkInfoList.stream().collect(Collectors.groupingBy(PerformanceBenchmarkInfo::getIndexName));
|
|
|
+ //Map转List
|
|
|
+ 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).average().orElse(0.0);
|
|
|
+ //装机容量求和
|
|
|
+ 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());
|
|
|
+ //前年全年指标数据
|
|
|
+ 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).average().orElse(0.0);
|
|
|
+ //前年计划值
|
|
|
+ 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).average().orElse(0.0);
|
|
|
+ plannedValueQnSum = 0;
|
|
|
+ completeValueWnSum = 0;
|
|
|
+ } else {
|
|
|
+ plannedValueWnSum = completeValueSum / pbiGroup.getPbis().size();
|
|
|
+ plannedValueQnSum = -1;
|
|
|
+ completeValueWnSum = -1;
|
|
|
+ }
|
|
|
+ pbiGroup.getPbis().forEach(PerformanceBenchmarkInfo -> {
|
|
|
+ double A = yearIndexRecommendedValueA(completeValueSum, installCapacitySum, PerformanceBenchmarkInfo.getInstallCapacity());
|
|
|
+ double B = yearIndexRecommendedValueB(plannedValueWnSum, plannedValueQnSum, completeValueWnSum);
|
|
|
+ PerformanceBenchmarkInfo.setRecommendedValue(Math.max(A, B));
|
|
|
+ updateList.add(PerformanceBenchmarkInfo);
|
|
|
+ });
|
|
|
+ }
|
|
|
} else if ("JDKP".equals(checkCycle) || "YDKP".equals(checkCycle)) {
|
|
|
List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = baseMapper.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth);
|
|
|
- List<PerformanceBenchmarkInfo> updateList = new ArrayList<>();
|
|
|
-
|
|
|
-
|
|
|
+ //Map分组
|
|
|
+ Map<String, List<PerformanceBenchmarkInfo>> grouped = performanceBenchmarkInfoList.stream().collect(Collectors.groupingBy(PerformanceBenchmarkInfo::getIndexName));
|
|
|
+ //Map转List
|
|
|
+ List<PbiGroup> pbiGroupList = grouped.entrySet().stream().map(entry -> new PbiGroup(entry.getKey(), entry.getValue())).collect(Collectors.toList());
|
|
|
+ for (PbiGroup pbiGroup : pbiGroupList) {
|
|
|
+ //去年1季/月度指标数据
|
|
|
+ List<PerformanceBenchmarkInfo> wnfData = baseMapper.selectListByIndexName(manageCategory, checkCycle, degreeYear - 1, quarterlyMonth, pbiGroup.getIndexName());
|
|
|
+ double zb;
|
|
|
+ if (wnfData.size() > 0) {
|
|
|
+ //去年全年指标数据
|
|
|
+ List<PerformanceBenchmarkInfo> wnhData = baseMapper.selectListByIndexName(manageCategory, checkCycle, degreeYear - 1, null, pbiGroup.getIndexName());
|
|
|
+ //去年全年发电量总和
|
|
|
+ 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 {
|
|
|
+ //当年全年指标数据
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
|
|
|
+ if (null != PerformanceBenchmarkInfo.getPlannedValue()) {
|
|
|
+ PerformanceBenchmarkInfo.setRecommendedValue(quarterlyMonthIndexRecommendedValue(PerformanceBenchmarkInfo.getPlannedValue(), zb));
|
|
|
+ updateList.add(PerformanceBenchmarkInfo);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ super.updateBatchById(updateList);
|
|
|
+ if (updateList.size() > 0) {
|
|
|
+ addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "立标");
|
|
|
}
|
|
|
- addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "立标");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -168,14 +331,18 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
if (benchmarkingRecordList.size() == 0) {
|
|
|
List<PerformanceBenchmarkInfo> performanceBenchmarkInfoList = baseMapper.selectList(manageCategory, checkCycle, degreeYear, quarterlyMonth);
|
|
|
performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
|
|
|
- PerformanceBenchmarkInfo.setBgVal(PerformanceBenchmarkInfo.getInstallCapacity() / PerformanceBenchmarkInfo.getCompleteValue());
|
|
|
+ if (null != PerformanceBenchmarkInfo.getInstallCapacity() && null != PerformanceBenchmarkInfo.getCompleteValue() && 0 != PerformanceBenchmarkInfo.getCompleteValue()) {
|
|
|
+ PerformanceBenchmarkInfo.setBgVal(PerformanceBenchmarkInfo.getInstallCapacity() / PerformanceBenchmarkInfo.getCompleteValue());
|
|
|
+ }
|
|
|
});
|
|
|
performanceBenchmarkInfoList.sort(Comparator.comparingDouble(PerformanceBenchmarkInfo::getBgVal).reversed());
|
|
|
if (!performanceBenchmarkInfoList.isEmpty() && performanceBenchmarkInfoList.get(0).getBgVal() != 0) {
|
|
|
performanceBenchmarkInfoList.get(0).setIsBg(1);
|
|
|
}
|
|
|
super.updateBatchById(performanceBenchmarkInfoList);
|
|
|
- addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "标杆");
|
|
|
+ if (performanceBenchmarkInfoList.size() > 0) {
|
|
|
+ addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "标杆");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -190,15 +357,23 @@ 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 (performanceBenchmarkInfo.getCompleteValue() >= performanceBenchmarkInfo.getScalingValue()) {
|
|
|
- performanceBenchmarkInfo.setIsDb(1);
|
|
|
- performanceBenchmarkInfo.setDbVal(performanceBenchmarkInfo.getCompleteValue() - performanceBenchmarkInfo.getScalingValue());
|
|
|
+ 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);
|
|
|
- addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "达标");
|
|
|
+ if (performanceBenchmarkInfoList.size() > 0 && flag) {
|
|
|
+ addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "达标");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -214,14 +389,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);
|
|
|
+ AtomicBoolean flag = new AtomicBoolean(false);
|
|
|
performanceBenchmarkInfoList.stream().filter(p -> p.getIsBg().equals(1)).findFirst().ifPresent(performanceBenchmarkInfo -> performanceBenchmarkInfoList.forEach(PerformanceBenchmarkInfo -> {
|
|
|
- if (PerformanceBenchmarkInfo.getCompleteValue() > performanceBenchmarkInfo.getScalingValue()) {
|
|
|
- PerformanceBenchmarkInfo.setIsCb(1);
|
|
|
- PerformanceBenchmarkInfo.setCbVal(PerformanceBenchmarkInfo.getCompleteValue() - performanceBenchmarkInfo.getScalingValue());
|
|
|
+ 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);
|
|
|
- addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "超标");
|
|
|
+ if (performanceBenchmarkInfoList.size() > 0 && flag.get()) {
|
|
|
+ addRecord(manageCategory, checkCycle, degreeYear, quarterlyMonth, "超标");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -237,8 +420,10 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
*/
|
|
|
private Double yearIndexRecommendedValueB(double a, double b, double c) {
|
|
|
double B;
|
|
|
- if (b == 0) {
|
|
|
- B = a * 0.02;
|
|
|
+ if (b == -1) {
|
|
|
+ B = a;
|
|
|
+ } else if (b == 0) {
|
|
|
+ B = a + (a * 0.02);
|
|
|
} else {
|
|
|
B = (a / b) * c;
|
|
|
}
|
|
@@ -262,4 +447,15 @@ public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<Performance
|
|
|
benchmarkingRecord.setTagType(toolCategory);
|
|
|
benchmarkingRecordService.save(benchmarkingRecord);
|
|
|
}
|
|
|
+
|
|
|
+ @Data
|
|
|
+ private static class PbiGroup {
|
|
|
+ private String indexName;
|
|
|
+ private List<PerformanceBenchmarkInfo> pbis;
|
|
|
+
|
|
|
+ public PbiGroup(String indexName, List<PerformanceBenchmarkInfo> pbis) {
|
|
|
+ this.indexName = indexName;
|
|
|
+ this.pbis = pbis;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|