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 +++
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderServices.cs | 20 ++++++++++++++++++++
新建文件夹/WMS/src/views/Alarm/MessageInfo_Hty.vue | 4 ++--
新建文件夹/WIDESEA_WMSServer/WIDESEA_WMSServer/GoodsJob.cs | 14 +++++++++-----
4 files changed, 34 insertions(+), 7 deletions(-)
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 4e97b26..3745236 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"
@@ -142,6 +142,15 @@
cabinOrderDetail.Order_Inqty += Inqty;
if (cabinOrderDetail.Order_Inqty > cabinOrderDetail.Order_qty)
return WebResponseContent.Instance.Error($"鍏ュ簱鏁伴噺涓嶅彲瓒呭嚭鍗曟嵁鏁伴噺");
+ //澶т欢搴撴暣绠辨牎楠�
+ if (warehouseCode == WarehouseEnum.澶т欢搴�.ObjToInt().ToString("000"))
+ {
+ var BoxRule = materielInfo.BoxQty;
+ if (BoxRule > 0 && Inqty % BoxRule != 0)
+ {
+ return WebResponseContent.Instance.Error($"澶т欢搴撳彧鍏佽瀛樻斁鏁寸璐х墿锛佸綋鍓嶅叆搴撴暟閲� {Convert.ToInt32(Inqty)} 涓嶆槸绠辫 {Convert.ToInt32(BoxRule)} 鐨勬暣鏁板��");
+ }
+ }
#region 澶勭悊鍏ュ簱鍗曪紝璐т綅锛屽簱瀛橈紝搴撳瓨鎵规淇℃伅
_unitOfWorkManage.BeginTran();
@@ -162,6 +171,7 @@
#region 璐т綅
var location = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode);
if (location == null) return WebResponseContent.Instance.Error($"璇风淮鎶よ揣浣嶇紪鍙枫�恵LocationCode}銆戠殑璐т綅淇℃伅");
+
//if (location.EnableStatus == EnableStatusEnum.Disable.ObjToInt())
// return WebResponseContent.Instance.Error($"璐т綅缂栧彿銆恵LocationCode}銆戝凡绂佺敤锛岃鎭㈠姝e父鍐嶄娇鐢�");
if (location.WarehouseCode != cabinOrderDetail.Reservoirarea)
@@ -321,6 +331,16 @@
{
string WareCodeMJ = WarehouseEnum.楹荤簿搴�.ObjToInt().ToString("000");
string WareCodeLD = WarehouseEnum.鍐峰喕搴�.ObjToInt().ToString("000");
+ #region 妫�鏌ユ槸鍚︽湁鏈畬鎴愮殑鐩樼偣浠诲姟
+ var dt_bath = _inventory_BatchServices.Repository.QueryData(x => order.details.Select(d => d.goods_no).Contains(x.MaterielCode)).ToList();
+ if (dt_bath.Count>=1)
+ {
+ foreach (var item in dt_bath)
+ {
+ if (item.SupplyQuantity > 0) throw new Exception($"鍏ュ簱鍗曘�恵order.order_no}銆戠墿鏂欑紪鍙枫�恵dt_bath[0].MaterielCode}銆戝瓨鍦ㄦ湭瀹屾垚鐨勭洏鐩堝叆搴撲换鍔★紝璇峰鐞嗗畬鎴愬悗鍐嶈繘琛屾甯稿叆搴撴搷浣�");
+ }
+ }
+ #endregion
List<Dt_CabinOrder> dt_CabinOrders = new List<Dt_CabinOrder>();
#region 鐗规畩鑽搧鍏ョ壒娈婂簱鎴�
if (order.warehouse_no == WareCodeMJ || order.warehouse_no == WareCodeLD)
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();
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/GoodsJob.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/GoodsJob.cs"
index 46d43f6..017264e 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/GoodsJob.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/GoodsJob.cs"
@@ -1,22 +1,26 @@
锘縰sing Pomelo.AspNetCore.TimedJob;
-using WIDESEA_ISquareCabinServices;
+using WIDESEA_ISystemService;
using WIDESEA_IWMsInfoServices;
-using static WIDESEA_DTO.SquareCabin.TowcsDto;
+
namespace WIDESEA_WMSServer
{
public class GoodsJob : Job
{
private readonly IMaterielInfoService _materielInfoService;
- public GoodsJob(IMaterielInfoService materielInfoService)
+ private readonly ISys_LogService _logger;
+ public GoodsJob(IMaterielInfoService materielInfoService, ISys_LogService logger)
{
_materielInfoService = materielInfoService;
+ _logger=logger;
}
//姣忛殧1绉掓墽琛屼竴娆�
- [Invoke(Begin = "2025-09-01", Interval = 1000 * 5, IsEnabled = false, SkipWhileExecuting = true)]
+ [Invoke(Begin = "2025-09-01", Interval = 1000 * 60 * 60 * 24 * 7, IsEnabled = true, SkipWhileExecuting = true)]
public void Run()
{
- Console.WriteLine($"鐗╂枡淇℃伅浠诲姟鎵ц缁撴潫锛歿DateTime.Now}");
+ _logger.ScheduledDeletion();
+ Console.WriteLine($"鍒犻櫎鏃ュ織鎵ц缁撴潫锛歿DateTime.Now}");
+ //Console.WriteLine($"鐗╂枡淇℃伅浠诲姟鎵ц缁撴潫锛歿DateTime.Now}");
}
}
}
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/Alarm/MessageInfo_Hty.vue" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/Alarm/MessageInfo_Hty.vue"
index 300c65b..96a23f7 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/Alarm/MessageInfo_Hty.vue"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/views/Alarm/MessageInfo_Hty.vue"
@@ -136,7 +136,7 @@
type: "string",
width: 150,
align: "center",
- bind: { key: "messageGroupBy", data: [] },
+ bind: { key: "MessageGroupByEnum", data: [] },
require: true,
},
{
@@ -145,7 +145,7 @@
type: "string",
width: 100,
align: "center",
- bind: { key: "messageStatus", data: [] },
+ bind: { key: "MessageStatusEnum", data: [] },
require: true,
},
{
--
Gitblit v1.9.3