Pārlūkot izejas kodu

3秒播放率数据调整

zhaoxian 4 gadi atpakaļ
vecāks
revīzija
da4c8fb691

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

@@ -30,6 +30,8 @@ public enum CheckParametersEnum {
     PARAMETER27("eventJinJianLandingPage", "event_jin_jian_landing_page"),
     PARAMETER28("eventCreditGrantLandingPage", "event_credit_grant_landing_page"),
     PARAMETER29("eventNextDayStay", "event_next_day_stay"),
+    PARAMETER31("play3sRatio", "play_3s_ratio"),
+    PARAMETER32("play3sCount", "play_3s_count"),
     PARAMETER30("formCount", "form_count");
 
     private String sqlName;

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

@@ -111,6 +111,7 @@
                SUM(event_credit_grant_landing_page) as 'eventCreditGrantLandingPage',
                SUM(event_next_day_stay) as 'eventNextDayStay',
                SUM(form_count) as 'formCount',
+               SUM(play_3s_count) as 'play3sCount',
                IFNULL(ROUND(SUM(charge) / SUM(activation), 2), 0) as 'activationCost',
                IFNULL(ROUND(SUM(charge) / SUM(aclick) * 1000, 2), 0) as 'impression1kCost',
                IFNULL(ROUND(SUM(charge) / SUM(photo_click), 2), 0) as 'photoClickCost',
@@ -142,7 +143,8 @@
                IFNULL(ROUND(SUM(event_credit_grant_app) / SUM(event_jin_jian_app) * 100, 2),
                       0) as 'eventCreditGrantAppRatio',
                IFNULL(ROUND(SUM(form_count) / SUM(bclick) * 100, 2), 0) as 'formActionRatio',
-               IFNULL(ROUND(SUM(submit) / SUM(bclick) * 100, 2), 0) as 'submitRatio'
+               IFNULL(ROUND(SUM(submit) / SUM(bclick) * 100, 2), 0) as 'submitRatio',
+               IFNULL(ROUND(SUM(play_3s_count) / SUM(photo_show) * 100, 2), 0) as 'play3sRatio'
         FROM ctop_etl_kuaishou_report_account_daily
         WHERE account_id = #{accountId}
           AND stat_date >= #{startTime}
@@ -153,7 +155,7 @@
     <select id="getOnedayEtlReportList" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         <if test="type == 'alone'">
-            ${value} as 'value',
+            IFNULL(${value},0) as 'value',
         </if>
         <if test="type == 'more'">
             <if test="value == 'activationCost'">

+ 3 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountHourlyMapper.xml

@@ -121,7 +121,7 @@
     <select id="getOnedayEtlReportList" resultType="com.alibaba.fastjson.JSONObject">
         SELECT stat_date as 'statDate',
         <if test="type == 'alone'">
-            ${value} as 'value',
+            IFNULL(${value},0) as 'value',
         </if>
         <if test="type == 'more'">
             <if test="value == 'activationCost'">
@@ -136,8 +136,8 @@
             <if test="value == 'actionCost'">
                 IFNULL(ROUND(charge / bclick, 2), 0) as 'value',
             </if>
-            <if test="value == 'play3sRatio'">
-                IFNULL(ROUND(play_3s_count / photo_show * 100, 2), 0) as 'value',
+            <if test="value == 'play3sCount'">
+                IFNULL(ROUND(play_3s_ratio * photo_show, 2), 0) as 'value',
             </if>
             <if test="value == 'downloadStartedCost'">
                 IFNULL(ROUND(charge / download_started, 2), 0) as 'value',

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

@@ -128,12 +128,20 @@ public class EtlKuaishouReportAccountHourlyServiceImpl extends ServiceImpl<EtlKu
             if ("photo_comment".equals(value)) {
                 value = "comment";
             }
+            if("play_3s_count".equals(value)){
+                value =  value = request.getString("value");
+                type = "more";
+            }
             todayList = etlHourlyAccountMapper.getOnedayEtlReportList(startTime, accountId, value, type);
             String lastDay = DateUtils.getLastDay(startTime, 1);
             yesterdayList = etlHourlyAccountMapper.getOnedayEtlReportList(lastDay, accountId, value, type);
             completionTime(todayList);
             completionTime(yesterdayList);
         } else {
+            if (value.equals("play_3s_ratio")) {
+                value = request.getString("value");
+                type = "more";
+            }
             updateTime = etlDailyAccountMapper.getNewlyUpdateTime();
             todayList = etlDailyAccountMapper.getOnedayEtlReportList(startTime, endTime, accountId, value, type);
             int days = DateUtils.dateDiff(startTime, endTime);