From a770206c91e495b802b3e9371e06834586ad7715 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 30 十月 2025 20:17:30 +0800
Subject: [PATCH] 1
---
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs | 68 ++++++++++++++++++---------------
1 files changed, 37 insertions(+), 31 deletions(-)
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs"
index 7130732..6611878 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/InventoryServices.cs"
@@ -7,6 +7,7 @@
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
+using WIDESEA_Common.OrderEnum;
using WIDESEA_Common.StockEnum;
using WIDESEA_Common.TaskEnum;
using WIDESEA_Common.WareHouseEnum;
@@ -53,7 +54,7 @@
if (response.resultCode != "0")
{
- SendErrorToUpstream(8, "", response.resultMsg ?? "涓婃父鎺ュ彛杩斿洖澶辫触", "");
+ //SendErrorToUpstream(8, "", response.resultMsg ?? "涓婃父鎺ュ彛杩斿洖澶辫触", "");
return responseContent.Error(response.resultMsg ?? "涓婃父鎺ュ彛杩斿洖澶辫触");
}
@@ -81,7 +82,7 @@
catch (Exception ex)
{
Db.Ado.RollbackTran();
- SendErrorToUpstream(8, "", ex.Message, "");
+ //SendErrorToUpstream(8, "", ex.Message, "");
return responseContent.Error("鍚屾澶辫触: " + ex.Message);
}
}
@@ -228,42 +229,45 @@
ProductionDate = detail.finishDate.ToString("yyyy-MM-dd"),
ShelfLife = 0,
ValidityPeriod = cabinOrderDetail.Exp_date,
- Remark = "WCS鍥炰紶鍒涘缓"
+ Remark = "鏅鸿兘绔嬪簱"
};
BaseDal.Db.Insertable(inventoryInfo).ExecuteCommand();
}
#endregion
- #region 鍒涘缓搴撳瓨鎵规淇℃伅
- // 6锔忊儯 鏌ヨ搴撳瓨鎵规淇℃伅
- var inventory_Batch = BaseDal.Db.Queryable<Dt_Inventory_Batch>()
- .First(x => x.MaterielCode == inventoryInfo.MaterielCode && x.BatchNo == inventoryInfo.BatchNo);
+ #region 鍒涘缓搴撳瓨鎵规淇℃伅 鍙湁涓嶆槸璋冩嫧鍏ュ簱鍗曪紙115锛夋墠瀵规壒娆′俊鎭繘琛屼慨鏀�
+ if (cabinOrder.Order_type != InOrderTypeEnum.Allocat.ObjToInt().ToString())
+ {
+ // 6锔忊儯 鏌ヨ搴撳瓨鎵规淇℃伅
+ var inventory_Batch = BaseDal.Db.Queryable<Dt_Inventory_Batch>()
+ .First(x => x.MaterielCode == inventoryInfo.MaterielCode && x.BatchNo == inventoryInfo.BatchNo);
- if (inventory_Batch != null)
- {
- inventory_Batch.StockQuantity += orderQty;
- inventory_Batch.AvailableQuantity += orderQty;
- BaseDal.Db.Updateable(inventory_Batch).ExecuteCommand();
- }
- else
- {
- inventory_Batch = new Dt_Inventory_Batch
+ if (inventory_Batch != null)
{
- MaterielCode = inventoryInfo.MaterielCode,
- MaterielName = inventoryInfo.MaterielName,
- MaterielSpec = inventoryInfo.MaterielSpec,
- BatchNo = inventoryInfo.BatchNo,
- StockQuantity = inventoryInfo.StockQuantity,
- OutboundQuantity = inventoryInfo.OutboundQuantity,
- AvailableQuantity = inventoryInfo.AvailableQuantity,
- SupplyQuantity = inventoryInfo.SupplyQuantity,
- ERPStockQuantity = 0,
- Status = false,
- ProductionDate = detail.finishDate.ToString("yyyy-MM-dd"),
- ValidityPeriod = inventoryInfo.ValidityPeriod,
- Remark = "鑷姩鍒涘缓"
- };
- BaseDal.Db.Insertable(inventory_Batch).ExecuteCommand();
+ inventory_Batch.StockQuantity += orderQty;
+ inventory_Batch.AvailableQuantity += orderQty;
+ BaseDal.Db.Updateable(inventory_Batch).ExecuteCommand();
+ }
+ else
+ {
+ inventory_Batch = new Dt_Inventory_Batch
+ {
+ MaterielCode = inventoryInfo.MaterielCode,
+ MaterielName = inventoryInfo.MaterielName,
+ MaterielSpec = inventoryInfo.MaterielSpec,
+ BatchNo = inventoryInfo.BatchNo,
+ StockQuantity = inventoryInfo.StockQuantity,
+ OutboundQuantity = inventoryInfo.OutboundQuantity,
+ AvailableQuantity = inventoryInfo.AvailableQuantity,
+ SupplyQuantity = inventoryInfo.SupplyQuantity,
+ ERPStockQuantity = 0,
+ Status = false,
+ ProductionDate = detail.finishDate.ToString("yyyy-MM-dd"),
+ ValidityPeriod = inventoryInfo.ValidityPeriod.ObjToDate(),
+ Remark = "鑷姩鍒涘缓"
+ };
+ BaseDal.Db.Insertable(inventory_Batch).ExecuteCommand();
+ }
}
#endregion
@@ -288,6 +292,8 @@
SupplyQuantity = 0,
Remark = "鍏ュ簱"
};
+ //杩欓噷杩欓噷鐨勫叆搴撹皟鎷ㄥ崟鐘舵�佹槸115锛屽氨灏嗚皟鎷ㄤ换鍔$姸鎬佹敼涓�7
+ if (cabinOrder.Order_type == InOrderTypeEnum.Allocat.ObjToInt().ToString()) supplyTask_Hty.TaskType = TaskTypeEnum.AllocatIn.ObjToInt();
BaseDal.Db.Insertable(supplyTask_Hty).ExecuteCommand();
#endregion
}
--
Gitblit v1.9.3