|
|
@@ -363,7 +363,7 @@ public class ExecutionTaskServiceImpl implements ExecutionTaskService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void topReturnVideoExecutionTaskCreateHandler(String params) {
|
|
|
+ public void videoExecutionTaskCreateHandler(String params) {
|
|
|
Map<String, String> paramJson = new HashMap<>();
|
|
|
try {
|
|
|
paramJson = JSONObject.parseObject(params, new TypeReference<Map<String, String>>() {
|
|
|
@@ -374,7 +374,7 @@ public class ExecutionTaskServiceImpl implements ExecutionTaskService {
|
|
|
|
|
|
|
|
|
long start = System.nanoTime();
|
|
|
- log.info("topReturnVideoExecutionTaskCreateHandler start");
|
|
|
+ log.info("videoExecutionTaskCreateHandler start");
|
|
|
|
|
|
String table = paramJson.getOrDefault("table", yesterdayReturnVideoTable);
|
|
|
String dt = paramJson.get("dt");
|
|
|
@@ -382,35 +382,35 @@ public class ExecutionTaskServiceImpl implements ExecutionTaskService {
|
|
|
LocalDateTime yesterday = LocalDateTime.now().minusDays(1);
|
|
|
dt = DateUtil.formatLocalDateTime(yesterday, "yyyyMMdd");
|
|
|
}
|
|
|
- String sql = "select * from " + table + " where dt='" + dt + "' ORDER BY 回流人数 DESC;";
|
|
|
+ String sql = "select * from " + table + " where dt='" + dt + "' ORDER BY sort_field DESC;";
|
|
|
List<Record> records = odpsManager.query(sql);
|
|
|
if (Objects.isNull(records) || records.isEmpty()) {
|
|
|
- log.info("topReturnVideoExecutionTaskCreateHandler records is empty");
|
|
|
+ log.info("videoExecutionTaskCreateHandler records is empty");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
String contentScope = paramJson.getOrDefault("contentScope", YESTERDAY_RETURN_TOP10_VIDEO_SCOPE);
|
|
|
|
|
|
- XxlJobLogger.log("topReturnVideoExecutionTaskCreateHandler records size={}", records.size());
|
|
|
+ XxlJobLogger.log("videoExecutionTaskCreateHandler records size={}", records.size());
|
|
|
List<Record> findRecords = new ArrayList<>();
|
|
|
for (Record record : records) {
|
|
|
if (Objects.isNull(record)) {
|
|
|
continue;
|
|
|
}
|
|
|
- String videoId = record.getString("videoid");
|
|
|
- int count = sdExecutionTaskContentMapper.countByContentId(ContentTypeEnum.VIDEO.getValue(), videoId);
|
|
|
- if (count > 0) {
|
|
|
- continue;
|
|
|
- }
|
|
|
+ String videoId = record.getString("videoid");
|
|
|
+ int count = sdExecutionTaskContentMapper.countByContentId(ContentTypeEnum.VIDEO.getValue(), videoId);
|
|
|
+ if (count > 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
findRecords.add(record);
|
|
|
}
|
|
|
if (findRecords.isEmpty()) {
|
|
|
- XxlJobLogger.log("topReturnVideoExecutionTaskCreateHandler findRecords is empty");
|
|
|
+ XxlJobLogger.log("videoExecutionTaskCreateHandler findRecords is empty");
|
|
|
return;
|
|
|
}
|
|
|
- XxlJobLogger.log("topReturnVideoExecutionTaskCreateHandler findRecords size={}", findRecords.size());
|
|
|
+ XxlJobLogger.log("videoExecutionTaskCreateHandler findRecords size={}", findRecords.size());
|
|
|
long topCostMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
|
|
|
- log.info("topReturnVideoExecutionTaskCreateHandler get top video cost={}ms", topCostMs);
|
|
|
+ log.info("videoExecutionTaskCreateHandler get top video cost={}ms", topCostMs);
|
|
|
// 创建解构任务
|
|
|
int count = 0;
|
|
|
for (Record record : findRecords) {
|
|
|
@@ -433,14 +433,14 @@ public class ExecutionTaskServiceImpl implements ExecutionTaskService {
|
|
|
List<SdExecutionTaskContent> contentList = new ArrayList<>();
|
|
|
contentList.add(sdExecutionTaskContent);
|
|
|
boolean createResult = executionTaskCreateService.create(sdExecutionTask, contentList);
|
|
|
- log.info("topReturnVideoExecutionTaskCreateHandler sdExecutionTask create videoId = {} result={}", videoId, createResult);
|
|
|
+ log.info("videoExecutionTaskCreateHandler sdExecutionTask create videoId = {} result={}", videoId, createResult);
|
|
|
count++;
|
|
|
} catch (Exception e) {
|
|
|
- log.error("topReturnVideoExecutionTaskCreateHandler error {}", record, e);
|
|
|
+ log.error("videoExecutionTaskCreateHandler error {}", record, e);
|
|
|
}
|
|
|
}
|
|
|
long costMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
|
|
|
- log.info("topReturnVideoExecutionTaskCreateHandler recordSize = {} count = {} finish cost = {}ms", records.size(), count, costMs);
|
|
|
+ log.info("videoExecutionTaskCreateHandler recordSize = {} count = {} finish cost = {}ms", records.size(), count, costMs);
|
|
|
|
|
|
}
|
|
|
|