注释和报错

This commit is contained in:
FanLian
2023-07-18 09:10:57 +08:00
parent c92dbc3397
commit 919af3542c
6 changed files with 103 additions and 89 deletions

View File

@@ -272,11 +272,11 @@ namespace Tnb.WarehouseMgr
var loc = await _db.Queryable<BasLocation>().FirstAsync(it => it.location_code == input.instock.location_code && it.is_type != EnumLocationType..ToString());
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.instock.carry_code);
//如果数据不全,
//如果数据不全或有误
if (carry.IsNull() || loc.IsNull() || instockds?.Count < 1 || instockcodes?.Count < 1)
{
//报错, 提示数据不全。
throw new AppFriendlyException("数据不全!", 500);
//报错, 提示数据不全或有误
throw new AppFriendlyException("数据不全或有误", 500);
}
// 生成入库申请数据,添加其他数据 主表
instock.id = SnowflakeIdHelper.NextId();
@@ -330,7 +330,7 @@ namespace Tnb.WarehouseMgr
//入库取终点 //出库起点
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = instock?.warehouse_id!, Size = 1 };
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
WmsPointH sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == instock.location_id);
WmsPointH sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == instock.location_id);
WmsPointH ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == endLocations[0].id);