From b63d81722fa0fc56f3f6da7ccf8a294f15b8253a Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期二, 22 七月 2025 16:30:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java |   97 +++++++++++++++++++++++++++---------------------
 1 files changed, 55 insertions(+), 42 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 487d9fc..fb90334 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
@@ -252,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 {
@@ -369,36 +371,40 @@
             resultMap.put("itemCode", weekInsDetailResultResponse.getItemCode());
             resultMap.put("itemName", weekInsDetailResultResponse.getItemName());
             resultMap.put("itemDemand", weekInsDetailResultResponse.getItemDemand());
-            // 浣跨敤AtomicInteger浣滀负璁℃暟鍣紝浠�1寮�濮�
-            AtomicInteger counter = new AtomicInteger(1);
             Map<Integer, EamWeekInsDetailResultResponse> collect = weekInsDetailResultResponseList
                     .stream()
                     .collect(Collectors.toMap(
-                            // 鍒嗙粍閿細浣跨敤鑷搴忓彿锛堜粠1寮�濮嬶級
-                            item -> counter.getAndIncrement(),
+                            // 鍒嗙粍閿細浣跨敤planInspectionDate瀛楁钀藉湪鏈湀鐨勫懆鏁�
+                            item -> {
+                                Calendar calendar = Calendar.getInstance();
+                                calendar.setTime(item.getPlanInspectionDate());
+                                return calendar.get(Calendar.WEEK_OF_MONTH);
+                            },
                             // 鍊硷細鐩存帴浣跨敤褰撳墠瀵硅薄
                             item -> item,
-                            // 鍚堝苟鍑芥暟锛氬綋鍚屼竴搴忓彿鏈夊涓璞℃椂锛堢悊璁轰笂涓嶄細鍙戠敓锛夛紝濡備綍澶勭悊
-                            (existing, replacement) -> existing, // 鑻ユ湁閲嶅閿紝淇濈暀宸插瓨鍦ㄧ殑瀵硅薄
+                            // 鍚堝苟鍑芥暟锛氬綋鍚屼竴鍛ㄦ湁澶氫釜瀵硅薄鏃讹紙鏍规嵁闇�姹備笉浼氬彂鐢燂紝浣嗕粛闇�鎻愪緵锛�
+                            (existing, replacement) -> existing,
                             // 鎸囧畾Map鐨勫叿浣撳疄鐜帮紙鍙�夛級
                             LinkedHashMap::new // 淇濇寔鎻掑叆椤哄簭
                     ));
             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 {
@@ -438,12 +444,18 @@
         Map<Integer, EamWeekInsDetailUserResponse> groupMap = eamWeekInsDetailUserResponseList
                 .stream()
                 .collect(Collectors.toMap(
-                        // 鍒嗙粍閿細浣跨敤鑷搴忓彿锛堜粠1寮�濮嬶級
-                        item -> counter.getAndIncrement(),
-                        // 鍊硷細鐩存帴浣跨敤褰撳墠瀵硅薄锛堜綔涓哄垵濮嬪�硷級
+                        // 鍒嗙粍閿細浣跨敤 planInspectionDate 瀛楁钀藉湪鏈湀鐨勫懆鏁�
+                        item -> {
+                            Calendar calendar = Calendar.getInstance();
+                            calendar.setTime(item.getPlanInspectionDate());
+                            return calendar.get(Calendar.WEEK_OF_MONTH);
+                        },
+                        // 鍊硷細鐩存帴浣跨敤褰撳墠瀵硅薄
                         item -> item,
-                        // 鍚堝苟鍑芥暟锛氬綋鍚屼竴鈥滃ぉ鈥濇湁澶氫釜瀵硅薄鏃讹紝濡備綍澶勭悊锛堣繖閲岀ず渚嬪彇绗竴涓級
-                        (existing, replacement) -> existing // 鑻ユ湁閲嶅閿紝淇濈暀宸插瓨鍦ㄧ殑瀵硅薄
+                        // 鍚堝苟鍑芥暟锛氬綋鍚屼竴鍛ㄦ湁澶氫釜瀵硅薄鏃讹紙鏍规嵁闇�姹備笉浼氬彂鐢燂級
+                        (existing, replacement) -> existing,
+                        // 浣跨敤 LinkedHashMap 淇濇寔鎻掑叆椤哄簭
+                        LinkedHashMap::new
                 ));
         Map<String, Object> resultMap = new LinkedHashMap<>();
         for (int i = 1; i <= 5; i++) {
@@ -529,7 +541,7 @@
         } else {
             eamInspectionOrder.setEquipmentId(equipment.getId());
         }
-        flowCommonService.initActBusiness("宸ュ崟鍙�: " + eamInspectionOrder.getOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode() + (equipment.getInstallationPosition() == null ? "" : ";瀹夎浣嶇疆: " + equipment.getInstallationPosition()),
+        flowCommonService.initActBusiness("宸ュ崟鍙�: " + eamInspectionOrder.getOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode(),
                 eamInspectionOrder.getId(), "IEamInspectionOrderService", "eam_inspection", null);
         Map<String, Object> variables = new HashMap<>();
         variables.put("dataId", eamInspectionOrder.getId());
@@ -679,9 +691,9 @@
             updateEamInspectionOrder(eamInspectionOrder);
 
             //鏌ヨ鏁版嵁,杩涜璁惧缁翠慨澶勭悊
-            if (eamInspectionOrder.getInspectionStatus().equals(InspectionStatus.WAIT_CONFIRM.name())) {
-                updateEamInspectionOrderDetail(eamInspectionOrder);
-            }
+//            if (eamInspectionOrder.getInspectionStatus().equals(InspectionStatus.WAIT_CONFIRM.name())) {
+//                updateEamInspectionOrderDetail(eamInspectionOrder);
+//            }
 
             return eamInspectionOrder;
         } catch (Exception e) {
@@ -750,13 +762,14 @@
             values.put("organization", request.getConfirmComment());
             values.put("comment", request.getConfirmComment());
             values.put("confirmation", request.getConfirmDealType());
-            request.setComment(request.getConfirmComment());
+            request.setComment("缁翠慨宸ョ‘璁ょ粨鏉�");
             if ("2".equals(request.getConfirmDealType())) {
                 // 缁翠慨宸ラ┏鍥�
                 List<String> usernames = new ArrayList<>();
                 usernames.add(order.getOperator());
                 order.setInspectionStatus(InspectionStatus.UNDER_INSPECTION.name());
                 values.put("NextAssignee", usernames);
+                request.setComment("缁翠慨宸ラ┏鍥炵粨鏉�");
             }
         }
         request.setValues(values);

--
Gitblit v1.9.3