From 3abf837adf14f12819f43b20795584b684a97957 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 13 四月 2026 13:15:00 +0800
Subject: [PATCH] #启动入库优化

---
 src/main/java/com/zy/core/plugin/XiaosongProcess.java |   49 +------------------------------------------------
 1 files changed, 1 insertions(+), 48 deletions(-)

diff --git a/src/main/java/com/zy/core/plugin/XiaosongProcess.java b/src/main/java/com/zy/core/plugin/XiaosongProcess.java
index e01aeb4..e3f6fa6 100644
--- a/src/main/java/com/zy/core/plugin/XiaosongProcess.java
+++ b/src/main/java/com/zy/core/plugin/XiaosongProcess.java
@@ -1,9 +1,7 @@
 package com.zy.core.plugin;
 
-import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.core.common.Cools;
-import com.zy.asrs.utils.Utils;
 import com.zy.asrs.entity.BasDevp;
 import com.zy.asrs.service.BasDevpService;
 import com.zy.common.service.CommonService;
@@ -57,7 +55,7 @@
     @Override
     public void run() {
         //妫�娴嬪叆搴撶珯鏄惁鏈変换鍔$敓鎴愶紝骞跺惎鍔ㄥ叆搴�
-        checkInStationHasTask();
+        stationOperateProcessUtils.submitStationEnableInTasks(DISPATCH_INTERVAL_MS);
         //璇锋眰鐢熸垚鍏ュ簱浠诲姟
         generateStoreWrkFile();
 
@@ -115,51 +113,6 @@
 
                 storeInTaskGenerationService.submitGenerateStoreTask(this, basDevp, stationObjModel, 0L,
                         () -> storeInTaskGenerationService.generate(this, basDevp, stationObjModel));
-            }
-        }
-    }
-
-    //妫�娴嬪叆搴撶珯鏄惁鏈変换鍔$敓鎴愶紝骞跺惎鍔ㄥ叆搴�
-    private synchronized void checkInStationHasTask() {
-        List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>());
-        for (BasDevp basDevp : basDevps) {
-            StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo());
-            if(stationThread == null){
-                continue;
-            }
-
-            Map<Integer, StationProtocol> stationMap = stationThread.getStatusMap();
-
-            List<StationObjModel> list = basDevp.getInStationList$();
-            for (StationObjModel entity : list) {
-                Integer stationId = entity.getStationId();
-                if(!stationMap.containsKey(stationId)){
-                    continue;
-                }
-
-                StationProtocol stationProtocol = stationMap.get(stationId);
-                if (stationProtocol == null) {
-                    continue;
-                }
-
-                Object lock = redisUtil.get(RedisKeyType.GENERATE_ENABLE_IN_STATION_DATA_LIMIT.key + stationId);
-                if(lock != null){
-                    continue;
-                }
-
-                if (stationProtocol.isAutoing()
-                        && stationProtocol.isLoading()
-                        && stationProtocol.getTaskNo() == 0
-                        && stationProtocol.isEnableIn()
-                ) {
-                    StationCommand command = stationThread.getCommand(StationCommandType.MOVE, commonService.getWorkNo(WrkIoType.ENABLE_IN.id), stationId, entity.getBarcodeStation().getStationId(), 0);
-                    stationCommandDispatcher.dispatch(basDevp.getDevpNo(), command, "xiaosong-process", "enable-in");
-                    if (entity.getBarcodeStation() != null && entity.getBarcodeStation().getStationId() != null) {
-                        Utils.precomputeInTaskEnableRow(entity.getBarcodeStation().getStationId());
-                    }
-                    redisUtil.set(RedisKeyType.GENERATE_ENABLE_IN_STATION_DATA_LIMIT.key + stationId, "lock", 15);
-                    News.info("{}绔欑偣鍚姩鍏ュ簱鎴愬姛锛屾暟鎹寘:{}", stationId, JSON.toJSONString(command));
-                }
             }
         }
     }

--
Gitblit v1.9.1