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); }