From 6d3ea08855337c0cfcc60df2903d3431611c7097 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期六, 13 十二月 2025 17:36:56 +0800
Subject: [PATCH] 优化程序,输送线入库按钮对接

---
 项目代码/WCSServices/WIDESEAWCS_Tasks/一期线体/ConveyorLineJob1.cs |   32 +++++++++++++++++++++++++-------
 1 files changed, 25 insertions(+), 7 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Tasks/\344\270\200\346\234\237\347\272\277\344\275\223/ConveyorLineJob1.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Tasks/\344\270\200\346\234\237\347\272\277\344\275\223/ConveyorLineJob1.cs"
index e821c77..ba907c7 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Tasks/\344\270\200\346\234\237\347\272\277\344\275\223/ConveyorLineJob1.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Tasks/\344\270\200\346\234\237\347\272\277\344\275\223/ConveyorLineJob1.cs"
@@ -44,7 +44,8 @@
         private readonly IRouterRepository _routerRepository;
         private readonly IRouterService _routerService;
         private readonly IRouterExtension _routerExtension;
-
+        private static string BarCode1 = "";
+        private static string BarCode2 = "";
         public ConveyorLineJob1(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension)
         {
             _cacheService = cacheService;
@@ -90,14 +91,31 @@
                                 //涓婃姤WMS鏂欑鍒拌揪
                                 if (pickBarCode.IsNotEmptyOrNull())
                                 {
-                                    WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, pickBarCode);
-                                    if (content.Status)
+                                    if (device.DeviceCode == "CL1" && BarCode1!= pickBarCode)
                                     {
-                                        WriteInfo(device.DeviceCode, $"{station.PickStationCode}鎷i�夌敵璇蜂笂鎶ユ垚鍔焮pickBarCode}");
+                                        WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, pickBarCode);
+                                        if (content.Status)
+                                        {
+                                            WriteInfo(device.DeviceCode, $"{station.PickStationCode}鎷i�夌敵璇蜂笂鎶ユ垚鍔焮pickBarCode}");
+                                        }
+                                        else
+                                        {
+                                            WriteError(device.DeviceCode, $"{station.PickStationCode}鎷i�夌敵璇蜂笂鎶MS閿欒{pickBarCode}锛屼俊鎭瘂content.Message}");
+                                        }
+                                        BarCode1 = pickBarCode;
                                     }
-                                    else
+                                    if (device.DeviceCode == "CL2" && BarCode1 != pickBarCode)
                                     {
-                                        WriteError(device.DeviceCode, $"{station.PickStationCode}鎷i�夌敵璇蜂笂鎶MS閿欒{pickBarCode}锛屼俊鎭瘂content.Message}");
+                                        WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, pickBarCode);
+                                        if (content.Status)
+                                        {
+                                            WriteInfo(device.DeviceCode, $"{station.PickStationCode}鎷i�夌敵璇蜂笂鎶ユ垚鍔焮pickBarCode}");
+                                        }
+                                        else
+                                        {
+                                            WriteError(device.DeviceCode, $"{station.PickStationCode}鎷i�夌敵璇蜂笂鎶MS閿欒{pickBarCode}锛屼俊鎭瘂content.Message}");
+                                        }
+                                        BarCode2 = pickBarCode;
                                     }
                                 }
                                 else
@@ -115,7 +133,7 @@
                             if (InTake==256 && InBarCode.IsNotEmptyOrNull())
                             {
                                 //鐢宠鍏ュ簱浠诲姟
-                                Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == InBarCode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt() && x.TaskState != TaskStatusEnum.CL_Executing.ObjToInt());
+                                Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == InBarCode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt() && x.TaskState != TaskStatusEnum.CL_Executing.ObjToInt() && x.DeviceCode==device.DeviceCode);
                                 if (task != null) continue;
 
                                 WebResponseContent content = _taskService.RequestInTask(station.StationCode, InBarCode);

--
Gitblit v1.9.3