Browse Source

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-boot

yumeng 4 years ago
parent
commit
2279d6ecfd

+ 6 - 7
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -11,6 +11,7 @@ import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouNewCreateCampaign;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.material.service.IEtlKuaishouVideoInfoService;
 import cn.com.ctop.kuaishou.modules.material.service.IEtlKuaishouVideoInfoService;
+import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
 import cn.com.ctop.kuaishou.modules.report.service.*;
 import cn.com.ctop.kuaishou.modules.report.service.*;
 import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
 import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
@@ -28,6 +29,7 @@ import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 import org.springframework.test.context.junit4.SpringRunner;
 
 
+import javax.annotation.Resource;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Date;
@@ -41,7 +43,7 @@ import static org.jeecg.common.util.DateUtils.getAnotherDay;
 
 
 @RunWith(SpringRunner.class)
 @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@ActiveProfiles("dev")
+@ActiveProfiles("wps")
 @Slf4j
 @Slf4j
 public class SampleTest {
 public class SampleTest {
     @Autowired
     @Autowired
@@ -550,14 +552,11 @@ public class SampleTest {
 
 
     @Autowired
     @Autowired
     private IEtlKuaishouVideoInfoService videoEtlInfoService;
     private IEtlKuaishouVideoInfoService videoEtlInfoService;
-
+    @Resource
+    private EtlKuaishouAccountMaterialReportDailyMapper etlKuaishouAccountMaterialReportDailyMapper;
     @Test
     @Test
     public void etlKuaishouVideoInfo() {
     public void etlKuaishouVideoInfo() {
-        Date startDate = DateUtils.parseDate("2021-03-01", "yyyy-MM-dd");
-        for (int i = 0; i < 365; i++) {
-//            dailyService.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate(DateUtils.addDay(startDate,i)));
-            videoEtlInfoService.etlKuaishouVideoInfo(DateUtils.formatDate(DateUtils.addDay(startDate, i)));
-        }
+        etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate());
     }
     }
 
 
 }
 }

+ 23 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadEtlJob.java

@@ -1,11 +1,16 @@
 package cn.com.ctop.job.kuaishou.handler;
 package cn.com.ctop.job.kuaishou.handler;
 
 
+import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouAccountMaterialReportDailyService;
 import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouReportAccountDailyService;
 import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouReportAccountDailyService;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xxl.job.core.handler.annotation.XxlJob;
+import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
+import javax.annotation.Resource;
+
 /**
 /**
  * 账户维度-盯盘每日数据
  * 账户维度-盯盘每日数据
  *
  *
@@ -16,6 +21,10 @@ public class KuaishouDailyAccountReportLoadEtlJob {
 
 
     @Autowired
     @Autowired
     private IEtlKuaishouReportAccountDailyService iEtlKuaishouReportAccountDailyService;
     private IEtlKuaishouReportAccountDailyService iEtlKuaishouReportAccountDailyService;
+    @Autowired
+    private IEtlKuaishouAccountMaterialReportDailyService etlKuaishouAccountMaterialReportDailyService;
+    @Resource
+    private EtlKuaishouAccountMaterialReportDailyMapper etlKuaishouAccountMaterialReportDailyMapper;
 
 
     @XxlJob("kuaishouDailyAccountReportLoadEtl")
     @XxlJob("kuaishouDailyAccountReportLoadEtl")
     public void execute() throws Exception {
     public void execute() throws Exception {
@@ -26,4 +35,18 @@ public class KuaishouDailyAccountReportLoadEtlJob {
             XxlJobHelper.log(e.getMessage());
             XxlJobHelper.log(e.getMessage());
         }
         }
     }
     }
+
+    /**
+     * 快手账户素材数据清洗任务
+     * @throws Exception
+     */
+    @XxlJob("etlKuaishouAccountMaterialReportDailyData")
+    public void etlKuaishouAccountMaterialReportDailyData() throws Exception {
+        try {
+            etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate());
+            XxlJobHelper.log("queryEveryDayDataForAccount success");
+        } catch (Exception e) {
+            XxlJobHelper.log(e.getMessage());
+        }
+    }
 }
 }

+ 1 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouAccountMaterialReportDailyMapper.xml

@@ -106,8 +106,7 @@ group by m.account_id,m.signature
         play_3s_count)
         play_3s_count)
         values
         values
         <foreach collection="records" item="record" separator=",">
         <foreach collection="records" item="record" separator=",">
-            (
-            #{record.companyId} ,
+            (#{record.companyId} ,
             #{record.companyName} ,
             #{record.companyName} ,
             #{record.projectId} ,
             #{record.projectId} ,
             #{record.projectName} ,
             #{record.projectName} ,