yumeng hace 5 años
padre
commit
081970f3f3

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

@@ -29,8 +29,8 @@ public class SampleTest {
         try {
 
 
-          //  reportTaskService.createTask(1022694L,"c2defedd56511f4a768ce8e34e0232ff");
-           reportTaskService.getTaskList();
+          //  reportTaskService.createTask(3727345L,"871fc2c248782a94ad2962c941555abc");
+            reportTaskService.getTaskList();
 
 
 

+ 19 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouReportTaskServiceImpl.java

@@ -11,6 +11,8 @@ import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouReportTaskMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportTaskService;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper;
 import cn.com.ctop.kuaishou.modules.utils.DownloadUtils;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -52,6 +54,13 @@ public class KuaiShouReportTaskServiceImpl extends ServiceImpl<KuaiShouReportTas
     @Autowired
     private KuaishouReportDailyCampaignMapper reportDailyCampaignMapper;
 
+
+    @Autowired
+    private KuaishouReportDailyGroupMapper reportDailyGroupMapper;
+
+    @Autowired
+    private KuaishouReportDailyCreativeMapper reportDailyCreativeMapper;
+
     @Override
     public void createTask(Long accountId, String token) {
         if (Check.isNull(accountId) || Check.isNull(token)) {
@@ -68,8 +77,8 @@ public class KuaiShouReportTaskServiceImpl extends ServiceImpl<KuaiShouReportTas
             String endDate = DateUtils.getDate("yyyy-MM-dd");
             String startDate = DateUtils.addMonth(endDate, -6);
             JSONObject taskParams = new JSONObject();
-            taskParams.put("start_date", startDate);
-            taskParams.put("end_date", endDate);
+            taskParams.put("start_date", "2020-03-11");
+            taskParams.put("end_date", "2020-03-11");
 
             if (Check.isNull(typeList)) {
                 getTypeList();
@@ -173,11 +182,18 @@ public class KuaiShouReportTaskServiceImpl extends ServiceImpl<KuaiShouReportTas
             if (!Check.isNull(localPath)) {
                 if (task.getViewType() == 1) {
                     reportDailyAccountMapper.loadAccountDailyReport(task.getAccountId(), localPath);
-                }else if(task.getViewType() == 2){
+                } else if (task.getViewType() == 2) {
                     reportDailyCampaignMapper.loadCampaignDailyReport(task.getAccountId(), localPath);
 
+                } else if (task.getViewType() == 3) {
+                    reportDailyGroupMapper.loadGroupDailyReport(task.getAccountId(), localPath);
+
+                } else if (task.getViewType() == 4) {
+                    reportDailyCreativeMapper.loadCreativeDailyReport(task.getAccountId(), localPath);
+
                 }
 
+
             }
             task.setTaskStatus(4);
             this.updateById(task);

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

@@ -1,8 +1,9 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
-import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreative;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 public interface KuaishouReportDailyCreativeMapper extends BaseMapper<KuaishouReportDailyCreative> {
+    void loadCreativeDailyReport(@Param("accountId") Long accountId, @Param("localPath") String localPath);
 }

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

@@ -1,8 +1,9 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
-import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyGroup;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 public interface KuaishouReportDailyGroupMapper extends BaseMapper<KuaishouReportDailyGroup> {
+    void loadGroupDailyReport(@Param("accountId") Long accountId, @Param("localPath") String localPath);
 }

+ 72 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyCreativeMapper.xml

@@ -2,4 +2,76 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper">
 
+
+    <insert id="loadCreativeDailyReport">
+		LOAD DATA local INFILE  #{localPath}
+		INTO TABLE ctop_kuaishou_report_daily_creative_new CHARACTER SET utf8
+		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
+		IGNORE 1 LINES
+		(
+		creative_id,
+		creative_name,
+		status,
+		campaign_id,
+		campaign_name,
+		unit_id,
+		unit_name,
+		@ad_scene,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        stat_date,
+        @stat_hour,
+        photo_click,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        photo_click_cost,
+        action_cost,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay_first_day_roi,
+        event_pay,
+        event_pay_purchase_amount,
+        event_pay_roi,
+        event_register,
+        event_register_cost,
+        event_register_ratio,
+        event_jin_jian_app,
+        event_jin_jian_app_cost,
+        event_credit_grant_app,
+        event_credit_grant_app_cost,
+        event_credit_grant_app_ratio,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_order_paid_cost,
+        form_count,
+        form_cost,
+        form_action_ratio,
+        event_jin_jian_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_credit_grant_landing_page,
+        event_credit_grant_landing_page_cost,
+        event_credit_grant_landing_ratio,
+        event_next_day_stay_cost,
+        event_next_day_stay_ratio,
+        event_next_day_stay,
+        play_3s_ratio
+        )
+          set account_id = #{accountId}
+    </insert>
+
 </mapper>

+ 70 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyGroupMapper.xml

@@ -2,4 +2,74 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper">
 
+    <insert id="loadGroupDailyReport">
+		LOAD DATA local INFILE  #{localPath}
+		INTO TABLE ctop_kuaishou_report_daily_group_new CHARACTER SET utf8
+		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
+		IGNORE 1 LINES
+		(
+		unit_id,
+		unit_name,
+		status,
+		campaign_id,
+		campaign_name,
+		@ad_scene,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        stat_date,
+        @stat_hour,
+        photo_click,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        photo_click_cost,
+        action_cost,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay_first_day_roi,
+        event_pay,
+        event_pay_purchase_amount,
+        event_pay_roi,
+        event_register,
+        event_register_cost,
+        event_register_ratio,
+        event_jin_jian_app,
+        event_jin_jian_app_cost,
+        event_credit_grant_app,
+        event_credit_grant_app_cost,
+        event_credit_grant_app_ratio,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_order_paid_cost,
+        form_count,
+        form_cost,
+        form_action_ratio,
+        event_jin_jian_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_credit_grant_landing_page,
+        event_credit_grant_landing_page_cost,
+        event_credit_grant_landing_ratio,
+        event_next_day_stay_cost,
+        event_next_day_stay_ratio,
+        event_next_day_stay,
+        play_3s_ratio
+        )
+          set account_id = #{accountId}
+    </insert>
+
+
 </mapper>