From 9c5dc8b744446ec2a1ec170b2834b8bb0241982d Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期三, 27 八月 2025 08:57:32 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/service/CommonService.java |   76 +++++++++++++++++++++++++++----------
 1 files changed, 55 insertions(+), 21 deletions(-)

diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index df07cec..ddac7df 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -256,6 +256,7 @@
         if (crnNo == 2 || crnNo == 3) {
             if (crnSearchList >= 2) {
                 if (basCrnpService.checkSiteError(1, true)) {
+                    boolean flag = true;
                     //灏濊瘯鎵�1鍙峰集杞ㄥ爢鍨涙満搴撲綅
                     crnNo = 1;
                     List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>()
@@ -264,7 +265,19 @@
                     );
                     if(wrkMasts.size() > crnSearchDetectTaskCount){
                         log.error(crnNo + "鍙峰爢鍨涙満宸茶揪鍒板叆搴撴帶鍒朵笂闄愶紒锛侊紒 浠诲姟鏁伴噺锛� {}锛� 鎺у埗鏁伴噺锛歿}", wrkMasts.size(), crnSearchDetectTaskCount);
-                    }else {
+                        flag = false;
+                    }
+
+                    List<WrkMast> wrkMastsList = wrkMastService.selectList(new EntityWrapper<WrkMast>()
+                            .eq("crn_no", crnNo)
+                            .in("io_type", 1, 10, 53, 57, 101, 103, 107, 110)
+                    );
+                    if (wrkMastsList.size() > applyInTaskTotalCount) {
+                        log.error(crnNo + "鍙峰爢鍨涙満宸茶揪鍒扮敵璇峰叆搴撴椂鎬讳换鍔℃暟閲忎笂闄�(鍏ュ簱銆佸嚭搴�)锛侊紒锛� 浠诲姟鏁伴噺锛� {}锛� 鎺у埗鏁伴噺锛歿}", wrkMastsList.size(), applyInTaskTotalCount);
+                        flag = false;
+                    }
+
+                    if (flag) {
                         List<Integer> nearRowList = new ArrayList<Integer>() {{
                             add(4);
                             add(6);
@@ -297,26 +310,47 @@
                 //灏濊瘯鎵�1鍙峰集杞ㄥ爢鍨涙満搴撲綅
                 crnNo = 1;
                 if (basCrnpService.checkSiteError(crnNo, true)) {
-                    List<Integer> nearRowList = new ArrayList<Integer>() {{
-                        add(4);
-                        add(6);
-                        add(3);
-                        add(1);
-                    }};
-                    for (Integer near : nearRowList) {
-                        List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
-                                .eq("row1", near)
-                                .eq("loc_sts", "O")
-                                .eq("whs_type", rowLastnoType.getType().longValue())
-                                .eq("loc_type1", locTypeDto.getLocType1())
-                                .eq("loc_type2", locTypeDto.getLocType2())
-                        );
-                        int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type", 100));
-                        if (locMasts.size() - crnCountO <= 2) {
-                            log.error(crnNo + "鍙峰爢鍨涙満娌℃湁绌哄簱浣嶏紒锛侊紒 灏哄瑙勬牸锛� {}锛� 杞娆℃暟锛歿}", JSON.toJSONString(locTypeDto), times);
-                        } else {
-                            nearRow = near;
-                            break;
+                    boolean flag = true;
+                    List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>()
+                            .eq("crn_no", crnNo)
+                            .in("io_type", 1, 10, 53, 57)
+                    );
+                    if(wrkMasts.size() > crnSearchDetectTaskCount){
+                        log.error(crnNo + "鍙峰爢鍨涙満宸茶揪鍒板叆搴撴帶鍒朵笂闄愶紒锛侊紒 浠诲姟鏁伴噺锛� {}锛� 鎺у埗鏁伴噺锛歿}", wrkMasts.size(), crnSearchDetectTaskCount);
+                        flag = false;
+                    }
+
+                    List<WrkMast> wrkMastsList = wrkMastService.selectList(new EntityWrapper<WrkMast>()
+                            .eq("crn_no", crnNo)
+                            .in("io_type", 1, 10, 53, 57, 101, 103, 107, 110)
+                    );
+                    if (wrkMastsList.size() > applyInTaskTotalCount) {
+                        log.error(crnNo + "鍙峰爢鍨涙満宸茶揪鍒扮敵璇峰叆搴撴椂鎬讳换鍔℃暟閲忎笂闄�(鍏ュ簱銆佸嚭搴�)锛侊紒锛� 浠诲姟鏁伴噺锛� {}锛� 鎺у埗鏁伴噺锛歿}", wrkMastsList.size(), applyInTaskTotalCount);
+                        flag = false;
+                    }
+
+                    if (flag) {
+                        List<Integer> nearRowList = new ArrayList<Integer>() {{
+                            add(4);
+                            add(6);
+                            add(3);
+                            add(1);
+                        }};
+                        for (Integer near : nearRowList) {
+                            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
+                                    .eq("row1", near)
+                                    .eq("loc_sts", "O")
+                                    .eq("whs_type", rowLastnoType.getType().longValue())
+                                    .eq("loc_type1", locTypeDto.getLocType1())
+                                    .eq("loc_type2", locTypeDto.getLocType2())
+                            );
+                            int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type", 100));
+                            if (locMasts.size() - crnCountO <= 2) {
+                                log.error(crnNo + "鍙峰爢鍨涙満娌℃湁绌哄簱浣嶏紒锛侊紒 灏哄瑙勬牸锛� {}锛� 杞娆℃暟锛歿}", JSON.toJSONString(locTypeDto), times);
+                            } else {
+                                nearRow = near;
+                                break;
+                            }
                         }
                     }
                 }

--
Gitblit v1.9.1