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/二期线体/ConveyorLineJob2.cs |   49 ++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 42 insertions(+), 7 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Tasks/\344\272\214\346\234\237\347\272\277\344\275\223/ConveyorLineJob2.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Tasks/\344\272\214\346\234\237\347\272\277\344\275\223/ConveyorLineJob2.cs"
index 2cd34b8..0497039 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Tasks/\344\272\214\346\234\237\347\272\277\344\275\223/ConveyorLineJob2.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Tasks/\344\272\214\346\234\237\347\272\277\344\275\223/ConveyorLineJob2.cs"
@@ -5,6 +5,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Reflection;
+using System.Reflection.Metadata;
 using System.Text;
 using System.Threading.Tasks;
 using WIDESEAWCS_Common;
@@ -60,24 +61,55 @@
                                 //涓婃姤WMS鏂欑鍒拌揪
                                 if (PickBarCode.IsNotEmptyOrNull())
                                 {
-                                    //WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, PickBarCode);
-                                    WebResponseContent content = WebResponseContent.Instance.OK();
+                                    WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, PickBarCode);
+                                    //WebResponseContent content = WebResponseContent.Instance.OK();
                                     if (content.Status)
                                     {
                                         //鍐欏叆鎷i�夌‘璁�
                                         conveyorLine.SetValue(ConveyorLineDBName.W_PickToHode, (short)300, station.StationCode);
+                                        WriteInfo(conveyorLine.DeviceCode, $"{station.PickStationCode}鎷i�夌敵璇蜂笂鎶ユ垚鍔焮PickBarCode}");
                                     }
                                     else
                                     {
-                                        WriteError(nameof(conveyorLine.DeviceCode), $"{station.PickStationCode}鎷i�夌敵璇蜂笂鎶MS閿欒锛屼俊鎭瘂content.Message}");
+                                        WriteError(conveyorLine.DeviceCode, $"{station.PickStationCode}鎷i�夌敵璇蜂笂鎶MS閿欒{PickBarCode}锛屼俊鎭瘂content.Message}");
                                     }
                                 }
                                 else
                                 {
-                                    WriteError(nameof(conveyorLine.DeviceCode), $"{station.PickStationCode}鎷i�夌敵璇蜂负{PickRequest}鏉$爜涓虹┖鍊�");
+                                    WriteError(conveyorLine.DeviceCode, $"{station.PickStationCode}鎷i�夌敵璇蜂负{PickRequest}鏉$爜涓虹┖鍊�");
                                 }
                             }
-                            
+                            //鎸夐挳鐢宠
+                            bool DownRequest = conveyorLine.GetValue<ConveyorLineDBName, bool>(ConveyorLineDBName.R_DownRequest, station.StationCode);
+                            if (DownRequest)
+                            {
+                                string PickBarCode = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.R_PickBarCode, station.StationCode).Trim();
+                                //涓婃姤WMS鏂欑鍒拌揪
+                                if (PickBarCode.IsNotEmptyOrNull())
+                                {
+                                    ContainerFlowDTO containerFlowDTO = new ContainerFlowDTO()
+                                    {
+                                        SlotCode = station.PickStationCode,
+                                        ContainerCode = PickBarCode,
+                                        Direction="100"
+                                    };
+                                    WebResponseContent responseContent = _taskService.ContainerFlow(containerFlowDTO, station.StationDeviceCode, station.PickStationCode);
+                                    if (responseContent.Status)
+                                    {
+                                        conveyorLine.SetValue(ConveyorLineDBName.W_PickToHode, (short)containerFlowDTO.Direction.ObjToInt(), station.StationCode);
+                                    }
+                                    else
+                                    {
+                                        WriteError(conveyorLine.DeviceCode, $"{station.PickStationCode}鎸夐挳鐢宠閿欒{PickBarCode}锛屼俊鎭瘂responseContent.Message}");
+                                    };
+                                }
+                                else
+                                {
+                                    WriteError(conveyorLine.DeviceCode, $"{station.PickStationCode}鎸夐挳鐢宠涓簕DownRequest}鏉$爜涓虹┖鍊�");
+                                }
+                                
+                            }
+
                         }
                         else
                         {
@@ -97,20 +129,23 @@
                                     {
                                         //鍐欏叆鍏ュ簱纭
                                         conveyorLine.SetValue(ConveyorLineDBName.W_InResponse, true, station.StationCode);
+                                        WriteInfo(conveyorLine.DeviceCode, $"绔欏彴{station.StationCode}鏂欑{InBarCode}鐢宠鍏ュ簱鎴愬姛");
                                     }
                                     else
                                     {
-                                        WriteError(nameof(conveyorLine.DeviceCode), $"绔欏彴{station.StationCode}鏂欑{InBarCode}鐢宠鍏ュ簱浠诲姟閿欒锛屼俊鎭瘂content.Message}");
+                                        WriteError(conveyorLine.DeviceCode, $"绔欏彴{station.StationCode}鏂欑{InBarCode}鐢宠鍏ュ簱浠诲姟閿欒锛屼俊鎭瘂content.Message}");
                                     }
                                 }
                                 else
                                 {
-                                    WriteError(nameof(conveyorLine.DeviceCode), $"绔欏彴{station.StationCode}鍏ュ簱鐢宠涓簕InRequest}鏉$爜涓虹┖鍊�");
+                                    WriteError(conveyorLine.DeviceCode, $"绔欏彴{station.StationCode}鍏ュ簱鐢宠涓簕InRequest}鏉$爜涓虹┖鍊�");
                                 }
                             }
                         }
                         
                     }
+
+                    conveyorLine.SetValue(ConveyorLineDBName.WriteHeart, true, conveyorLine.DeviceCode);
                 }
             }
             catch (Exception ex)

--
Gitblit v1.9.3