From 696edbff3c8812e4b820f624d66a02ae6ddb1a06 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期四, 16 四月 2026 13:40:18 +0800
Subject: [PATCH] Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs"
index e34d7b7..84eba5c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs"
@@ -1,6 +1,8 @@
 锘縰sing LogLibrary.Log;
 using MailKit;
+using MailKit.Net.Smtp;
 using MailKit.Search;
+using Microsoft.AspNetCore.Http;
 using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
 using Org.BouncyCastle.Asn1.X509;
 using Org.BouncyCastle.Bcpg;
@@ -80,7 +82,8 @@
             _allocateOrderRepository = allocateOrderRepository;
         }
 
-        public async Task<WebResponseContent> GroupPallet(GroupPalletDto palletDto)
+        public async Task<WebResponseContent> 
+            GroupPallet(GroupPalletDto palletDto)
         {
             WebResponseContent content = new WebResponseContent();
             try
@@ -152,7 +155,7 @@
 
                 if(inboundOrder.BusinessType != "11")
                 {
-                    var warehouseType = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode).Select(x => x.WarehouseCode).First();
+                    var warehouseType = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => (x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode)&& x.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()).Select(x => x.WarehouseCode).First();
 
                     if (string.IsNullOrEmpty(warehouseType))
                     {
@@ -180,6 +183,20 @@
                     stockInfo = new Dt_StockInfo() { PalletType = (int)PalletTypeEnum.None, LocationType = Convert.ToInt32(palletDto.locationType) };
                     stockInfo.Details = new List<Dt_StockInfoDetail>();
                 }
+                //else
+                //{
+                //      var allowStatus = new[]
+                //  {
+                //      (int)StockStatusEmun.缁勭洏鏆傚瓨,
+                //      (int)StockStatusEmun.鏅轰粨鍏ユ櫤浠撶粍鐩樻殏瀛�,
+                //      (int)StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨
+                //  };
+
+                //    if (!allowStatus.Contains(stockInfo.StockStatus))
+                //    {
+                //        return content.Error($"璇ユ墭鐩榹stockInfo.PalletCode}鐘舵�佷笉鍏佽缁勭洏");
+                //    }
+                //}
 
                 if (inboundOrder.BusinessType != MESDocumentType.PurchaseInbound.ToString() && stockInfo != null && stockInfo.Details.Count > 0 && stockInfo.Details.FirstOrDefault()?.WarehouseCode != palletDto.WarehouseType)
                 {
@@ -194,6 +211,10 @@
                 if (inboundOrder.BusinessType == "11" && inboundOrder.IsTestMaterials == 1 && palletDto.WarehouseType != "1076" && palletDto.WarehouseType != "5057")
                 {
                     return content.Error($"璇ュ崟鎹负璇曚骇鐗╂枡锛岄渶瑕佸叆搴撳埌璇曚骇浠擄紝璇烽噸鏂版牴鎹巶鍖洪�夋嫨璇曚骇浠撳簱杩涜缁勭洏鍏ュ簱");
+                }
+                if (inboundOrder.IsTestMaterials == 0 && (palletDto.WarehouseType == "1076" || palletDto.WarehouseType == "5057"))
+                {
+                    return content.Error($"璇ュ崟鎹负闈炶瘯浜х墿鏂欙紝涓嶈兘鍏ュ埌璇曚骇浠擄紝璇烽噸鏂版牴鎹粨搴撹繘琛岀粍鐩樺叆搴�");
                 }
                 if (!_locationInfoService.QueryLocationCount(Convert.ToInt32(palletDto.locationType)))
                 {
@@ -595,7 +616,7 @@
 
                     var response = responseModel(inboundOrder, 3, null, allocatefeedmodel);
 
-                    if (response != null && response.IsSuccess)
+                    if (response != null && response.IsSuccess && response.Data.Code == "200")
                     {
                         _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 })
                         .Where(it => it.OrderId == inboundOrder.Id && inbounddetailID.Contains(it.Id)).ExecuteCommand();
@@ -689,7 +710,7 @@
                     }
                     var response = responseModel(inboundOrder, 3, feedmodel);
 
-                    if (response != null && response.IsSuccess)
+                    if (response != null && response.IsSuccess && response.Data.Code == "200")
                     {
                         _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 })
                         .Where(it => inbounddetailID.Contains(it.Id)).ExecuteCommand();

--
Gitblit v1.9.3