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/DeliveryOrderServices.cs |   15 ++++++++-------
 1 files changed, 8 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/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 938f0e2..c28476c 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"
@@ -979,12 +979,6 @@
                     inventory_Batch.OutboundQuantity -= supplyTask.StockQuantity;
                 }
                 #endregion
-                if (supplyTask.WarehouseCode == WarehouseEnum.绔嬪簱.ObjToInt().ToString("000"))
-                {
-                    materielInfo.Business_qty -= supplyTask.StockQuantity;
-                    if (materielInfo.Business_qty < materielInfo.MinQty)
-                        CreateAllocatInOut(materielInfo);//鍒涘缓璋冩嫧浠诲姟
-                }
                 supplyTask.TaskStatus = SupplyStatusEnum.OutFinish.ObjToInt();
 
                 _unitOfWorkManage.BeginTran();
@@ -1000,13 +994,20 @@
                 if (location != null) _locationInfoService.UpdateData(location);
                 _deliveryOrderDetailServices.UpdateData(cabinOrderDetail);
                 _supplyTaskService.Repository.DeleteAndMoveIntoHty(supplyTask, OperateTypeEnum.浜哄伐瀹屾垚);
-                _unitOfWorkManage.CommitTran();
 
                 #region 鍒ゆ柇璇︽儏鏄惁鍏ㄩ儴瀹屾垚
                 if (!_deliveryOrderDetailServices.Repository.QueryData(x => x.DeliveryOrderId == deliveryOrder.Id && x.OotDetailStatus != "宸插畬鎴�").Any())
                     deliveryOrder.OutStatus = "宸插畬鎴�";
                 BaseDal.UpdateData(deliveryOrder);
+                if (supplyTask.WarehouseCode == WarehouseEnum.绔嬪簱.ObjToInt().ToString("000"))
+                {
+                    materielInfo.Business_qty -= supplyTask.StockQuantity;
+                    if (materielInfo.Business_qty < materielInfo.MinQty)
+                        CreateAllocatInOut(materielInfo);//鍒涘缓璋冩嫧浠诲姟
+                }
                 #endregion
+                _unitOfWorkManage.CommitTran();
+
                 content.OK();
             }
             catch (Exception ex)

--
Gitblit v1.9.3