From 279077bf41bc726b474ca5d76cd2b8393d41d867 Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期三, 05 十一月 2025 12:16:01 +0800
Subject: [PATCH] 1

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs |   37 ++++++++++++++++++-------------------
 1 files changed, 18 insertions(+), 19 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
index 426ae4d..040e69b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
@@ -1,6 +1,7 @@
 锘縰sing Microsoft.AspNetCore.Routing;
 using Quartz;
 using SqlSugar;
+using System.Threading.Tasks;
 using WIDESEAWCS_Common;
 using WIDESEAWCS_Common.Helper;
 using WIDESEAWCS_Common.TaskEnum;
@@ -30,6 +31,7 @@
         private readonly IRouterService _routerService;
         private readonly IRepository<Dt_Task> _taskRepository;
         private readonly IRepository<Dt_StationManger> _stationMangerRepository;
+
 
         public CommonConveyorLineJob(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRepository<Dt_StationManger> stationMangerRepository, IRepository<Dt_Task> taskRepository, IRouterRepository routerRepository, IRouterService routerService)
         {
@@ -94,25 +96,17 @@
                                 }
                             }
                             //鍑哄叆搴撶珯鍙�
-                            if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt())
+                            else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt())
                             {
                                 //鍏ュ簱鐢熸垚鍫嗗灈鏈哄叆搴撲换鍔�
                                 if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !ACK)
                                 {
-                                    if (conveyorLineInfoRead.TaskNo == 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//閲囪喘鍏ュ簱
+                                    if (conveyorLineInfoRead.TaskNo != 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//閲囪喘鍏ュ簱
                                     {
-                                        WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.Barcode, item.StationCode);
-                                        if (content.Status)
+                                        WebResponseContent contentweb = _taskService.UpdateTaskIninfo(conveyorLineInfoRead.Barcode, conveyorLineInfoRead.TaskNo);
+                                        if (contentweb.Status)
                                         {
-                                            Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == conveyorLineInfoRead.Barcode && x.CurrentAddress == item.StationCode && x.DeviceCode == device.DeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt());
-                                            if (task != null)
-                                            {
-                                                _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: item.StackerCraneCode, sourceAddress: item.StackerCraneStationCode);
-                                                device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
-                                                device.SetValue(W_ConveyorLineDB.TaskNo, 1111, item.StationCode);
-                                                //_taskService.UpdateTask(task, TaskStatusEnum.RGV_NEW);
-                                            }
-
+                                            device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
                                         }
                                     }
 
@@ -174,15 +168,19 @@
 
                             }
                             //鍏ュ簱绔欏彴
-                            if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt())
+                            else if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt())
                             {
                                 if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !ACK)
                                 {
                                     if (conveyorLineInfoRead.TaskNo == 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//閲囪喘鍏ュ簱
                                     {
-                                        device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
-                                        device.SetValue(W_ConveyorLineDB.EndPos, 2020, item.StationCode);
-                                        device.SetValue(W_ConveyorLineDB.TaskNo, 1111, item.StationCode);
+                                        Dt_Task dt_Ta = _taskService.GetTaskIninfo(conveyorLineInfoRead.Barcode);
+                                        if(dt_Ta != null)
+                                        {
+                                            device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
+                                            device.SetValue(W_ConveyorLineDB.EndPos, dt_Ta.SourceAddress, item.StationCode);
+                                            device.SetValue(W_ConveyorLineDB.TaskNo, dt_Ta.TaskNum, item.StationCode);
+                                        }
                                     }
 
 
@@ -196,8 +194,9 @@
                         }
 
                     }
-                }
-                catch (Exception)
+        
+                
+                catch (Exception ex)
                 {
                 }
 

--
Gitblit v1.9.3