预任务执行,Agv及电梯任务根据配置执行
This commit is contained in:
@@ -20,5 +20,6 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string WriteTagUrl { get; set; }
|
public string WriteTagUrl { get; set; }
|
||||||
|
|
||||||
|
public string Environment { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,5 +50,11 @@
|
|||||||
/// AGV心跳
|
/// AGV心跳
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string AGVKeepalive = "AGVKeepalive";
|
public const string AGVKeepalive = "AGVKeepalive";
|
||||||
|
/// <summary>
|
||||||
|
/// 运行环境名称
|
||||||
|
/// </summary>
|
||||||
|
public const string EnvironmentName = "TIANYI";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,10 @@
|
|||||||
<Configurations>Debug;Release;tianyi</Configurations>
|
<Configurations>Debug;Release;tianyi</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||||
|
<DefineConstants>$(DefineConstants);production</DefineConstants>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\BasicData\Tnb.BasicData.Interfaces\Tnb.BasicData.Interfaces.csproj" />
|
<ProjectReference Include="..\..\BasicData\Tnb.BasicData.Interfaces\Tnb.BasicData.Interfaces.csproj" />
|
||||||
<ProjectReference Include="..\..\EquipMgr\Tnb.EquipMgr.Entities\Tnb.EquipMgr.Entities.csproj" />
|
<ProjectReference Include="..\..\EquipMgr\Tnb.EquipMgr.Entities\Tnb.EquipMgr.Entities.csproj" />
|
||||||
|
|||||||
@@ -382,38 +382,42 @@ namespace Tnb.WarehouseMgr
|
|||||||
|
|
||||||
await db.Ado.CommitTranAsync();
|
await db.Ado.CommitTranAsync();
|
||||||
|
|
||||||
//呼梯操作
|
if(_eleCtlCfg.Environment == ElevatorConsts.EnvironmentName)
|
||||||
//获取目标库位为电梯库位的任务
|
|
||||||
List<(string endlocation_code, string device_id, string id, string? start_floor)> endLocCodes = 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)
|
|
||||||
{
|
{
|
||||||
|
//呼梯操作
|
||||||
await CallingLanding(endLocCodes);
|
//获取目标库位为电梯库位的任务
|
||||||
}
|
List<(string endlocation_code, string device_id, string id, string? start_floor)> endLocCodes = disTasks
|
||||||
//执行电梯任务
|
.Where(it => it.endlocation_code.StartsWith("DT", StringComparison.OrdinalIgnoreCase) &&
|
||||||
List<WmsDistaskH>? elevatorTasks = disTasks.Where(it => it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)).ToList();
|
!it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase))
|
||||||
|
.Select(it => (it.endlocation_code, it.device_id, it.id, it.start_floor)).ToList();
|
||||||
if (elevatorTasks?.Count > 0)
|
if (endLocCodes?.Count > 0)
|
||||||
{
|
|
||||||
Logger.Information($"当前电梯任务数:{elevatorTasks?.Count ?? 0}");
|
|
||||||
Logger.Information("准备执行电梯任务");
|
|
||||||
Logger.Information("执行电梯任务");
|
|
||||||
|
|
||||||
foreach (WmsDistaskH? elevatorTask in elevatorTasks)
|
|
||||||
{
|
{
|
||||||
await ExecuteTargetFloorTask(elevatorTask);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
await CallingLanding(endLocCodes);
|
||||||
|
}
|
||||||
|
//执行电梯任务
|
||||||
|
List<WmsDistaskH>? elevatorTasks = disTasks.Where(it => it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
|
|
||||||
|
if (elevatorTasks?.Count > 0)
|
||||||
|
{
|
||||||
|
Logger.Information($"当前电梯任务数:{elevatorTasks?.Count ?? 0}");
|
||||||
|
Logger.Information("准备执行电梯任务");
|
||||||
|
Logger.Information("执行电梯任务");
|
||||||
|
|
||||||
|
foreach (WmsDistaskH? elevatorTask in elevatorTasks)
|
||||||
|
{
|
||||||
|
await ExecuteTargetFloorTask(elevatorTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
////调用AGV创建任务链接口
|
||||||
|
List<WmsDistaskH> agvTasks = disTasks.Where(it => !it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
|
if (agvTasks?.Count > 0)
|
||||||
|
{
|
||||||
|
await AgvDispatch(agvTasks, agvCts.Token);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
////调用AGV创建任务链接口
|
#
|
||||||
List<WmsDistaskH> agvTasks = disTasks.Where(it => !it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)).ToList();
|
|
||||||
if (agvTasks?.Count > 0)
|
|
||||||
{
|
|
||||||
await AgvDispatch(agvTasks, agvCts.Token);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex) when (ex is HttpRequestException hReqEx)
|
catch (Exception ex) when (ex is HttpRequestException hReqEx)
|
||||||
|
|||||||
@@ -3,5 +3,6 @@
|
|||||||
"token": "780BE4144636CF47DDF3920B0F1D069B",
|
"token": "780BE4144636CF47DDF3920B0F1D069B",
|
||||||
"GetTagListUrl": "http://192.168.11.110:9100/Dev/GetTagList",
|
"GetTagListUrl": "http://192.168.11.110:9100/Dev/GetTagList",
|
||||||
"GetTagUrl": "http://192.168.11.110:9100/Dev/GetTag",
|
"GetTagUrl": "http://192.168.11.110:9100/Dev/GetTag",
|
||||||
"WriteTagUrl": "http://192.168.11.110:9100/Dev/writeTag"
|
"WriteTagUrl": "http://192.168.11.110:9100/Dev/writeTag",
|
||||||
|
"Environment": ""
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user