From 97485ed8543cc34a21c7e42fdbd1be3d8c03392c Mon Sep 17 00:00:00 2001
From: zhangchengsong <2244205553@qq.com>
Date: 星期二, 20 一月 2026 11:40:52 +0800
Subject: [PATCH] '更新重新下发任务的逻辑'
---
项目代码/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs"
index d7168ca..eb116ca 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs"
@@ -76,10 +76,10 @@
List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterialNo, item.Width, outBSTOrders.FirstOrDefault().WarehouseId).Where(x=>!outStocks.Select(x=>x.PalletCode).Contains(x.PalletCode)).ToList();
if (!stockInfos.Any())
{
- throw new Exception($"鏈壘鍒板彲鍒嗛厤搴撳瓨");
+ continue;
}
//鍒嗛厤瀹為檯搴撳瓨
- List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(stockInfos, needQuantity).ToList();
+ List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutOldStocks(stockInfos, needQuantity).ToList();
//娣诲姞搴撳瓨鍒嗛厤
outStocks.AddRange(autoAssignStocks);
//鑾峰彇鎵�鏈夎鐗╂枡鍗曟嵁
@@ -100,6 +100,11 @@
decimal orderDetailNeedQuantity = details[i].XqLen - detailAssignQuantity;
+ if (autoAssignStocks.Count==0)
+ {
+ break;
+ }
+
decimal useStockLength = autoAssignStocks[0].StockLength- autoAssignStocks[0].StockOutLength;
Dt_OutSGOrder? sGOrder = outBSTOrders.FirstOrDefault(x => x.Id == details[i].OutSGOrderId);
if (orderDetailNeedQuantity > useStockLength)
--
Gitblit v1.9.3