|
@@ -1019,4 +1019,73 @@ public class VideoVectorJob {
|
|
|
content.setUpdateTime(new Date());
|
|
content.setUpdateTime(new Date());
|
|
|
deconstructContentMapper.updateByPrimaryKeySelective(content);
|
|
deconstructContentMapper.updateByPrimaryKeySelective(content);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 聚合视频向量化任务
|
|
|
|
|
+ * 依次执行三个视频向量化子任务:vectorVideoJob、aigcVideoVectorJob、resultLogVideoVectorJob
|
|
|
|
|
+ * 任一子任务失败不影响后续子任务执行
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param param 参数
|
|
|
|
|
+ * @return 执行结果
|
|
|
|
|
+ */
|
|
|
|
|
+ @XxlJob("allVideoVectorJob")
|
|
|
|
|
+ public ReturnT<String> allVideoVectorJob(String param) {
|
|
|
|
|
+ log.info("开始执行聚合视频向量化任务, param: {}", param);
|
|
|
|
|
+
|
|
|
|
|
+ boolean hasFailure = false;
|
|
|
|
|
+ StringBuilder failMessages = new StringBuilder();
|
|
|
|
|
+
|
|
|
|
|
+ // 1. 执行 vectorVideoJob
|
|
|
|
|
+ try {
|
|
|
|
|
+ log.info("===== 开始执行子任务: vectorVideoJob =====");
|
|
|
|
|
+ ReturnT<String> result = vectorVideoJob(param);
|
|
|
|
|
+ if (result.getCode() != ReturnT.SUCCESS_CODE) {
|
|
|
|
|
+ hasFailure = true;
|
|
|
|
|
+ failMessages.append("vectorVideoJob失败: ").append(result.getMsg()).append("; ");
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("===== 子任务 vectorVideoJob 执行完成, code={} =====", result.getCode());
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ hasFailure = true;
|
|
|
|
|
+ failMessages.append("vectorVideoJob异常: ").append(e.getMessage()).append("; ");
|
|
|
|
|
+ log.error("子任务 vectorVideoJob 执行异常: {}", e.getMessage(), e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 2. 执行 aigcVideoVectorJob
|
|
|
|
|
+ try {
|
|
|
|
|
+ log.info("===== 开始执行子任务: aigcVideoVectorJob =====");
|
|
|
|
|
+ ReturnT<String> result = aigcVideoVectorJob(param);
|
|
|
|
|
+ if (result.getCode() != ReturnT.SUCCESS_CODE) {
|
|
|
|
|
+ hasFailure = true;
|
|
|
|
|
+ failMessages.append("aigcVideoVectorJob失败: ").append(result.getMsg()).append("; ");
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("===== 子任务 aigcVideoVectorJob 执行完成, code={} =====", result.getCode());
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ hasFailure = true;
|
|
|
|
|
+ failMessages.append("aigcVideoVectorJob异常: ").append(e.getMessage()).append("; ");
|
|
|
|
|
+ log.error("子任务 aigcVideoVectorJob 执行异常: {}", e.getMessage(), e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 3. 执行 resultLogVideoVectorJob
|
|
|
|
|
+ try {
|
|
|
|
|
+ log.info("===== 开始执行子任务: resultLogVideoVectorJob =====");
|
|
|
|
|
+ ReturnT<String> result = resultLogVideoVectorJob(param);
|
|
|
|
|
+ if (result.getCode() != ReturnT.SUCCESS_CODE) {
|
|
|
|
|
+ hasFailure = true;
|
|
|
|
|
+ failMessages.append("resultLogVideoVectorJob失败: ").append(result.getMsg()).append("; ");
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("===== 子任务 resultLogVideoVectorJob 执行完成, code={} =====", result.getCode());
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ hasFailure = true;
|
|
|
|
|
+ failMessages.append("resultLogVideoVectorJob异常: ").append(e.getMessage()).append("; ");
|
|
|
|
|
+ log.error("子任务 resultLogVideoVectorJob 执行异常: {}", e.getMessage(), e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (hasFailure) {
|
|
|
|
|
+ log.warn("聚合视频向量化任务完成,部分子任务失败: {}", failMessages);
|
|
|
|
|
+ return new ReturnT<>(ReturnT.FAIL_CODE, "部分子任务失败: " + failMessages);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ log.info("聚合视频向量化任务全部完成");
|
|
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|