From 225d11e2ddaa55d1d482201cb4d89c9486cdba69 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期五, 20 六月 2025 12:27:52 +0800
Subject: [PATCH] 更新代码

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs |   65 ++++++++++++++++++++++++++++++--
 1 files changed, 61 insertions(+), 4 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
index 4759255..e3935d1 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
@@ -16,6 +16,7 @@
 using WIDESEA_Common.TaskEnum;
 using WIDESEA_Common.WareHouseEnum;
 using WIDESEA_Core;
+using WIDESEA_Core.Enums;
 using WIDESEA_Core.Helper;
 using WIDESEA_DTO;
 using WIDESEA_DTO.MES;
@@ -60,7 +61,7 @@
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒扮粍鐩樹俊鎭�");
                 }
-                if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎷i�夊畬鎴�.ObjToInt())
+                if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎷i�夊畬鎴�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.閫佹瀹屾垚.ObjToInt())
                 {
                     return WebResponseContent.Instance.Error($"璇ユ墭鐩樼姸鎬佷笉姝g‘,涓嶅彲鐢宠鍏ュ簱");
                 }
@@ -134,6 +135,11 @@
                         stockInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt();
                         newTask.TaskType = TaskTypeEnum.InPick.ObjToInt();
                     }
+                    else if (stockInfo.StockStatus == StockStatusEmun.閫佹瀹屾垚.ObjToInt())
+                    {
+                        stockInfo.StockStatus = StockStatusEmun.鎵嬪姩缁勭洏鍏ュ簱纭.ObjToInt();
+                        newTask.TaskType = TaskTypeEnum.InQuality.ObjToInt();
+                    }
                     else
                     {
                         stockInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt();
@@ -162,7 +168,52 @@
                 return WebResponseContent.Instance.Error(ex.Message);
             }
         }
-
+        /// <summary>
+        /// 鏌ヨ璐ㄦ鏁伴噺
+        /// </summary>
+        /// <param name="palletCode">鎵樼洏鍙�</param>
+        /// <returns></returns>
+        public WebResponseContent InQualityConfirm(string palletCode)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(palletCode);
+                if (stockInfo == null)
+                {
+                    return content.Error($"鏈壘鍒拌鎵樼洏搴撳瓨淇℃伅");
+                }
+                if (stockInfo.Details.Count<=0)
+                {
+                    return content.Error($"璇ユ墭鐩樺簱瀛樻槑缁嗕负绌�");
+                }
+                if (stockInfo.StockStatus != StockStatusEmun.閫佹瀹屾垚.ObjToInt())
+                {
+                    return content.Error($"璇ユ墭鐩樿繕鏈�佹鍑哄簱瀹屾垚");
+                }
+                Dt_OutStockLockInfo? outStockLockInfo = _outboundRepository.OutboundStockLockInfoRepository.QueryData(x => x.PalletCode == palletCode && x.Status == OutLockStockStatusEnum.鍑哄簱瀹屾垚.ObjToInt() && x.OrderType== OutOrderTypeEnum.Quality.ObjToInt()).OrderByDescending(x=>x.Id).FirstOrDefault();
+                if (outStockLockInfo != null)
+                {
+                    //鑾峰彇瀵瑰簲妫�楠屽崟
+                    Dt_CheckOrder checkOrder = _checkOrderRepository.QueryFirst(x=>x.ReceiveDetailRowNo== outStockLockInfo.Id && x.CheckOrderStatus==CheckOrderStatusEnum.Checked.ObjToInt());
+                    if (checkOrder == null)
+                    {
+                        return content.Error($"璇ユ墭鐩橀�佹淇℃伅鏈");
+                    }
+                    content.OK("鎴愬姛", data:new { stockInfo.Details.FirstOrDefault()?.MaterielCode,checkOrder.ReceivedQuantity,checkOrder.ScrappedQuantity,checkOrder.DefectedQuantity,checkOrder.QualifiedQuantity,stockQuantity= stockInfo.Details.Sum(x=>x.StockQuantity) }) ;
+                }
+                else
+                {
+                    content.Error("璇ユ墭鐩橀�佹鍑哄簱璇︽儏涓嶅瓨鍦�");
+                }
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                content.Error(ex.Message);
+            }
+            return content;
+        }
         /// <summary>
         /// 鍏ョ┖绠�
         /// </summary>
@@ -374,7 +425,7 @@
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒扮粍鐩樹俊鎭�");
                 }
-                if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎷i�夊畬鎴�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.閫�搴�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.MES閫�搴�.ObjToInt())
+                if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎷i�夊畬鎴�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.閫�搴�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.MES閫�搴�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.閫佹瀹屾垚.ObjToInt())
                 {
                     return WebResponseContent.Instance.Error($"璇ユ墭鐩樼姸鎬佷笉姝g‘,涓嶅彲鐢宠鍏ュ簱");
                 }
@@ -434,6 +485,11 @@
                 else if (stockInfo.StockStatus == StockStatusEmun.鎷i�夊畬鎴�.ObjToInt())
                 {
                     newTask.TaskType = TaskTypeEnum.InPick.ObjToInt();
+                }
+                else if (stockInfo.StockStatus == StockStatusEmun.閫佹瀹屾垚.ObjToInt())
+                {
+                    stockInfo.StockStatus = StockStatusEmun.鎵嬪姩缁勭洏鍏ュ簱纭.ObjToInt();
+                    newTask.TaskType = TaskTypeEnum.InQuality.ObjToInt();
                 }
                 else
                 {
@@ -523,8 +579,9 @@
                 }
                 else if (stockInfo.StockStatus == StockStatusEmun.MES绌烘墭閫�搴�.ObjToInt())
                 {
+                    Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x=>x.WarehouseId==stockInfo.WarehouseId && x.PalletType==stockInfo.PalletType);
                     //todo 灏忔墭鐩樻殏鏃舵湭鍚敤
-                    if (stockInfo.PalletType == PalletTypeEnum.MediumPallet.ObjToInt())
+                    if (palletTypeInfo.LocaitonCount==2)
                     {
                         newTask.TaskType = TaskTypeEnum.MesPalletLargeReturn.ObjToInt();
                     }

--
Gitblit v1.9.3