外协提升二楼入库、erp包材入库同步、erp重发调拨出库处理、电梯优化

This commit is contained in:
2024-08-28 16:03:35 +08:00
parent 7809aefb9b
commit 68f4b5c5af
16 changed files with 485 additions and 14 deletions

View File

@@ -204,6 +204,8 @@ namespace Tnb.ProductionMgr
_wareHouseService.db_ElevatorTaskExceptionHandles.Add(db_ElevatorTaskExceptionHandle);
SemaphoreSlim s_elevatortask = new(1);
_wareHouseService.s_elevatortaskDic.Add(s_elevatorArea, s_elevatortask);
SemaphoreSlim s_elevatortaskWCSRequest = new(1);
_wareHouseService.s_elevatortaskWCSRequestDic.Add(s_elevatorArea, s_elevatortaskWCSRequest);
}
}
@@ -1929,11 +1931,17 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
foreach (string area in _wareHouseService.s_elevatortaskDic.Keys)
{
SemaphoreSlim s_elevatortask = _wareHouseService.s_elevatortaskDic[area];
SemaphoreSlim s_elevatortaskWCSRequest = _wareHouseService.s_elevatortaskWCSRequestDic[area];
if (s_elevatortask.CurrentCount == 0)
return;
if (s_elevatortaskWCSRequest.CurrentCount == 0)
return;
await s_elevatortask.WaitAsync();
//WCS下发任务前会判断是否一托下 防止向WCS发送一托下指令和下发任务同步进行
await s_elevatortaskWCSRequest.WaitAsync();
var db_ElevatorTaskExceptionHandle = _wareHouseService.db_ElevatorTaskExceptionHandles[index];
taskActions[index] = Task.Run(async () =>
@@ -1948,7 +1956,6 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】检查到需要恢复/执行的电梯任务{elevatorTasks.Count}条 {string.Join(',', elevatorTasks.Select(x => x.bill_code))}");
if (elevatorTasks?.Count > 0)
{
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】{JsonConvert.SerializeObject(elevatorTasks)}");
@@ -2044,6 +2051,8 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
finally
{
s_elevatortask.Release();
if (s_elevatortaskWCSRequest.CurrentCount == 0)
s_elevatortaskWCSRequest.Release();
}
});
index++;