From d6372da6f37778e90a4bae02865e8ec77e980b6e Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期四, 17 七月 2025 17:14:26 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java |   98 ++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 72 insertions(+), 26 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java
index ebddfb4..c91a37c 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java
@@ -19,6 +19,7 @@
 import org.jeecg.common.constant.DataBaseConstant;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.StrUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog;
 import org.jeecg.modules.eam.constant.*;
@@ -47,6 +48,7 @@
 import javax.annotation.Resource;
 import java.time.LocalDate;
 import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
@@ -172,6 +174,14 @@
      */
     @Override
     public JSONObject exportInspectionOrderBaseInfo(String equipmentCode, String inspectionDate) {
+        if (StrUtils.isEmpty(inspectionDate)) {
+            // 鑾峰彇褰撳墠鏃ユ湡
+            LocalDate currentDate = LocalDate.now();
+            // 瀹氫箟鏃ユ湡鏍煎紡
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
+            // 鏍煎紡鍖栧綋鍓嶆湀浠�
+            inspectionDate = currentDate.format(formatter);
+        }
         // 鍒涘缓缁撴灉瀵硅薄
         JSONObject result = new JSONObject();
         EamInspectionOrderBaseResponse eamInspectionOrderBaseResponse = eamInspectionOrderMapper.findInsOrderBaseInfo(equipmentCode, inspectionDate);
@@ -191,6 +201,14 @@
      */
     @Override
     public JSONObject exportInspectionOrderDetailList(String equipmentCode, String inspectionDate) {
+        if (StrUtils.isEmpty(inspectionDate)) {
+            // 鑾峰彇褰撳墠鏃ユ湡
+            LocalDate currentDate = LocalDate.now();
+            // 瀹氫箟鏃ユ湡鏍煎紡
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
+            // 鏍煎紡鍖栧綋鍓嶆湀浠�
+            inspectionDate = currentDate.format(formatter);
+        }
         // 鍒涘缓缁撴灉瀵硅薄
         JSONObject result = new JSONObject();
         List<EamInsOrderDetailResultResponse> eamInsOrderDetailResultResponseList = eamInspectionOrderMapper.findInsOrderDetailList(equipmentCode, inspectionDate);
@@ -234,19 +252,21 @@
             for (int i = 1; i <= 31; i++) {
                 if (collect.containsKey(i)) {
                     String inspectionResult = "";
-                    switch (collect.get(i).getInspectionResult()) {
-                        case "NORMAL":
-                            inspectionResult = "鈭�";
-                            break;
-                        case "ANOMALY":
-                            inspectionResult = "脳";
-                            break;
-                        case "FAULT":
-                            inspectionResult = "鈻�";
-                            break;
-                        case "CLOSE":
-                            inspectionResult = "T";
-                            break;
+                    if (!StrUtils.isEmpty(collect.get(i).getInspectionResult())) {
+                        switch (collect.get(i).getInspectionResult()) {
+                            case "NORMAL":
+                                inspectionResult = "鈭�";
+                                break;
+                            case "ANOMALY":
+                                inspectionResult = "脳";
+                                break;
+                            case "FAULT":
+                                inspectionResult = "鈻�";
+                                break;
+                            case "CLOSE":
+                                inspectionResult = "T";
+                                break;
+                        }
                     }
                     resultMap.put("inspectionResult" + i, inspectionResult);
                 } else {
@@ -267,6 +287,14 @@
      */
     @Override
     public JSONObject exportInspectionOrderDetailUserList(String equipmentCode, String inspectionDate) {
+        if (StrUtils.isEmpty(inspectionDate)) {
+            // 鑾峰彇褰撳墠鏃ユ湡
+            LocalDate currentDate = LocalDate.now();
+            // 瀹氫箟鏃ユ湡鏍煎紡
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
+            // 鏍煎紡鍖栧綋鍓嶆湀浠�
+            inspectionDate = currentDate.format(formatter);
+        }
         // 鍒涘缓缁撴灉瀵硅薄
         JSONObject result = new JSONObject();
         List<EamInsOrderDetailUserResponse> eamInsOrderDetailUserResponseList = eamInspectionOrderMapper.findInspectionOrderDetailUserList(equipmentCode, inspectionDate);
@@ -310,6 +338,14 @@
      */
     @Override
     public JSONObject exportWeekInsDetailList(String equipmentCode, String inspectionDate) {
+        if (StrUtils.isEmpty(inspectionDate)) {
+            // 鑾峰彇褰撳墠鏃ユ湡
+            LocalDate currentDate = LocalDate.now();
+            // 瀹氫箟鏃ユ湡鏍煎紡
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
+            // 鏍煎紡鍖栧綋鍓嶆湀浠�
+            inspectionDate = currentDate.format(formatter);
+        }
         // 鍒涘缓缁撴灉瀵硅薄
         JSONObject result = new JSONObject();
         List<EamWeekInsDetailResultResponse> eamWeekInsDetailResultResponseList = eamInspectionOrderMapper.findWeekInsDetailList(equipmentCode, inspectionDate);
@@ -352,19 +388,21 @@
             for (int i = 1; i <= 5; i++) {
                 if (collect.containsKey(i)) {
                     String inspectionResult = "";
-                    switch (collect.get(i).getInspectionResult()) {
-                        case "NORMAL":
-                            inspectionResult = "鈭�";
-                            break;
-                        case "ANOMALY":
-                            inspectionResult = "脳";
-                            break;
-                        case "FAULT":
-                            inspectionResult = "鈻�";
-                            break;
-                        case "CLOSE":
-                            inspectionResult = "T";
-                            break;
+                    if (!StrUtils.isEmpty(collect.get(i).getInspectionResult())) {
+                        switch (collect.get(i).getInspectionResult()) {
+                            case "NORMAL":
+                                inspectionResult = "鈭�";
+                                break;
+                            case "ANOMALY":
+                                inspectionResult = "脳";
+                                break;
+                            case "FAULT":
+                                inspectionResult = "鈻�";
+                                break;
+                            case "CLOSE":
+                                inspectionResult = "T";
+                                break;
+                        }
                     }
                     resultMap.put("inspectionResult" + i, inspectionResult);
                 } else {
@@ -385,6 +423,14 @@
      */
     @Override
     public JSONObject exportWeekInsOrderDetailUserList(String equipmentCode, String inspectionDate) {
+        if (StrUtils.isEmpty(inspectionDate)) {
+            // 鑾峰彇褰撳墠鏃ユ湡
+            LocalDate currentDate = LocalDate.now();
+            // 瀹氫箟鏃ユ湡鏍煎紡
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
+            // 鏍煎紡鍖栧綋鍓嶆湀浠�
+            inspectionDate = currentDate.format(formatter);
+        }
         // 鍒涘缓缁撴灉瀵硅薄
         JSONObject result = new JSONObject();
         List<EamWeekInsDetailUserResponse> eamWeekInsDetailUserResponseList = eamInspectionOrderMapper.findWeekInsOrderDetailUserList(equipmentCode, inspectionDate);

--
Gitblit v1.9.3