原材料仓逻辑、看板调整

This commit is contained in:
2024-07-31 09:04:20 +08:00
parent ac43e1edf4
commit 9221113607
17 changed files with 743 additions and 45 deletions

View File

@@ -3218,6 +3218,7 @@ namespace Tnb.WarehouseMgr
{
try
{
await s_floor2CreatePretask.WaitAsync();
List<WmsCarryD> wmsCarryCodes = _db.Queryable<WmsCarryD>().Where(r => r.carry_id == rackid).ToList();
int move_num = 6;
@@ -3225,17 +3226,16 @@ namespace Tnb.WarehouseMgr
BasLocation startLocation = null;
int index = 0;
await _db.Ado.BeginTranAsync();
foreach (WmsCarryD wmsCarryD in wmsCarryCodes)
{
await s_floor2CreatePretask.WaitAsync();
//入库取终点 //出库起点
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_ZC_ID, Size = 1 };
List<BasLocation> endLocations = await InStockStrategy(inStockStrategyInput);
if (endLocations.Count == 0)
{
Logger.LogWarning("没有可用的入库库位");
continue;
throw new Exception("没有可用的入库库位");
}
// 每6个重新获取一次起点
@@ -3256,8 +3256,7 @@ namespace Tnb.WarehouseMgr
bool isMatch = await IsCarryAndLocationMatchByCarryStd(carry, endLocation);
if (!isMatch)
{
Logger.LogWarning("库位与载具规格不匹配");
continue;
throw new Exception("库位与载具规格不匹配");
}
CommonCreatePretaskInput commonCreatePretaskInput = new CommonCreatePretaskInput();
@@ -3293,25 +3292,26 @@ namespace Tnb.WarehouseMgr
await _db.Updateable<BasLocation>().SetColumns(it => it.is_lock == 1).Where(r => r.id == endLocations[0].id).ExecuteCommandAsync();
await _db.Updateable<BasLocation>().SetColumns(it => it.task_nums == it.task_nums + 1).Where(r => r.id == startLocation.id).ExecuteCommandAsync();
Entities.Dto.Outputs.Result res = await CommonCreatePretask(commonCreatePretaskInput);
Entities.Dto.Outputs.Result res = await CommonCreatePretask(commonCreatePretaskInput, _db);
if (res.code == JNPF.Common.Enums.HttpStatusCode.OK)
{
}
else
{
Logger.LogInformation($"【二楼kiva把料架送到下升降机后生成中储仓入库任务】 未成功生成预任务 起点{startLocation.location_code} 终点{endLocation.location_code} 料箱 {wmsCarryD.membercarry_code}");
throw new Exception($"【二楼kiva把料架送到下升降机后生成中储仓入库任务】 未成功生成预任务 起点{startLocation.location_code} 终点{endLocation.location_code} 料箱 {wmsCarryD.membercarry_code}");
}
index++;
s_floor2CreatePretask.Release();
}
await _db.Ado.CommitTranAsync();
return true;
}
catch(Exception ex)
{
Logger.LogInformation($"【二楼kiva把料架送到下升降机后生成中储仓入库任务】{ex}");
s_floor2CreatePretask.Release();
await _db.Ado.RollbackTranAsync();
return false;
}
finally