From 761260f2ac0aa211625c8904cc86fc2400a8adfc Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期三, 04 三月 2026 16:56:57 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs |   58 +++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 49 insertions(+), 9 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
index 0b14d18..c2cec70 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
@@ -3,6 +3,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Reflection.Metadata;
 using System.Text;
 using System.Text.Json;
 using System.Threading.Tasks;
@@ -13,6 +14,7 @@
 using WIDESEAWCS_Core.Enums;
 using WIDESEAWCS_Core.Helper;
 using WIDESEAWCS_DTO;
+using WIDESEAWCS_DTO.WMS;
 using WIDESEAWCS_Model.Models;
 
 namespace WIDESEAWCS_TaskInfoService
@@ -30,11 +32,14 @@
         /// <exception cref="NotImplementedException"></exception>
         public WebResponseContent UpdateTaskStatus(object TaskDTO, DeviceTypeEnum deviceTypeEnum)
         {
+
+            WebResponseContent content = new WebResponseContent();
+            GALAXISUpdateTaskStatus gALAXIS = new();
             try
             {
                 if (deviceTypeEnum == DeviceTypeEnum.GALAXIS)
                 {
-                    GALAXISUpdateTaskStatus? gALAXIS = TaskDTO.Serialize().DeserializeObject<GALAXISUpdateTaskStatus>();
+                     gALAXIS = TaskDTO.Serialize().DeserializeObject<GALAXISUpdateTaskStatus>();
                     if (gALAXIS == null) throw new Exception("鍙傛暟杞崲澶辫触锛�");
                     var task = BaseDal.QueryFirst(x => x.WMSTaskNum == gALAXIS.taskId);
                     if (task == null) throw new Exception($"鏈壘鍒颁换鍔�,浠诲姟缂栧彿銆恵gALAXIS.taskId}銆�");
@@ -60,13 +65,18 @@
                 {
 
                 }
-                return WebResponseContent.Instance.OK();
+                //return WebResponseContent.Instance.OK();
+               return content.OK();
             }
             catch (Exception ex)
             {
-                throw new Exception(ex.Message);
+                return content.Error(ex.Message);
             }
-        } 
+            finally
+            {
+                _trackloginfoService.AddTrackLog(gALAXIS, content, "涓嬪彂鍑箰澹獳GV浠诲姟", "", "");
+            }
+        }
         #endregion
 
         #region 浠诲姟鐘舵�佽浆鎹�
@@ -85,6 +95,7 @@
                         6 => TaskStatusEnum.TaskTypeError,
                         7 => TaskStatusEnum.ParameterError,
                         8 => TaskStatusEnum.RCSError,
+                        10 => TaskStatusEnum.Takeing,
                         13 => TaskStatusEnum.Cancel,
                         _ => throw new ArgumentOutOfRangeException(
                             nameof(status),
@@ -107,7 +118,7 @@
             {
                 throw new Exception(ex.Message);
             }
-        } 
+        }
         #endregion
 
         #region 浠诲姟璧风偣瀹屾垚
@@ -133,7 +144,7 @@
                 Db.Ado.RollbackTran();
                 throw new Exception(ex.Message);
             }
-        } 
+        }
         #endregion
 
         #region 浠诲姟瀹屾垚
@@ -147,10 +158,39 @@
         {
             try
             {
+                WMSInOutBoundCompleteFeedback boundCompleteFeedback = new WMSInOutBoundCompleteFeedback();
+                WMSReturn agvContent = null;
                 dt_Task.TaskState = TaskStatusEnum.Finish.ObjToInt();
+
+                Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(WMSInOutBoundCompleteFeedback));
+                if (apiInfo == null) dt_Task.ExceptionMessage = "鏈壘鍒板嚭鍏ュ簱瀹屾垚鍙嶉WMS鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�";
+                else
+                {
+                    boundCompleteFeedback.taskCode = dt_Task.WMSTaskNum;
+                    boundCompleteFeedback.containerCode = dt_Task.PalletCode;
+                    boundCompleteFeedback.fromStationCode = dt_Task.SourceAddress;
+                    boundCompleteFeedback.toLocationCode = dt_Task.TargetAddress;
+                    switch (deviceTypeEnum)
+                    {
+                        case DeviceTypeEnum.GALAXIS:
+                            boundCompleteFeedback.businessType = 1;
+                            break;
+                        case DeviceTypeEnum.YuanLiJuHe:
+                            boundCompleteFeedback.businessType = 2;
+                            break;
+                    }
+
+                    boundCompleteFeedback.completeType = 1;
+                    string response = HttpHelper.Post(apiInfo.ApiAddress, boundCompleteFeedback.Serialize());
+                    agvContent = response.DeserializeObject<WMSReturn>();
+                    if (agvContent.code != 0) dt_Task.ExceptionMessage = agvContent.msg;
+                }
                 Db.Ado.BeginTran();
                 UpdateLocationStatus(dt_Task.TargetAddress, deviceTypeEnum, LocationStatusEnum.InStock);
-                BaseDal.DeleteAndMoveIntoHty(dt_Task, OperateTypeEnum.鑷姩瀹屾垚);
+                if (agvContent != null && agvContent.code == 0)
+                    BaseDal.DeleteAndMoveIntoHty(dt_Task, OperateTypeEnum.鑷姩瀹屾垚);
+                else
+                    BaseDal.UpdateData(dt_Task);
                 Db.Ado.CommitTran();
                 return WebResponseContent.Instance.OK();
             }
@@ -159,7 +199,7 @@
                 Db.Ado.RollbackTran();
                 throw new Exception(ex.Message);
             }
-        } 
+        }
         #endregion
 
         #region 鏇存柊璐т綅鐘舵��
@@ -211,7 +251,7 @@
             {
                 throw new Exception(ex.Message);
             }
-        } 
+        }
         #endregion
     }
 }

--
Gitblit v1.9.3