From 101a25491c535c5fd4173e7f002aea57986512f6 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 24 十月 2025 23:16:05 +0800
Subject: [PATCH] 添加盘盈盘亏
---
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs | 13 +++++++------
新建文件夹/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs | 4 ++--
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/extend/Check.cs | 35 +++++++++++++++++++++++------------
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderServices.cs | 8 ++++++--
4 files changed, 38 insertions(+), 22 deletions(-)
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs"
index 65ea267..7340c60 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs"
@@ -35,8 +35,8 @@
[Description("鍑哄簱瀹屾垚")]
鍑哄簱瀹屾垚 = 8,
- [Description("绉诲簱閿佸畾")]
- 绉诲簱閿佸畾 = 9,
+ [Description("鐩樼偣閿佸畾")]
+ 鐩樼偣閿佸畾 = 9,
[Description("鍏ュ簱瀹屾垚鏈缓鍑哄簱鍗�")]
鍏ュ簱瀹屾垚鏈缓鍑哄簱鍗� = 10,
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderServices.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderServices.cs"
index 101709c..c67bae5 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderServices.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderServices.cs"
@@ -359,7 +359,7 @@
List<Dt_CabinOrder>? dt_CabinOrders = responseContent.Data as List<Dt_CabinOrder>;
if (dt_CabinOrders != null) _CabinOrders.AddRange(dt_CabinOrders);
}
- else
+ else if (order.order_type == "3")//鍏ュ簱閫�鏂�
{
//鍒涘缓鍑哄簱鍗�
#region 杞崲涓哄嚭搴撳崟
@@ -368,7 +368,7 @@
order_no = order.order_no,
order_type = order.order_type,
warehouse_no = order.warehouse_no,
- details=new List<UpstreamOutOrderDetail>()
+ details = new List<UpstreamOutOrderDetail>()
};
foreach (var item in order.details)
{
@@ -384,6 +384,10 @@
_eliveryOrderServices.CreateOutboundOrder(upstramOutOrderInfo);
#endregion
}
+ else if (order.order_type == "5")//鎶ユ孩鍏ュ簱
+ {
+
+ }
};
BaseDal.Db.InsertNav(_CabinOrders).Include(x => x.Details).ExecuteCommand();
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 1a23626..e110ae9 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"
@@ -110,10 +110,11 @@
foreach (var outorder in newOutOrders)
{
- bool skipOrder = false; // 鏍囪鏄惁璺宠繃璇ュ嚭搴撳崟
-
- // 濡傛灉杩欎釜鍑哄簱鍗曠被鍨嬩笉绛変簬1锛屽睘浜庡嚭搴撻��璐э紙瑕佸叆璐т笂娓镐紶杩囨潵鐨勬暟閲忎负璐熸暟锛�
- if (outorder.order_type != "1")
+ if (outorder.order_type == "1") // 姝e父鍑哄簱鍗�
+ {
+ CreateOutboundOrder(outorder);//鍒涘缓鍑哄簱鍗曘�佸鐞嗗簱瀛樸�佹坊鍔犲嚭搴撲换鍔�
+ }
+ else if (outorder.order_type == "2")//鍑哄簱閫�璐�
{
// 鍒涘缓鍑哄簱閫�璐у崟 - 杩欓噷闇�瑕佹牴鎹笟鍔¢�昏緫瀹炵幇
// 鏆傛椂璺宠繃鎴栧疄鐜伴��璐ч�昏緫
@@ -143,9 +144,9 @@
BaseDal.Db.InsertNav(dt_CabinOrders).Include(x => x.Details).ExecuteCommand();
#endregion
}
- else if (outorder.order_type == "1") // 姝e父鍑哄簱鍗�
+ else if (outorder.order_type == "3")//鎶ユ崯鍑哄簱
{
- CreateOutboundOrder(outorder);//鍒涘缓鍑哄簱鍗曘�佸鐞嗗簱瀛樸�佹坊鍔犲嚭搴撲换鍔�
+
}
}
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/extend/Check.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/extend/Check.cs"
index 54f6325..e4c1574 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/extend/Check.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/extend/Check.cs"
@@ -4,6 +4,7 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.OrderEnum;
+using WIDESEA_Common.StockEnum;
using WIDESEA_Common.TaskEnum;
using WIDESEA_Common.WareHouseEnum;
using WIDESEA_Core;
@@ -29,9 +30,12 @@
{
List<Dt_DeliveryOrder> deliveryOrders = new List<Dt_DeliveryOrder>();
List<Dt_SupplyTask> supplyTasks = new List<Dt_SupplyTask>();
+ List<Dt_InventoryInfo> _InventoryInfos = new List<Dt_InventoryInfo>();
List<Dt_Inventory_Batch> inventory_Batches = _inventory_BatchServices.Repository.QueryData(x => keys.Contains(x.Id));
foreach (var item in inventory_Batches)
{
+ supplyTasks = _supplyTaskService.Repository.QueryData(x => x.MaterielCode == item.MaterielCode && x.BatchNo == item.BatchNo && x.TaskStatus == SupplyStatusEnum.NewCheck.ObjToInt()).ToList();
+ if (supplyTasks.Count > 0) throw new Exception($"鐗╂枡缂栧彿銆恵item.MaterielCode}銆戞壒娆″彿銆恵item.BatchNo}銆戝凡瀛樺湪鐩樼偣浠诲姟锛岃鍏堝畬鎴愬綋鍓嶇洏鐐逛换鍔�");
List<Dt_InventoryInfo> inventoryInfos = _inventoryInfoService.Repository.QueryData(x => item.MaterielCode == x.MaterielCode && x.BatchNo == item.BatchNo);
if (inventoryInfos.Count > 0)
{
@@ -83,13 +87,19 @@
Remark = "鐩樼偣"
};
supplyTasks.Add(supplyTask);
+ _InventoryInfos.Add(inventory);
}
//}
#endregion
}
}
}
+ _InventoryInfos.ForEach(x =>
+ {
+ x.StockStatus = StockStatusEmun.鐩樼偣閿佸畾.ObjToInt();
+ });
_unitOfWorkManage.BeginTran();
+ _inventoryInfoService.UpdateData(_InventoryInfos);
_supplyTaskService.AddData(supplyTasks);
BaseDal.Db.InsertNav(deliveryOrders)
.Include(x => x.Details)
@@ -248,13 +258,6 @@
_supplyTaskService.Repository.DeleteAndMoveIntoHty(supplyTask, OperateTypeEnum.鑷姩瀹屾垚);
#endregion
- #region 搴撳瓨鎵规
- Dt_Inventory_Batch inventory_Batch = _inventory_BatchServices.Repository.QueryFirst(x => x.BatchNo == inventoryInfo.BatchNo && x.MaterielCode == inventoryInfo.MaterielCode);
- if (inventory_Batch == null) throw new Exception($"鏈壘鍒扮墿鏂欑紪鍙枫�恵inventoryInfo.MaterielCode}銆戠墿鏂欐壒娆°�恵inventoryInfo.BatchNo}銆戠殑搴撳瓨鎵规淇℃伅");
- inventory_Batch.SupplyQuantity += supplyTask.SupplyQuantity;
- _inventory_BatchServices.UpdateData(inventory_Batch);
- #endregion
-
#region 鍒ゆ柇褰撳墠鐗╂枡鎵规鐨勭洏鐐逛换鍔℃槸鍚﹀叏閮ㄥ畬鎴�
List<Dt_SupplyTask> supplyTasks = _supplyTaskService.Repository.QueryData(x => x.MaterielCode == supplyTask.MaterielCode && x.BatchNo == supplyTask.BatchNo && x.TaskStatus == SupplyStatusEnum.NewCheck.ObjToInt() && x.WarehouseCode == supplyTask.WarehouseCode).ToList();
if (supplyTasks.Count < 1)
@@ -272,20 +275,28 @@
supplyTasks = _supplyTaskService.Repository.QueryData(x => x.MaterielCode == supplyTask.MaterielCode && x.BatchNo == supplyTask.BatchNo && x.TaskStatus == SupplyStatusEnum.NewCheck.ObjToInt()).ToList();
if (supplyTasks.Count < 1)
{
- #region 妫�鏌ユ槸鍚︽湁鐩樼偣宸紓锛屾棤宸紓鐩存帴澶勭悊鏁版嵁
- if (inventory_Batch.SupplyQuantity == inventory_Batch.StockQuantity)
+ #region 鏌ユ壘搴撳瓨
+ var inventoryInfos = _inventoryInfoService.Repository.QueryData(x => x.BatchNo == cabinOrderDetail.Batch_num && x.MaterielCode == cabinOrderDetail.Goods_no);
+ var SupplyQuantitys = inventoryInfos.Select(x => x.SupplyQuantity).ToList().Sum();
+ #endregion
+
+ #region 搴撳瓨鎵规
+ Dt_Inventory_Batch inventory_Batch = _inventory_BatchServices.Repository.QueryFirst(x => x.BatchNo == cabinOrderDetail.Batch_num && x.MaterielCode == cabinOrderDetail.Goods_no);
+ if (SupplyQuantitys == inventory_Batch.StockQuantity)
{
- var inventoryInfos = _inventoryInfoService.Repository.QueryData(x => x.BatchNo == inventory_Batch.BatchNo && x.MaterielCode == inventory_Batch.MaterielCode);
foreach (var item in inventoryInfos)
{
item.StockQuantity = item.SupplyQuantity;
item.SupplyQuantity = 0;
+ item.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
}
_inventoryInfoService.UpdateData(inventoryInfos);
- inventory_Batch.SupplyQuantity = 0;
+ }
+ else
+ {
+ inventory_Batch.SupplyQuantity = SupplyQuantitys;
_inventory_BatchServices.UpdateData(inventory_Batch);
}
- #endregion
}
#endregion
--
Gitblit v1.9.3