From af9c3ed5d036ad68faf7e18f566679b3da92d244 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期六, 22 三月 2025 11:36:06 +0800
Subject: [PATCH] 合并

---
 CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs |   28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
index bf61d3b..a4a9afc 100644
--- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
+++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -19,6 +19,7 @@
 
 #endregion << 鐗� 鏈� 娉� 閲� >>
 
+using Autofac.Core;
 using AutoMapper;
 using HslCommunication;
 using Microsoft.CodeAnalysis;
@@ -40,11 +41,13 @@
 using WIDESEAWCS_ITaskInfoService;
 using WIDESEAWCS_Model.Models;
 using WIDESEAWCS_QuartzJob;
+using WIDESEAWCS_QuartzJob.DeviceBase;
 using WIDESEAWCS_QuartzJob.DTO;
 using WIDESEAWCS_QuartzJob.Repository;
 using WIDESEAWCS_QuartzJob.Service;
 using WIDESEAWCS_SignalR;
 using WIDESEAWCS_Tasks.ConveyorLineJob;
+using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
 using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
 using Platform = WIDESEAWCS_Model.Models.Platform;
 
@@ -117,7 +120,18 @@
                     List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode);
                     foreach (string childDeviceCode in childDeviceCodes)
                     {
-                        ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode);
+                        ConveyorLineTaskCommand_After command = null;
+                        if (childDeviceCode == "2236")
+                        {
+                            var stationPLC = _stationManagerRepository.QueryFirst(x => x.stationType == 1 && x.stationChildCode == childDeviceCode).stationPLC;
+                            IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationPLC);
+                            CommonConveyorLine_After conveyorLine1 = (CommonConveyorLine_After)device;
+                            command = conveyorLine1.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode);
+                        }
+                        else
+                        {
+                            command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode);
+                        }
 
                         if (command == null) continue;
                         if (command.ConveyorLineBarcode.Trim().Contains("\0")) command.ConveyorLineBarcode = "";
@@ -132,7 +146,7 @@
                             }
                         }
 
-                        if (childDeviceCode == "1670"||childDeviceCode=="1666"||childDeviceCode=="1548"||childDeviceCode=="1448")
+                        if (childDeviceCode == "1670" || childDeviceCode == "1666" || childDeviceCode == "1548" || childDeviceCode == "1448")
                         {
                             Platform platform = _platFormRepository.QueryFirst(x => x.PLCCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
                             if (platform != null)
@@ -298,10 +312,10 @@
 
                 //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                 _taskService.UpdateTaskStatusToNext(task);
-                if (task.TaskType == (int)TaskOutboundTypeEnum.OutTray)
-                {
-                    _taskService.UpdateTaskStatusToNext(task);
-                }
+                //if (task.TaskType == (int)TaskOutboundTypeEnum.OutTray)
+                //{
+                //    _taskService.UpdateTaskStatusToNext(task);
+                //}
             }
         }
 
@@ -390,7 +404,7 @@
                     taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationLocation);
                 }
 
-                if (stationManager.stationPLC == "1018" && stationManager.stationArea == "Cache")  //鏇存柊鍦ㄩ�旀暟鎹�
+                if ((stationManager.stationPLC == "1018" && stationManager.stationArea == "Cache") || task.TaskType == (int)TaskOutboundTypeEnum.OutTray)  //鏇存柊鍦ㄩ�旀暟鎹�
                 {
                     dt_needBarcode needBarcode = _needBarcodeRepository.QueryFirst(x => x.productLine == stationManager.productLine && x.toArea == stationManager.stationChildCode);
 

--
Gitblit v1.9.3