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 | 64 +++++++++++++++++++++++--------
1 files changed, 47 insertions(+), 17 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 41662d0..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,35 +110,60 @@
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")//鍑哄簱閫�璐�
{
// 鍒涘缓鍑哄簱閫�璐у崟 - 杩欓噷闇�瑕佹牴鎹笟鍔¢�昏緫瀹炵幇
// 鏆傛椂璺宠繃鎴栧疄鐜伴��璐ч�昏緫
- continue;
+ //continue;
+ #region 杞崲鎴愬叆搴撳崟
+ UpstreamOrderInfo order = new UpstreamOrderInfo()
+ {
+ order_no = outorder.order_no,
+ order_type = outorder.order_type,
+ warehouse_no = outorder.warehouse_no,
+ details = new List<UpstreamOrderDetail>()
+ };
+ foreach (var item in outorder.details)
+ {
+ UpstreamOrderDetail detail = new UpstreamOrderDetail()
+ {
+ batch_num = item.batch_num,
+ goods_no = item.goods_no,
+ order_qty = item.order_qty,
+ exp_date = item.exp_date,
+ };
+ order.details.Add(detail);
+ }
+ responseContent = _cabinOrderServices.CreateInboundOrder(order);
+ List<Dt_CabinOrder>? dt_CabinOrders = responseContent.Data as List<Dt_CabinOrder>;
+ if (dt_CabinOrders != null && dt_CabinOrders.Count > 0)
+ 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);//鍒涘缓鍑哄簱鍗曘�佸鐞嗗簱瀛樸�佹坊鍔犲嚭搴撲换鍔�
+
}
}
// 鎵归噺鎻掑叆鍑哄簱鍗曞拰鏄庣粏
- if (_DeliveryOrders.Any())
- {
- BaseDal.Db.InsertNav(_DeliveryOrders).Include(x => x.Details).ExecuteCommand();
- }
+ //if (_DeliveryOrders.Any())
+ //{
+ // BaseDal.Db.InsertNav(_DeliveryOrders).Include(x => x.Details).ExecuteCommand();
+ //}
//涓嬪彂鍑哄簱鍗曚换鍔$粰wcs
Db.Ado.CommitTran();
- var tex = CreateSupplyTask(order_no);
- if (!tex)
- {
- return responseContent.Error("鍒涘缓渚涘簲浠诲姟澶辫触");
- }
+ //var tex = CreateSupplyTask(order_no);
+ //if (!tex)
+ //{
+ // return responseContent.Error("鍒涘缓渚涘簲浠诲姟澶辫触");
+ //}
return responseContent.OK($"鍚屾鍑哄簱鍗曟垚鍔燂紝鍏眥_DeliveryOrders.Count}鏉�");
}
catch (Exception ex)
@@ -1045,7 +1070,12 @@
}
#endregion
if (supplyTask.WarehouseCode == WarehouseEnum.绔嬪簱.ObjToInt().ToString("000"))
- CreateAllocatInOut(materielInfo);//鍒涘缓璋冩嫧浠诲姟
+ {
+ materielInfo.Business_qty -= supplyTask.StockQuantity;
+ _basicService.MaterielInfoService.Repository.UpdateData(materielInfo);
+ if (materielInfo.Business_qty < materielInfo.MinQty)
+ CreateAllocatInOut(materielInfo);//鍒涘缓璋冩嫧浠诲姟
+ }
_unitOfWorkManage.CommitTran();
#endregion
content.OK();
--
Gitblit v1.9.3