From 2b4c3a985b279345c2d9f5ceeb2deffd3e13bb8c Mon Sep 17 00:00:00 2001 From: FanLian Date: Thu, 13 Jul 2023 14:17:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E7=94=B3=E8=AF=B7=E9=A2=84?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=94=9F=E6=88=90=E5=90=8E=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E5=8D=95=E6=8D=AE=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.WarehouseMgr/WmsOutStockService.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs index c02d3280..b34ae85d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs @@ -306,7 +306,7 @@ namespace Tnb.WarehouseMgr //报错, 提示数据不全。 throw new AppFriendlyException("数据不全!", 500); } - // 生成入库申请数据,添加其他数据 主表 + // 生成出库申请数据,添加其他数据 主表 outstock.id = SnowflakeIdHelper.NextId(); outstock.location_id = location.id; outstock.biz_type = WmsWareHouseConst.BIZTYPE_WMSOUTSTOCK_ID; @@ -483,10 +483,16 @@ namespace Tnb.WarehouseMgr pretaskCodes.AddRange(curPreTaskCodes); } var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes); - GenPreTaskUpInput genPreTaskAfterUpInput = new(); - genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList(); - genPreTaskAfterUpInput.LocationIds = new HashSet(locIds).ToList(); - await _wareHouseService.GenInStockTaskHandleAfter(genPreTaskAfterUpInput, it => new WmsCarryH { is_lock = 1 }, it => new BasLocation { is_lock = 1 }); + if(isOk) + { + await _db.Updateable(outstockDs).SetColumns(it => new WmsOutstockD{line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).ExecuteCommandAsync(); + await _db.Updateable(outstock).SetColumns(it => new WmsOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).ExecuteCommandAsync(); + GenPreTaskUpInput genPreTaskAfterUpInput = new(); + genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList(); + genPreTaskAfterUpInput.LocationIds = new HashSet(locIds).ToList(); + await _wareHouseService.GenInStockTaskHandleAfter(genPreTaskAfterUpInput, it => new WmsCarryH { is_lock = 1 }, it => new BasLocation { is_lock = 1 }); + } + } else throw new AppFriendlyException("库存不足", 500); }