From 63e1ee997a5318e628b992f969bdac2fec6dbf14 Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期四, 04 十二月 2025 14:39:00 +0800
Subject: [PATCH] 1

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs |  311 ++++++++++++++++++++++++++++++++-------------------
 1 files changed, 194 insertions(+), 117 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
index cd322d0..7d5d27d 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
@@ -17,6 +17,7 @@
 using System.Reflection;
 using System.Reflection.Metadata;
 using System.Security.Policy;
+using System.Text;
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using WIDESEA_Cache;
@@ -95,6 +96,26 @@
         _wareAreaInfoRepository = wareAreaInfoRepository;
         _inventoryRecordRepository = inventoryRecordRepository;
     }
+    #region 鍒濆鍖栨彁鍗囨満
+    public async Task<WebResponseContent> InitializationElevator()
+    {
+        WebResponseContent content = new WebResponseContent();
+        try
+        {
+            var address = GetWCSIPAddress("WCSIPAddress","InitializationElevator");
+            if (address != null)
+            {
+                await HttpHelper.PostAsync(address, "");
+                return content.OK("鎴愬姛");
+            }
+            return content.Error("澶辫触");
+        }
+        catch (Exception ex)
+        {
+            return content.Error(ex.Message);
+        }
+    }
+    #endregion
 
     #region 澶栭儴鎺ュ彛鏂规硶
 
@@ -105,6 +126,13 @@
         WebResponseContent content = new WebResponseContent();
         try
         {
+            if (task.TaskState.GetTaskStateGroup() == TaskStateGroup.CarryGroup)
+            {
+                var result1 = UpdateLocationStatus(task.SourceAddress, LocationEnum.Free, task.TaskNum.Value, StatusChangeTypeEnum.AutomaticOutbound);
+                await _locationStatusChangeRecordRepository.AddDataAsync(result1.Item1);
+                await _locationRepository.UpdateDataAsync(result1.Item2);
+            }
+
             task.TaskState = (int)TaskOutStatusEnum.OutFinish;
             var taskHty = task.Adapt<Dt_Task_Hty>();
             taskHty.FinishTime = DateTime.Now;
@@ -113,14 +141,15 @@
             stock.ModifyDate = DateTime.Now;
             stock.LocationCode = task.TargetAddress;
             var result2 = UpdateLocationStatus(task.TargetAddress, LocationEnum.InStock, task.TaskNum.Value, StatusChangeTypeEnum.AutomaticOutbound);
+
             DtStockInfo_Hty stockInfo_Hty = stock.Adapt<DtStockInfo_Hty>();
             var orderDetails = _orderOutDetailsRepository.QueryData(x => x.PalletCode == task.PalletCode);
             List<Dt_OrderOutDetails_Hty> orderdetailshtys = new List<Dt_OrderOutDetails_Hty>();
 
             orderDetails.ForEach(item =>
-            {
-                orderdetailshtys.Add(item.Adapt<Dt_OrderOutDetails_Hty>());
-            });
+        {
+            orderdetailshtys.Add(item.Adapt<Dt_OrderOutDetails_Hty>());
+        });
 
             await ERPAllocateOut(stock);
 
@@ -172,8 +201,9 @@
                 boxingInfo.BoxingInfoDetails = mergedDetails;
             }
 
-            await _unitOfWorkManage.UseTranAsync(async () =>
-            {
+            //await _unitOfWorkManage.UseTranAsync(async () =>
+            //{
+            _unitOfWorkManage.BeginTran();
                 await DeleteStockInfoAsync(stock.Id);
                 _boxingInfoRepository.UpdateDataNav(boxingInfo);
                 await DeleteStockInfoDetailsAsync(stock.StockInfoDetails);
@@ -185,12 +215,14 @@
 
                 await DeleteTaskAsync(task.TaskId);
                 await AddTaskHtyAsync(taskHty);
-            });
+            _unitOfWorkManage.CommitTran();
+            //});
             content.OK("鍑哄簱瀹屾垚");
 
         }
         catch (Exception ex)
         {
+            _unitOfWorkManage.RollbackTran();
             task.ErrorMessage = ex.Message;
             await BaseDal.UpdateDataAsync(task);
             return content.Error(ex.Message);
@@ -268,7 +300,15 @@
             {
                 return content.Error("鏈壘鍒扮粍鐩樻暟鎹�");
             }
-            await ERPAllocate(boxinfo);
+
+            if (task.TaskState.GetTaskStateGroup() == TaskStateGroup.CarryGroup)
+            {
+                var result1 = UpdateLocationStatus(task.SourceAddress, LocationEnum.Free, task.TaskNum.Value, StatusChangeTypeEnum.AutomaticInbound);
+                await _locationStatusChangeRecordRepository.AddDataAsync(result1.Item1);
+                await _locationRepository.UpdateDataAsync(result1.Item2);
+            }
+
+            
 
             var stock = CreateStock(boxinfo, task);
 
@@ -280,18 +320,22 @@
 
             var result2 = UpdateLocationStatus(task.TargetAddress, LocationEnum.InStock, task.TaskNum.Value, StatusChangeTypeEnum.AutomaticInbound);
 
-            await _unitOfWorkManage.UseTranAsync(async () =>
-            {
-                await _stockInfoRepository.AddDataNavAsync(stock);
+            //await _unitOfWorkManage.UseTranAsync(async () =>
+            //{
+            _unitOfWorkManage.BeginTran();
+            await _stockInfoRepository.AddDataNavAsync(stock);
                 await DeleteTaskAsync(task.TaskId);
                 await AddTaskHtyAsync(taskHty);
                 await _locationStatusChangeRecordRepository.AddDataAsync(result2.Item1);
                 await _locationRepository.UpdateDataAsync(result2.Item2);
-            });
+            _unitOfWorkManage.CommitTran();
+            //});
+            await ERPAllocate(boxinfo);
             content.OK("鍏ュ簱瀹屾垚");
         }
         catch (Exception ex)
         {
+            _unitOfWorkManage.RollbackTran();
             task.ErrorMessage = ex.Message;
             await BaseDal.UpdateDataAsync(task);
             return content.Error(ex.Message);
@@ -339,64 +383,6 @@
         };
     }
     #endregion 鍏ュ簱浠诲姟瀹屾垚
-
-    #region AGV鎼繍浠诲姟瀹屾垚
-    public async Task<WebResponseContent> CompleteCarryTaskAsync(Dt_Task task,DtStockInfo stockInfo)
-    {
-        WebResponseContent content = new WebResponseContent();
-        try
-        {
-            var Sourcelocation = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.SourceAddress);
-            var Targetlocation = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.TargetAddress);
-
-            //UpdateLocationStatus(Sourcelocation, LocationEnum.Free);
-            //UpdateLocationStatus(Targetlocation, LocationEnum.InStock);
-
-            task.TaskState = (int)TaskAGVCarryStatusEnum.CarryFinish;
-            var taskHty = task.Adapt<Dt_Task_Hty>();
-            taskHty.FinishTime = DateTime.Now;
-            taskHty.OperateType = App.User.UserName != null ? (int)OperateTypeEnum.浜哄伐瀹屾垚 : (int)OperateTypeEnum.鑷姩瀹屾垚;
-            taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System";
-            await _unitOfWorkManage.UseTranAsync(async () =>
-            {
-                await DeleteTaskAsync(task.TaskId);
-                await AddTaskHtyAsync(taskHty);
-            });
-        }
-        catch (Exception ex)
-        {
-            return content.Error(ex.Message);
-        }
-        return content;
-    }
-
-    #endregion
-
-    #region AGV璺ㄦゼ灞備换鍔″畬鎴�
-    public async Task<WebResponseContent> CompleteAcrossFloorTaskAsync(Dt_Task task, DtStockInfo stockInfo)
-    {
-        WebResponseContent content = new WebResponseContent();
-        try
-        {
-            task.TaskState = (int)TaskAcrossFloorStatusEnum.CarryFinish;
-            var taskHty = task.Adapt<Dt_Task_Hty>();
-            taskHty.FinishTime = DateTime.Now;
-            taskHty.OperateType = App.User.UserName != null ? (int)OperateTypeEnum.浜哄伐瀹屾垚 : (int)OperateTypeEnum.鑷姩瀹屾垚;
-            taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System";
-            await _unitOfWorkManage.UseTranAsync(async () =>
-            {
-                await DeleteTaskAsync(task.TaskId);
-                await AddTaskHtyAsync(taskHty);
-            });
-        }
-        catch (Exception ex)
-        {
-            return content.Error(ex.Message);
-        }
-        return content;
-    }
-
-    #endregion
 
     #region 浠诲姟瀹屾垚
 
@@ -499,14 +485,14 @@
                 return content.Error("鎵樼洏淇℃伅涓嶅瓨鍦紝璇风‘璁ゆ墭鐩樺凡缁勭洏鎴愬姛");
             }
 
-            foreach (var item in boxingInfo.BoxingInfoDetails)
-            {
-                var ERPStock = SqlSugarHelper.DBERPtext.Queryable<鐢ㄥ弸鍗虫椂搴撳瓨_ST>().Where(x => x.瀛樺偍鍦扮偣鍚嶇О == item.Warehouse && x.鏂欏彿 == item.MaterielCode && x.鍝佸悕 == item.MaterielName && x.搴撳瓨鏁伴噺 >= item.Quantity).ToList().FirstOrDefault();
-                if (ERPStock == null)
-                {
-                    return content.Error($"缁勭洏鏁版嵁鏈湪ERP搴撳瓨鏁版嵁涓紝璇蜂汉宸ョ‘璁ゆ暟鎹槸鍚︽纭�");
-                }
-            }
+            //foreach (var item in boxingInfo.BoxingInfoDetails)
+            //{
+            //    var ERPStock = SqlSugarHelper.DBERP.Queryable<鐢ㄥ弸鍗虫椂搴撳瓨_ST>().Where(x => x.瀛樺偍鍦扮偣鍚嶇О == item.Warehouse && x.鏂欏彿 == item.MaterielCode && x.鍝佸悕 == item.MaterielName && x.搴撳瓨鏁伴噺 >= item.Quantity).ToList().FirstOrDefault();
+            //    if (ERPStock == null)
+            //    {
+            //        return content.Error($"缁勭洏鏁版嵁鏈湪ERP搴撳瓨鏁版嵁涓紝璇蜂汉宸ョ‘璁ゆ暟鎹槸鍚︽纭�");
+            //    }
+            //}
 
             var StartAddress = await _locationRepository.QueryFirstAsync(x => x.LocationCode == taskDto.Position);
             if (StartAddress == null)
@@ -543,6 +529,7 @@
                 case 4:
                 case 5:
                 case 6:
+                case 7:
                     taskNew = InboundAGVCacheArea(taskDto, StartAddress, area);
                     break;
                 default:
@@ -554,6 +541,12 @@
 
             await _unitOfWorkManage.UseTranAsync(async () =>
             {
+                if (taskDto.AreaId == 3 || taskDto.AreaId == 7)
+                {
+                    var result2 = UpdateLocationStatus(taskNew.TargetAddress, LocationEnum.Lock, taskNew.TaskNum.Value, (int)StatusChangeTypeEnum.AutomaticInbound);
+                    await _locationStatusChangeRecordRepository.AddDataAsync(result2.Item1);
+                    await _locationRepository.UpdateDataAsync(result2.Item2);
+                }
                 await _locationStatusChangeRecordRepository.AddDataAsync(result.Item1);
                 await _locationRepository.UpdateDataAsync(result.Item2);
                 BaseDal.AddData(taskNew);
@@ -649,7 +642,7 @@
     /// </summary>
     /// <param name="palletCode"></param>
     /// <returns></returns>
-    public async Task<WebResponseContent> OutBoundTaskAsync(string palletCode,string remark)
+    public async Task<WebResponseContent> OutBoundTaskAsync(string palletCode,string remark,int doubleTray)
     {
         WebResponseContent content = new WebResponseContent();
         try
@@ -676,7 +669,7 @@
                 return content.Error("璇ユ墭鐩樺簱瀛樺凡鍦ㄥ嚭搴撶紦瀛樺尯");
             }
 
-            Dt_Task taskNew = await RequestOutboundTaskAsync(new RequestTaskDto { PalletCode = palletCode, AreaId = 2, Position = stcok.LocationCode, TaskType = (int)TaskOutboundTypeEnum.Outbound });
+            Dt_Task taskNew = await RequestOutboundTaskAsync(new RequestTaskDto { PalletCode = palletCode, AreaId = 2, Position = stcok.LocationCode, TaskType = (int)TaskOutboundTypeEnum.Outbound, DoubleTray= doubleTray });
             List<Dt_InventoryRecord> records = new List<Dt_InventoryRecord>();
             stcok.StockInfoDetails.ForEach(x =>
             {
@@ -692,7 +685,7 @@
             });
 
             var taskDto = CreateListTaskDTO(taskNew);
-            var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound);
+            var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound, location);
             await _unitOfWorkManage.UseTranAsync(async () =>
             {
                 await BaseDal.AddDataAsync(taskNew);
@@ -709,6 +702,12 @@
         }
     }
 
+
+    /// <summary>
+    /// 鍏朵粬鍑哄簱
+    /// </summary>
+    /// <param name="details"></param>
+    /// <returns></returns>
 
     public async Task<WebResponseContent> OtherOutBoundTaskAsync(List<DtStockInfoDetail> details)
     {
@@ -761,7 +760,7 @@
             stock.StockInfoDetails = details;
 
             var taskDto = CreateListTaskDTO(taskNew);
-            var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound);
+            var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound, stock.LocationInfo);
             await _unitOfWorkManage.UseTranAsync(async () =>
             {
                 await BaseDal.AddDataAsync(taskNew);
@@ -844,7 +843,7 @@
             stock.StockInfoDetails = details;
 
             var taskDto = CreateListTaskDTO(taskNew);
-            var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound);
+            var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound, stock.LocationInfo);
             await _unitOfWorkManage.UseTranAsync(async () =>
             {
                 await BaseDal.AddDataAsync(taskNew);
@@ -861,13 +860,20 @@
         }
     }
 
-    public (List<DtLocationStatusChangeRecord>,List<DtLocationInfo>) GetlcoationState(Dt_Task task, StatusChangeTypeEnum StatusChangeTypeEnum)
+    public (List<DtLocationStatusChangeRecord>,List<DtLocationInfo>) GetlcoationState(Dt_Task task, StatusChangeTypeEnum StatusChangeTypeEnum, DtLocationInfo location)
     {
         List<DtLocationStatusChangeRecord> locationStatusChangeRecords = new List<DtLocationStatusChangeRecord>();
         List<DtLocationInfo> locations = new List<DtLocationInfo>();
         var result = UpdateLocationStatus(task.SourceAddress, LocationEnum.InStockDisable, task.TaskNum.Value, (int)StatusChangeTypeEnum);
         locationStatusChangeRecords.AddRange(result.Item1);
         locations.AddRange(result.Item2);
+
+        if(location.AreaId ==3|| location.AreaId == 7)
+        {
+            var result2 = UpdateLocationStatus(task.TargetAddress, LocationEnum.Lock, task.TaskNum.Value, (int)StatusChangeTypeEnum);
+            locationStatusChangeRecords.AddRange(result2.Item1);
+            locations.AddRange(result2.Item2);
+        }
 
         return (locationStatusChangeRecords,locations);
     }
@@ -915,6 +921,7 @@
             case 4:
             case 5:
             case 6:
+            case 7:
                 return OutboundAGVCacheArea(taskDto, StartAddress, area);
             default:
                 throw new Exception("璇烽�夋嫨姝g‘鐨勫尯鍩熶俊鎭�");
@@ -963,6 +970,74 @@
 
     }
     #endregion 璇锋眰鍑哄簱锛堝疄鐩�&绌虹洏锛�
+
+    #region 璇锋眰绉诲簱浠诲姟
+    public async Task<WebResponseContent> RequestRelocationTaskAsync(string SourceAddress,string TargetAddress)
+    {
+        WebResponseContent content = new WebResponseContent();
+        try
+        {
+            var startLocation = await _locationRepository.QueryFirstAsync(x => x.LocationCode == SourceAddress);
+            var endLocation = await _locationRepository.QueryFirstAsync(x => x.LocationCode == TargetAddress);
+
+            if (!startLocation.IsNotEmptyOrNull() || !endLocation.IsNotEmptyOrNull())
+            {
+                return content.Error("搴撲綅淇℃伅涓嶅瓨鍦�");
+            }
+            if (endLocation.LocationStatus != (int)LocationEnum.Free)
+            {
+                return content.Error($"缁堢偣搴撲綅{endLocation.LocationCode}鏈浜庣┖闂茬姸鎬侊紝璇蜂汉宸ョ‘璁ゅ簱浣嶇姸鎬�");
+            }
+            if ((startLocation.AreaId == 1 || endLocation.AreaId == 1) && startLocation.AreaId != endLocation.AreaId)
+            {
+                return content.Error("绉诲簱璧风偣搴撲綅涓庣粓鐐瑰簱浣嶄笉鍦ㄥ悓涓�鍖哄煙");
+            }
+            if (startLocation.Floor != endLocation.Floor)
+            {
+                return content.Error("绉诲簱璧风偣搴撲綅涓庣粓鐐瑰簱浣嶄笉鍦ㄥ悓涓�妤煎眰");
+            }
+
+            var stock = await _stockInfoRepository.QueryFirstAsync(x => x.LocationCode == startLocation.LocationCode);
+            var taskNew = new Dt_Task
+            {
+                Grade = startLocation.Floor == "1F" ? 10 : 1,
+                Roadway = endLocation.RoadwayNo,
+                TargetAddress = endLocation.LocationCode,
+                Dispatchertime = DateTime.Now,
+                MaterialNo = "",
+                NextAddress = endLocation.LocationCode,
+                OrderNo = null,
+                PalletCode = stock == null ? "M" + DateTime.Now.ToString("MMddHHmmss") + "-" + new Random().Next(100, 1000) : stock.PalletCode,
+                SourceAddress = startLocation.LocationCode,
+                CurrentAddress = startLocation.LocationCode,
+                TaskState = startLocation.AreaId == 1 ? (int)TaskRelocationStatusEnum.RelocationNew : (int)TaskRelocationStatusEnum.RelocationNewAGV,
+                TaskType = (int)TaskRelocationTypeEnum.Relocation,
+                TaskNum = BaseDal.GetTaskNo().Result,
+                CreateDate = DateTime.Now,
+                TaskId = 0,
+                AGVTaskNum = GenerateUniqueId(),
+                Floor = startLocation.Floor,
+            };
+
+
+            var result = AddTaskAsync(new List<Dt_Task>() { taskNew });
+            await _unitOfWorkManage.UseTranAsync(async () =>
+            {
+                await _locationStatusChangeRecordRepository.AddDataAsync(result.Item2);
+                await _locationRepository.UpdateDataAsync(result.Item1);
+                await BaseDal.AddDataAsync(taskNew);
+            });
+            await SendWCSTask(CreateListTaskDTO(taskNew));
+            return content.OK("鎴愬姛");
+        }
+        catch (Exception ex)
+        {
+            return content.Error(ex.Message);
+        }
+    }
+
+
+    #endregion
 
     #region 璇锋眰璺ㄦゼ灞�2浠诲姟
     /// <summary>
@@ -1058,6 +1133,7 @@
             Remark = StartAddress.AreaId.ToString(),
             AGVTaskNum = GenerateUniqueId(),
             Floor = StartAddress.Floor,
+            DoubleTray = taskDto.DoubleTray,
         };
 
     }
@@ -1204,6 +1280,7 @@
             switch (location.AreaId)
             {
                 case 2:
+                case 7:
                     locationInfos = _locationRepository.QueryData(x => x.Row == location.Row && x.Column > location.Column && x.Remark == location.Remark && x.AreaId == location.AreaId);
                     break;
                 case 5:
@@ -1258,7 +1335,7 @@
                             PalletCode = stock == null ? "M" + DateTime.Now.ToString("MMddHHmmss") + "-" + new Random().Next(100, 1000) : stock.PalletCode,
                             SourceAddress = item.LocationCode,
                             CurrentAddress = item.LocationCode,
-                            TaskState = (int)TaskAGVCarryStatusEnum.CarryNew,
+                            TaskState = (int)TaskRelocationStatusEnum.RelocationNewAGV,
                             TaskType = (int)TaskRelocationTypeEnum.Relocation,
                             TaskNum = BaseDal.GetTaskNo().Result,
                             CreateDate = DateTime.Now,
@@ -1339,6 +1416,7 @@
                 case 4:
                 case 5:
                 case 6:
+                case 7:
                     locationInfo = await GetAGVEmptyCacheLocation(areaInfo.AreaID, location);
                     break;
                 default:
@@ -1404,37 +1482,6 @@
         }
         return content;
     }
-    #endregion
-
-    #region 鑾峰彇浠诲姟鏁版嵁
-    public async Task<WebResponseContent> GetTaskData()
-    {
-        WebResponseContent content = new WebResponseContent();
-        try
-        {
-            var task = await BaseDal.QueryDataAsync(x => true);
-            var taskData = new List<TaskData>
-            {
-                new TaskData { Status = "宸插彇娑�", Count = task.Count+50 },
-                new TaskData { Status = "宸插畬鎴�", Count = 735 }
-            };
-
-            // 鏋勫缓绗﹀悎瑕佹眰鐨勬牸寮�
-            var result = taskData.Select(item => new
-            {
-                value = item.Count,
-                name = item.Status,
-                itemStyle = new { color = item.Status == "宸插彇娑�" ? "#FF0000" : "#00FF00" }
-            }).ToList();
-
-            return content.OK(data: result);
-        }
-        catch (Exception ex)
-        {
-            return content.Error(ex.Message);
-        }
-    }
-
     #endregion
 
     #endregion 澶栭儴鎺ュ彛鏂规硶
@@ -1975,6 +2022,32 @@
         return (changeRecordDto, locations);
     }
 
+    public (DtLocationStatusChangeRecord, DtLocationInfo) UpdateEndLocationStatus(string locationCode, LocationEnum locationStatus, int taskNum, StatusChangeTypeEnum StatusChangeType)
+    {
+        var location = _locationRepository.QueryFirst(x => x.LocationCode == locationCode);
+
+        if (location != null && (location.AreaId == 3 || location.AreaId == 7))
+        {
+            int Beforelocation = location.LocationStatus;
+
+            location.LocationStatus = (int)locationStatus;
+
+            DtLocationStatusChangeRecord dtLocationStatusChangeRecord = new DtLocationStatusChangeRecord()
+            {
+                ChangeType = (int)StatusChangeType,
+                LocationCode = locationCode,
+                LocationId = location.Id,
+                Creater = "System",
+                TaskNum = taskNum,
+                AfterStatus = location.LocationStatus,
+                BeforeStatus = Beforelocation,
+            };
+
+            return (dtLocationStatusChangeRecord, location);
+        }
+        return (null, null);
+    }
+
     public (DtLocationStatusChangeRecord, DtLocationInfo) UpdateLocationStatus(string locationCode, LocationEnum locationStatus, int taskNum, StatusChangeTypeEnum StatusChangeType)
     {
         var location = _locationRepository.QueryFirst(x => x.LocationCode == locationCode);
@@ -2011,7 +2084,7 @@
                 }
             }
         }
-        else if (location.AreaId == 2)
+        else if (location.AreaId == 2 || location.AreaId == 7)
         {
             var locationLateral = _locationRepository.QueryData(x => x.Row == location.Row && x.Column > location.Column && x.Remark == location.Remark);
             if (locationLateral.Count > 0)
@@ -2049,6 +2122,7 @@
             TaskType = task.TaskType,
             Floor =task.Floor,
             AGVTaskNum = task.AGVTaskNum,
+            DoubleTray = task.DoubleTray,
         } };
     }
 
@@ -2068,6 +2142,7 @@
             AGVTaskNum = task.AGVTaskNum,
             Remark = task.Remark,
             Floor = task.Floor,
+            DoubleTray = task.DoubleTray,
         };
     }
     private List<WMSTaskDTO> CreateTaskDTO(List<Dt_Task> task)
@@ -2089,6 +2164,7 @@
                 AGVTaskNum = item.AGVTaskNum,
                 Remark = item.Remark,
                 Floor = item.Floor,
+                DoubleTray = item.DoubleTray,
             });
         }
 
@@ -2385,6 +2461,7 @@
         switch (AreaId)
         {
             case 2:
+            case 7:
                 return await FromShallowToDeep(AreaId, loc);
             case 3:
                 return await AGVLIKU(AreaId);
@@ -2516,7 +2593,7 @@
             }
         }
 
-        else if (location.AreaId == 2)
+        else if (location.AreaId == 2 || location.AreaId == 7)
         {
             var locationLateral = _locationRepository.QueryData(x => x.Row == location.Row && x.Column > location.Column && x.Remark == location.Remark);
 

--
Gitblit v1.9.3