From 8344f9ceac01f8dd87c22efecf2b20bdcb6b0a56 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期五, 14 十一月 2025 23:27:49 +0800
Subject: [PATCH] 优化盘点以及人工入库进行校正
---
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs"
index c0433d5..5e3d40a 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs"
@@ -247,6 +247,7 @@
Dt_Inventory_Batch? inventory_Batch = inventory_Batchs.Where(x => x.MaterielCode == item.Goods_no && x.BatchNo == item.Batch_num).FirstOrDefault();
if (inventory_Batch == null) throw new Exception($"鏈壘鍒板嚭搴撳崟鍙枫�恵entityOrder.Out_no}銆戜腑鐗╂枡缂栧彿銆恵item.Goods_no}銆戠墿鏂欐壒娆°�恵item.Batch_num}銆戠殑搴撳瓨鎵规淇℃伅");
if (inventory_Batch.AvailableQuantity < item.Order_qty) throw new Exception($"鍑哄簱鍗曞彿銆恵entityOrder.Out_no}銆戜腑鐗╂枡缂栧彿銆恵item.Goods_no}銆戠墿鏂欐壒娆°�恵item.Batch_num}銆戠殑搴撳瓨鎵规淇℃伅鍙敤鏁伴噺涓嶈冻");
+ if (inventory_Batch.SupplyQuantity > 0) throw new Exception($"鍑哄簱鍗曞彿銆恵entityOrder.Out_no}銆戜腑鐗╂枡缂栧彿銆恵item.Goods_no}銆戠墿鏂欐壒娆°�恵item.Batch_num}銆戠殑搴撳瓨鎵规淇℃伅瀛樺湪鏈畬鎴愮殑鐩樼偣浠诲姟锛屾棤娉曞垱寤哄嚭搴撳崟");
inventory_Batch.AvailableQuantity -= item.Order_qty;
inventory_Batch.OutboundQuantity += item.Order_qty;
List<Dt_InventoryInfo> dt_InventoryInfos = InventoryInfos.Where(x => x.MaterielCode == item.Goods_no && x.BatchNo == item.Batch_num).ToList();
@@ -324,6 +325,7 @@
#endregion
else
{
+
string WareCodeDJ = WarehouseEnum.澶т欢搴�.ObjToInt().ToString("000");
string WareCodeLK = WarehouseEnum.绔嬪簱.ObjToInt().ToString("000");
#region 鍒涘缓澶т欢搴撱�佺珛搴撳嚭搴撳ご琛�
@@ -363,6 +365,7 @@
Dt_Inventory_Batch? inventory_Batch = inventory_Batchs.Where(x => x.MaterielCode == detail.goods_no && x.BatchNo == detail.batch_num).FirstOrDefault();
if (inventory_Batch == null) throw new Exception($"鏈壘鍒板嚭搴撳崟鍙枫�恵outorder.order_no}銆戜腑鐗╂枡缂栧彿銆恵detail.goods_no}銆戠墿鏂欐壒娆°�恵detail.batch_num}銆戠殑搴撳瓨鎵规淇℃伅");
if (inventory_Batch.AvailableQuantity < detail.order_qty) throw new Exception($"鍑哄簱鍗曞彿銆恵outorder.order_no}銆戜腑鐗╂枡缂栧彿銆恵detail.goods_no}銆戠墿鏂欐壒娆°�恵detail.batch_num}銆戠殑搴撳瓨鎵规淇℃伅鍙敤鏁伴噺涓嶈冻");
+ if(inventory_Batch.SupplyQuantity>0) throw new Exception($"鍑哄簱鍗曞彿銆恵outorder.order_no}銆戜腑鐗╂枡缂栧彿銆恵detail.goods_no}銆戠墿鏂欐壒娆°�恵detail.batch_num}銆戠殑搴撳瓨鎵规淇℃伅瀛樺湪鏈畬鎴愮殑鐩樼偣浠诲姟锛屾棤娉曞垱寤哄嚭搴撳崟");
inventory_Batch.AvailableQuantity -= detail.order_qty;
inventory_Batch.OutboundQuantity += detail.order_qty;
List<Dt_InventoryInfo> dt_InventoryInfos = InventoryInfos.Where(x => x.MaterielCode == inventory_Batch.MaterielCode && x.BatchNo == inventory_Batch.BatchNo).ToList();
--
Gitblit v1.9.3