From 528badf2f1efe5355975de7942fb7a26e71a8e18 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期六, 01 十一月 2025 18:34:37 +0800
Subject: [PATCH] 优化盘点流程、出入库退货流程
---
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/NewBusiness.cs | 4 +-
新建文件夹/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json | 2
新建文件夹/WIDESEA_WMSServer/ClassLibrary2/MaterielInfoService.cs | 2
新建文件夹/WIDESEA_WMSServer/ClassLibrary2/MessageInfoService.cs | 3 +
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/extend/Check.cs | 84 +++++++++++++++++++++---------------------
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/Business.cs | 14 ++++++
新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/CabinOrderServices.cs | 2
新建文件夹/WIDESEA_WMSServer/WIDESEA_WMSServer/InOrderJob.cs | 2
新建文件夹/WIDESEA_WMSServer/WIDESEA_WMSServer/OutOrderJob.cs | 2
新建文件夹/WIDESEA_WMSServer/WIDESEA_WMSServer/AlarmJob.cs | 2
10 files changed, 66 insertions(+), 51 deletions(-)
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/ClassLibrary2/MaterielInfoService.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/ClassLibrary2/MaterielInfoService.cs"
index d7ddf51..73ff4ff 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/ClassLibrary2/MaterielInfoService.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/ClassLibrary2/MaterielInfoService.cs"
@@ -26,7 +26,7 @@
public IRepository<Dt_MaterielInfo> Repository => BaseDal;
- static string SearchDate = "2025-10-30 00:00:00";
+ static string SearchDate = "2025-11-01 00:00:00";
/// <summary>
/// 鑾峰彇鑽搧鍩虹淇℃伅鍚屾鎺ュ彛
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/ClassLibrary2/MessageInfoService.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/ClassLibrary2/MessageInfoService.cs"
index 55e2047..365a8ea 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/ClassLibrary2/MessageInfoService.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/ClassLibrary2/MessageInfoService.cs"
@@ -48,7 +48,10 @@
{
Dt_MessageInfo dt_MessageInfo = null;
if (groupByEnum == MessageGroupByEnum.InventoryExceedAlarm)
+ {
dt_MessageInfo = BaseDal.QueryFirst(x => x.MessageName == messageName && x.MessageRemark == messageRemark);
+ if (dt_MessageInfo != null && dt_MessageInfo.MessageInfo == messageInfo) return content;
+ }
else
dt_MessageInfo = BaseDal.QueryFirst(x => x.MessageName == messageName && x.MessageInfo == messageInfo);
if (groupByEnum != MessageGroupByEnum.InventoryExceedAlarm && dt_MessageInfo != null) return content;
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/Business.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/Business.cs"
index 3f4c35a..19cb17d 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/Business.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/Business.cs"
@@ -526,7 +526,7 @@
//鐗╂枡绫诲瀷
materialCode = materialCode,
externalOrderNo = order.Out_no,
- outOrderType = order.Out_type == "6" ? "30" : "10",
+ outOrderType = order.Out_type,
priority = 1,
Is_cancel = 0,
details = order.Details.Select(d => new ToeOutdiInDetail
@@ -538,6 +538,16 @@
quantity = (int)d.Order_qty,
}).ToList()
};
+ switch (order.Out_type)
+ {
+ case "1"://姝e父鍑哄簱
+ case "3"://鍏ュ簱閫�璐�
+ ediDto.outOrderType = "10";//涓�鑸氦鏄撳嚭搴撳崟
+ break;
+ case "6"://鐩樹簭鍑哄簱
+ ediDto.outOrderType = "30";//鐩樹簭鍑哄簱鍗�
+ break;
+ }
var result = HttpHelper.Post(url, ediDto.ToJsonString());
var resp = JsonConvert.DeserializeObject<TowcsResponse<object>>(result);
if (resp != null && resp.code == "0")
@@ -722,6 +732,7 @@
}
else
{
+ if (item.First().Order_type == "2") url = "http://121.37.118.63:80/GYZ2/95fck/outOrderOk";//鍑哄簱閫�璐�
var result = HttpHelper.Post(url, new { order_no = item.Key }.ToJsonString());
var response = JsonConvert.DeserializeObject<UpstreamOrderResponse>(result);
if (response != null && response.resultCode == "0")
@@ -787,6 +798,7 @@
}
else
{
+ if (item.First().Out_type == "3") url = "http://121.37.118.63:80/GYZ2/95fck/inOrderOk";//鍏ュ簱閫�璐�
var result = HttpHelper.Post(url, new { order_no = item.Key }.ToJsonString());
var response = JsonConvert.DeserializeObject<UpstreamOrderResponse>(result);
if (response != null && response.resultCode == "0")
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 bfefa82..1c40815 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"
@@ -133,7 +133,7 @@
if (cabinOrder == null || cabinOrder.OdrderStatus == "宸插畬鎴�")
return WebResponseContent.Instance.Error($"鍏ュ簱鍗曞凡瀹屾垚");
//Dt_CabinOrderDetail cabinOrderDetail = cabinOrder.Details.Where(x => x.Goods_no == materielCode && x.Batch_num == batchNo && x.Status == 2).FirstOrDefault();
- Dt_CabinOrderDetail cabinOrderDetail = cabinOrder.Details.Where(x => x.Id == id).FirstOrDefault();
+ Dt_CabinOrderDetail? cabinOrderDetail = cabinOrder.Details.Where(x => x.Id == id).FirstOrDefault();
if (cabinOrderDetail == null || cabinOrderDetail.OrderDetailStatus == "宸插畬鎴�")
return WebResponseContent.Instance.Error($"鍏ュ簱鍗曟槑缁嗗凡瀹屾垚");
Dt_MaterielInfo materielInfo = _materielInfoService.Repository.QueryFirst(x => x.MaterielCode == cabinOrderDetail.Goods_no);
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/NewBusiness.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/NewBusiness.cs"
index 508891d..dfdc13f 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/NewBusiness.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/NewBusiness.cs"
@@ -16,7 +16,7 @@
public partial class Business
{
#region 鑾峰彇ERP鍏ュ簱鍗�
- static string SearchInOrderDate = "2025-10-30 00:00:00";
+ static string SearchInOrderDate = "2025-11-01 00:00:00";
public WebResponseContent GetInOrder()
{
WebResponseContent content = new WebResponseContent();
@@ -87,7 +87,7 @@
#endregion
#region 鑾峰彇ERP鍑哄簱鍗�
- static string SearchOutOrderDate = "2025-10-30 00:00:00";
+ static string SearchOutOrderDate = "2025-11-01 00:00:00";
public WebResponseContent GetOutOrder()
{
WebResponseContent content = new WebResponseContent();
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 da9a188..bb3deea 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"
@@ -35,7 +35,7 @@
List<Dt_Inventory_Batch> inventory_Batches = _inventory_BatchServices.Repository.QueryData(x => keys.Contains(x.Id));
foreach (var item in inventory_Batches)
{
- var supplyTasks = _supplyTaskService.Repository.QueryData(x => x.MaterielCode == item.MaterielCode && x.BatchNo == item.BatchNo && x.TaskStatus == SupplyStatusEnum.NewCheck.ObjToInt()).ToList();
+ var 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}銆戝凡瀛樺湪鐩樼偣浠诲姟锛岃鍏堝畬鎴愬綋鍓嶇洏鐐逛换鍔�");
supplyTasks = _supplyTaskService.Repository.QueryData(x => x.MaterielCode == item.MaterielCode && x.BatchNo == item.BatchNo && x.TaskStatus == SupplyStatusEnum.NewOut.ObjToInt()).ToList();
if (supplyTasks.Count > 0) throw new Exception($"鐗╂枡缂栧彿銆恵item.MaterielCode}銆戞壒娆″彿銆恵item.BatchNo}銆戝凡瀛樺湪鐩樼偣浠诲姟锛岃鍏堝畬鎴愬綋鍓嶇洏鐐逛换鍔�");
@@ -233,17 +233,10 @@
if (Qty != 0) return WebResponseContent.Instance.Error($"澶т欢搴撳簱瀛樹负鏁寸锛佺洏鐐规暟閲忎笉鑳藉瓨鍦ㄦ暎浠�");
}
#endregion
- //if (cabinOrderDetail.Order_Outqty > cabinOrderDetail.Order_qty)
- // return WebResponseContent.Instance.Error($"瀹炵洏鏁伴噺涓嶅彲瓒呭嚭璐﹂潰鏁伴噺");
-
- #region 澶勭悊鍑哄簱鍗曪紝璐т綅锛屽簱瀛橈紝搴撳瓨鎵规淇℃伅
- _unitOfWorkManage.BeginTran();
#region 淇敼鐩樼偣鍗�
cabinOrder.OutStatus = "寮�濮�";
cabinOrderDetail.OotDetailStatus = "寮�濮�";
- Repository.UpdateData(cabinOrder);
- _deliveryOrderDetailServices.Repository.UpdateData(cabinOrderDetail);
#endregion
#region 搴撳瓨
@@ -258,16 +251,40 @@
inventoryInfo = _inventoryInfoService.Repository.QueryFirst(x => x.BatchNo == cabinOrderDetail.Batch_num && x.MaterielCode == cabinOrderDetail.Goods_no && x.WarehouseCode == supplyTask.WarehouseCode);
}
inventoryInfo.SupplyQuantity = supplyTask.SupplyQuantity;
- _inventoryInfoService.UpdateData(inventoryInfo);
- #endregion
-
- #region 浠诲姟璁板綍
- //_supplyTaskService.UpdateData(supplyTask);
- _supplyTaskService.Repository.DeleteAndMoveIntoHty(supplyTask, OperateTypeEnum.鑷姩瀹屾垚);
#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();
+ List<Dt_SupplyTask> supplyTasks1 = _supplyTaskService.Repository.QueryData(x => x.MaterielCode == supplyTask.MaterielCode && x.BatchNo == supplyTask.BatchNo && x.TaskStatus == SupplyStatusEnum.NewCheck.ObjToInt()).ToList();
+ Dt_Inventory_Batch inventory_Batch = new Dt_Inventory_Batch();
+ List<Dt_InventoryInfo> inventoryInfos = new List<Dt_InventoryInfo>();
+ if (supplyTasks1.Count < 1)
+ {
+ #region 鏌ユ壘搴撳瓨
+ inventoryInfos = _inventoryInfoService.Repository.QueryData(x => x.BatchNo == cabinOrderDetail.Batch_num && x.MaterielCode == cabinOrderDetail.Goods_no);
+ var SupplyQuantitys = inventoryInfos.Sum(x => x.SupplyQuantity);
+ #endregion
+
+ #region 搴撳瓨鎵规
+ inventory_Batch = _inventory_BatchServices.Repository.QueryFirst(x => x.BatchNo == cabinOrderDetail.Batch_num && x.MaterielCode == cabinOrderDetail.Goods_no);
+ //濡傛灉鐩樼偣鏁板拰鎵规鎬绘暟瀵逛笂浜嗭紝鐩樼偣鏁拌祴鍊间负0锛岃祴鍊煎氨娣诲姞鐩樼偣鏁�
+ if (SupplyQuantitys == inventory_Batch.StockQuantity)
+ {
+ foreach (var item in inventoryInfos)
+ {
+ item.StockQuantity = item.SupplyQuantity;
+ item.SupplyQuantity = 0;
+ item.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
+ }
+ }
+ else
+ {
+ inventory_Batch.SupplyQuantity = SupplyQuantitys;
+ }
+ #endregion
+ }
+ _unitOfWorkManage.BeginTran();
+ #region 澶勭悊鐩樼偣鍗�
if (supplyTasks.Count < 1)
{
#region 瀹屾垚鐩樼偣鍗�
@@ -282,39 +299,22 @@
#endregion
}
- supplyTasks = _supplyTaskService.Repository.QueryData(x => x.MaterielCode == supplyTask.MaterielCode && x.BatchNo == supplyTask.BatchNo && x.TaskStatus == SupplyStatusEnum.NewCheck.ObjToInt()).ToList();
- if (supplyTasks.Count < 1)
+ else
{
- #region 鏌ユ壘搴撳瓨
- var inventoryInfos = _inventoryInfoService.Repository.QueryData(x => x.BatchNo == cabinOrderDetail.Batch_num && x.MaterielCode == cabinOrderDetail.Goods_no);
- var SupplyQuantitys = inventoryInfos.Sum(x => x.SupplyQuantity);
- #endregion
-
- #region 搴撳瓨鎵规
- Dt_Inventory_Batch inventory_Batch = _inventory_BatchServices.Repository.QueryFirst(x => x.BatchNo == cabinOrderDetail.Batch_num && x.MaterielCode == cabinOrderDetail.Goods_no);
- //濡傛灉鐩樼偣鏁板拰鎵规鎬绘暟瀵逛笂浜嗭紝鐩樼偣鏁拌祴鍊间负0锛岃祴鍊煎氨娣诲姞鐩樼偣鏁�
- if (SupplyQuantitys == inventory_Batch.StockQuantity)
- {
- foreach (var item in inventoryInfos)
- {
- item.StockQuantity = item.SupplyQuantity;
- item.SupplyQuantity = 0;
- item.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
- }
- _inventoryInfoService.UpdateData(inventoryInfos);
- }
- else
- {
- inventory_Batch.SupplyQuantity = SupplyQuantitys;
- _inventory_BatchServices.UpdateData(inventory_Batch);
- }
- #endregion
+ Repository.UpdateData(cabinOrder);
+ _deliveryOrderDetailServices.Repository.UpdateData(cabinOrderDetail);
}
-
+ #endregion
+ _inventoryInfoService.UpdateData(inventoryInfo);
+ _supplyTaskService.Repository.DeleteAndMoveIntoHty(supplyTask, OperateTypeEnum.鑷姩瀹屾垚);
+ if (inventoryInfos.Count > 1)
+ {
+ _inventoryInfoService.UpdateData(inventoryInfos);
+ _inventory_BatchServices.UpdateData(inventory_Batch);
+ }
_unitOfWorkManage.CommitTran();
#endregion
content.OK();
- #endregion
}
catch (Exception ex)
{
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/AlarmJob.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/AlarmJob.cs"
index 301f908..795cef5 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/AlarmJob.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/AlarmJob.cs"
@@ -19,7 +19,7 @@
_inventoryInfoService = inventoryInfoService;
}
//姣忛殧1绉掓墽琛屼竴娆�
- [Invoke(Begin = "2025-09-01", Interval = 1000 * 5, IsEnabled = true, SkipWhileExecuting = true)]
+ [Invoke(Begin = "2025-11-01", Interval = 1000 * 5, IsEnabled = true, SkipWhileExecuting = true)]
public void Run()
{
//鍐峰簱
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/InOrderJob.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/InOrderJob.cs"
index d0d04eb..0b814d0 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/InOrderJob.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/InOrderJob.cs"
@@ -14,7 +14,7 @@
_materielInfoService = materielInfoService;
}
//姣忛殧1绉掓墽琛屼竴娆�
- [Invoke(Begin = "2025-09-01", Interval = 1000 * 5, IsEnabled = true, SkipWhileExecuting = true)]
+ [Invoke(Begin = "2025-11-01", Interval = 1000 * 5, IsEnabled = true, SkipWhileExecuting = true)]
public void Run()
{
_materielInfoService.GetMedicineGoodsInfom();
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/OutOrderJob.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/OutOrderJob.cs"
index 7a19fc0..190546d 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/OutOrderJob.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/OutOrderJob.cs"
@@ -14,7 +14,7 @@
_materielInfoService = materielInfoService;
}
//姣忛殧1绉掓墽琛屼竴娆�
- [Invoke(Begin = "2025-09-01", Interval = 1000 * 5, IsEnabled = true, SkipWhileExecuting = true)]
+ [Invoke(Begin = "2025-11-01", Interval = 1000 * 5, IsEnabled = true, SkipWhileExecuting = true)]
public void Run()
{
//鑾峰彇涓婃父鍑哄簱鍗曟暟鎹�
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json"
index 2230e6b..ec565af 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json"
@@ -31,6 +31,6 @@
"ApiName": "WIDESEA",
"ExpMinutes": 120,
"DBSeedEnable": false, //鏄惁鍚敤鏁版嵁搴撶瀛愭暟鎹紝鍒涘缓琛�
- "PDAVersion": "10",
+ "PDAVersion": "11",
"WebSocketPort": 9296
}
--
Gitblit v1.9.3