From 2b1c858126f9c059bd6e308923eabfc71b1b4e7a Mon Sep 17 00:00:00 2001
From: pjb <pjb123456>
Date: 星期一, 11 八月 2025 17:03:53 +0800
Subject: [PATCH] *

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

diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 4a39889..0ca5ca9 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -16,6 +16,8 @@
 import com.zy.common.model.StartupDto;
 import com.zy.common.properties.SlaveProperties;
 import com.zy.common.web.param.SearchLocParam;
+import com.zy.system.entity.Config;
+import com.zy.system.service.ConfigService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -62,6 +64,9 @@
 
     @Resource
     private LocMastMapper locMastMapper;
+
+    @Resource
+    private ConfigService configService;
 
     /**
      * 鐢熸垚宸ヤ綔鍙�
@@ -169,6 +174,17 @@
 
         // 鍏ョ┖妗跺簱
         if (staDescId == 1 && locArea == 2) {
+            Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "emptyBucketInCacheCount").eq("status", 1));
+            if (config != null && !Cools.isEmpty(config.getValue())) { // 闄愬埗鍏ョ┖妗跺簱杈撻�佺嚎缂撳瓨浠诲姟鏁帮紝閬垮厤鍫靛
+                int value = Integer.parseInt(config.getValue());
+                List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<BasDevp>().in("dev_no", 1044, 1045, 1046, 1047, 1048, 1049, 1050).ne("wrk_no", 0));
+                long count = basDevps.stream().map(BasDevp::getWrkNo).distinct().count();
+                log.info("鍏ョ┖妗跺簱杈撻�佺嚎缂撳瓨浠诲姟鏁�:{}",count);
+                if(count >= value) {
+                    log.error("-----鍏ョ┖妗跺簱杈撻�佺嚎缂撳瓨浠诲姟鏁帮細{}锛岃秴閰嶇疆缂撳瓨鏁帮細{}----",count,value);
+                    throw new CoolException("鍏ョ┖妗跺簱杈撻�佺嚎缂撳瓨浠诲姟鏁帮細"+count+"锛岃秴閰嶇疆缂撳瓨鏁帮細" + value);
+                }
+            }
             List<WrkMast> wrkMastList = wrkMastMapper.selectLastInEmptyLoc(); // 鍓嶉潰鍏ョ┖妗跺簱鐨勪换鍔�(鏈墽琛屽爢鍨涙満鍏ュ簱)
 
             if (wrkMastList.size() == 0) {
@@ -250,6 +266,8 @@
                                 throw new CoolException("涓庡墠闈㈡《绫诲瀷涓�鏍凤紝鍓嶉潰璇ユ《绫诲瀷浠诲姟鏁版槸濂囨暟锛屾槸10锛�12鎺�,浣嗘槸瀵瑰簲搴撲綅涓嶄负绌�");
                             }
                         } else {
+                            // 鑷姩缁欏墠闈换鍔¤ˉ灏炬《淇″彿
+                            wrkMastService.updateCtnType(wrkMast);
                             log.error("-----涓庡墠闈㈡《绫诲瀷涓�鏍凤紝鍓嶉潰璇ユ《绫诲瀷浠诲姟鏁版槸濂囨暟锛屼絾鏄笉鏄�10锛�12鎺�----");
                             throw new CoolException("涓庡墠闈㈡《绫诲瀷涓�鏍凤紝鍓嶉潰璇ユ《绫诲瀷浠诲姟鏁版槸濂囨暟锛屼絾鏄笉鏄�10锛�12鎺�");
                         }

--
Gitblit v1.9.1