调整,wms进出库代码逻辑

This commit is contained in:
alex
2023-07-11 16:49:14 +08:00
parent 0c64a6ccda
commit ff225db2e1
4 changed files with 14 additions and 8 deletions

View File

@@ -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";// 自动