Explorar o código

添加快手素材所属公司数据清洗定时任务

songyh %!s(int64=4) %!d(string=hai) anos
pai
achega
09337912e0

+ 6 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouEtlVideoJob.java

@@ -60,4 +60,10 @@ public class KuaishouEtlVideoJob {
             materialReportDailyService.etlKuaishouAccountMaterialReportInfo(DateUtils.formatDate(DateUtils.addDay(new Date(),-i)));
         }
     }
+
+    @XxlJob("etlKuaishouReportCompanyInfo")
+    public void etlKuaishouReportCompanyInfo(){
+        Date date = DateUtils.addDay(new Date(),-1);
+        materialReportDailyService.etlKuaishouReportCompanyInfo(DateUtils.formatDate(date));
+    }
 }

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

@@ -21,4 +21,6 @@ public interface EtlKuaishouAccountMaterialReportDailyMapper extends BaseMapper<
     void replaceBatch(@Param(value = "records")List<EtlKuaishouAccountMaterialReportDaily> getList);
 
     void replace(@Param(value = "report")EtlKuaishouAccountMaterialReportDaily report);
+
+    void etlKuaishouReportCompanyInfo(@Param(value = "date") String formatDate);
 }

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

@@ -208,6 +208,14 @@
             #{report.play3sCount}
         )
     </insert>
+    <update id="etlKuaishouReportCompanyInfo">
+        update ctop_etl_kuaishou_account_material_report_daily a left join ctop_user_allocation cua on a.account_id = cua.account_id
+            left join user_company uc on cua.user_id = uc.user_id
+            set a.company_name = uc.company_name
+        where a.company_name is null
+          and uc.company_name is not null
+          and a.stat_date = :date
+    </update>
     <select id="etlKuaishouAccountMaterialReportDailyList"
             resultType="cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouAccountMaterialReportDaily">
     select

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IEtlKuaishouAccountMaterialReportDailyService.java

@@ -14,4 +14,6 @@ public interface IEtlKuaishouAccountMaterialReportDailyService extends IService<
     void etlKuaishouAccountMaterialReportDailyData(String date);
 
     void etlKuaishouAccountMaterialReportInfo(String formatDate);
+
+    void etlKuaishouReportCompanyInfo(String formatDate);
 }

+ 5 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/EtlKuaishouAccountMaterialReportDailyServiceImpl.java

@@ -76,4 +76,9 @@ public class EtlKuaishouAccountMaterialReportDailyServiceImpl extends ServiceImp
         }
         log.info("{}数据获取完成",formatDate);
     }
+
+    @Override
+    public void etlKuaishouReportCompanyInfo(String formatDate) {
+        etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouReportCompanyInfo(formatDate);
+    }
 }