空载具出库数量控制修改
This commit is contained in:
@@ -76,11 +76,13 @@ namespace Tnb.WarehouseMgr
|
||||
//判断目标库位是否自动签收
|
||||
BasLocation loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsPointH.location_id)].ToString());
|
||||
|
||||
int qty = int.Parse(input.data[nameof(OutStockStrategyQuery.qty)].ToString());
|
||||
//出库取起点,获取所有符合输入的载具规格的载具
|
||||
OutStockStrategyQuery OutStockStrategyInput = new()
|
||||
{
|
||||
carrystd_id = input.data[nameof(OutStockStrategyQuery.carrystd_id)].ToString(),
|
||||
warehouse_id = input.data[nameof(OutStockStrategyQuery.warehouse_id)].ToString(),
|
||||
Size = qty
|
||||
};
|
||||
List<WmsCarryH>? carrys = await _wareHouseService.OutStockStrategy(OutStockStrategyInput);
|
||||
Logger.Information($"根据出库策略获取的载具数量:{carrys?.Count}");
|
||||
@@ -127,12 +129,14 @@ namespace Tnb.WarehouseMgr
|
||||
//根据每个载具的起始库位做路径运算
|
||||
if (carrys?.Count > 0)
|
||||
{
|
||||
WmsEmptyOutstockH setQty = await _db.Queryable<WmsEmptyOutstockH>().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)].ToString());
|
||||
if (qty > carrys.Count)
|
||||
{
|
||||
throw new AppFriendlyException($"实际可出空载具数量只有 {carrys.Count}", 500);
|
||||
}
|
||||
|
||||
int min = (carrys.Count > setQty.qty) ? setQty.qty : carrys.Count;
|
||||
Logger.Information($"min={min}");
|
||||
Logger.Information($"【WmsEmptyOut】 qty={qty}");
|
||||
|
||||
for (int i = 0; i < min; i++)
|
||||
for (int i = 0; i < qty; i++)
|
||||
{
|
||||
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carrys[i].location_id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user