调整呼梯逻辑代码
This commit is contained in:
@@ -90,7 +90,7 @@ namespace Tnb.WarehouseMgr
|
||||
.Select((a, b, c, d) => new WmsElevatorH
|
||||
{
|
||||
distask_id = c.id,
|
||||
device_id = c.device_id,
|
||||
device_id = a.elevator_id,
|
||||
}, true)
|
||||
.FirstAsync();
|
||||
|
||||
|
||||
@@ -248,7 +248,6 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
}, true).ToListAsync();
|
||||
|
||||
Logger.Information($"elevatorList:{JsonConvert.SerializeObject(elevatorList)}");
|
||||
|
||||
//获取所有未下发的预任务申请
|
||||
List<WmsPretaskH> preTasks = await db.Queryable<WmsPretaskH>().InnerJoin<WmsCarryH>((a, b) => a.startlocation_id == b.location_id && a.carry_id == b.id)
|
||||
@@ -409,15 +408,20 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
//呼梯操作
|
||||
//获取目标库位为电梯库位的任务
|
||||
List<(string endlocation_code, string device_id, string id, string? start_floor)> endLocCodes = disTasks
|
||||
.Where(it => it.endlocation_code.StartsWith("DT", StringComparison.OrdinalIgnoreCase) &&
|
||||
var eleTasks = disTasks.Where(it => it.endlocation_code.StartsWith("DT", StringComparison.OrdinalIgnoreCase) &&
|
||||
!it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase))
|
||||
.Select(it => (it.endlocation_code, it.device_id, it.id, it.start_floor)).ToList();
|
||||
if (endLocCodes?.Count > 0)
|
||||
.ToList();
|
||||
foreach (var et in eleTasks)
|
||||
{
|
||||
|
||||
await CallingLanding(endLocCodes);
|
||||
var ele = elevatorList.Find(x => x.location_code == et.endlocation_code);
|
||||
if(ele!=null)
|
||||
{
|
||||
et.device_id = ele.elevator_id;
|
||||
}
|
||||
}
|
||||
List<(string endlocation_code, string device_id, string id, string? start_floor)> endLocCodes = eleTasks
|
||||
.Select(it => (it.endlocation_code, it.device_id, it.id, it.start_floor)).ToList();
|
||||
|
||||
//执行电梯任务
|
||||
List<WmsDistaskH>? elevatorTasks = disTasks.Where(it => it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user