现场问题处理

This commit is contained in:
2024-09-12 14:07:03 +08:00
parent df00f0b1e2
commit c1b4d60778
10 changed files with 406 additions and 100 deletions

View File

@@ -2085,10 +2085,10 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
if (s_agvElevatortaskDic.CurrentCount == 0)
return;
await s_agvElevatortaskDic.WaitAsync();
var floor3outstock = await db_agvElevatorTaskExceptionHandles.Queryable<BasFactoryConfig>().Where(p => p.key == "floor3outstock").FirstAsync();
if (floor3outstock != null && floor3outstock.value == "0")
return;
await s_agvElevatortaskDic.WaitAsync();
try
{
@@ -2218,28 +2218,28 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
// 检查有没有同时从同个暂存区分区发到同个电梯任务
if (wmsElevatorH.task_nums + wmsElevatorH.carry_count > 0)
{
List<string> currentAreaLocs = await db_agvElevatorTaskExceptionHandles.Queryable<WmsElevatorcacheArea>().Where(r => r.name == ).Select(r => r.location_code).ToListAsync();
// 同个暂存分区同个电梯的托盘
List<string> _carrys = await db_agvElevatorTaskExceptionHandles.Queryable<WmsPretaskH>()
.InnerJoin<WmsPretaskH>((a, b) => currentAreaLocs.Contains(a.startlocation_code) && a.carry_code == b.carry_code
&& a.endlocation_code == b.startlocation_code && a.endlocation_code == $"DT-3-{elevatorSno}")
.Where((a, b) => (a.status != WmsWareHouseConst.PRETASK_BILL_STATUS_CANCEL_ID && a.status != WmsWareHouseConst.PRETASK_BILL_STATUS_COMPLE_ID)
|| (b.status != WmsWareHouseConst.PRETASK_BILL_STATUS_CANCEL_ID && b.status != WmsWareHouseConst.PRETASK_BILL_STATUS_COMPLE_ID)).Select((a, b) => a.carry_code).ToListAsync();
//if (wmsElevatorH.task_nums + wmsElevatorH.carry_count > 0)
//{
// List<string> currentAreaLocs = await db_agvElevatorTaskExceptionHandles.Queryable<WmsElevatorcacheArea>().Where(r => r.name == 切换发货区).Select(r => r.location_code).ToListAsync();
// // 同个暂存分区同个电梯的托盘
// List<string> _carrys = await db_agvElevatorTaskExceptionHandles.Queryable<WmsPretaskH>()
// .InnerJoin<WmsPretaskH>((a, b) => currentAreaLocs.Contains(a.startlocation_code) && a.carry_code == b.carry_code
// && a.endlocation_code == b.startlocation_code && a.endlocation_code == $"DT-3-{elevatorSno}")
// .Where((a, b) => (a.status != WmsWareHouseConst.PRETASK_BILL_STATUS_CANCEL_ID && a.status != WmsWareHouseConst.PRETASK_BILL_STATUS_COMPLE_ID)
// || (b.status != WmsWareHouseConst.PRETASK_BILL_STATUS_CANCEL_ID && b.status != WmsWareHouseConst.PRETASK_BILL_STATUS_COMPLE_ID)).Select((a, b) => a.carry_code).ToListAsync();
if (_carrys.Count > 0)
{
LoggerAgvElevatorTask.LogInformation($"出现同时从同个暂存区分区发到同个电梯{wmsElevatorH.elevator_code}的托盘{string.Join(',', _carrys)},等待托盘任务完成");
continue;
}
}
// if (_carrys.Count > 0)
// {
// LoggerAgvElevatorTask.LogInformation($"出现同时从同个暂存区分区发到同个电梯{wmsElevatorH.elevator_code}的托盘{string.Join(',', _carrys)},等待托盘任务完成");
// continue;
// }
//}
floor3FirstSelectElevatorTasknums.value = (int.Parse(floor3FirstSelectElevatorTasknums.value) - 1).ToString();
if (floor3FirstSelectElevatorTasknums.value == "0")
{
LoggerAgvElevatorTask.LogInformation($"重置首选电梯为{(wmsElevatorH.elevator_code == "Elevator3" ? "Elevator4" : "Elevator3")}");
LoggerAgvElevatorTask.LogInformation($"下次任务下发后重置首选电梯为{(wmsElevatorH.elevator_code == "Elevator3" ? "Elevator4" : "Elevator3")}");
// 选择另一个电梯座位首选电梯
await db_agvElevatorTaskExceptionHandles.Updateable<BasFactoryConfig>().SetColumns(r => r.value == (r.value == "Elevator3" ? "Elevator4" : "Elevator3"))
.Where(r => r.key == "floor3FirstSelectElevator").ExecuteCommandAsync();
@@ -2309,7 +2309,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
if (isOk)
{
LoggerAgvElevatorTask.LogInformation($"成功下发预任务 {string.Join(',', preTasks.Select(r => r.bill_code))}");
LoggerAgvElevatorTask.LogInformation($"成功下发载具 {string.Join(',', preTasks.Select(r => r.carry_code))}");
LoggerAgvElevatorTask.LogInformation($"成功下发载具 {string.Join(',', preTasks.Distinct().Select(r => r.carry_code))}");
//查询库位表
BasLocation location = await db_agvElevatorTaskExceptionHandles.Queryable<BasLocation>().SingleAsync(it => it.id == startloc.id);
{
@@ -2992,8 +2992,8 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
F2KTPsupplementtimer = new Timer(F2KTPsupplement, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
YCLInternalTransfertimer = new Timer(YCLInternalTransfer, null, TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(185));
elevatorTimer = new Timer(ElevatorTaskExceptionHandle, null, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20));
agvelevatorTimer = new Timer(AgvelevatorTimerTaskExceptionHandle, null, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20));
elevatorTimer = new Timer(ElevatorTaskExceptionHandle, null, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10));
agvelevatorTimer = new Timer(AgvelevatorTimerTaskExceptionHandle, null, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10));
return Task.CompletedTask;
}