Browse Source

Merge branch 'prod-5.1.3' of http://175.6.40.68:8081/Jone/hzims-back into prod-5.1.3

zhongwei
wangyinsheng 2 months ago
parent
commit
534750323c
  1. 12
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java

12
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.setFileUrl(picUrl);
record.setCurrentValue(picUrl); record.setCurrentValue(picUrl);
pictureHandle(picUrl, content.getContentId(), record, task); pictureHandle(picUrl, content.getContentId(), record, task);
} else {
record.setCurrentValue("获取视频地址失败");
} }
} }
return record; return record;
@ -257,7 +259,8 @@ public class VideoTaskSchedule {
} }
} catch (IOException e) { } catch (IOException e) {
log.error("获取截图文件失败", e); log.error("获取截图文件失败", e);
throw new HzServiceException("获取截图文件失败"); record.setCurrentValue("获取截图文件失败");
return;
} }
R<BladeFile> fileResponse = ossClient.putFileByNameAndTenantId("file", multipartFile, task.getTenantId()); R<BladeFile> fileResponse = ossClient.putFileByNameAndTenantId("file", multipartFile, task.getTenantId());
log.info("【taskId:{}}】视频巡检任务执行,上传minio结果,{}", task.getId(), Optional.ofNullable(fileResponse).map(JsonUtil::toJson).orElse("null")); log.info("【taskId:{}}】视频巡检任务执行,上传minio结果,{}", task.getId(), Optional.ofNullable(fileResponse).map(JsonUtil::toJson).orElse("null"));
@ -267,6 +270,7 @@ public class VideoTaskSchedule {
ContentEntity content = contentService.getById(contentId); ContentEntity content = contentService.getById(contentId);
if (StringUtil.isBlank(content.getMultiCheckTypeSon())) { if (StringUtil.isBlank(content.getMultiCheckTypeSon())) {
record.setCurrentValue("没有找到巡检内容");
return; return;
} }
@ -279,7 +283,9 @@ public class VideoTaskSchedule {
BigModelAnalysisResponseDTO analysisResponse = bigModelClient.analysis(analysisRequest); BigModelAnalysisResponseDTO analysisResponse = bigModelClient.analysis(analysisRequest);
log.info("【taskId:{}}】视频巡检任务执行,大模型分析结果,{}", task.getId(), Optional.ofNullable(analysisResponse).map(JsonUtil::toJson).orElse("null")); log.info("【taskId:{}}】视频巡检任务执行,大模型分析结果,{}", task.getId(), Optional.ofNullable(analysisResponse).map(JsonUtil::toJson).orElse("null"));
if (!analysisResponse.getSuccess() || CollectionUtil.isEmpty(analysisResponse.getData())) { 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<BigModelAnalysisResponseDTO.BigModelAnalysisResult> results = analysisResponse.getData(); List<BigModelAnalysisResponseDTO.BigModelAnalysisResult> results = analysisResponse.getData();
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
@ -321,7 +327,7 @@ public class VideoTaskSchedule {
messageDTO.setContent(textBuilder.toString()); messageDTO.setContent(textBuilder.toString());
R booleanR = messageClient.sendAppAndWsMsgByUsers(messageDTO); R booleanR = messageClient.sendAppAndWsMsgByUsers(messageDTO);
if (!booleanR.isSuccess()) { if (!booleanR.isSuccess()) {
throw new ServiceException("消息推送失败"); log.error("【taskId:{}}】,返回的消息为{}", task.getId(), booleanR.getMsg());
} }
log.info("推送成功~"); log.info("推送成功~");
} }

Loading…
Cancel
Save