现场问题处理,电梯逻辑处理

This commit is contained in:
2024-09-10 17:42:47 +08:00
parent ddae9f34d7
commit fc57a19cf8
20 changed files with 410 additions and 90 deletions

View File

@@ -165,7 +165,7 @@ namespace Tnb.WarehouseMgr
WmsSaleD wmsOutstockD = await _db.Queryable<WmsSaleD>().FirstAsync(it => it.id == input.source_id);
await _db.Ado.BeginTranAsync();
//入库取终点 //出库起点
OutStockStrategyQuery outStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, material_id = wmsOutstockD.material_id, qty = input.qty, code_batch = wmsOutstockD.code_batch, Region_id = WmsWareHouseConst.REGION_CPOutstock_ID };
OutStockStrategyQuery outStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, material_id = wmsOutstockD.material_id, qty = input.qty, code_batch = wmsOutstockD.code_batch, Region_id = WmsWareHouseConst.REGION_CPOutstock_ID, dbConn = _db };
List<Tuple<string, WmsCarryH, WmsCarryCode, BasLocation>> items = await _wareHouseService.OutStockStrategy_saleRelease(outStockStrategyInput);
decimal canOutstockQty = items.Sum(r => r.Item3.codeqty).ParseToDecimal();
@@ -200,7 +200,7 @@ namespace Tnb.WarehouseMgr
//人工发货
else
{
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, Size = items_pretask.Count, Region_id = WmsWareHouseConst.REGION_CPManualOutstock_ID };
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, Size = items_pretask.Count, Region_id = WmsWareHouseConst.REGION_CPManualOutstock_ID, dbConn = _db };
endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
if (endLocations.Count < items_pretask.Count)
@@ -244,11 +244,15 @@ namespace Tnb.WarehouseMgr
throw new AppFriendlyException($"载具{carry.carry_code}无法选到缓存区库位,请检查电梯缓存分区配置表", 500);
}
#endregion
if (endLocation == null)
{
throw new AppFriendlyException("一楼没有足够的未锁定且空闲的出库工位", 500);
}
}
//人工发货
else
{
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, Size = 1, Region_id = WmsWareHouseConst.REGION_CPManualOutstock_ID };
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, Size = 1, Region_id = WmsWareHouseConst.REGION_CPManualOutstock_ID, dbConn = _db };
endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
if (endLocations.Count < 1)
@@ -257,10 +261,6 @@ namespace Tnb.WarehouseMgr
}
endLocation = endLocations[0];
}
if (endLocation == null)
{
throw new AppFriendlyException("一楼没有足够的未锁定且空闲的出库工位", 500);
}
WmsPointH sPoint = null!;
WmsPointH ePoint = null!;
@@ -366,8 +366,7 @@ namespace Tnb.WarehouseMgr
//所有库位加锁
string?[] ids = new[] { startLocation.id, preTasks[0].endlocation_id, endLocationId };
_ = await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
int row = await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
}
}
}