现场问题处理

This commit is contained in:
2024-09-15 00:59:43 +08:00
parent e3452074aa
commit 71f390cade
3 changed files with 33 additions and 10 deletions

View File

@@ -2008,9 +2008,15 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
// 一托货 // 一托货
else if (group.Count() == 1) else if (group.Count() == 1)
{ {
// 如果当前电梯没有执行中的任务 则呼叫电梯下 // 如果当前电梯没有执行中且货位不同的任务 则呼叫电梯下
if (db_ElevatorTaskExceptionHandle.Queryable<WmsDistaskH>().Where(r => r.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID List<WmsDistaskH> _wmsDistaskHs = await db_ElevatorTaskExceptionHandle.Queryable<WmsDistaskH>()
&& r.status != WmsWareHouseConst.TASK_BILL_STATUS_CANCEL_ID && r.endlocation_id == wmsDistaskHs[0].startlocation_id).Count() == 0) .InnerJoin<WmsElevatorcacheArea>((a, b) => a.startlocation_id == b.location_id)
.Where((a, b) => a.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID
&& a.status != WmsWareHouseConst.TASK_BILL_STATUS_CANCEL_ID && a.endlocation_id == wmsDistaskHs[0].startlocation_id
&& !wmsElevator.innerpos.Contains(b.name)
).ToListAsync();
if (_wmsDistaskHs.Count() == 0)
{ {
if (e != null) if (e != null)
{ {
@@ -2020,8 +2026,10 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】呼叫电梯 {e.elevator_code}"); LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】呼叫电梯 {e.elevator_code}");
await _wareHouseService.ExecuteTargetFloorTask(wmsDistaskHs, db_ElevatorTaskExceptionHandle); await _wareHouseService.ExecuteTargetFloorTask(wmsDistaskHs, db_ElevatorTaskExceptionHandle);
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】呼叫电梯 {e.elevator_code}执行完成"); LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】呼叫电梯 {e.elevator_code}执行完成");
}
else
{
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】等待 {string.Join(',', _wmsDistaskHs.Select(r => r.carry_code ))}");
} }
} }
else else
@@ -2467,6 +2475,13 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
{ {
if (s_taskFloor4DMC2CPKService.CurrentCount == 0) if (s_taskFloor4DMC2CPKService.CurrentCount == 0)
return; return;
var Floor4DMC2CPK = await db_Floor4DMC2CPK.Queryable<BasFactoryConfig>().Where(p => p.key == "Floor4DMC2CPK").FirstAsync();
// 0则不进行移转
if (Floor4DMC2CPK != null && Floor4DMC2CPK.value == "0")
{
return;
}
await s_taskFloor4DMC2CPKService.WaitAsync(); await s_taskFloor4DMC2CPKService.WaitAsync();
Stopwatch stopwatch = new Stopwatch(); Stopwatch stopwatch = new Stopwatch();
stopwatch.Start(); stopwatch.Start();
@@ -2504,11 +2519,16 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
continue; continue;
} }
BasLocation startlocation = await db_Floor4DMC2CPK.Queryable<BasLocation>().Where(r => r.id == wmsCarryH.location_id).FirstAsync();
if (startlocation.is_lock == 1)
{
LoggerFloor4DMC2CPK.LogWarning($"【四楼待灭菌线到灭菌仓】 起点库位{startlocation.location_code}已锁定");
continue;
}
await db_Floor4DMC2CPK.Ado.BeginTranAsync(); await db_Floor4DMC2CPK.Ado.BeginTranAsync();
BasLocation startlocation = await db_Floor4DMC2CPK.Queryable<BasLocation>().Where(r => r.id == wmsCarryH.location_id).FirstAsync();
InStockStrategyQuery inStockStrategyInput = new() InStockStrategyQuery inStockStrategyInput = new()
{ {
warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID,

View File

@@ -436,6 +436,7 @@ namespace Tnb.WarehouseMgr
// 如果当前所放梯内货位已占用 // 如果当前所放梯内货位已占用
if (wmsElevatorH.innerpos.Contains(wmsElevatorcacheArea.name)) if (wmsElevatorH.innerpos.Contains(wmsElevatorcacheArea.name))
{ {
Logger.LogInformation($"电梯{devName}内托盘{dis.carry_code}当前准备放置的货位已有货!");
return await ToApiResult(HttpStatusCode.InternalServerError, $"电梯{devName}内托盘{dis.carry_code}当前准备放置的货位已有货!"); return await ToApiResult(HttpStatusCode.InternalServerError, $"电梯{devName}内托盘{dis.carry_code}当前准备放置的货位已有货!");
} }

View File

@@ -2565,8 +2565,10 @@ namespace Tnb.WarehouseMgr
await db.Updateable(carryHs).ExecuteCommandAsync(); await db.Updateable(carryHs).ExecuteCommandAsync();
#region #region
// 一托下的时候切换首选电梯 var _floor3FirstSelectElevator = await db_agvElevatorTaskExceptionHandles.Queryable<BasFactoryConfig>().Where(p => p.key == "floor3FirstSelectElevator").FirstAsync();
if (disTaskIds.Count == 1) // 一托下且当前电梯还没有后续任务且首选电梯为当前电梯的情况下,切换首选电梯为另一部
int task_nums = db.Queryable<WmsElevatorH>().Where(r => r.elevator_code == devName).Sum(r => r.task_nums);
if (disTaskIds.Count == 1 && task_nums == 1 && devName == _floor3FirstSelectElevator.value)
{ {
await ChangeSelectedElevator(db); await ChangeSelectedElevator(db);
} }
@@ -4539,7 +4541,7 @@ namespace Tnb.WarehouseMgr
{ {
List<BasLocation> locations = await db_agvElevatorTaskExceptionHandles.Queryable<BasLocation>() List<BasLocation> locations = await db_agvElevatorTaskExceptionHandles.Queryable<BasLocation>()
.InnerJoin<WmsElevatorcacheArea>((a, b) => a.id == b.location_id) .InnerJoin<WmsElevatorcacheArea>((a, b) => a.id == b.location_id)
.Where((a, b) => b.name == YCLInnerTransfer.value && a.is_use == "1" && a.is_lock == 0).OrderBy("a.location_code").ToListAsync(); .Where((a, b) => b.name == && a.is_use == "1" && a.is_lock == 0).OrderBy("a.location_code").ToListAsync();
startloc = locations.FirstOrDefault(); startloc = locations.FirstOrDefault();
#region #region