From 6a71dd91fc77040eab3ffc37a52f039e293f2a73 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期日, 12 四月 2026 18:41:56 +0800
Subject: [PATCH] #条码站申请入库增加入库模式判断

---
 src/main/java/com/zy/core/plugin/store/StoreInTaskGenerationService.java |   52 ++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 48 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/zy/core/plugin/store/StoreInTaskGenerationService.java b/src/main/java/com/zy/core/plugin/store/StoreInTaskGenerationService.java
index fc921fa..2bc21da 100644
--- a/src/main/java/com/zy/core/plugin/store/StoreInTaskGenerationService.java
+++ b/src/main/java/com/zy/core/plugin/store/StoreInTaskGenerationService.java
@@ -32,6 +32,7 @@
 public class StoreInTaskGenerationService {
     private static final int APPLY_IN_TASK_TIMEOUT_SECONDS = 5;
 
+    @Autowired
     private WrkMastService wrkMastService;
     @Autowired
     private StationOperateProcessUtils stationOperateProcessUtils;
@@ -101,9 +102,51 @@
             return;
         }
 
-        long count = wrkMastService.count(new QueryWrapper<WrkMast>().eq("barcode", context.getStationProtocol().getBarcode()));
+        StationProtocol stationProtocol = context.getStationProtocol();
+        if (stationProtocol == null) {
+            return;
+        }
+
+        if (!stationProtocol.isAutoing()) {
+            return;
+        }
+
+        if (!stationProtocol.isLoading()) {
+            return;
+        }
+
+        if (!stationProtocol.isInEnable()) {
+            return;
+        }
+
+        if (stationProtocol.getTaskNo() == 0) {
+            return;
+        }
+
+        if (Cools.isEmpty(stationProtocol.getBarcode())) {
+            return;
+        }
+
+        if (stationProtocol.getError() > 0) {
+            return;
+        }
+
+        if (stationProtocol.isInBarcodeError()) {
+            return;
+        }
+
+        if (!stationProtocol.getIoMode().equals(1)) {
+            policy.setSystemWarning(context, "褰撳墠绔欑偣涓嶅浜庡叆搴撴ā寮�");
+            return;
+        }
+
+        String barcode = context.getStationProtocol().getBarcode();
+        long count = wrkMastService.count(new QueryWrapper<WrkMast>().eq("barcode", barcode));
         if (count > 0) {
-            policy.setSystemWarning(context, "绯荤粺浠诲姟宸插瓨鍦�");
+            Object tipsLimit = redisUtil.get(RedisKeyType.GENERATE_IN_TASK_SUCCESS_REPEAT_WARNING_TIPS_LIMIT.key + barcode);
+            if (tipsLimit == null) {
+                policy.setSystemWarning(context, "绯荤粺浠诲姟宸插瓨鍦�");
+            }
             return;
         }
 
@@ -176,6 +219,7 @@
             WrkMast wrkMast = commonService.createInTask(taskParam);
             policy.afterTaskCreated(context, wrkMast);
             policy.clearSystemWarning(context);
+            redisUtil.set(RedisKeyType.GENERATE_IN_TASK_SUCCESS_REPEAT_WARNING_TIPS_LIMIT.key + wrkMast.getBarcode(), "lock", 30);
         } catch (Exception e) {
             News.error("澶勭悊WMS鍏ュ簱鍝嶅簲寮傚父锛宐arcode={}锛宻tationId={}", request.getBarcode(),
                     request.getSourceStaNo(), e);
@@ -190,8 +234,8 @@
         result.setResponse(response);
         result.setMessage(message);
 
-        News.error("WMS鍏ュ簱璇锋眰澶辫触锛宐arcode={}锛宻tationId={}锛宺esponse={}",
-                request.getBarcode(), request.getSourceStaNo(), policy.buildFailureMessage(result));
+        News.error("WMS鍏ュ簱璇锋眰澶辫触锛宐arcode={}锛宻tationId={}锛宺esponse={}锛學CS鍝嶅簲={}",
+                request.getBarcode(), request.getSourceStaNo(), result.getResponse(), result.getMessage());
         redisUtil.set(policy.getGenerateLockKey(context), "lock", policy.getRetryLockSeconds(context));
         policy.onApplyFailed(context, result);
     }

--
Gitblit v1.9.1