Forráskód Böngészése

feat:添加日志

zhaohaipeng 3 hete
szülő
commit
e3cb5d8f69

+ 19 - 2
supply-demand-engine-core/src/main/java/com/tzld/piaoquan/sde/service/impl/ExecutionTaskServiceImpl.java

@@ -41,6 +41,7 @@ import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
 
 /**
  * @author supeng
@@ -381,7 +382,7 @@ public class ExecutionTaskServiceImpl implements ExecutionTaskService {
 
 
         long start = System.nanoTime();
-        log.info("videoExecutionTaskCreateHandler start");
+        log.info("videoExecutionTaskCreateHandler start: {}", JSONObject.toJSONString(paramJson));
 
         String table = paramJson.getOrDefault("table", yesterdayReturnVideoTable);
         String dt = paramJson.get("dt");
@@ -447,6 +448,14 @@ public class ExecutionTaskServiceImpl implements ExecutionTaskService {
                 contentList.add(sdExecutionTaskContent);
                 boolean createResult = executionTaskCreateService.create(sdExecutionTask, contentList);
                 log.info("videoExecutionTaskCreateHandler sdExecutionTask create videoId = {} result={}", videoId, createResult);
+
+                // 内容库添加数据
+                ContentProfile contentProfile = new ContentProfile();
+                contentProfile.setContentId(videoId);
+                contentProfile.setContentType(ContentTypeEnum.VIDEO.getValue());
+                contentProfile.setStage(ContentProfileStageEnum.DECONSTRUCTION_SELECT_TOPIC.getValue());
+                contentProfileService.insertOrUpdate(contentProfile);
+
                 count++;
             } catch (Exception e) {
                 log.error("videoExecutionTaskCreateHandler error {}", record, e);
@@ -539,7 +548,15 @@ public class ExecutionTaskServiceImpl implements ExecutionTaskService {
         if (StringUtils.isEmpty(dtList)) {
             return;
         }
-        for (String dt : dtList.split(",")) {
+
+        List<String> dts = Arrays.stream(dtList.split(","))
+                .filter(StringUtils::isNotEmpty)
+                .collect(Collectors.toList());
+
+        log.info("batchCreateDeconstructTask: {}", dts);
+
+        for (String dt : dts) {
+            log.info("batchCreateDeconstructTask start submit: {}", dt);
             JSONObject paramJson = new JSONObject();
             paramJson.put("table", "loghubods.supply_demand_task_video_collect_exp_top");
             paramJson.put("contentScope", contentScope);

+ 18 - 0
supply-demand-engine-service/src/test/java/com/tzld/piaoquan/sde/ExecutionTaskServiceTest.java

@@ -0,0 +1,18 @@
+package com.tzld.piaoquan.sde;
+
+
+import com.tzld.piaoquan.sde.service.ExecutionTaskService;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class ExecutionTaskServiceTest extends BaseTest {
+
+    @Autowired
+    private ExecutionTaskService executionTaskService;
+
+    @Test
+    public void test() {
+        executionTaskService.batchCreateDeconstructTask("20260124", "yesterday_exp_top200_video_scope");
+    }
+
+}