修复消息处理逻辑并增加地址检查在 `RequestInbound.cs` 中,更新了对 `content.Message` 的条件判断,增加了对 "无法获取目标地址" 消息的处理逻辑,并确保错误信息始终被记录。在 `Dt_TaskService.cs` 中,增加了对 `ToAddress` 变量的空值检查,确保在创建新任务实例之前,地址是有效的。
| | |
| | | } |
| | | else |
| | | { |
| | | if (content.Message != "请求过于频繁,请稍后再试") |
| | | if (content.Message != "请求过于频繁,请稍后再试" || content.Message != "无法获取目标地址") |
| | | { |
| | | WriteInfo(conveyorLine.DeviceName, content.Message); |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, stationManager.stationNGChildCode, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); |
| | | ConsoleHelper.WriteErrorLine($"【{conveyorLine.DeviceName}】托盘号:【{command.ConveyorLineBarcode}】请求点位:【{childDeviceCode}】异常信息【{content.Message}】"); |
| | | WriteInfo(conveyorLine.DeviceName, $"【{conveyorLine.DeviceName}】托盘号:【{command.ConveyorLineBarcode}】请求点位:【{childDeviceCode}】异常信息【{content.Message}】"); |
| | | } |
| | | } |
| | | ConsoleHelper.WriteErrorLine($"【{conveyorLine.DeviceName}】托盘号:【{command.ConveyorLineBarcode}】请求点位:【{childDeviceCode}】异常信息【{content.Message}】"); |
| | | } |
| | | } |
| | | |
| | |
| | | ToAddress = await GetRoadWayAsync(process); |
| | | else |
| | | ToAddress = process[0]; |
| | | |
| | | if(string.IsNullOrEmpty(ToAddress)) |
| | | { |
| | | return content.Error("无法获取目标地址"); |
| | | } |
| | | // 创建新任务实例 |
| | | var task = new Dt_Task |
| | | { |