Quellcode durchsuchen

Merge remote-tracking branch 'origin/V1.1.5' into V1.1.5

syh vor 4 Jahren
Ursprung
Commit
c303eee24f

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

@@ -1,6 +1,7 @@
 package cn.com.ctop.job.kuaishou.handler;
 
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouVideoGetService;
+import cn.com.ctop.kuaishou.modules.material.service.IEtlKuaishouVideoInfoService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouVideoEtlInfoService;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import org.jeecg.common.util.DateUtils;
@@ -15,6 +16,9 @@ public class KuaishouEtlVideoJob {
     private IKuaishouVideoEtlInfoService kuaishouVideoEtlInfoService;
     @Autowired
     private IKuaiShouVideoGetService videoGetService;
+    @Autowired
+    private IEtlKuaishouVideoInfoService videoEtlInfoService;
+
 
     @XxlJob("kuaishouEtlVideoJob")
     public void execute() throws Exception {
@@ -40,5 +44,12 @@ public class KuaishouEtlVideoJob {
         videoGetService.etlVideoBaseInfoByStaDate(statDate);
     }
 
+    @XxlJob("etlFinalKuaishouVideoInfo")
+    public void etlKuaishouVideoInfo(){
+        Date startDate = DateUtils.addDay(new Date(), -2);
+        for(int i=0;i<=2;i++){
+            videoEtlInfoService.etlKuaishouVideoInfo(DateUtils.formatDate(DateUtils.addDay(startDate,i)));
+        }
+    }
 
 }

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

@@ -16,4 +16,6 @@ public interface KsVideoReportMapper {
     List<JSONObject> getKuaiShouVideoReportByMap(Map<String, Object> requestMap);
 
     List<JSONObject> getDesignList();
+
+    Long getTotalByMap(Map<String, Object> requestMap);
 }

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

@@ -53,6 +53,50 @@
     </select>
 
 
+    <select id="getTotalByMap" resultType="java.lang.Long">
+        SELECT
+        count(1)
+        FROM
+        (select
+        t1.signature
+        from ctop_etl_kuaishou_account_material_report_daily t1
+        where 1 = 1
+        <if test="accountIds !=null and accountIds != ''">
+            and t1.account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="startDate !=null and startDate != ''">
+            AND t1.stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate !=null and endDate != ''">
+            AND t1.stat_date &lt;= #{endDate}
+        </if>
+        GROUP BY t1.signature
+        ) t1
+        LEFT JOIN ctop_etl_kuaishou_video_info t2
+        ON t1.signature = t2.video_code
+        WHERE
+        1 = 1
+        <if test="leaderId !=null and leaderId != ''">
+            AND t2.design_team_leader_id = #{leaderId}
+        </if>
+        <if test="clipId !=null and clipId != ''">
+            AND t2.clip_id = #{clipId}
+        </if>
+        <if test="planId !=null and planId != ''">
+            AND t2.plan_id = #{planId}
+        </if>
+        <if test="shotId !=null and shotId != ''">
+            AND t2.shot_id = #{shotId}
+        </if>
+
+
+    </select>
+
+
     <select id="queryVideoReportBy" resultType="com.alibaba.fastjson.JSONObject">
         SELECT * from (SELECT
         t1.signature,
@@ -150,4 +194,5 @@
 	)
     </select>
 
+
 </mapper>

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

@@ -37,9 +37,11 @@ public class KsVideoReportServiceImpl implements IKsVideoReportService {
 
     @Override
     public PageInfo<JSONObject> getKuaiShouVideoPageReportByMap(Map<String, Object> requestMap, int pageSize, int pageNo) {
-        PageHelper.startPage(pageNo, pageSize);
-        List<JSONObject> jsonObjectList = ksVideoReportMapper.getKuaiShouVideoReportByMap(requestMap);
-        return new PageInfo<>(jsonObjectList);
+        Long total = ksVideoReportMapper.getTotalByMap(requestMap);
+        PageHelper.startPage(pageNo, pageSize, false);
+        PageInfo pageInfo = new PageInfo(ksVideoReportMapper.getKuaiShouVideoReportByMap(requestMap));
+        pageInfo.setTotal(total);
+        return pageInfo;
 
     }