From 44587effc96563290a99b90c79cdf1a244d81770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BC=9F?= <421281095@qq.com> Date: Wed, 10 Sep 2025 09:16:34 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E5=B0=9D=E8=AF=95=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BB=BB=E5=8A=A1=E4=B8=8D=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ServiceApp/Subscribe/ConfigSubscribe.cs | 71 +++++++++---------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/OpenAuth.App/ServiceApp/Subscribe/ConfigSubscribe.cs b/OpenAuth.App/ServiceApp/Subscribe/ConfigSubscribe.cs index 02cfed5..fdb8ff8 100644 --- a/OpenAuth.App/ServiceApp/Subscribe/ConfigSubscribe.cs +++ b/OpenAuth.App/ServiceApp/Subscribe/ConfigSubscribe.cs @@ -561,9 +561,7 @@ public class ConfigSubscribe : IJob } _logger.LogDebug("航线进度未跳过处理"); code = data.result; // result - - - + var taskAssign1 = _manageApp.GetTaskAssignByFlightId(flightId1); // 处理航线进度 ,也有可能是失败 if (code != 0) @@ -603,39 +601,7 @@ public class ConfigSubscribe : IJob } else { - var step = (int)data.output.progress.current_step; - _logger.LogDebug($"航线进度:{waylineMissionState} {step} {message}"); - if (step.Equals(25)) // todo 关于会接收到不同消息问题,如何处理 - { - var task = await _sqlSugarClient.Queryable() - .FirstAsync(y => y.Id == taskAssign1.TaskId); - if (task != null && !string.IsNullOrEmpty(task.AIInspection) && - task.AIInspection.Equals("true") && string.IsNullOrEmpty(task.PushUrl)) - { - _logger.LogDebug("执行AI 智能巡检。。。。。"); - //var rtmp = "rtmp://box.wisestcity.com:1935/live/7"; - var bid = Guid.NewGuid().ToString(); - var tid = Guid.NewGuid().ToString(); - var param = @$"{{ - ""bid"": ""{bid}"", - ""method"": ""live_start_push"", - ""tid"": ""{tid}"", - ""timestamp"": {DateTimeOffset.Now.ToUnixTimeMilliseconds()}, - ""data"": {{ - ""url_type"": 1, - ""url"": ""{rtmp}"", - ""video_id"": ""1581F8HGX254V00A0BUY/99-0-0/normal-0"", - ""video_quality"": 3 - }} - }}"; - _logger.LogDebug($"直播参数:{param}"); - var topicRequest = $"thing/product/{sn}/services"; - // 开启直播 - await _mqttClientManager.PublishAsync(topicRequest, param); - liveInfo[$"{tid}{bid}"] = taskAssign1.TaskId; - } - } - + // 航线成功 if (waylineMissionState.Equals(9)) // 航结结束,更新任务状态 { @@ -669,6 +635,39 @@ public class ConfigSubscribe : IJob }; await _sqlSugarClient.Updateable(record).IgnoreNullColumns().ExecuteCommandAsync(); } + var step = (int)data.output.progress.current_step; + _logger.LogDebug($"航线进度:{waylineMissionState} {step} {message}"); + if (step.Equals(25)) // todo 关于会接收到不同消息问题,如何处理 + { + var task = await _sqlSugarClient.Queryable() + .FirstAsync(y => y.Id == taskAssign1.TaskId); + if (task != null && !string.IsNullOrEmpty(task.AIInspection) && + task.AIInspection.Equals("true") && string.IsNullOrEmpty(task.PushUrl)) + { + _logger.LogDebug("执行AI 智能巡检。。。。。"); + //var rtmp = "rtmp://box.wisestcity.com:1935/live/7"; + var bid = Guid.NewGuid().ToString(); + var tid = Guid.NewGuid().ToString(); + var param = @$"{{ + ""bid"": ""{bid}"", + ""method"": ""live_start_push"", + ""tid"": ""{tid}"", + ""timestamp"": {DateTimeOffset.Now.ToUnixTimeMilliseconds()}, + ""data"": {{ + ""url_type"": 1, + ""url"": ""{rtmp}"", + ""video_id"": ""1581F8HGX254V00A0BUY/99-0-0/normal-0"", + ""video_quality"": 3 + }} + }}"; + _logger.LogDebug($"直播参数:{param}"); + var topicRequest = $"thing/product/{sn}/services"; + // 开启直播 + await _mqttClientManager.PublishAsync(topicRequest, param); + liveInfo[$"{tid}{bid}"] = taskAssign1.TaskId; + } + } + } /*if (result.need_reply.Equals(1))