调整,wms进出库代码逻辑
This commit is contained in:
@@ -296,14 +296,17 @@ namespace Tnb.WarehouseMgr
|
||||
WmsOutstockH outstock = input.outstock.Adapt<WmsOutstockH>();
|
||||
//出库申请明细表
|
||||
List<WmsOutstockD> outstockDs = input.outstockDs.Adapt<List<WmsOutstockD>>();
|
||||
|
||||
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.outstock.location_code);
|
||||
//如果数据不全,
|
||||
if ((outstock?.location_id.IsNullOrWhiteSpace() ?? true) || outstockDs?.Count < 1)
|
||||
if (loc.IsNull() || outstockDs?.Count < 1)
|
||||
{
|
||||
//报错, 提示数据不全。
|
||||
throw new AppFriendlyException("数据不全!", 500);
|
||||
}
|
||||
// 生成入库申请数据,添加其他数据 主表
|
||||
outstock.id = SnowflakeIdHelper.NextId();
|
||||
outstock.location_id = loc.id;
|
||||
outstock.biz_type = WmsWareHouseConst.BIZTYPE_WMSOUTSTOCK_ID;
|
||||
outstock.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_OUTSTOCK_ENCODE).GetAwaiter().GetResult();
|
||||
outstock.generate_type = "1";// 自动
|
||||
|
||||
Reference in New Issue
Block a user