Просмотр исходного кода

Merge branch 'feature_20260211_zhaohaipeng_cluster_task' of Server/supply-demand-engine into master

zhaohaipeng 3 недель назад
Родитель
Сommit
ebcb2a0b3c

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

@@ -589,11 +589,10 @@ public class ExecutionTaskServiceImpl implements ExecutionTaskService {
         }
         String dt = xxlJobParamDto.getDt();
         if (StringUtils.isBlank(dt)) {
-            LocalDateTime yesterday = LocalDateTime.now().minusDays(1);
-            dt = DateUtil.formatLocalDateTime(yesterday, "yyyyMMdd");
+            dt = DateUtil.formatLocalDateTime(LocalDateTime.now(), "yyyyMMdd");
         }
 
-        String sql = String.format("select * from %s where dt = %s", table, dt);
+        String sql = String.format("select * from %s where dt = %s;", table, dt);
         log.info("query sql: {}", sql);
         XxlJobLogger.log("query sql: {}", sql);
         List<Record> records = odpsManager.query(sql);
@@ -622,7 +621,7 @@ public class ExecutionTaskServiceImpl implements ExecutionTaskService {
             }
 
             String contentId = record.getString("videoid");
-            Double weightScore = Double.parseDouble(record.getString("vov"));
+            Double weightScore = record.getDouble("vov");
             ManualClusterExecutionConfigDTO.ContentDTO content = new ManualClusterExecutionConfigDTO.ContentDTO();
             content.setContentId(contentId);
             content.setWeightScore(weightScore);

+ 2 - 0
supply-demand-engine-core/src/main/resources/mapper/SdExecutionTaskContentMapper.xml

@@ -7,6 +7,7 @@
         execution_task_id,
         content_type,
         content_id,
+        input_params,
         content
         )
         VALUES
@@ -15,6 +16,7 @@
             #{item.executionTaskId},
             #{item.contentType},
             #{item.contentId},
+            #{item.inputParams},
             #{item.content}
             )
         </foreach>

+ 4 - 1
supply-demand-engine-service/src/main/java/com/tzld/piaoquan/sde/controller/ExecutionTaskController.java

@@ -12,7 +12,10 @@ import com.tzld.piaoquan.sde.service.ExecutionTaskService;
 import io.swagger.v3.oas.annotations.Operation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * @author supeng

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

@@ -1,18 +1,27 @@
-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");
-    // }
-
-}
+// package com.tzld.piaoquan.sde;
+//
+//
+// import com.alibaba.fastjson.JSON;
+// import com.tzld.piaoquan.sde.model.dto.task.XxlJobParamDto;
+// 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 videoClusterExecutionTaskCreateHandlerTest() {
+//         XxlJobParamDto xxlJobParamDto = new XxlJobParamDto();
+//         xxlJobParamDto.setTable("loghubods.supply_video_deconstruction");
+//         xxlJobParamDto.setContentScope("top20_cate_top200_exp14d_top50_vov14d");
+//         executionTaskService.videoClusterExecutionTaskCreateHandler(JSON.toJSONString(xxlJobParamDto));
+//     }
+//
+//     @Test
+//     public void executionTaskSubmitHandlerTest() {
+//         executionTaskService.executionTaskSubmitHandler();
+//     }
+// }