From a6df2a29e7424ce327776fd3880ae514d8ca8c9f Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 07 七月 2025 06:32:24 +0800
Subject: [PATCH] 更新

---
 项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs |   63 +++++++++++++++++++------------
 1 files changed, 39 insertions(+), 24 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs"
index 5a885e6..d2bb2c1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -23,6 +23,7 @@
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
+using System.Diagnostics;
 using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using System.Reflection;
@@ -217,14 +218,14 @@
                         if (taskTypeGroup == TaskTypeGroup.InboundGroup)
                         {
                             stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress || x.StationDeviceCode == item.SourceAddress);
-                            if (stationManger==null && task.TaskType==TaskTypeEnum.InProduct.ObjToInt())
-                            {
-                                stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode==task.SourceAddress);
-                                //杞崲鎴愬搧浠撹捣鐐圭珯鍙�
-                                item.SourceAddress = stationManger.StationCode;
-                                task.CurrentAddress = stationManger.StationCode;
-                                task.SourceAddress = stationManger.StationCode;
-                            }
+                            //if (stationManger==null && task.TaskType==TaskTypeEnum.InProduct.ObjToInt())
+                            //{
+                            //    stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode==task.SourceAddress);
+                            //    //杞崲鎴愬搧浠撹捣鐐圭珯鍙�
+                            //    item.SourceAddress = stationManger.StationCode;
+                            //    task.CurrentAddress = stationManger.StationCode;
+                            //    task.SourceAddress = stationManger.StationCode;
+                            //}
                         }
                         else
                         {
@@ -244,10 +245,11 @@
 
                         if (routers.Count == 1)
                         {
-                            if (taskTypeGroup == TaskTypeGroup.InboundGroup && item.TargetAddress == stationManger.StackerCraneCode)
+                            if (taskTypeGroup == TaskTypeGroup.InboundGroup)
                             {
+                                task.CurrentAddress = router.StartPosi;
                                 task.NextAddress = router.NextPosi;
-                                task.DeviceCode = stationManger.StationDeviceCode;
+                                task.DeviceCode = router.ChildPosiDeviceCode;
                             }
                             else if (item.TaskType == TaskTypeEnum.MesMatReturn.ObjToInt() && !router.IsEnd)
                             {
@@ -439,21 +441,34 @@
             WebResponseContent content = new WebResponseContent();
             try
             {
-                string address = AppSettings.Get("WMSApiAddress");
-                if (string.IsNullOrEmpty(address))
+                //string address = AppSettings.Get("WMSApiAddress");
+                //if (string.IsNullOrEmpty(address))
+                //{
+                //    return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃");
+                //}
+                //string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTaskSimple?stationCode={sourceAddress}&palletCode={palletCode}");
+                //WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
+                //if (responseContent != null && responseContent.Status && responseContent.Data != null)
+                //{
+                //    WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString());
+                //    if (taskDTO != null)
+                //    {
+                WMSTaskDTO? taskDTO = new WMSTaskDTO()
                 {
-                    return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃");
-                }
-                string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTaskSimple?stationCode={sourceAddress}&palletCode={palletCode}");
-                WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
-                if (responseContent != null && responseContent.Status && responseContent.Data != null)
-                {
-                    WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString());
-                    if (taskDTO != null)
-                    {
-                        content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
-                    }
-                }
+                    Id = 1,
+                    TaskNum = DateTime.Now.ToString("mmss").ObjToInt(),
+                    PalletCode="",
+                    RoadWay="",
+                    TaskType=TaskTypeEnum.InProduct.ObjToInt(),
+                    TaskStatus=TaskStatusEnum.New.ObjToInt(),
+                    SourceAddress= sourceAddress,
+                    TargetAddress="",
+                    WarehouseId=1,
+                    Grade=0,
+                };
+                content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
+                //    }
+                //}
 
             }
             catch (Exception ex)

--
Gitblit v1.9.3