From 0fa137570bf7ac2bf58c8af2828cd595625fa400 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期日, 19 四月 2026 18:53:45 +0800
Subject: [PATCH] Merge branch 'dev' of http://115.159.85.185:8098/r/SuZhouGuanHong/ShanMeiXinNengYuan into dev

---
 Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_AGV.cs | 1347 +++++++++++++++++++++++++++++-----------------------------
 1 files changed, 672 insertions(+), 675 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_AGV.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_AGV.cs
index 74dfd61..c0cb8f1 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_AGV.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_AGV.cs
@@ -1,681 +1,678 @@
-using Mapster;
-using System.Text.Json;
-using WIDESEA_Common.Constants;
-using WIDESEA_Common.LocationEnum;
-using WIDESEA_Common.StockEnum;
-using WIDESEA_Common.TaskEnum;
-using WIDESEA_Common.WareHouseEnum;
-using WIDESEA_Core;
-using WIDESEA_Core.Enums;
-using WIDESEA_Core.Helper;
-using WIDESEA_DTO.Task;
-using WIDESEA_IStockService;
-using WIDESEA_Model.Models;
-
-namespace WIDESEA_TaskInfoService
-{
-    public partial class TaskService
-    {
-
-        public string AGV_OutTaskComplete = WIDESEA_Core.Helper.AppSettings.Configuration["AGV_OutTaskComplete"];
-        public string WCS_ReceiveTask = WIDESEA_Core.Helper.AppSettings.Configuration["WCS_ReceiveTask"];
-
-        /// <summary>
-        /// 鏋佸嵎搴撳嚭鍏ュ簱鐢宠
-        /// </summary>
-        public async Task<AGVResponse> ApplyInOutAsync(ApplyInOutDto applyInOutDto)
-        {
-            AGVResponse response = new AGVResponse();
-
-            try
-            {
-                var validationMessage = ValidateApplyInOutRequest(applyInOutDto);
-                if (validationMessage != null)
-                    return response.Error(validationMessage);
-
-                var existingTask = await BaseDal.QueryFirstAsync(x => x.PalletCode == applyInOutDto.TrayNumber || x.OrderNo == applyInOutDto.TaskId);
-                if (existingTask != null)
-                    return response.Error($"WMS宸叉湁褰撳墠浠诲姟锛屼笉鍙噸澶嶄笅鍙戯紝浠诲姟鍙凤細{applyInOutDto.TaskId}");
-
-                var task = BuildAgvTask(applyInOutDto);
-
-                if (applyInOutDto.InOut == 1)
-                {
-                    var inboundResult = await CreateAgvInboundTaskAsync(task, applyInOutDto);
-                    if (inboundResult != null)
-                        return inboundResult;
-                }
-                else
-                {
-                    var outboundResult = await CreateAgvOutboundTaskAsync(task, applyInOutDto);
-                    if (outboundResult != null)
-                        return outboundResult;
-                }
-
-                return response.OK(BuildAgvDataDto(task, applyInOutDto));
-            }
-            catch (Exception ex)
-            {
-                _unitOfWorkManage.RollbackTran();
-                return response.Error($"WMS浠诲姟鍒涘缓鎺ュ彛閿欒: {ex.Message}");
-            }
-        }
-
-        /// <summary>
-        /// 鎵嬪姩鍑哄簱瀹屾垚鍙嶉缁橝GV
-        /// </summary>
-        public async Task<WebResponseContent> OutTaskComplete(OutTaskCompleteDto outTaskCompleteDto)
-        {
-            WebResponseContent response = new WebResponseContent();
-
-            try
-            {
-                var validationMessage = ValidateOutTaskCompleteRequest(outTaskCompleteDto);
-                if (validationMessage != null)
-                    return response.Error(validationMessage);
-
-                var task = await BaseDal.QueryFirstAsync(x => x.OrderNo == outTaskCompleteDto.TaskId);
-                if (task == null)
-                    return response.Error("鏈壘鍒颁换鍔′俊鎭�");
-
-                outTaskCompleteDto.ReqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
-                var httpResponse = _httpClientHelper.Post<AGVResponse>(AGV_OutTaskComplete, outTaskCompleteDto.ToJson()).Data;
-                if (httpResponse == null || httpResponse.Data == null)
-                    return response.Error(httpResponse?.Msg ?? "AGV鎺ュ彛璋冪敤寮傚父");
-
-                if (!httpResponse.Code)
-                        return response.Error(string.IsNullOrWhiteSpace(httpResponse.Msg) ? "AGV鎺ュ彛璋冪敤澶辫触" : httpResponse.Msg);
-
-                var syncResult = await CompleteLocalOutboundAfterAgvAckAsync(task);
-                return syncResult.Status ? response.OK(httpResponse.Msg) : syncResult;
-            }
-            catch (Exception ex)
-            {
-                _unitOfWorkManage.RollbackTran();
-                return response.Error($"WMS浠诲姟瀹屾垚鎺ュ彛閿欒锛歿ex.Message}");
-            }
-        }
-
-        /// <summary>
-        /// 杈撻�佺嚎鐢宠杩涘叆
-        /// </summary>
-        public async Task<AGVResponse> ApplyEnterAsync(ApplyEnterDto applyEnterDto)
-        {
-            AGVResponse response = new AGVResponse();
-
-            try
-            {
-                var validationMessage = ValidateApplyEnterRequest(applyEnterDto);
-                if (validationMessage != null)
-                    return response.Error(validationMessage);
-
-                var task = await BaseDal.QueryFirstAsync(x => x.OrderNo == applyEnterDto.TaskId);
-                if (task == null)
-                    return response.Error($"鏈壘鍒颁换鍔′俊鎭紝浠诲姟鍙凤細{applyEnterDto.TaskId}");
-
-                if (CanApplyEnter(task, applyEnterDto))
-                    return response.OK();
-
-                return response.Error($"杈撻�佺嚎{applyEnterDto.DevId}褰撳墠绻佸繖锛岃绋嶅悗閲嶈瘯");
-            }
-            catch (Exception ex)
-            {
-                return response.Error($"WMS杈撻�佺嚎鐢宠鎺ュ彛閿欒锛歿ex.Message}");
-            }
-        }
-
-        /// <summary>
-        /// 鍙栨斁璐у畬鎴�
-        /// </summary>
-        public async Task<AGVResponse> TaskCompleteAsync(TaskCompleteDto taskCompleteDto)
-        {
-            AGVResponse response = new AGVResponse();
-
-            try
-            {
-                var validationMessage = ValidateTaskCompleteRequest(taskCompleteDto);
-                if (validationMessage != null)
-                    return response.Error(validationMessage);
-
-                var task = await BaseDal.QueryFirstAsync(x => x.OrderNo == taskCompleteDto.TaskId);
-                if (task == null)
-                    return response.Error($"鏈壘鍒颁换鍔′俊鎭紝浠诲姟鍙凤細{taskCompleteDto.TaskId}");
-
-                return taskCompleteDto.InOut == 2
-                    ? await CompleteAgvOutboundTaskAsync(task)
-                    : await CompleteAgvInboundTaskAsync(task);
-            }
-            catch (Exception ex)
-            {
-                _unitOfWorkManage.RollbackTran();
-                return response.Error($"WMS鍙栨斁璐у畬鎴愭帴鍙i敊璇細{ex.Message}");
-            }
-        }
-
-        /// <summary>
-        /// 浠诲姟鍙栨秷
-        /// </summary>
-        public async Task<AGVResponse> TaskCancelAsync(TaskCancelDto taskCancelDto)
-        {
-            AGVResponse response = new AGVResponse();
-
-            try
-            {
-                var validationMessage = ValidateTaskCancelRequest(taskCancelDto);
-                if (validationMessage != null)
-                    return response.Error(validationMessage);
-
-                var task = await BaseDal.QueryFirstAsync(x => x.OrderNo == taskCancelDto.TaskId);
-                if (task == null)
-                    return response.OK();
-
-                if (task.TaskStatus == (int)TaskInStatusEnum.InNew)
-                    return await CancelAgvInboundTask(task);
-
-                if (task.TaskStatus == (int)TaskOutStatusEnum.OutNew)
-                    return await CancelAgvOutboundTaskAsync(task);
-
-                return response.Error("浠诲姟宸茬粡鍦ㄦ墽琛屼腑锛屼笉鍙彇娑�");
-            }
-            catch (Exception ex)
-            {
-                _unitOfWorkManage.RollbackTran();
-                return response.Error($"WMS浠诲姟鍙栨秷鎺ュ彛閿欒锛歿ex.Message}");
-            }
-        }
-
-        #region 鍙傛暟楠岃瘉
-        private static string? ValidateApplyInOutRequest(ApplyInOutDto dto)
-        {
-            if (dto == null) return "璇锋眰鍙傛暟涓嶈兘涓虹┖";
-            if (string.IsNullOrWhiteSpace(dto.TrayNumber)) return "鎵樼洏鍙蜂笉鑳戒负绌�";
-            if (string.IsNullOrWhiteSpace(dto.TaskId)) return "浠诲姟鍙蜂笉鑳戒负绌�";
-            if (string.IsNullOrWhiteSpace(dto.MaterialType)) return "鐗╂枡绫诲瀷涓嶈兘涓虹┖";
-            if (string.IsNullOrWhiteSpace(dto.MaterialName)) return "鐗╂枡鎻忚堪涓嶈兘涓虹┖";
-            if (string.IsNullOrWhiteSpace(dto.ReqTime)) return "璇锋眰鏃堕棿涓嶈兘涓虹┖";
-            if (dto.Floor != 1 && dto.Floor != 2) return $"妤煎眰娈甸敊璇紝蹇呴』涓�1(妯″垏娈�)鎴�2(鍗风粫娈�)锛屽綋鍓嶅�硷細{dto.Floor}";
-            if (dto.YinYang != 1 && dto.YinYang != 2) return $"闃撮槼鏋侀敊璇紝蹇呴』涓�1(闃存瀬)鎴�2(闃虫瀬)锛屽綋鍓嶅�硷細{dto.YinYang}";
-            if (dto.InOut != 1 && dto.InOut != 2) return $"鍑哄叆搴撶被鍨嬮敊璇紝蹇呴』涓�1(鍏ュ簱)鎴�2(鍑哄簱)锛屽綋鍓嶅�硷細{dto.InOut}";
-            if (dto.InOut == 1 && (dto.Width == null || dto.Width <= 0)) return "鍏ュ簱鏃跺搴︿笉鑳戒负绌轰笖蹇呴』澶т簬0";
-            if (dto.InOut == 1 && string.IsNullOrWhiteSpace(dto.Group)) return "鍏ュ簱鏃舵暣鎵樼粍鍒笉鑳戒负绌�";
-            return null;
-        }
-
-        private static string? ValidateOutTaskCompleteRequest(OutTaskCompleteDto dto)
-        {
-            if (dto == null) return "璇锋眰鍙傛暟涓嶈兘涓虹┖";
-            if (string.IsNullOrWhiteSpace(dto.TaskId)) return "浠诲姟鍙蜂笉鑳戒负绌�";
-            if (string.IsNullOrWhiteSpace(dto.DevId)) return "鍑哄簱鍙g紪鍙蜂笉鑳戒负绌�";
-            return null;
-        }
-
-        private static string? ValidateApplyEnterRequest(ApplyEnterDto dto)
-        {
-            if (dto == null) return "璇锋眰鍙傛暟涓嶈兘涓虹┖";
-            if (string.IsNullOrWhiteSpace(dto.DevId)) return "璁惧缂栧彿涓嶈兘涓虹┖";
-            if (string.IsNullOrWhiteSpace(dto.TaskId)) return "浠诲姟鍙蜂笉鑳戒负绌�";
-            if (dto.InOut != 1 && dto.InOut != 2) return $"鍑哄叆搴撶被鍨嬮敊璇紝蹇呴』涓�1(鍏ュ簱)鎴�2(鍑哄簱)锛屽綋鍓嶅�硷細{dto.InOut}";
-            return null;
-        }
-
-        private static string? ValidateTaskCompleteRequest(TaskCompleteDto dto)
-        {
-            if (dto == null) return "璇锋眰鍙傛暟涓嶈兘涓虹┖";
-            if (string.IsNullOrWhiteSpace(dto.TaskId)) return "浠诲姟鍙蜂笉鑳戒负绌�";
-            if (string.IsNullOrWhiteSpace(dto.DevId)) return "璁惧缂栧彿涓嶈兘涓虹┖";
-            if (dto.InOut != 1 && dto.InOut != 2) return $"鍑哄叆搴撶被鍨嬮敊璇紝蹇呴』涓�1(鍏ュ簱)鎴�2(鍑哄簱)锛屽綋鍓嶅�硷細{dto.InOut}";
-            return null;
-        }
-
-        private static string? ValidateTaskCancelRequest(TaskCancelDto dto)
-        {
-            if (dto == null) return "璇锋眰鍙傛暟涓嶈兘涓虹┖";
-            if (string.IsNullOrWhiteSpace(dto.TaskId)) return "浠诲姟鍙蜂笉鑳戒负绌�";
-            return null;
-        }
-        #endregion 鍙傛暟楠岃瘉
-
-        #region 鍏蜂綋瀹炵幇
-        // 鍑哄叆搴撳叡鐢ㄥ垱寤轰换鍔�
-        private Dt_Task BuildAgvTask(ApplyInOutDto dto)
-        {
-            var task = new Dt_Task
-            {
-                OrderNo = dto.TaskId,
-                PalletCode = dto.TrayNumber,
-                PalletType = dto.Floor,
-                Grade = 1,
-                Creater = "AGV",
-                CreateDate = DateTime.Now,
-                Remark = $"鐗╂枡绫诲瀷锛歿dto.MaterialType}锛岀墿鏂欐弿杩帮細{dto.MaterialName}"
-            };
-
-            if (dto.YinYang == 1)
-            {
-                task.Roadway = WarehouseEnum.FJ1.ToString();
-                task.WarehouseId = (int)WarehouseEnum.FJ1;
-                task.SourceAddress = dto.InOut == 1 ? "D10010" : "D10020";
-                task.NextAddress = "D10080";
-                task.TargetAddress = "闃存瀬鍗峰簱";
-            }
-            else
-            {
-                task.Roadway = WarehouseEnum.ZJ1.ToString();
-                task.WarehouseId = (int)WarehouseEnum.ZJ1;
-                task.SourceAddress = dto.InOut == 1 ? "D10100" : "D10090";
-                task.NextAddress = "D10160";
-                task.TargetAddress = "姝f瀬鍗峰簱";
-            }
-
-            return task;
-        }
-
-        // 鏋勫缓杩斿洖AGV鍑哄叆搴撹姹備綋
-        private AGVDataDto BuildAgvDataDto(Dt_Task task, ApplyInOutDto dto)
-        {
-            return new AGVDataDto
-            {
-                DevId = dto.InOut == 1 ? task.SourceAddress : task.TargetAddress,
-                TrayNumber = task.PalletCode,
-                Group = dto.Group,
-                Width = dto.Width ?? 0,
-                LabelNumber = dto.LabelNumber,
-                ProductNo = dto.ProductNo,
-                ProductName = dto.ProductName,
-                Quantity = dto.Quantity,
-                UomCode = dto.UomCode,
-                ProductType = dto.ProductType,
-                Equipment = dto.Equipment,
-                ProductionDate = dto.ProductionDate,
-                LowerLimitTime = dto.LowerLimitTime,
-                WarningTime = dto.WarningTime,
-                OverdueTime = dto.OverdueTime
-            };
-        }
-
-        // 鍏ュ簱鍒涘缓
-        private async Task<AGVResponse?> CreateAgvInboundTaskAsync(Dt_Task task, ApplyInOutDto dto)
-        {
-            AGVResponse response = new AGVResponse();
-            var stockInfo = await _stockInfoService.GetStockInfoAsync(dto.TrayNumber);
-            if (stockInfo != null)
-                return response.Error($"褰撳墠鎵樼洏{dto.TrayNumber}宸茬粡鍏ュ簱浜�");
-
-            // 鍒涘缓搴撳瓨鏄庣粏
-            var details = new Dt_StockInfoDetail
-            {
-                MaterielCode = dto.ProductNo,
-                MaterielName = dto.ProductName,
-                StockQuantity = int.TryParse(dto.Quantity, out int quantity) ? quantity : 0,
-                Unit = dto.UomCode,
-                OrderNo = dto.ProductNo,
-                ProductionDate =dto.ProductionDate,
-                EffectiveDate = dto.LowerLimitTime,
-                SerialNumber = dto.TrayNumber,
-                Status = (int)StockStatusEmun.鍏ュ簱纭,
-                InboundOrderRowNo = 1,
-                Creater = StockConstants.AGV_USER,
-                CreateDate = DateTime.Now,
-                Remark = $"AGV鍏ュ簱浠诲姟鍒涘缓锛屼换鍔″彿锛歿dto.TaskId}"
-            };
-
-            // 鍒涘缓搴撳瓨涓昏褰�
-            var stock = new Dt_StockInfo
-            {
-                PalletCode = dto.TrayNumber,
-                PalletType = dto.Floor,
-                WarehouseId = dto.YinYang == 1 ? (int)WarehouseEnum.FJ1 : (int)WarehouseEnum.ZJ1,
-                StockStatus = (int)StockStatusEmun.鍏ュ簱纭,
-                Creater = StockConstants.AGV_USER,
-                CreateDate = DateTime.Now,
-                Remark = $"AGV鍏ュ簱浠诲姟鍒涘缓锛屼换鍔″彿锛歿dto.TaskId}",
-                Details = new List<Dt_StockInfoDetail> { details }
-            };
-
-            task.TaskType = (int)TaskInboundTypeEnum.Inbound;
-            task.TaskStatus = (int)TaskInStatusEnum.InNew;
-            task.CurrentAddress = task.SourceAddress;
-
-            _unitOfWorkManage.BeginTran();
-            try
-            {
-                // 鍏堝垱寤轰换鍔�
-                var taskResult = await BaseDal.AddDataAsync(task) > 0;
-                if (!taskResult)
-                {
-                    _unitOfWorkManage.RollbackTran();
-                    return response.Error("鍏ュ簱浠诲姟鍒涘缓澶辫触");
+using Mapster;
+using System.Text.Json;
+using WIDESEA_Common.Constants;
+using WIDESEA_Common.LocationEnum;
+using WIDESEA_Common.StockEnum;
+using WIDESEA_Common.TaskEnum;
+using WIDESEA_Common.WareHouseEnum;
+using WIDESEA_Core;
+using WIDESEA_Core.Enums;
+using WIDESEA_Core.Helper;
+using WIDESEA_DTO.Task;
+using WIDESEA_IStockService;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_TaskInfoService
+{
+    public partial class TaskService
+    {
+
+        public string AGV_OutTaskComplete = WIDESEA_Core.Helper.AppSettings.Configuration["AGV_OutTaskComplete"];
+        public string WCS_ReceiveTask = WIDESEA_Core.Helper.AppSettings.Configuration["WCS_ReceiveTask"];
+
+        /// <summary>
+        /// 鏋佸嵎搴撳嚭鍏ュ簱鐢宠
+        /// </summary>
+        public async Task<AGVResponse> ApplyInOutAsync(ApplyInOutDto applyInOutDto)
+        {
+            AGVResponse response = new AGVResponse();
+
+            try
+            {
+                var validationMessage = ValidateApplyInOutRequest(applyInOutDto);
+                if (validationMessage != null)
+                    return response.Error(validationMessage);
+
+                var existingTask = await BaseDal.QueryFirstAsync(x => x.PalletCode == applyInOutDto.TrayNumber || x.OrderNo == applyInOutDto.TaskId);
+                if (existingTask != null)
+                    return response.Error($"WMS宸叉湁褰撳墠浠诲姟锛屼笉鍙噸澶嶄笅鍙戯紝浠诲姟鍙凤細{applyInOutDto.TaskId}");
+
+                var task = BuildAgvTask(applyInOutDto);
+
+                if (applyInOutDto.InOut == 1)
+                {
+                    var inboundResult = await CreateAgvInboundTaskAsync(task, applyInOutDto);
+                    if (inboundResult != null)
+                        return inboundResult;
+                }
+                else
+                {
+                    var outboundResult = await CreateAgvOutboundTaskAsync(task, applyInOutDto);
+                    if (outboundResult != null)
+                        return outboundResult;
+                }
+
+                return response.OK(BuildAgvDataDto(task, applyInOutDto));
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return response.Error($"WMS浠诲姟鍒涘缓鎺ュ彛閿欒: {ex.Message}");
+            }
+        }
+
+        /// <summary>
+        /// 鎵嬪姩鍑哄簱瀹屾垚鍙嶉缁橝GV
+        /// </summary>
+        public async Task<WebResponseContent> OutTaskComplete(OutTaskCompleteDto outTaskCompleteDto)
+        {
+            WebResponseContent response = new WebResponseContent();
+
+            try
+            {
+                var validationMessage = ValidateOutTaskCompleteRequest(outTaskCompleteDto);
+                if (validationMessage != null)
+                    return response.Error(validationMessage);
+
+                var task = await BaseDal.QueryFirstAsync(x => x.OrderNo == outTaskCompleteDto.TaskId);
+                if (task == null)
+                    return response.Error("鏈壘鍒颁换鍔′俊鎭�");
+
+                outTaskCompleteDto.ReqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+                var httpResponse = _httpClientHelper.Post<AGVResponse>(AGV_OutTaskComplete, outTaskCompleteDto.ToJson()).Data;
+                if (httpResponse == null || httpResponse.Data == null)
+                    return response.Error(httpResponse?.Msg ?? "AGV鎺ュ彛璋冪敤寮傚父");
+
+                if (!httpResponse.Code)
+                        return response.Error(string.IsNullOrWhiteSpace(httpResponse.Msg) ? "AGV鎺ュ彛璋冪敤澶辫触" : httpResponse.Msg);
+
+                var syncResult = await CompleteLocalOutboundAfterAgvAckAsync(task);
+                return syncResult.Status ? response.OK(httpResponse.Msg) : syncResult;
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return response.Error($"WMS浠诲姟瀹屾垚鎺ュ彛閿欒锛歿ex.Message}");
+            }
+        }
+
+        /// <summary>
+        /// 杈撻�佺嚎鐢宠杩涘叆
+        /// </summary>
+        public async Task<AGVResponse> ApplyEnterAsync(ApplyEnterDto applyEnterDto)
+        {
+            AGVResponse response = new AGVResponse();
+
+            try
+            {
+                var validationMessage = ValidateApplyEnterRequest(applyEnterDto);
+                if (validationMessage != null)
+                    return response.Error(validationMessage);
+
+                var task = await BaseDal.QueryFirstAsync(x => x.OrderNo == applyEnterDto.TaskId);
+                if (task == null)
+                    return response.Error($"鏈壘鍒颁换鍔′俊鎭紝浠诲姟鍙凤細{applyEnterDto.TaskId}");
+
+                if (CanApplyEnter(task, applyEnterDto))
+                    return response.OK();
+
+                return response.Error($"杈撻�佺嚎{applyEnterDto.DevId}褰撳墠绻佸繖锛岃绋嶅悗閲嶈瘯");
+            }
+            catch (Exception ex)
+            {
+                return response.Error($"WMS杈撻�佺嚎鐢宠鎺ュ彛閿欒锛歿ex.Message}");
+            }
+        }
+
+        /// <summary>
+        /// 鍙栨斁璐у畬鎴�
+        /// </summary>
+        public async Task<AGVResponse> TaskCompleteAsync(TaskCompleteDto taskCompleteDto)
+        {
+            AGVResponse response = new AGVResponse();
+
+            try
+            {
+                var validationMessage = ValidateTaskCompleteRequest(taskCompleteDto);
+                if (validationMessage != null)
+                    return response.Error(validationMessage);
+
+                var task = await BaseDal.QueryFirstAsync(x => x.OrderNo == taskCompleteDto.TaskId);
+                if (task == null)
+                    return response.Error($"鏈壘鍒颁换鍔′俊鎭紝浠诲姟鍙凤細{taskCompleteDto.TaskId}");
+
+                return taskCompleteDto.InOut == 2
+                    ? await CompleteAgvOutboundTaskAsync(task)
+                    : await CompleteAgvInboundTaskAsync(task);
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return response.Error($"WMS鍙栨斁璐у畬鎴愭帴鍙i敊璇細{ex.Message}");
+            }
+        }
+
+        /// <summary>
+        /// 浠诲姟鍙栨秷
+        /// </summary>
+        public async Task<AGVResponse> TaskCancelAsync(TaskCancelDto taskCancelDto)
+        {
+            AGVResponse response = new AGVResponse();
+
+            try
+            {
+                var validationMessage = ValidateTaskCancelRequest(taskCancelDto);
+                if (validationMessage != null)
+                    return response.Error(validationMessage);
+
+                var task = await BaseDal.QueryFirstAsync(x => x.OrderNo == taskCancelDto.TaskId);
+                if (task == null)
+                    return response.OK();
+
+                if (task.TaskStatus == (int)TaskInStatusEnum.InNew)
+                    return await CancelAgvInboundTask(task);
+
+                if (task.TaskStatus == (int)TaskOutStatusEnum.OutNew)
+                    return await CancelAgvOutboundTaskAsync(task);
+
+                return response.Error("浠诲姟宸茬粡鍦ㄦ墽琛屼腑锛屼笉鍙彇娑�");
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return response.Error($"WMS浠诲姟鍙栨秷鎺ュ彛閿欒锛歿ex.Message}");
+            }
+        }
+
+        #region 鍙傛暟楠岃瘉
+        private static string? ValidateApplyInOutRequest(ApplyInOutDto dto)
+        {
+            if (dto == null) return "璇锋眰鍙傛暟涓嶈兘涓虹┖";
+            if (string.IsNullOrWhiteSpace(dto.TrayNumber)) return "鎵樼洏鍙蜂笉鑳戒负绌�";
+            if (string.IsNullOrWhiteSpace(dto.TaskId)) return "浠诲姟鍙蜂笉鑳戒负绌�";
+            if (string.IsNullOrWhiteSpace(dto.MaterialType)) return "鐗╂枡绫诲瀷涓嶈兘涓虹┖";
+            if (string.IsNullOrWhiteSpace(dto.MaterialName)) return "鐗╂枡鎻忚堪涓嶈兘涓虹┖";
+            if (string.IsNullOrWhiteSpace(dto.ReqTime)) return "璇锋眰鏃堕棿涓嶈兘涓虹┖";
+            if (dto.Floor != 1 && dto.Floor != 2) return $"妤煎眰娈甸敊璇紝蹇呴』涓�1(妯″垏娈�)鎴�2(鍗风粫娈�)锛屽綋鍓嶅�硷細{dto.Floor}";
+            if (dto.YinYang != 1 && dto.YinYang != 2) return $"闃撮槼鏋侀敊璇紝蹇呴』涓�1(闃存瀬)鎴�2(闃虫瀬)锛屽綋鍓嶅�硷細{dto.YinYang}";
+            if (dto.InOut != 1 && dto.InOut != 2) return $"鍑哄叆搴撶被鍨嬮敊璇紝蹇呴』涓�1(鍏ュ簱)鎴�2(鍑哄簱)锛屽綋鍓嶅�硷細{dto.InOut}";
+            if (dto.InOut == 1 && (dto.Width == null || dto.Width <= 0)) return "鍏ュ簱鏃跺搴︿笉鑳戒负绌轰笖蹇呴』澶т簬0";
+            if (dto.InOut == 1 && string.IsNullOrWhiteSpace(dto.Group)) return "鍏ュ簱鏃舵暣鎵樼粍鍒笉鑳戒负绌�";
+            return null;
+        }
+
+        private static string? ValidateOutTaskCompleteRequest(OutTaskCompleteDto dto)
+        {
+            if (dto == null) return "璇锋眰鍙傛暟涓嶈兘涓虹┖";
+            if (string.IsNullOrWhiteSpace(dto.TaskId)) return "浠诲姟鍙蜂笉鑳戒负绌�";
+            if (string.IsNullOrWhiteSpace(dto.DevId)) return "鍑哄簱鍙g紪鍙蜂笉鑳戒负绌�";
+            return null;
+        }
+
+        private static string? ValidateApplyEnterRequest(ApplyEnterDto dto)
+        {
+            if (dto == null) return "璇锋眰鍙傛暟涓嶈兘涓虹┖";
+            if (string.IsNullOrWhiteSpace(dto.DevId)) return "璁惧缂栧彿涓嶈兘涓虹┖";
+            if (string.IsNullOrWhiteSpace(dto.TaskId)) return "浠诲姟鍙蜂笉鑳戒负绌�";
+            if (dto.InOut != 1 && dto.InOut != 2) return $"鍑哄叆搴撶被鍨嬮敊璇紝蹇呴』涓�1(鍏ュ簱)鎴�2(鍑哄簱)锛屽綋鍓嶅�硷細{dto.InOut}";
+            return null;
+        }
+
+        private static string? ValidateTaskCompleteRequest(TaskCompleteDto dto)
+        {
+            if (dto == null) return "璇锋眰鍙傛暟涓嶈兘涓虹┖";
+            if (string.IsNullOrWhiteSpace(dto.TaskId)) return "浠诲姟鍙蜂笉鑳戒负绌�";
+            if (string.IsNullOrWhiteSpace(dto.DevId)) return "璁惧缂栧彿涓嶈兘涓虹┖";
+            if (dto.InOut != 1 && dto.InOut != 2) return $"鍑哄叆搴撶被鍨嬮敊璇紝蹇呴』涓�1(鍏ュ簱)鎴�2(鍑哄簱)锛屽綋鍓嶅�硷細{dto.InOut}";
+            return null;
+        }
+
+        private static string? ValidateTaskCancelRequest(TaskCancelDto dto)
+        {
+            if (dto == null) return "璇锋眰鍙傛暟涓嶈兘涓虹┖";
+            if (string.IsNullOrWhiteSpace(dto.TaskId)) return "浠诲姟鍙蜂笉鑳戒负绌�";
+            return null;
+        }
+        #endregion 鍙傛暟楠岃瘉
+
+        #region 鍏蜂綋瀹炵幇
+        // 鍑哄叆搴撳叡鐢ㄥ垱寤轰换鍔�
+        private Dt_Task BuildAgvTask(ApplyInOutDto dto)
+        {
+            var task = new Dt_Task
+            {
+                OrderNo = dto.TaskId,
+                PalletCode = dto.TrayNumber,
+                PalletType = dto.Floor,
+                Grade = 1,
+                Creater = "AGV",
+                CreateDate = DateTime.Now,
+                Remark = $"鐗╂枡绫诲瀷锛歿dto.MaterialType}锛岀墿鏂欐弿杩帮細{dto.MaterialName}"
+            };
+
+            if (dto.YinYang == 1)
+            {
+                task.Roadway = WarehouseEnum.FJ1.ToString();
+                task.WarehouseId = (int)WarehouseEnum.FJ1;
+                task.SourceAddress = dto.InOut == 1 ? "D10010" : "D10020";
+                task.NextAddress = "D10080";
+                task.TargetAddress = "闃存瀬鍗峰簱";
+            }
+            else
+            {
+                task.Roadway = WarehouseEnum.ZJ1.ToString();
+                task.WarehouseId = (int)WarehouseEnum.ZJ1;
+                task.SourceAddress = dto.InOut == 1 ? "D10100" : "D10090";
+                task.NextAddress = "D10160";
+                task.TargetAddress = "姝f瀬鍗峰簱";
+            }
+
+            return task;
+        }
+
+        // 鏋勫缓杩斿洖AGV鍑哄叆搴撹姹備綋
+        private AGVDataDto BuildAgvDataDto(Dt_Task task, ApplyInOutDto dto)
+        {
+            return new AGVDataDto
+            {
+                DevId = dto.InOut == 1 ? task.SourceAddress : task.TargetAddress,
+                TrayNumber = task.PalletCode,
+                Group = dto.Group,
+                Width = dto.Width ?? 0,
+                LabelNumber = dto.LabelNumber,
+                ProductNo = dto.ProductNo,
+                ProductName = dto.ProductName,
+                Quantity = dto.Quantity,
+                UomCode = dto.UomCode,
+                ProductType = dto.ProductType,
+                Equipment = dto.Equipment,
+                ProductionDate = dto.ProductionDate,
+                LowerLimitTime = dto.LowerLimitTime,
+                WarningTime = dto.WarningTime,
+                OverdueTime = dto.OverdueTime
+            };
+        }
+
+        // 鍏ュ簱鍒涘缓
+        private async Task<AGVResponse?> CreateAgvInboundTaskAsync(Dt_Task task, ApplyInOutDto dto)
+        {
+            AGVResponse response = new AGVResponse();
+            var stockInfo = await _stockInfoService.GetStockInfoAsync(dto.TrayNumber);
+            if (stockInfo != null)
+                return response.Error($"褰撳墠鎵樼洏{dto.TrayNumber}宸茬粡鍏ュ簱浜�");
+
+            // 鍒涘缓搴撳瓨鏄庣粏
+            var details = new Dt_StockInfoDetail
+            {
+                MaterielCode = dto.ProductNo,
+                MaterielName = dto.ProductName,
+                StockQuantity = int.TryParse(dto.Quantity, out int quantity) ? quantity : 0,
+                Unit = dto.UomCode,
+                OrderNo = dto.ProductNo,
+                ProductionDate =dto.ProductionDate,
+                EffectiveDate = dto.LowerLimitTime,
+                SerialNumber = dto.TrayNumber,
+                Status = (int)StockStatusEmun.鍏ュ簱纭,
+                InboundOrderRowNo = 1,
+                Creater = StockConstants.AGV_USER,
+                CreateDate = DateTime.Now,
+                Remark = $"AGV鍏ュ簱浠诲姟鍒涘缓锛屼换鍔″彿锛歿dto.TaskId}"
+            };
+
+            // 鍒涘缓搴撳瓨涓昏褰�
+            var stock = new Dt_StockInfo
+            {
+                PalletCode = dto.TrayNumber,
+                PalletType = dto.Floor,
+                WarehouseId = dto.YinYang == 1 ? (int)WarehouseEnum.FJ1 : (int)WarehouseEnum.ZJ1,
+                StockStatus = (int)StockStatusEmun.鍏ュ簱纭,
+                Creater = StockConstants.AGV_USER,
+                CreateDate = DateTime.Now,
+                Remark = $"AGV鍏ュ簱浠诲姟鍒涘缓锛屼换鍔″彿锛歿dto.TaskId}",
+                Details = new List<Dt_StockInfoDetail> { details }
+            };
+
+            task.TaskType = (int)TaskInboundTypeEnum.Inbound;
+            task.TaskStatus = (int)TaskInStatusEnum.InNew;
+            task.CurrentAddress = task.SourceAddress;
+
+            _unitOfWorkManage.BeginTran();
+            try
+            {
+                // 鍏堝垱寤轰换鍔�
+                var taskResult = await BaseDal.AddDataAsync(task) > 0;
+                if (!taskResult)
+                {
+                    _unitOfWorkManage.RollbackTran();
+                    return response.Error("鍏ュ簱浠诲姟鍒涘缓澶辫触");
                 }
                 var result = _stockInfoService.Repository.AddData(stock, x => x.Details);
                 if (result)
-                {
-                    _unitOfWorkManage.CommitTran();
-                    return null;
+                {
+                    _unitOfWorkManage.CommitTran();
+                    return null;
                 }
-                else
-                {
-                    _unitOfWorkManage.RollbackTran();
-                    return response.Error("搴撳瓨淇℃伅鍒涘缓澶辫触");
+                else
+                {
+                    _unitOfWorkManage.RollbackTran();
+                    return response.Error("搴撳瓨淇℃伅鍒涘缓澶辫触");
                 }
-                // 浣跨敤搴撳瓨鏈嶅姟娣诲姞搴撳瓨涓昏褰曞拰鏄庣粏
-                //var stockResult = await _stockInfoService.AddStockWithDetailsUsingTransactionAsync(stock);
-
-            }
-            catch (Exception ex)
-            {
-                _unitOfWorkManage.RollbackTran();
-                return response.Error($"鍏ュ簱浠诲姟鍒涘缓寮傚父锛歿ex.Message}");
-            }
-        }
-
-        // 鍑哄簱鍒涘缓
-        private async Task<AGVResponse?> CreateAgvOutboundTaskAsync(Dt_Task task, ApplyInOutDto dto)
-        {
-            AGVResponse response = new AGVResponse();
-            
-            // 妫�鏌ュ簱瀛樻槸鍚﹀瓨鍦�
-            var stockInfo = await _stockInfoService.GetStockInfoAsync(dto.TrayNumber);
-            if (stockInfo == null)
-                return response.Error($"鏈壘鍒版墭鐩榹dto.TrayNumber}鐨勫簱瀛樹俊鎭�");
-
-            // 妫�鏌ュ簱瀛樻槸鍚︽湁鏄庣粏锛堝嵆鏄惁鐪熺殑鏈夊簱瀛橈級
-            if (stockInfo.Details == null || !stockInfo.Details.Any())
-                return response.Error($"鎵樼洏{dto.TrayNumber}娌℃湁搴撳瓨鏄庣粏锛屾棤娉曞嚭搴�");
-
-            // 妫�鏌ュ簱瀛樻�绘暟閲忔槸鍚﹀ぇ浜�0
-            var totalQuantity = stockInfo.Details.Sum(d => d.StockQuantity);
-            if (totalQuantity <= 0)
-                return response.Error($"鎵樼洏{dto.TrayNumber}搴撳瓨鏁伴噺涓嶈冻锛屾棤娉曞嚭搴�");
-
-            // 鏍规嵁dto鍙傛暟杩涗竴姝ラ獙璇佸簱瀛樹俊鎭�
-            if (!string.IsNullOrEmpty(dto.ProductNo))
-            {
-                // 妫�鏌ュ簱瀛樻槑缁嗕腑鏄惁鍖呭惈鎸囧畾鐨勭墿鏂欑紪鐮�
-                var hasMatchingMaterial = stockInfo.Details.Any(d => d.MaterielCode == dto.ProductNo);
-                if (!hasMatchingMaterial)
-                    return response.Error($"鎵樼洏{dto.TrayNumber}涓病鏈夌墿鏂欑紪鐮佷负{dto.ProductNo}鐨勫簱瀛橈紝鏃犳硶鍑哄簱");
-            }
-
-            // 妫�鏌ュ簱瀛樼姸鎬佹槸鍚﹀厑璁稿嚭搴�
-            if (stockInfo.StockStatus != (int)StockStatusEmun.鍏ュ簱瀹屾垚)
-                return response.Error($"鎵樼洏{dto.TrayNumber}姝e湪绉诲姩涓紝璇风◢鍚庯紒");
-
-            // 妫�鏌ヨ揣浣嶄俊鎭�
-            var locationInfo = await _locationInfoService.GetLocationInfo(stockInfo.LocationCode);
-            if (locationInfo == null)
-                return response.Error($"鏈壘鍒版墭鐩榹stockInfo.LocationCode}鐨勮揣浣嶄俊鎭�");
-
-            // 妫�鏌ヨ揣浣嶇姸鎬佹槸鍚﹀厑璁稿嚭搴�
-            if (locationInfo.LocationStatus != (int)LocationStatusEnum.InStock)
-                return response.Error($"褰撳墠璐т綅{locationInfo.LocationStatus}鐘舵�佷俊鎭敊璇�");
-
-            // 楠岃瘉浠撳簱ID鏄惁鍖归厤锛堟牴鎹甦to鐨勯槾闃虫瀬鍙傛暟锛�
-            var expectedWarehouseId = dto.YinYang == 1 ? (int)WarehouseEnum.FJ1 : (int)WarehouseEnum.ZJ1;
-            if (stockInfo.WarehouseId != expectedWarehouseId)
-                return response.Error($"鎵樼洏{dto.TrayNumber}涓嶅湪棰勬湡鐨勪粨搴撲腑锛屾棤娉曞嚭搴�");
-
-            task.TaskType = (int)TaskOutboundTypeEnum.Outbound;
-            task.TaskStatus = (int)TaskOutStatusEnum.OutNew;
-            task.SourceAddress = stockInfo.LocationCode;
-            task.CurrentAddress = stockInfo.LocationCode;
-            task.TargetAddress = dto.YinYang == 1 ? "D10020" : "D10090";
-
-            var wmsTaskDto = _mapper.Map<WMSTaskDTO>(task);
-            var taskList = new List<WMSTaskDTO> { wmsTaskDto };
-            var requestBody = JsonSerializer.Serialize(taskList);
-
-            var httpResponse = _httpClientHelper.Post<WebResponseContent>(WCS_ReceiveTask, requestBody);
-            if (httpResponse == null || httpResponse.Data == null || !httpResponse.Data.Status)
-                return response.Error(httpResponse?.Data?.Message ?? "涓嬪彂WCS澶辫触");
-
-            stockInfo.StockStatus = (int)StockStatusEmun.鍑哄簱閿佸畾;
-            locationInfo.LocationStatus = (int)LocationStatusEnum.InStockLock;
-
-            _unitOfWorkManage.BeginTran();
-            var addTaskResult = await BaseDal.AddDataAsync(task) > 0;
-            var updateLocationResult = await _locationInfoService.UpdateLocationInfoAsync(locationInfo);
-            var updateStockResult = await _stockInfoService.UpdateStockAsync(stockInfo);
-            if (!addTaskResult || !updateLocationResult || !updateStockResult)
-            {
-                _unitOfWorkManage.RollbackTran();
-                return response.Error("鍑哄簱浠诲姟鍒涘缓澶辫触");
-            }
-            _unitOfWorkManage.CommitTran();
-
-
-            return null;
-        }
-
-        private async Task<WebResponseContent> CompleteLocalOutboundAfterAgvAckAsync(Dt_Task task)
-        {
-            task.TaskStatus = (int)TaskOutStatusEnum.Line_OutFinish;
-
-            _unitOfWorkManage.BeginTran();
-            var updateResult = BaseDal.UpdateData(task);
-            if (!updateResult)
-            {
-                _unitOfWorkManage.RollbackTran();
-                return WebResponseContent.Instance.Error("AGV瀹屾垚鍥炰紶鍚庯紝浠诲姟鏇存柊澶辫触");
-            }
-
-            _unitOfWorkManage.CommitTran();
-            return WebResponseContent.Instance.OK();
-        }
-
-        private bool CanApplyEnter(Dt_Task task, ApplyEnterDto dto)
-        {
-            if (dto.InOut == 1)
-            {
-                var hasExecutingOutTask = BaseDal.QueryFirst(x => x.TaskType == (int)TaskOutboundTypeEnum.Outbound
-                    && x.TargetAddress == task.SourceAddress
-                    && (x.TaskStatus == (int)TaskOutStatusEnum.SC_OutExecuting
-                        || x.TaskStatus == (int)TaskOutStatusEnum.Line_OutExecuting));
-
-                // 濡傛灉娌℃湁姝e湪鎵ц鐨勫嚭搴撲换鍔★紝鍒欏厑璁稿叆搴�
-                return hasExecutingOutTask == null;
-            }
-            else
-            {
-                return task.TaskType == (int)TaskOutboundTypeEnum.Outbound
-                    && task.TaskStatus == (int)TaskStatusEnum.Line_Finish;
-            }
-        }
-
-        // WCS鍏ュ簱瀹屾垚
-        private async Task<WebResponseContent> CompleteAgvInboundTaskAsync(CreateTaskDto taskDto)
-        {
-            WebResponseContent response = new WebResponseContent();
-            var task = await BaseDal.QueryFirstAsync(x => x.PalletType == taskDto.PalletType);
-            if (task == null)
-                return response.Error($"娌℃湁褰撳墠鎵樼洏{taskDto.PalletType}鍏ュ簱浠诲姟");
-
-            var stockInfo = await _stockInfoService.GetStockInfoAsync(task.PalletCode);
-            if (stockInfo == null)
-                return response.Error($"鏈壘鍒版墭鐩榹task.PalletCode}鐨勫簱瀛樹俊鎭�");
-
-            var locationInfo = await _locationInfoService.GetLocationInfoAsync(task.TargetAddress);
-            if (locationInfo == null)
-                return response.Error($"鏈壘鍒拌揣浣峽task.TargetAddress}鐨勪俊鎭�");
-
-            if (locationInfo.LocationStatus == (int)LocationStatusEnum.InStock)
-                return response.Error($"褰撳墠璐т綅{locationInfo.LocationStatus}鐘舵�佷笉鏄┖闂茬姸鎬侊紝鏃犳硶鍏ュ簱");
-
-            // 鏇存柊璐т綅鐘舵�佷负鍗犵敤
-            locationInfo.LocationStatus = (int)LocationStatusEnum.InStock;
-            task.TaskStatus = (int)TaskInStatusEnum.InFinish;
-            stockInfo.StockStatus = (int)StockStatusEmun.鍏ュ簱瀹屾垚;
-            _unitOfWorkManage.BeginTran();
-            var addStockResult = _stockInfoService.UpdateData(stockInfo);
-            var updateLocationResult = _locationInfoService.UpdateData(locationInfo);
-            BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
-
-            if (!addStockResult.Status || !updateLocationResult.Status)
-            {
-                _unitOfWorkManage.RollbackTran();
-                return response.Error("鍏ュ簱瀹屾垚鍚庯紝娣诲姞搴撳瓨鎴栬揣浣嶆洿鏂板け璐�");
-            }
-
-            _unitOfWorkManage.CommitTran();
-            return response.OK();
-        }
-
-        // AGV鍑哄簱瀹屾垚
-        private async Task<AGVResponse> CompleteAgvOutboundTaskAsync(Dt_Task task)
-        {
-            AGVResponse response = new AGVResponse();
-            var stockInfo = await _stockInfoService.GetStockInfoAsync(task.PalletCode);
-            if (stockInfo == null)
-                return response.Error($"鏈壘鍒版墭鐩榹task.PalletCode}鐨勫簱瀛樹俊鎭�");
-
-            var locationInfo = await _locationInfoService.GetLocationInfoAsync(stockInfo.LocationCode);
-            if (locationInfo == null)
-                return response.Error($"鏈壘鍒版墭鐩榹stockInfo.LocationCode}鐨勮揣浣嶄俊鎭�");
-
-            if (stockInfo.StockStatus != (int)StockStatusEmun.鍑哄簱閿佸畾 || locationInfo.LocationStatus != (int)LocationStatusEnum.InStockLock)
-                return response.Error($"褰撳墠搴撳瓨{stockInfo.StockStatus}鎴栬�呰揣浣峽locationInfo.LocationStatus}鐘舵�佷俊鎭敊璇�");
-
-            locationInfo.LocationStatus = (int)LocationStatusEnum.Free;
-            task.TaskStatus = (int)TaskOutStatusEnum.OutFinish;
-
-            _unitOfWorkManage.BeginTran();
-            //var deleteStockResult = _stockInfoService.DeleteData(stockInfo)
-            var deleteStockResult = await _stockInfoService.DeleteStockWithDetailsAsync(stockInfo.Id);
-            var updateLocationResult = _locationInfoService.UpdateData(locationInfo);
-            BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
-            if (!deleteStockResult.Status || !updateLocationResult.Status)
-            {
-                _unitOfWorkManage.RollbackTran();
-                return response.Error("鍑哄簱瀹屾垚鍚庯紝鏈湴搴撳瓨鎴栬揣浣嶆洿鏂板け璐�");
-            }
-
-            _unitOfWorkManage.CommitTran();
-            return response.OK();
-        }
-
-        // AGV宸叉斁璐э紝鍑嗗杈撻�佺嚎鍏ュ簱
-        private async Task<AGVResponse> CompleteAgvInboundTaskAsync(Dt_Task task)
-        {
-            AGVResponse response = new AGVResponse();
-            var availableLocation = await _locationInfoService.GetLocationInfo(task.Roadway);
-            if (availableLocation == null)
-                return response.Error("鏃犲彲鐢ㄧ殑鍏ュ簱璐т綅");
-
-            task.TargetAddress = availableLocation.LocationCode;
-
-            var wmsTaskDto = _mapper.Map<WMSTaskDTO>(task);
-            var taskList = new List<WMSTaskDTO> { wmsTaskDto };
-            var requestBody = JsonSerializer.Serialize(taskList);
-
-            var httpResponse = _httpClientHelper.Post<WebResponseContent>(WCS_ReceiveTask, requestBody);
-            if (httpResponse == null || httpResponse.Data == null || !httpResponse.Data.Status)
-                return response.Error(httpResponse?.Data?.Message ?? "涓嬪彂WCS澶辫触");
-
-            task.TaskStatus = (int)TaskInStatusEnum.Line_InExecuting;
-            task.Dispatchertime = DateTime.Now;
-
-            var locationInfo = await _locationInfoService.GetLocationInfoAsync(task.TargetAddress);
-            if (locationInfo == null)
-                return response.Error($"鏈壘鍒版墭鐩榹task.TargetAddress}鐨勮揣浣嶄俊鎭�");
-
-            if (locationInfo.LocationStatus != (int)LocationStatusEnum.Free)
-                return response.Error($"褰撳墠璐т綅{locationInfo.LocationStatus}鐘舵�佷俊鎭敊璇�");
-
-            var existingStock = await _stockInfoService.GetStockInfoAsync(task.PalletCode);
-            if (existingStock != null)
-                return response.Error($"鎵樼洏{task.PalletCode}鐨勫簱瀛樹俊鎭凡瀛樺湪锛岃鍕块噸澶嶅叆搴�");
-
-            //Dt_StockInfo stockInfo = new Dt_StockInfo
-            //{
-            //    PalletCode = task.PalletCode,
-            //    StockStatus = (int)StockStatusEmun.鍏ュ簱纭,
-            //    LocationCode = locationInfo.LocationCode,
-            //    WarehouseId = task.WarehouseId,
-            //    Creater = "AGV",
-            //    CreateDate = DateTime.Now
-            //};
-
-            locationInfo.LocationStatus = (int)LocationStatusEnum.FreeLock;
-
-            _unitOfWorkManage.BeginTran();
-            var updateTaskResult = BaseDal.UpdateData(task);
-            var updateLocationResult = _locationInfoService.UpdateData(locationInfo);
-            //var addStockResult = _stockInfoService.AddData(stockInfo);
-            if (!updateTaskResult || !updateLocationResult.Status /*|| !addStockResult.Status*/)
-            {
-                _unitOfWorkManage.RollbackTran();
-                return response.Error("鍏ュ簱瀹屾垚鍚庯紝鏈湴浠诲姟銆佸簱瀛樻垨璐т綅鏇存柊澶辫触");
-            }
-
-            _unitOfWorkManage.CommitTran();
-            return response.OK();
-        }
-
-        // AGV鍏ュ簱鍙栨秷
-        private async Task<AGVResponse> CancelAgvInboundTask(Dt_Task task)
-        {
-            AGVResponse response = new AGVResponse();
-            task.TaskStatus = (int)TaskInStatusEnum.InCancel;
-            
-            _unitOfWorkManage.BeginTran();
-            try
-            {
-                var stockInfo = await _stockInfoService.GetStockInfoAsync(task.PalletCode);
-                if (stockInfo != null)
-                {
-                    var deleteResult = await _stockInfoService.DeleteStockWithDetailsAsync(stockInfo.Id);
-                    if (!deleteResult.Status)
-                    {
-                        _unitOfWorkManage.RollbackTran();
-                        return response.Error($"鍒犻櫎搴撳瓨澶辫触: {deleteResult.Message}");
-                    }
-                }
-
-                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
-
-                _unitOfWorkManage.CommitTran();
-                return response.OK();
-            }
-            catch (Exception ex)
-            {
-                _unitOfWorkManage.RollbackTran();
-                return response.Error($"鍙栨秷鍏ュ簱浠诲姟鏃跺彂鐢熷紓甯�: {ex.Message}");
-            }
-        }
-
-
-        // AGV鍑哄簱鍙栨秷
-        private async Task<AGVResponse> CancelAgvOutboundTaskAsync(Dt_Task task)
-        {
-            AGVResponse response = new AGVResponse();
-            var stockInfo = await _stockInfoService.GetStockInfoAsync(task.PalletCode);
-            if (stockInfo == null)
-                return response.Error($"鏈壘鍒版墭鐩榹task.PalletCode}鐨勫簱瀛樹俊鎭�");
-
-            var locationInfo = await _locationInfoService.GetLocationInfoAsync(stockInfo.LocationCode);
-            if (locationInfo == null)
-                return response.Error($"鏈壘鍒版墭鐩榹stockInfo.LocationCode}鐨勮揣浣嶄俊鎭�");
-
-            if (stockInfo.StockStatus != (int)StockStatusEmun.鍑哄簱閿佸畾 || locationInfo.LocationStatus != (int)LocationStatusEnum.InStockLock)
-                return response.Error($"褰撳墠搴撳瓨{stockInfo.StockStatus}鎴栬�呰揣浣峽locationInfo.LocationStatus}鐘舵�佷俊鎭敊璇�");
-
-            stockInfo.StockStatus = (int)StockStatusEmun.鍏ュ簱瀹屾垚;
-            locationInfo.LocationStatus = (int)LocationStatusEnum.InStock;
-            task.TaskStatus = (int)TaskOutStatusEnum.OutCancel;
-
-            _unitOfWorkManage.BeginTran();
-            var updateLocationResult = _locationInfoService.UpdateData(locationInfo);
-            var updateStockResult = _stockInfoService.UpdateData(stockInfo);
-            BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
-            if (!updateLocationResult.Status || !updateStockResult.Status)
-            {
-                _unitOfWorkManage.RollbackTran();
-                return response.Error("鍑哄簱浠诲姟鍙栨秷澶辫触");
-            }
-
-            _unitOfWorkManage.CommitTran();
-            return response.OK();
-        }
-
-        #endregion 鍏蜂綋瀹炵幇
-    }
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return response.Error($"鍏ュ簱浠诲姟鍒涘缓寮傚父锛歿ex.Message}");
+            }
+        }
+
+        // 鍑哄簱鍒涘缓
+        private async Task<AGVResponse?> CreateAgvOutboundTaskAsync(Dt_Task task, ApplyInOutDto dto)
+        {
+            AGVResponse response = new AGVResponse();
+            
+            // 妫�鏌ュ簱瀛樻槸鍚﹀瓨鍦�
+            var stockInfo = await _stockInfoService.GetStockInfoAsync(dto.TrayNumber);
+            if (stockInfo == null)
+                return response.Error($"鏈壘鍒版墭鐩榹dto.TrayNumber}鐨勫簱瀛樹俊鎭�");
+
+            // 妫�鏌ュ簱瀛樻槸鍚︽湁鏄庣粏锛堝嵆鏄惁鐪熺殑鏈夊簱瀛橈級
+            if (stockInfo.Details == null || !stockInfo.Details.Any())
+                return response.Error($"鎵樼洏{dto.TrayNumber}娌℃湁搴撳瓨鏄庣粏锛屾棤娉曞嚭搴�");
+
+            // 妫�鏌ュ簱瀛樻�绘暟閲忔槸鍚﹀ぇ浜�0
+            var totalQuantity = stockInfo.Details.Sum(d => d.StockQuantity);
+            if (totalQuantity <= 0)
+                return response.Error($"鎵樼洏{dto.TrayNumber}搴撳瓨鏁伴噺涓嶈冻锛屾棤娉曞嚭搴�");
+
+            // 鏍规嵁dto鍙傛暟杩涗竴姝ラ獙璇佸簱瀛樹俊鎭�
+            if (!string.IsNullOrEmpty(dto.ProductNo))
+            {
+                // 妫�鏌ュ簱瀛樻槑缁嗕腑鏄惁鍖呭惈鎸囧畾鐨勭墿鏂欑紪鐮�
+                var hasMatchingMaterial = stockInfo.Details.Any(d => d.MaterielCode == dto.ProductNo);
+                if (!hasMatchingMaterial)
+                    return response.Error($"鎵樼洏{dto.TrayNumber}涓病鏈夌墿鏂欑紪鐮佷负{dto.ProductNo}鐨勫簱瀛橈紝鏃犳硶鍑哄簱");
+            }
+
+            // 妫�鏌ュ簱瀛樼姸鎬佹槸鍚﹀厑璁稿嚭搴�
+            if (stockInfo.StockStatus != (int)StockStatusEmun.鍏ュ簱瀹屾垚)
+                return response.Error($"鎵樼洏{dto.TrayNumber}姝e湪绉诲姩涓紝璇风◢鍚庯紒");
+
+            // 妫�鏌ヨ揣浣嶄俊鎭�
+            var locationInfo = await _locationInfoService.GetLocationInfo(stockInfo.LocationCode);
+            if (locationInfo == null)
+                return response.Error($"鏈壘鍒版墭鐩榹stockInfo.LocationCode}鐨勮揣浣嶄俊鎭�");
+
+            // 妫�鏌ヨ揣浣嶇姸鎬佹槸鍚﹀厑璁稿嚭搴�
+            if (locationInfo.LocationStatus != (int)LocationStatusEnum.InStock)
+                return response.Error($"褰撳墠璐т綅{locationInfo.LocationStatus}鐘舵�佷俊鎭敊璇�");
+
+            // 楠岃瘉浠撳簱ID鏄惁鍖归厤锛堟牴鎹甦to鐨勯槾闃虫瀬鍙傛暟锛�
+            var expectedWarehouseId = dto.YinYang == 1 ? (int)WarehouseEnum.FJ1 : (int)WarehouseEnum.ZJ1;
+            if (stockInfo.WarehouseId != expectedWarehouseId)
+                return response.Error($"鎵樼洏{dto.TrayNumber}涓嶅湪棰勬湡鐨勪粨搴撲腑锛屾棤娉曞嚭搴�");
+
+            task.TaskType = (int)TaskOutboundTypeEnum.Outbound;
+            task.TaskStatus = (int)TaskOutStatusEnum.OutNew;
+            task.SourceAddress = stockInfo.LocationCode;
+            task.CurrentAddress = stockInfo.LocationCode;
+            task.TargetAddress = dto.YinYang == 1 ? "D10020" : "D10090";
+
+            var wmsTaskDto = _mapper.Map<WMSTaskDTO>(task);
+            var taskList = new List<WMSTaskDTO> { wmsTaskDto };
+            var requestBody = JsonSerializer.Serialize(taskList);
+
+            var httpResponse = _httpClientHelper.Post<WebResponseContent>(WCS_ReceiveTask, requestBody);
+            if (httpResponse == null || httpResponse.Data == null || !httpResponse.Data.Status)
+                return response.Error(httpResponse?.Data?.Message ?? "涓嬪彂WCS澶辫触");
+
+            stockInfo.StockStatus = (int)StockStatusEmun.鍑哄簱閿佸畾;
+            locationInfo.LocationStatus = (int)LocationStatusEnum.InStockLock;
+
+            _unitOfWorkManage.BeginTran();
+            var addTaskResult = await BaseDal.AddDataAsync(task) > 0;
+            var updateLocationResult = await _locationInfoService.UpdateLocationInfoAsync(locationInfo);
+            var updateStockResult = await _stockInfoService.UpdateStockAsync(stockInfo);
+            if (!addTaskResult || !updateLocationResult || !updateStockResult)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return response.Error("鍑哄簱浠诲姟鍒涘缓澶辫触");
+            }
+            _unitOfWorkManage.CommitTran();
+
+
+            return null;
+        }
+
+        private async Task<WebResponseContent> CompleteLocalOutboundAfterAgvAckAsync(Dt_Task task)
+        {
+            task.TaskStatus = (int)TaskOutStatusEnum.Line_OutFinish;
+
+            _unitOfWorkManage.BeginTran();
+            var updateResult = BaseDal.UpdateData(task);
+            if (!updateResult)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return WebResponseContent.Instance.Error("AGV瀹屾垚鍥炰紶鍚庯紝浠诲姟鏇存柊澶辫触");
+            }
+
+            _unitOfWorkManage.CommitTran();
+            return WebResponseContent.Instance.OK();
+        }
+
+        private bool CanApplyEnter(Dt_Task task, ApplyEnterDto dto)
+        {
+            if (dto.InOut == 1)
+            {
+                var hasExecutingOutTask = BaseDal.QueryFirst(x => x.TaskType == (int)TaskOutboundTypeEnum.Outbound
+                    && x.TargetAddress == task.SourceAddress
+                    && (x.TaskStatus == (int)TaskOutStatusEnum.SC_OutExecuting
+                        || x.TaskStatus == (int)TaskOutStatusEnum.Line_OutExecuting));
+
+                // 濡傛灉娌℃湁姝e湪鎵ц鐨勫嚭搴撲换鍔★紝鍒欏厑璁稿叆搴�
+                return hasExecutingOutTask == null;
+            }
+            else
+            {
+                return task.TaskType == (int)TaskOutboundTypeEnum.Outbound
+                    && task.TaskStatus == (int)TaskStatusEnum.Line_Finish;
+            }
+        }
+
+        // WCS鍏ュ簱瀹屾垚
+        private async Task<WebResponseContent> CompleteAgvInboundTaskAsync(CreateTaskDto taskDto)
+        {
+            WebResponseContent response = new WebResponseContent();
+            var task = await BaseDal.QueryFirstAsync(x => x.PalletType == taskDto.PalletType);
+            if (task == null)
+                return response.Error($"娌℃湁褰撳墠鎵樼洏{taskDto.PalletType}鍏ュ簱浠诲姟");
+
+            var stockInfo = await _stockInfoService.GetStockInfoAsync(task.PalletCode);
+            if (stockInfo == null)
+                return response.Error($"鏈壘鍒版墭鐩榹task.PalletCode}鐨勫簱瀛樹俊鎭�");
+
+            var locationInfo = await _locationInfoService.GetLocationInfoAsync(task.TargetAddress);
+            if (locationInfo == null)
+                return response.Error($"鏈壘鍒拌揣浣峽task.TargetAddress}鐨勪俊鎭�");
+
+            if (locationInfo.LocationStatus == (int)LocationStatusEnum.InStock)
+                return response.Error($"褰撳墠璐т綅{locationInfo.LocationStatus}鐘舵�佷笉鏄┖闂茬姸鎬侊紝鏃犳硶鍏ュ簱");
+
+            // 鏇存柊璐т綅鐘舵�佷负鍗犵敤
+            locationInfo.LocationStatus = (int)LocationStatusEnum.InStock;
+            task.TaskStatus = (int)TaskInStatusEnum.InFinish;
+            stockInfo.StockStatus = (int)StockStatusEmun.鍏ュ簱瀹屾垚;
+            _unitOfWorkManage.BeginTran();
+            var addStockResult = _stockInfoService.UpdateData(stockInfo);
+            var updateLocationResult = _locationInfoService.UpdateData(locationInfo);
+            BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+
+            if (!addStockResult.Status || !updateLocationResult.Status)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return response.Error("鍏ュ簱瀹屾垚鍚庯紝娣诲姞搴撳瓨鎴栬揣浣嶆洿鏂板け璐�");
+            }
+
+            _unitOfWorkManage.CommitTran();
+            return response.OK();
+        }
+
+        // AGV鍑哄簱瀹屾垚
+        private async Task<AGVResponse> CompleteAgvOutboundTaskAsync(Dt_Task task)
+        {
+            AGVResponse response = new AGVResponse();
+            var stockInfo = await _stockInfoService.GetStockInfoAsync(task.PalletCode);
+            if (stockInfo == null)
+                return response.Error($"鏈壘鍒版墭鐩榹task.PalletCode}鐨勫簱瀛樹俊鎭�");
+
+            var locationInfo = await _locationInfoService.GetLocationInfoAsync(stockInfo.LocationCode);
+            if (locationInfo == null)
+                return response.Error($"鏈壘鍒版墭鐩榹stockInfo.LocationCode}鐨勮揣浣嶄俊鎭�");
+
+            if (stockInfo.StockStatus != (int)StockStatusEmun.鍑哄簱閿佸畾 || locationInfo.LocationStatus != (int)LocationStatusEnum.InStockLock)
+                return response.Error($"褰撳墠搴撳瓨{stockInfo.StockStatus}鎴栬�呰揣浣峽locationInfo.LocationStatus}鐘舵�佷俊鎭敊璇�");
+
+            locationInfo.LocationStatus = (int)LocationStatusEnum.Free;
+            task.TaskStatus = (int)TaskOutStatusEnum.OutFinish;
+
+            _unitOfWorkManage.BeginTran();
+            //var deleteStockResult = _stockInfoService.DeleteData(stockInfo)
+            var deleteStockResult = await _stockInfoService.DeleteStockWithDetailsAsync(stockInfo.Id);
+            var updateLocationResult = _locationInfoService.UpdateData(locationInfo);
+            BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+            if (!deleteStockResult.Status || !updateLocationResult.Status)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return response.Error("鍑哄簱瀹屾垚鍚庯紝鏈湴搴撳瓨鎴栬揣浣嶆洿鏂板け璐�");
+            }
+
+            _unitOfWorkManage.CommitTran();
+            return response.OK();
+        }
+
+        // AGV宸叉斁璐э紝鍑嗗杈撻�佺嚎鍏ュ簱
+        private async Task<AGVResponse> CompleteAgvInboundTaskAsync(Dt_Task task)
+        {
+            AGVResponse response = new AGVResponse();
+            var availableLocation = await _locationInfoService.GetLocationInfo(task.Roadway);
+            if (availableLocation == null)
+                return response.Error("鏃犲彲鐢ㄧ殑鍏ュ簱璐т綅");
+
+            task.TargetAddress = availableLocation.LocationCode;
+
+            var wmsTaskDto = _mapper.Map<WMSTaskDTO>(task);
+            var taskList = new List<WMSTaskDTO> { wmsTaskDto };
+            var requestBody = JsonSerializer.Serialize(taskList);
+
+            var httpResponse = _httpClientHelper.Post<WebResponseContent>(WCS_ReceiveTask, requestBody);
+            if (httpResponse == null || httpResponse.Data == null || !httpResponse.Data.Status)
+                return response.Error(httpResponse?.Data?.Message ?? "涓嬪彂WCS澶辫触");
+
+            task.TaskStatus = (int)TaskInStatusEnum.Line_InExecuting;
+            task.Dispatchertime = DateTime.Now;
+
+            var locationInfo = await _locationInfoService.GetLocationInfoAsync(task.TargetAddress);
+            if (locationInfo == null)
+                return response.Error($"鏈壘鍒版墭鐩榹task.TargetAddress}鐨勮揣浣嶄俊鎭�");
+
+            if (locationInfo.LocationStatus != (int)LocationStatusEnum.Free)
+                return response.Error($"褰撳墠璐т綅{locationInfo.LocationStatus}鐘舵�佷俊鎭敊璇�");
+
+            var existingStock = await _stockInfoService.GetStockInfoAsync(task.PalletCode);
+            if (existingStock != null)
+                return response.Error($"鎵樼洏{task.PalletCode}鐨勫簱瀛樹俊鎭凡瀛樺湪锛岃鍕块噸澶嶅叆搴�");
+
+            //Dt_StockInfo stockInfo = new Dt_StockInfo
+            //{
+            //    PalletCode = task.PalletCode,
+            //    StockStatus = (int)StockStatusEmun.鍏ュ簱纭,
+            //    LocationCode = locationInfo.LocationCode,
+            //    WarehouseId = task.WarehouseId,
+            //    Creater = "AGV",
+            //    CreateDate = DateTime.Now
+            //};
+
+            locationInfo.LocationStatus = (int)LocationStatusEnum.FreeLock;
+
+            _unitOfWorkManage.BeginTran();
+            var updateTaskResult = BaseDal.UpdateData(task);
+            var updateLocationResult = _locationInfoService.UpdateData(locationInfo);
+            //var addStockResult = _stockInfoService.AddData(stockInfo);
+            if (!updateTaskResult || !updateLocationResult.Status /*|| !addStockResult.Status*/)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return response.Error("鍏ュ簱瀹屾垚鍚庯紝鏈湴浠诲姟銆佸簱瀛樻垨璐т綅鏇存柊澶辫触");
+            }
+
+            _unitOfWorkManage.CommitTran();
+            return response.OK();
+        }
+
+        // AGV鍏ュ簱鍙栨秷
+        private async Task<AGVResponse> CancelAgvInboundTask(Dt_Task task)
+        {
+            AGVResponse response = new AGVResponse();
+            task.TaskStatus = (int)TaskInStatusEnum.InCancel;
+            
+            _unitOfWorkManage.BeginTran();
+            try
+            {
+                var stockInfo = await _stockInfoService.GetStockInfoAsync(task.PalletCode);
+                if (stockInfo != null)
+                {
+                    var deleteResult = await _stockInfoService.DeleteStockWithDetailsAsync(stockInfo.Id);
+                    if (!deleteResult.Status)
+                    {
+                        _unitOfWorkManage.RollbackTran();
+                        return response.Error($"鍒犻櫎搴撳瓨澶辫触: {deleteResult.Message}");
+                    }
+                }
+
+                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+
+                _unitOfWorkManage.CommitTran();
+                return response.OK();
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return response.Error($"鍙栨秷鍏ュ簱浠诲姟鏃跺彂鐢熷紓甯�: {ex.Message}");
+            }
+        }
+
+
+        // AGV鍑哄簱鍙栨秷
+        private async Task<AGVResponse> CancelAgvOutboundTaskAsync(Dt_Task task)
+        {
+            AGVResponse response = new AGVResponse();
+            var stockInfo = await _stockInfoService.GetStockInfoAsync(task.PalletCode);
+            if (stockInfo == null)
+                return response.Error($"鏈壘鍒版墭鐩榹task.PalletCode}鐨勫簱瀛樹俊鎭�");
+
+            var locationInfo = await _locationInfoService.GetLocationInfoAsync(stockInfo.LocationCode);
+            if (locationInfo == null)
+                return response.Error($"鏈壘鍒版墭鐩榹stockInfo.LocationCode}鐨勮揣浣嶄俊鎭�");
+
+            if (stockInfo.StockStatus != (int)StockStatusEmun.鍑哄簱閿佸畾 || locationInfo.LocationStatus != (int)LocationStatusEnum.InStockLock)
+                return response.Error($"褰撳墠搴撳瓨{stockInfo.StockStatus}鎴栬�呰揣浣峽locationInfo.LocationStatus}鐘舵�佷俊鎭敊璇�");
+
+            stockInfo.StockStatus = (int)StockStatusEmun.鍏ュ簱瀹屾垚;
+            locationInfo.LocationStatus = (int)LocationStatusEnum.InStock;
+            task.TaskStatus = (int)TaskOutStatusEnum.OutCancel;
+
+            _unitOfWorkManage.BeginTran();
+            var updateLocationResult = _locationInfoService.UpdateData(locationInfo);
+            var updateStockResult = _stockInfoService.UpdateData(stockInfo);
+            BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+            if (!updateLocationResult.Status || !updateStockResult.Status)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return response.Error("鍑哄簱浠诲姟鍙栨秷澶辫触");
+            }
+
+            _unitOfWorkManage.CommitTran();
+            return response.OK();
+        }
+
+        #endregion 鍏蜂綋瀹炵幇
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3