From 9ca86187d65db0180f6d23b8efd13136b6db394c Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期五, 20 九月 2024 11:45:40 +0800
Subject: [PATCH] 考核成绩导出优化

---
 ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java
index 3148832..1d31b48 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java
@@ -93,6 +93,7 @@
     //杞崲鎴愬瓧绗︿覆鐢ㄤ簬excel瀵煎嚭
     public static CheckIndexCarVO getExcelVo(@NonNull CheckIndexCar checkIndexCar) {
         CheckIndexCarVO checkIndexCarVo = new CheckIndexCarVO();
+        checkIndexCarVo.setNum(checkIndexCar.getNum());
         checkIndexCarVo.setScore(checkIndexCar.getScore().setScale(2,RoundingMode.HALF_UP));
         checkIndexCarVo.setDeptName(checkIndexCar.getDeptName());
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
@@ -120,6 +121,7 @@
      * 瀵煎嚭鏃剁敤浜庤绠楀钩鍧囧��
      */
     public static CheckIndexCar calculateAverage(List<CheckIndexCar> checkIndexCars) {
+        Integer numSum = 0;
         BigDecimal scoreSum = BigDecimal.ZERO;
         BigDecimal viewConnectStabilitySum = BigDecimal.ZERO;
         BigDecimal siteOnlineSum = BigDecimal.ZERO;
@@ -132,6 +134,7 @@
         BigDecimal vehicleUrlAvailabilitySum = BigDecimal.ZERO;
         BigDecimal vehiclePictureAvailabilitySum = BigDecimal.ZERO;
         for (CheckIndexCar car : checkIndexCars) {
+            numSum = numSum + (car.getNum() == null? 0:car.getNum());
             scoreSum = scoreSum.add(car.getScore() == null ? BigDecimal.ZERO : car.getScore());
             viewConnectStabilitySum = viewConnectStabilitySum.add(car.getViewConnectStability());
             siteOnlineSum = siteOnlineSum.add(car.getSiteOnline());
@@ -149,6 +152,7 @@
         checkIndexCar.setDeptName(checkIndexCars.get(0).getDeptName());
         checkIndexCar.setExamineTag(checkIndexCars.get(0).getExamineTag());
         checkIndexCar.setScore(scoreSum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP));
+        checkIndexCar.setNum(numSum/checkIndexCars.size());
         checkIndexCar.setViewConnectStability(viewConnectStabilitySum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP));
         checkIndexCar.setSiteOnline(siteOnlineSum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP));
         checkIndexCar.setDeviceDirectoryConsistent(deviceDirectoryConsistentSum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP));

--
Gitblit v1.8.0