From a9a3f943efb083de8ed88b293897886b3ef612a2 Mon Sep 17 00:00:00 2001
From: helongyang <647556386@qq.com>
Date: 星期一, 11 八月 2025 17:37:09 +0800
Subject: [PATCH] 功能增添优化
---
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs"
index 2f7bfe9..42aba4b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs"
@@ -60,19 +60,19 @@
float originalNeedQuantity = mesOutboundOrder.OrderQuantity;
float needQuantity = originalNeedQuantity;
-
+ //鑾峰彇搴撳瓨
List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(mesOutboundOrder.MaterialCode, "", mesOutboundOrder.WarehouseId);
if (!stockInfos.Any())
{
throw new Exception($"鏈壘鍒板彲鍒嗛厤搴撳瓨");
}
List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(stockInfos, mesOutboundOrder.MaterialCode, needQuantity, out float residueQuantity);
- mesOutboundOrder.LockQuantity += needQuantity - residueQuantity;
+ if (residueQuantity>0)
+ {
+ throw new Exception($"搴撳瓨涓嶈冻");
+ }
autoAssignStocks.OrderBy(x => x.Details.FirstOrDefault()?.StockQuantity).ToList();
outStocks.AddRange(autoAssignStocks);
- float assignQuantity = needQuantity - residueQuantity;
-
- float orderQuantity = mesOutboundOrder.OrderQuantity;
for (int j = 0; j < autoAssignStocks.Count; j++)
{
float detailAssignQuantity = outStockLockInfos.Where(x => x.MaterielCode == mesOutboundOrder.MaterialCode).Sum(x => x.AssignQuantity);//鍑哄簱璁㈠崟鏄庣粏宸插垎閰嶆暟閲�
--
Gitblit v1.9.3