From 9a886d711d8b21adc335fdf8c39350584c7ba6fd Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 14 十月 2025 02:12:14 +0800
Subject: [PATCH] 更新代码,取消MES出库单号同步标识,平库转立库功能,寄售周期判断取消,精品标识等
---
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs | 29 ++++++++++++++++++++++-------
1 files changed, 22 insertions(+), 7 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
index fc6cb0c..43506f3 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
@@ -238,11 +238,19 @@
while (needQuantity > 0)
{
Dt_StockInfo stockInfo = stockInfos[index];
- float useableStockQuantity = stockInfo.Details.Where(x => x.MaterielCode == materielCode).Sum(x => x.StockQuantity - x.OutboundQuantity);
- if (useableStockQuantity < needQuantity && useableStockQuantity>0)
+ // 璁$畻鍙敤搴撳瓨鏃惰浆鎹负decimal
+ decimal useableStockQuantity = stockInfo.Details
+ .Where(x => x.MaterielCode == materielCode)
+ .Sum(x => (decimal)x.StockQuantity - (decimal)x.OutboundQuantity);
+
+ // 灏唍eedQuantity杞崲涓篸ecimal杩涜姣旇緝
+ if (useableStockQuantity < (decimal)needQuantity && useableStockQuantity > 0)
{
- stockInfo.Details.ForEach(x => x.OutboundQuantity = x.StockQuantity);
- needQuantity -= useableStockQuantity;
+ stockInfo.Details.ForEach(x =>
+ x.OutboundQuantity = x.StockQuantity);
+
+ // 浣跨敤decimal杩涜璁$畻鍚庡啀杞洖float
+ needQuantity = (float)((decimal)needQuantity - useableStockQuantity);
}
else
{
@@ -250,14 +258,20 @@
{
if (x.StockQuantity > x.OutboundQuantity && x.MaterielCode == materielCode)
{
- if (x.StockQuantity - x.OutboundQuantity >= needQuantity)
+ // 灏嗙浉鍏冲�艰浆鎹负decimal杩涜绮剧‘璁$畻
+ decimal currentStock = (decimal)x.StockQuantity;
+ decimal currentOutbound = (decimal)x.OutboundQuantity;
+ decimal currentNeed = (decimal)needQuantity;
+ decimal available = currentStock - currentOutbound;
+
+ if (available >= currentNeed)
{
- x.OutboundQuantity += needQuantity;
+ x.OutboundQuantity = (float)(currentOutbound + currentNeed);
needQuantity = 0;
}
else
{
- needQuantity -= (x.StockQuantity - x.OutboundQuantity);
+ needQuantity = (float)(currentNeed - available);
x.OutboundQuantity = x.StockQuantity;
}
}
@@ -266,6 +280,7 @@
outStocks.Add(stockInfo);
index++;
}
+
}
else
{
--
Gitblit v1.9.3