From d8f650de070335be494c33d0705e8105b7a215d6 Mon Sep 17 00:00:00 2001
From: 刘磊 <1161824510@qq.com>
Date: 星期四, 26 十二月 2024 14:31:26 +0800
Subject: [PATCH] 同步

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
index 63f98fd..de1a341 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -62,8 +62,9 @@
         private readonly IDt_StationManagerRepository _stationManagerRepository;
         private readonly ICacheService _cacheService;
         private readonly INoticeService _noticeService;
+        private readonly IDt_needBarcodeRepository _needBarcodeRepository;
 
-        public CommonConveyorLine_GWJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerRepository stationManagerRepository, ICacheService cacheService, INoticeService noticeService)
+        public CommonConveyorLine_GWJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerRepository stationManagerRepository, ICacheService cacheService, INoticeService noticeService, IDt_needBarcodeRepository needBarcodeRepository)
         {
             _taskService = taskService;
             _taskExecuteDetailService = taskExecuteDetailService;
@@ -75,6 +76,7 @@
             _stationManagerRepository = stationManagerRepository;
             _cacheService = cacheService;
             _noticeService = noticeService;
+            _needBarcodeRepository = needBarcodeRepository;
         }
 
         public Task Execute(IJobExecutionContext context)
@@ -366,17 +368,30 @@
                 WebResponseContent content = new WebResponseContent();
                 ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                 taskCommand.InteractiveSignal = command.InteractiveSignal;
+                Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
                 if (task.PalletCode != command.ConveyorLineBarcode)
                 {
-                    var NGAddress = _platFormRepository.QueryFirst(x => x.PlatCode == task.TargetAddress).Capacity;
-                    taskCommand.ConveyorLineTargetAddress = (short)NGAddress;
+                    //var NGAddress = _platFormRepository.QueryFirst(x => x.PlatCode == task.TargetAddress).Capacity;
+                    //taskCommand.ConveyorLineTargetAddress = (short)NGAddress;
+                    taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode);
                 }
                 else
                 {
-                    Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
+                    //Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
                     taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationLocation);
                 }
 
+                if (stationManager.stationPLC == "1018" && stationManager.stationArea == "Cache")  //鏇存柊鍦ㄩ�旀暟鎹�
+                {
+                    dt_needBarcode needBarcode = _needBarcodeRepository.QueryFirst(x => x.productLine == stationManager.productLine && x.toArea == stationManager.stationChildCode);
+
+                    if (needBarcode != null)
+                    {
+                        needBarcode.inLineNum--;
+                        _needBarcodeRepository.UpdateData(needBarcode);
+                    }
+                }
+
                 conveyorLine.SendCommand(taskCommand, childDeviceCode);
                 conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                 //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);

--
Gitblit v1.9.3