From 733e63cb362f17aea4a1020654fa348a0d0c1f06 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期一, 24 二月 2025 00:08:59 +0800
Subject: [PATCH] 优化入库逻辑,优化直接出库逻辑,优化移库任务逻辑

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/PartialTaskService_StackCrane.cs |   51 ++++++++++++++++++++++-----------------------------
 1 files changed, 22 insertions(+), 29 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/PartialTaskService_StackCrane.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/PartialTaskService_StackCrane.cs"
index 97ba682..c1cdd22 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/PartialTaskService_StackCrane.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/PartialTaskService_StackCrane.cs"
@@ -52,44 +52,37 @@
                 {
                     //todo 
                     int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>();
+                    task.CurrentAddress = task.NextAddress;
+                    task.NextAddress = string.Empty;
                     task.TaskState = nextStatus;
                     task.ModifyDate = DateTime.Now;
                     task.Modifier = "System";
+                    WMSTaskDTO WMStask = _mapper.Map<WMSTaskDTO>(task);
+                    if (task.TargetIsPickPlace)
+                    {
+                        task.TaskState = (int)TaskInStatusEnum.InFinish;
+                        AddTask_Hty(task, TaskOperateTypeEnum.AutoComplete);
+                    }
+                    else
+                        BaseDal.UpdateData(task);
+                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄叆搴撳畬鎴�");
 
                     #region 鍚慦MS鍙嶉鍫嗗灈鏈轰换鍔″畬鎴�
-                    WMSTaskDTO WMStask = _mapper.Map<WMSTaskDTO>(task);
-                    var ResultData = HttpHelper.PostAsync(WMSInterfaceAddress.UpdateTaskStatus, WMStask.ToJson(), headers: new Dictionary<string, string>());
-                    if (ResultData.Result == null) throw new Exception($"浠诲姟鐘舵�佸悓姝ュ埌WMS澶辫触!浠诲姟鍙�:{task.TaskNum}");
-                    content = JsonConvert.DeserializeObject<WebResponseContent>(ResultData.Result);
-                    if (content.Status)
-                    {
-                        //isDel = content.Status;
-                        BaseDal.UpdateData(task);
-                        _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄叆搴撳畬鎴�");
-                    }
-                    #endregion
-                    #region MyRegion
-
-
-
-                    //WMSTaskDTO taskDTO = new WMSTaskDTO()
-                    //{
-                    //    TaskNum = Convert.ToInt32(DateTime.Now.ToString("HHmmss")),
-                    //    Grade = 1,
-                    //    PalletCode = task.PalletCode + "S",
-                    //    RoadWay = "SC01",
-                    //    SourceAddress = task.TargetAddress,
-                    //    TargetAddress = "CLOutAreaA",
-                    //    TaskState = (int)TaskOutStatusEnum.OutNew,
-                    //    Id = 0,
-                    //    TaskType = (int)TaskOutboundTypeEnum.Outbound
-                    //};
-
-                    //content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); 
+                    HttpHelper.PostAsync(WMSInterfaceAddress.UpdateTaskStatus, WMStask.ToJson(), headers: new Dictionary<string, string>());
                     #endregion
                 }
                 else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
                 {
+                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskRelocationStatusEnum>();
+                    task.TaskState = nextStatus;
+                    task.ModifyDate = DateTime.Now;
+                    task.Modifier = "System";
+
+                    task.CurrentAddress = task.NextAddress;
+                    task.NextAddress = string.Empty;
+                    BaseDal.UpdateData(task);
+
+                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈虹Щ搴撳畬鎴�");
                     //todo 璋冪敤WMS绉诲簱瀹屾垚
                 }
                 else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OtherGroup && task.TaskState == (int)TaskCarStatusEnum.SC_CarExecuting)

--
Gitblit v1.9.3