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