From 679893ee68e2f7d422431bb22b665e9217f23410 Mon Sep 17 00:00:00 2001
From: Admin <Admin@ADMIN>
Date: 星期四, 16 四月 2026 16:41:11 +0800
Subject: [PATCH] 深库位与浅库位出库时,进行浅货位移库不可直接出库

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs |  116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 116 insertions(+), 0 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs"
index 43a9f6d..7342ec0 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs"
@@ -3,6 +3,7 @@
 using MoYu.Localization;
 using Newtonsoft.Json;
 using System.Diagnostics.CodeAnalysis;
+using System.Threading.Tasks;
 using WIDESEAWCS_Common;
 using WIDESEAWCS_Common.TaskEnum;
 using WIDESEAWCS_Core;
@@ -28,6 +29,83 @@
                 var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
                 var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue;
                 var requestTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.TransferCheck)?.ConfigValue;
+                if (wmsBase == null || requestTask == null)
+                {
+                    throw new InvalidOperationException("WMS IP 鏈厤缃�");
+                }
+                var wmsIpAddrss = wmsBase + requestTask;
+
+                var result = HttpHelper.Post(wmsIpAddrss, new { taskNum = taskNum }.ToJsonString());
+                content = JsonConvert.DeserializeObject<WebResponseContent>(result);
+
+                if (!content.Status)
+                {
+                    // wms澶辫触
+                    throw new Exception();
+                }
+
+
+                //todo 浼樺寲 濡傛湭鏌ヨ鍒颁换鍔″垯澶勭悊
+                //if (content.Data != null)
+                //{
+                var task = JsonConvert.DeserializeObject<Dt_Task>(content.Data.ToString());
+
+                Dt_Task? Relocationtask = null;
+
+                //濡傛煡璇㈢Щ搴撲换鍔℃椂瀛樺湪鍐呬晶鍑哄簱浠诲姟鍒欑洿鎺ユ墽琛屽唴渚у嚭搴撲换鍔�
+                var currentExistOutTask = BaseDal.QueryFirst(x => x.TaskNum == task.TaskNum && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup);
+                if (currentExistOutTask != null )
+                {
+                    return currentExistOutTask;
+                }
+
+                if (task.TaskNum != taskNum)
+                {
+
+                    Dt_Task dt_Task=BaseDal.QueryData(x => x.PalletCode == task.PalletCode && x.TaskState== (int)TaskOutStatusEnum.OutNew).FirstOrDefault();
+                    if (dt_Task!=null)
+                    {
+                        dt_Task.SourceAddress = task.TargetAddress;
+                        dt_Task.CurrentAddress= task.TargetAddress;
+
+                        BaseDal.UpdateData(dt_Task);
+                    }
+
+                    BaseDal.AddData(task);
+                    Relocationtask = BaseDal.QueryFirst(x => x.TaskNum == task.TaskNum);
+                }
+                //}
+
+                if (Relocationtask != null)
+                {
+                    return task;
+                }
+                else
+                {
+                    return null;
+                }
+
+            }
+            catch (Exception ex)
+            {
+                throw new Exception($"璇锋眰寮傚父锛歿ex.Message}");
+            }
+        }
+
+        /// <summary>
+        /// 鏍规嵁鎵樼洏鍙枫�佽捣濮嬪湴鍧�鍚慦MS璇锋眰浠诲姟锛堝叆搴撶増鏈�)
+        /// </summary>
+        /// <param name="palletCode">鎵樼洏鍙�</param>
+        /// <param name="sourceAddress">璧峰鍦板潃</param>
+        /// <returns></returns>
+        public Dt_Task? InBeforeCheck(int taskNum)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
+                var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue;
+                var requestTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.InTransferCheck)?.ConfigValue;
                 if (wmsBase == null || requestTask == null)
                 {
                     throw new InvalidOperationException("WMS IP 鏈厤缃�");
@@ -153,6 +231,34 @@
             }
         }
 
+        /// <summary>
+        /// 杞﹁疆娴佸悜鍒嗛厤鏌ヨ鍘嗗彶璇锋眰
+        /// </summary>
+        /// <param name="czCode"></param>
+        /// <param name="stationManager"></param>
+        /// <returns></returns>
+        public string RequestWheletHty(string czCode)
+        {
+            WebResponseContent content = new WebResponseContent();
+            Dt_Task_Hty dt_Task_Hty = _taskHtyRepository.QueryFirst(x => x.task_CZInfo == czCode && x.CreateDate >= DateTime.Now.AddMinutes(-30));
+            if (dt_Task_Hty == null) return null;
+
+            if (dt_Task_Hty.Towhereabouts == "2032" || dt_Task_Hty.Towhereabouts == "2042")
+            {
+                return dt_Task_Hty.Towhereabouts;
+
+            }else if(dt_Task_Hty.TargetAddress == "2032" || dt_Task_Hty.TargetAddress == "2042")
+            {
+                return dt_Task_Hty.TargetAddress;
+            }
+            else
+            {
+                return null;
+            }
+
+                
+        }
+
         // 妫�鏌ュ綋鍓嶆墭鐩樻槸鍚﹀瓨鍦ㄤ换鍔�
         private async Task<bool> HasTask(string palletCode)
         {
@@ -209,11 +315,21 @@
                 task.wheels_mttype = taskDTO.wheels_mttype;
                 task.WheelsNewOrOld = taskDTO.WheelsNewOrOld;
                 task.WheelsLX = taskDTO.WheelsLX;
+                if(taskDTO.axle_czh !=null && taskDTO.axle_czh != "")
+                {
+                    task.axle_czh = taskDTO.axle_czh;
+                }
 
                 if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                 {
                     var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationLocation == taskDTO.TargetAddress && x.Roadway == taskDTO.RoadWay);
+
                     task.TaskState = (int)TaskOutStatusEnum.OutNew;
+                    if (task.SourceAddress == "2009")
+                    {
+                        task.TaskState = (int)TaskOutStatusEnum.SC_OutFinish;
+                    }
+                    
                     task.CurrentAddress = taskDTO.RoadWay;
                     task.NextAddress = stationinfo.stationChildCode;
                     task.SourceAddress = taskDTO.SourceAddress;

--
Gitblit v1.9.3