From 0b0519371d0d4b6f79da29802cf628e874d27b88 Mon Sep 17 00:00:00 2001 From: luyie Date: Sat, 21 Sep 2024 11:51:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=A7=86=E9=A2=91=E5=B7=A1=E6=A3=80?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=BC=82=E5=B8=B8=E6=8A=9B=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=AF=B9=E5=BA=94=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java index c408c71..dff2a32 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java @@ -195,6 +195,8 @@ public class VideoTaskSchedule { record.setFileUrl(picUrl); record.setCurrentValue(picUrl); pictureHandle(picUrl, content.getContentId(), record, task); + } else { + record.setCurrentValue("获取视频地址失败"); } } return record; @@ -257,7 +259,7 @@ public class VideoTaskSchedule { } } catch (IOException e) { log.error("获取截图文件失败", e); - throw new HzServiceException("获取截图文件失败"); + record.setCurrentValue("获取截图文件失败"); } R fileResponse = ossClient.putFileByNameAndTenantId("file", multipartFile, task.getTenantId()); log.info("【taskId:{}}】视频巡检任务执行,上传minio结果,{}", task.getId(), Optional.ofNullable(fileResponse).map(JsonUtil::toJson).orElse("null")); @@ -267,6 +269,7 @@ public class VideoTaskSchedule { ContentEntity content = contentService.getById(contentId); if (StringUtil.isBlank(content.getMultiCheckTypeSon())) { + record.setCurrentValue("没有找到巡检内容"); return; } @@ -279,7 +282,9 @@ public class VideoTaskSchedule { BigModelAnalysisResponseDTO analysisResponse = bigModelClient.analysis(analysisRequest); log.info("【taskId:{}}】视频巡检任务执行,大模型分析结果,{}", task.getId(), Optional.ofNullable(analysisResponse).map(JsonUtil::toJson).orElse("null")); if (!analysisResponse.getSuccess() || CollectionUtil.isEmpty(analysisResponse.getData())) { - throw new HzServiceException("大模型识别失败"); + record.setCurrentValue("大模型分析失败"); + log.error("【taskId:{}}】,返回消息 : {}" , task.getId(),Optional.ofNullable(analysisResponse).map(JsonUtil::toJson).orElse("null")); + return; } List results = analysisResponse.getData(); StringBuilder stringBuilder = new StringBuilder(); @@ -321,7 +326,7 @@ public class VideoTaskSchedule { messageDTO.setContent(textBuilder.toString()); R booleanR = messageClient.sendAppAndWsMsgByUsers(messageDTO); if (!booleanR.isSuccess()) { - throw new ServiceException("消息推送失败"); + log.error("【taskId:{}}】,返回的消息为{}", task.getId(), booleanR.getMsg()); } log.info("推送成功~"); }