From 801ddd3be4d6bf8553cac870435bb5092eca6b60 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 06 一月 2025 18:50:38 +0800
Subject: [PATCH] 更新前端代码

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 54 insertions(+), 1 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
index ec9afa0..f8fa0af 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
@@ -13,12 +13,65 @@
 using WIDESEA_Common.TaskEnum;
 using WIDESEA_Common.OrderEnum;
 using WIDESEA_Common.StockEnum;
+using WIDESEA_Common.CommonEnum;
+using WIDESEA_Common.LocationEnum;
 
 namespace WIDESEA_TaskInfoService
 {
     public partial class TaskService
     {
-
+        /// <summary>
+        /// 閫夋嫨搴撳瓨鐢熸垚鍑哄簱浠诲姟
+        /// </summary>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        public WebResponseContent Outbound(int id)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x=>x.Id==id).Includes(x=>x.Details).First();
+                if (stockInfo == null)
+                {
+                    return content.Error($"鏈壘鍒板簱瀛�");
+                }
+                Dt_LocationInfo locationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
+                if (locationInfo!=null && (locationInfo.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && locationInfo.LocationStatus==LocationStatusEnum.InStock.ObjToInt() && stockInfo.StockStatus==StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt())
+                {
+                    List<Dt_Task> tasks = GetTasks(new List<Dt_StockInfo>() { stockInfo });
+                    if (tasks == null || tasks.Count <= 0)
+                    {
+                        return content.Error($"鐢熸垚浠诲姟澶辫触");
+                    }
+                    //澶勭悊搴撳瓨鏁版嵁
+                    stockInfo.StockStatus = (int)StockStatusEmun.鍑哄簱閿佸畾;
+                    LocationStatusEnum locationStatus = (LocationStatusEnum)locationInfo.LocationStatus;
+                    locationInfo.LocationStatus = (int)LocationStatusEnum.Lock;
+                    //鍒ゆ柇鏄惁鏈夊嚭搴撳崟淇℃伅
+                    _unitOfWorkManage.BeginTran();
+                    //鏇存柊搴撳瓨鐘舵��
+                    _stockRepository.StockInfoRepository.UpdateData(stockInfo);
+                    //鏇存柊璐т綅鐘舵��
+                    _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)stockInfo.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId);
+                    //鏂板缓浠诲姟
+                    BaseDal.AddData(tasks);
+                    //鍔犲叆璐т綅鍙樺姩璁板綍
+                    _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, locationStatus, LocationStatusEnum.Lock, LocationChangeType.OutboundAssignLocation, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", tasks[0].TaskNum);
+                    _unitOfWorkManage.CommitTran();
+                    PushTasksToWCS(tasks);
+                    content.OK();
+                }
+                else
+                {
+                    content.Error($"璐т綅鍑哄簱鏉′欢涓嶆弧瓒�");
+                }
+            }
+            catch (Exception ex)
+            {
+                content.Error(ex.Message);
+            }
+            return content;
+        }
         /// <summary>
         /// 搴撳瓨鏁版嵁杞嚭搴撲换鍔�
         /// </summary>

--
Gitblit v1.9.3