|
|
@@ -424,53 +424,53 @@ public class ExecutionTaskServiceImpl implements ExecutionTaskService {
|
|
|
long topCostMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
|
|
|
log.info("historyTopReturnVideoExecutionTaskCreateHandler get top video cost={}ms", topCostMs);
|
|
|
// 创建解构任务
|
|
|
-// for (Record record : records) {
|
|
|
-// try {
|
|
|
-// if (Objects.isNull(record)) {
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-// String videoId = record.getString("videoid");
|
|
|
-// ContentProfile contentProfile = contentProfileService.findContentProfileByIdAndStage(videoId, ContentProfileStageEnum.DECONSTRUCTION_SELECT_TOPIC);
|
|
|
-// if (Objects.nonNull(contentProfile)) {
|
|
|
-// continue;
|
|
|
-// }
|
|
|
-// SdExecutionTask sdExecutionTask = new SdExecutionTask();
|
|
|
-// sdExecutionTask.setTaskNo(IdGeneratorUtil.generateExecutionTaskNo());
|
|
|
-// sdExecutionTask.setTaskType(TaskTypeEnum.DECONSTRUCT.getValue());
|
|
|
-// sdExecutionTask.setTaskStatus(ExecutionTaskStatusEnum.INIT.getValue());
|
|
|
-// sdExecutionTask.setContentType(ContentTypeEnum.VIDEO.getValue());
|
|
|
-// // 属性设置
|
|
|
-// SdExecutionTaskPropertiesDTO propertiesDTO = new SdExecutionTaskPropertiesDTO();
|
|
|
-// propertiesDTO.setContentScope(HISTORY_RETURN_TOP50_VIDEO_SCOPE);
|
|
|
-// sdExecutionTask.setProperties(JSONObject.toJSONString(propertiesDTO));
|
|
|
-// // 关联内容
|
|
|
-// SdExecutionTaskContent sdExecutionTaskContent = new SdExecutionTaskContent();
|
|
|
-// sdExecutionTaskContent.setContentType(ContentTypeEnum.VIDEO.getValue());
|
|
|
-// sdExecutionTaskContent.setContentId(videoId);
|
|
|
-// sdExecutionTaskContent.setContent(null);
|
|
|
-// List<SdExecutionTaskContent> contentList = new ArrayList<>();
|
|
|
-// contentList.add(sdExecutionTaskContent);
|
|
|
-// boolean createResult = executionTaskCreateService.create(sdExecutionTask, contentList);
|
|
|
-// log.info("historyTopReturnVideoExecutionTaskCreateHandler sdExecutionTask create videoId = {} result={}", videoId, createResult);
|
|
|
-// // 内容库添加数据
|
|
|
-// ContentProfile insertContentProfile = new ContentProfile();
|
|
|
-// insertContentProfile.setContentId(videoId);
|
|
|
-// insertContentProfile.setContentType(ContentTypeEnum.VIDEO.getValue());
|
|
|
-// insertContentProfile.setStage(ContentProfileStageEnum.DECONSTRUCTION_SELECT_TOPIC.getValue());
|
|
|
-// contentProfileService.insertOrUpdate(insertContentProfile);
|
|
|
-// } catch (Exception e) {
|
|
|
-// log.error("historyTopReturnVideoExecutionTaskCreateHandler error {}", record, e);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// LambdaQueryWrapper<ContentProfile> wrapper = new LambdaQueryWrapper<>();
|
|
|
-// wrapper.eq(ContentProfile::getStage, ContentProfileStageEnum.DECONSTRUCTION_SELECT_TOPIC.getValue());
|
|
|
-// wrapper.eq(ContentProfile::getContentType, ContentTypeEnum.VIDEO.getValue());
|
|
|
-// wrapper.eq(ContentProfile::getIsDeleted, IsDeleteEnum.NORMAL.getValue());
|
|
|
-// long count = contentProfileMapper.selectCount(wrapper);
|
|
|
-// if (count > maxCount) {
|
|
|
-// log.info("historyTopReturnVideoExecutionTaskCreateHandler count = {} maxCount = {}", count, maxCount);
|
|
|
-// break;
|
|
|
-// }
|
|
|
+ for (Record record : records) {
|
|
|
+ try {
|
|
|
+ if (Objects.isNull(record)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String videoId = record.getString("videoid");
|
|
|
+ ContentProfile contentProfile = contentProfileService.findContentProfileByIdAndStage(videoId, ContentProfileStageEnum.DECONSTRUCTION_SELECT_TOPIC);
|
|
|
+ if (Objects.nonNull(contentProfile)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ SdExecutionTask sdExecutionTask = new SdExecutionTask();
|
|
|
+ sdExecutionTask.setTaskNo(IdGeneratorUtil.generateExecutionTaskNo());
|
|
|
+ sdExecutionTask.setTaskType(TaskTypeEnum.DECONSTRUCT.getValue());
|
|
|
+ sdExecutionTask.setTaskStatus(ExecutionTaskStatusEnum.INIT.getValue());
|
|
|
+ sdExecutionTask.setContentType(ContentTypeEnum.VIDEO.getValue());
|
|
|
+ // 属性设置
|
|
|
+ SdExecutionTaskPropertiesDTO propertiesDTO = new SdExecutionTaskPropertiesDTO();
|
|
|
+ propertiesDTO.setContentScope(HISTORY_RETURN_TOP50_VIDEO_SCOPE);
|
|
|
+ sdExecutionTask.setProperties(JSONObject.toJSONString(propertiesDTO));
|
|
|
+ // 关联内容
|
|
|
+ SdExecutionTaskContent sdExecutionTaskContent = new SdExecutionTaskContent();
|
|
|
+ sdExecutionTaskContent.setContentType(ContentTypeEnum.VIDEO.getValue());
|
|
|
+ sdExecutionTaskContent.setContentId(videoId);
|
|
|
+ sdExecutionTaskContent.setContent(null);
|
|
|
+ List<SdExecutionTaskContent> contentList = new ArrayList<>();
|
|
|
+ contentList.add(sdExecutionTaskContent);
|
|
|
+ boolean createResult = executionTaskCreateService.create(sdExecutionTask, contentList);
|
|
|
+ log.info("historyTopReturnVideoExecutionTaskCreateHandler sdExecutionTask create videoId = {} result={}", videoId, createResult);
|
|
|
+ // 内容库添加数据
|
|
|
+ ContentProfile insertContentProfile = new ContentProfile();
|
|
|
+ insertContentProfile.setContentId(videoId);
|
|
|
+ insertContentProfile.setContentType(ContentTypeEnum.VIDEO.getValue());
|
|
|
+ insertContentProfile.setStage(ContentProfileStageEnum.DECONSTRUCTION_SELECT_TOPIC.getValue());
|
|
|
+ contentProfileService.insertOrUpdate(insertContentProfile);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("historyTopReturnVideoExecutionTaskCreateHandler error {}", record, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<ContentProfile> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(ContentProfile::getStage, ContentProfileStageEnum.DECONSTRUCTION_SELECT_TOPIC.getValue());
|
|
|
+ wrapper.eq(ContentProfile::getContentType, ContentTypeEnum.VIDEO.getValue());
|
|
|
+ wrapper.eq(ContentProfile::getIsDeleted, IsDeleteEnum.NORMAL.getValue());
|
|
|
+ long count = contentProfileMapper.selectCount(wrapper);
|
|
|
+ if (count > maxCount) {
|
|
|
+ log.info("historyTopReturnVideoExecutionTaskCreateHandler count = {} maxCount = {}", count, maxCount);
|
|
|
+ break;
|
|
|
+ }
|
|
|
//向前找数据
|
|
|
current = current.minusDays(1);
|
|
|
dt = DateUtil.formatLocalDate(current, "yyyyMMdd");
|