diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs index ca7ee9bd..1d8edacb 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs @@ -257,6 +257,9 @@ namespace Tnb.WarehouseMgr var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes); if (isOk) { + await _db.Updateable(outStockDList).SetColumns(it => it.line_status == WmsWareHouseConst.BILLSTATUS_ON_ID).ExecuteCommandAsync(); + await _db.Updateable().SetColumns(it => it.status == WmsWareHouseConst.BILLSTATUS_ON_ID).Where(it => it.id == input.data["ReturnIdentity"].ToString()).ExecuteCommandAsync(); + GenPreTaskUpInput genPreTaskAfterUpInput = new(); genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList(); genPreTaskAfterUpInput.LocationIds = new HashSet(locIds).ToList(); @@ -496,16 +499,16 @@ namespace Tnb.WarehouseMgr pretaskCodes.AddRange(curPreTaskCodes); } var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes); - if(isOk) + if (isOk) { - await _db.Updateable(outstockDs).SetColumns(it => new WmsOutstockD{line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).ExecuteCommandAsync(); + 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); }