From 1d044540ee1b7041c7e89bdfe6d1339c99e80a4e Mon Sep 17 00:00:00 2001
From: 刘磊 <1161824510@qq.com>
Date: 星期三, 08 一月 2025 14:41:16 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/HuaYiZhongHeng/BaiBuLiKu

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 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 2c879f9..64ffdc4 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
@@ -63,9 +63,10 @@
         private readonly IDt_StationManagerRepository _stationManagerRepository;
         private readonly ICacheService _cacheService;
         private readonly INoticeService _noticeService;
+        private readonly IDt_needBarcodeRepository _needBarcodeRepository;
         private readonly IDeviceInfoRepository _deviceInfoRepository;
 
-        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, IDeviceInfoRepository deviceInfoRepository)
+        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, IDeviceInfoRepository deviceInfoRepository)
         {
             _taskService = taskService;
             _taskExecuteDetailService = taskExecuteDetailService;
@@ -77,6 +78,7 @@
             _stationManagerRepository = stationManagerRepository;
             _cacheService = cacheService;
             _noticeService = noticeService;
+            _needBarcodeRepository = needBarcodeRepository;
             _deviceInfoRepository = deviceInfoRepository;
         }
 
@@ -138,7 +140,8 @@
                                     MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
                                     if (method != null)
                                     {
-                                        int count = string.IsNullOrEmpty(platform.Location) ? 0 + 1 : platform.Location.Split(',').Count() + 1;
+                                        //var strings = platform.Location.Split(',').ToList();
+                                        int count = 1;
                                         method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
                                     }
                                 }
@@ -161,7 +164,7 @@
                             childDeviceCode,
                             commandAfter = command,
                         };
-                        _noticeService.StackerData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, data = obj });
+                        _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, data = obj });
 
                         #endregion 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
                     }
@@ -369,17 +372,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