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

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}");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -28,8 +28,8 @@ namespace Tnb.WarehouseMgr
WmsPretaskH preTask = await _db.Queryable<WmsPretaskH>().SingleAsync(it => it.id == disTask.pretask_id);
if (preTask != null)
{
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
_ = await _db.Updateable(preTask).UpdateColumns(it => it.status).ExecuteCommandAsync();
//preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
//_ = await _db.Updateable(preTask).UpdateColumns(it => it.status).ExecuteCommandAsync();
}
_ = await _db.Deleteable<WmsElevatorUnexecute>().Where(it => it.distask_id == id).ExecuteCommandAsync();
_ = await _db.Deleteable(disTask).ExecuteCommandAsync();

View File

@@ -1015,7 +1015,7 @@ namespace Tnb.WarehouseMgr
commonCreatePretaskInput.endlocation_id = wmsMaterialTransferCarry.endlocation_id;
commonCreatePretaskInput.carry_id = wmsMaterialTransferCarry.carry_id;
commonCreatePretaskInput.carry_code = wmsMaterialTransferCarry.carry_code;
commonCreatePretaskInput.task_type = WmsWareHouseConst.BIZTYPE_WMSTRANSFER_ID;
commonCreatePretaskInput.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
commonCreatePretaskInput.biz_type = WmsWareHouseConst.BIZTYPE_WMSMATERIALTRANSFER_ID;
commonCreatePretaskInput.source_id = wmsMaterialTransferCarry.mat_bill_id;
commonCreatePretaskInput.isExcuteMission = false;
@@ -1175,7 +1175,7 @@ namespace Tnb.WarehouseMgr
{
try
{
List<WmsCarryH> wmsCarryHs = _db.Queryable<WmsCarryH>().Where(r => r.work_station == input.work_station && r.is_lock == 0
List<WmsCarryH> wmsCarryHs = _db.Queryable<WmsCarryH>().Where(r => r.work_station == input.work_station && r.is_lock == 0 && r.carrystd_id == WmsWareHouseConst.CARRY_LJSTD_ID
&& (r.carry_status == ((int)(EnumCarryStatus.)).ToString() || r.carry_status == ((int)(EnumCarryStatus.)).ToString())).ToList();
if (string.IsNullOrEmpty(input.work_station))
{

View File

@@ -15,6 +15,7 @@ using Newtonsoft.Json;
using Npgsql.TypeHandlers;
using SqlSugar;
using Tnb.ProductionMgr.Entities.Entity;
using Tnb.ProductionMgr.Entities.Entity.ErpEntity;
namespace JNPF.Systems.Common;