随料架更新料箱位置,下任务顺序变更

This commit is contained in:
2024-07-18 23:54:39 +08:00
parent fd8806b204
commit 9912976239
5 changed files with 3442 additions and 3404 deletions

View File

@@ -553,6 +553,15 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
LoggerBGWCarrySupplement.LogInformation($"【BGWCarrySupplementtimer】 没有未锁定且已占用且库位中没有记录托盘的数据");
continue;
}
WmsPretaskH wmsPretaskH = db_BGWCarrySupplementtimer.Queryable<WmsPretaskH>().Where(r => r.endlocation_code == endLocation.location_code
&& r.status != WmsWareHouseConst.PRETASK_BILL_STATUS_COMPLE_ID && r.status != WmsWareHouseConst.PRETASK_BILL_STATUS_CANCEL_ID).First();
if (wmsPretaskH != null)
{
LoggerBGWCarrySupplement.LogWarning($"【BGWCarrySupplementtimer】存在未完成的预任务{wmsPretaskH.bill_code} 不能送托盘!");
continue;
}
BasLocation startLocation = wmsLoc.First();
//锁定起点库位
@@ -1171,7 +1180,8 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
BasLocation startLocation = rackStartLocations.First();
List<WmsCarryH> wmsCarryHs = db_Floor2timer送空托到上升降区.Queryable<WmsCarryH>().Where(r => r.location_id == startLocation.id).ToList();
List<WmsCarryH> wmsCarryHs = db_Floor2timer送空托到上升降区.Queryable<WmsCarryH>().Where(r => r.location_id == startLocation.id
&& r.carrystd_id == WmsWareHouseConst.CARRY_LJSTD_ID).ToList();
if (wmsCarryHs.Count == 0)
{
LoggerFloor2RackDelivery.LogError($"【送空托到上升降区】 起点{startLocation.id} {startLocation.location_code}上找不到料架");
@@ -1346,7 +1356,8 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
BasLocation startLocation = rackStartLocations.First();
List<WmsCarryH> wmsCarryHs = db_Floor2timer送满托到下升降区.Queryable<WmsCarryH>().Where(r => r.location_id == startLocation.id).ToList();
List<WmsCarryH> wmsCarryHs = db_Floor2timer送满托到下升降区.Queryable<WmsCarryH>().Where(r => r.location_id == startLocation.id
&& r.carrystd_id == WmsWareHouseConst.CARRY_LJSTD_ID).ToList();
if (wmsCarryHs.Count == 0)
{
LoggerFloor2RackDelivery.LogError($"【送满托到下升降区】 起点{startLocation.id} {startLocation.location_code}上找不到料架");
@@ -1358,7 +1369,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
LoggerFloor2RackDelivery.LogError($"【送满托到下升降区】 起点{startLocation.id} {startLocation.location_code}上存在多个料架");
continue;
}
WmsPretaskH wmsPretaskH = db_Floor2timer送满托到下升降区.Queryable<WmsPretaskH>().Where(r => r.endlocation_code == wmsMechanicalArmH.location_code
&& r.status != WmsWareHouseConst.PRETASK_BILL_STATUS_COMPLE_ID && r.status != WmsWareHouseConst.PRETASK_BILL_STATUS_CANCEL_ID).First();
if (wmsPretaskH != null)
@@ -1748,22 +1759,31 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
async void ElevatorTaskExceptionHandle(object args)
{
List<WmsDistaskH> wmsDistaskHs = db_ElevatorTaskExceptionHandle.Queryable<WmsDistaskH>()
.Where(r => r.startlocation_code.Contains("DT") && r.endlocation_code.Contains("DT") && r.act_start_date == null && r.act_end_date == null).ToList();
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】检查到需要恢复的电梯任务{wmsDistaskHs.Count}条 {string.Join(',', wmsDistaskHs.Select(x => x.bill_code))}");
foreach (WmsDistaskH wmsDistaskH in wmsDistaskHs)
try
{
ElevagorInfoQuery q = new() { endlocation_id = wmsDistaskH.endlocation_id, taskCode = wmsDistaskH.bill_code };
List<WmsDistaskH> wmsDistaskHs = db_ElevatorTaskExceptionHandle.Queryable<WmsDistaskH>()
.Where(r => r.startlocation_code.Contains("DT") && r.endlocation_code.Contains("DT") && r.act_start_date == null && r.act_end_date == null).ToList();
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】执行电梯任务时 根据任务单号获取电梯参数 {JsonConvert.SerializeObject(q)}");
var e = await _wareHouseService.FindElevatorFromPars(q);
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】执行电梯任务时 根据任务单号获取电梯结果 {JsonConvert.SerializeObject(e)}");
if (e == null)
continue;
wmsDistaskH.device_id = e.device_id;
await _wareHouseService.ExecuteTargetFloorTask(wmsDistaskH);
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】检查到需要恢复的电梯任务{wmsDistaskHs.Count}条 {string.Join(',', wmsDistaskHs.Select(x => x.bill_code))}");
foreach (WmsDistaskH wmsDistaskH in wmsDistaskHs)
{
ElevagorInfoQuery q = new() { endlocation_id = wmsDistaskH.endlocation_id, taskCode = wmsDistaskH.bill_code };
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】执行电梯任务时 根据任务单号获取电梯参数 {JsonConvert.SerializeObject(q)}");
var e = await _wareHouseService.FindElevatorFromPars(q);
LoggerElevatorTask.Information($"【ElevatorTaskExceptionHandle】执行电梯任务时 根据任务单号获取电梯结果 {JsonConvert.SerializeObject(e)}");
if (e == null)
continue;
wmsDistaskH.device_id = e.device_id;
await _wareHouseService.ExecuteTargetFloorTask(wmsDistaskH);
}
}
catch(Exception ex)
{
LoggerFloor2RackDelivery.LogError($"【ElevatorTaskExceptionHandle】{ex.Message}");
LoggerFloor2RackDelivery.LogError($"【ElevatorTaskExceptionHandle】{ex.StackTrace}");
}
}