Forráskód Böngészése

修改数据百分比返回格式

songyh 3 éve
szülő
commit
94ae3ca2e3

+ 29 - 29
jeecg-boot-report/src/main/java/cn/com/ctop/common/constant/AccountReportConstants.java

@@ -154,7 +154,7 @@ public class AccountReportConstants {
             "}";
     public static final String KUAISHOU_FILED_MAPPING_JSON = "{\n" +
             "  \"cost\": {\n" +
-            "    \"filed\": \"IFNULL(sum(charge),0) as cost \",\n" +
+            "    \"filed\": \"IFNULL(sum(charge),3) as cost \",\n" +
             "    \"comment\": \"消耗\"\n" +
             "  },\n" +
             "  \"photoShow\": {\n" +
@@ -174,11 +174,11 @@ public class AccountReportConstants {
             "    \"comment\": \"行为数\"\n" +
             "  },\n" +
             "  \"clickRate\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(`show`) != 0  THEN ROUND(sum(photo_click)/sum(`show`)*100,2)  else 0 END AS clickRate \",\n" +
+            "    \"filed\": \"CASE WHEN sum(`show`) != 0  THEN ROUND(sum(photo_click)/sum(`show`),4)  else 0 END AS clickRate \",\n" +
             "    \"comment\": \"封面点击率\"\n" +
             "  },\n" +
             "  \"bClickRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(aclick) != 0 THEN ROUND(sum(bclick)/sum(aclick) * 100,2) ELSE 0 END AS bClickRate \",\n" +
+            "    \"filed\": \"CASE WHEN  sum(aclick) != 0 THEN ROUND(sum(bclick)/sum(aclick),4) ELSE 0 END AS bClickRate \",\n" +
             "    \"comment\": \"行为率\"\n" +
             "  },\n" +
             "  \"cpm\": {\n" +
@@ -202,7 +202,7 @@ public class AccountReportConstants {
             "    \"comment\": \"安卓开始下载单价\"\n" +
             "  },\n" +
             "  \"downloadStartRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN round(sum(download_started)/sum(bclick)*100,2) else 0 end AS downloadStartRate\",\n" +
+            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN round(sum(download_started)/sum(bclick),4) else 0 end AS downloadStartRate\",\n" +
             "    \"comment\": \"安卓开始下载率\"\n" +
             "  },\n" +
             "  \"downloadFinish\": {\n" +
@@ -214,7 +214,7 @@ public class AccountReportConstants {
             "    \"comment\": \"安卓下载完成单价\"\n" +
             "  },\n" +
             "  \"downloadFinishRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(download_started) != 0 then  round(sum(download_completed)/sum(download_started)*100,2) else 0 end AS downloadFinishRate  \",\n" +
+            "    \"filed\": \"CASE WHEN  sum(download_started) != 0 then  round(sum(download_completed)/sum(download_started),4) else 0 end AS downloadFinishRate  \",\n" +
             "    \"comment\": \"安卓下载完成率\"\n" +
             "  },\n" +
             "  \"active\": {\n" +
@@ -234,7 +234,7 @@ public class AccountReportConstants {
             "    \"comment\": \"首日付费金额\"\n" +
             "  },\n" +
             "  \"firstDayPayCost\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_pay_first_day) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_pay_first_day),2) end AS firstDayPayCost \",\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_pay_first_day) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_pay_first_day),3) end AS firstDayPayCost \",\n" +
             "    \"comment\": \"首日付费成本\"\n" +
             "  },\n" +
             "  \"firstDayPayROI\": {\n" +
@@ -266,7 +266,7 @@ public class AccountReportConstants {
             "    \"comment\": \"注册成本\"\n" +
             "  },\n" +
             "  \"activeRegisterRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(activation) !=0  THEN round(sum(event_register)/sum(activation)*100,2) else 0 end as activeRegisterRate \",\n" +
+            "    \"filed\": \"CASE WHEN  sum(activation) !=0  THEN round(sum(event_register)/sum(activation),4) else 0 end as activeRegisterRate \",\n" +
             "    \"comment\": \"注册率\"\n" +
             "  },\n" +
             "  \"eventJinJianApp\": {\n" +
@@ -286,7 +286,7 @@ public class AccountReportConstants {
             "    \"comment\": \"授信成本\"\n" +
             "  },\n" +
             "  \"eventCreditGrantAppRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(event_jin_jian_app) !=0 THEN round(sum(event_credit_grant_app)/sum(event_jin_jian_app)*100,2) ELSE 0 end as eventCreditGrantAppRate\",\n" +
+            "    \"filed\": \"CASE WHEN  sum(event_jin_jian_app) !=0 THEN round(sum(event_credit_grant_app)/sum(event_jin_jian_app),4) ELSE 0 end as eventCreditGrantAppRate\",\n" +
             "    \"comment\": \"授信率\"\n" +
             "  },\n" +
             "  \"formCount\": {\n" +
@@ -294,7 +294,7 @@ public class AccountReportConstants {
             "    \"comment\": \"表单提交数\"\n" +
             "  },\n" +
             "  \"formCountRate\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(activation) != 0  THEN  round(sum(form_count)/sum(activation)*100,2) else 0 end as formCountRate \",\n" +
+            "    \"filed\": \"CASE WHEN sum(activation) != 0  THEN  round(sum(form_count)/sum(activation),4) else 0 end as formCountRate \",\n" +
             "    \"comment\": \"表单提交率\"\n" +
             "  },\n" +
             "  \"formCountCost\": {\n" +
@@ -310,7 +310,7 @@ public class AccountReportConstants {
             "    \"comment\": \"次留成本\"\n" +
             "  },\n" +
             "  \"nextDayOpenRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(activation) != 0 THEN  round(sum(event_next_day_stay)/sum(activation)*100,2) ELSE 0 end as nextDayOpenRate\",\n" +
+            "    \"filed\": \"CASE WHEN  sum(activation) != 0 THEN  round(sum(event_next_day_stay)/sum(activation),4) ELSE 0 end as nextDayOpenRate\",\n" +
             "    \"comment\": \"次留率\"\n" +
             "  },\n" +
             "  \"eventJinJianLandingPage\": {\n" +
@@ -330,7 +330,7 @@ public class AccountReportConstants {
             "    \"comment\": \"落地页授信成本\"\n" +
             "  },\n" +
             "  \"eventCreditGrantLandingPageRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(event_jin_jian_landing_page)  != 0 THEN  round(sum(event_credit_grant_landing_page)/sum(event_jin_jian_landing_page)*100,2) ELSE 0 end as eventCreditGrantLandingPageRate \",\n" +
+            "    \"filed\": \"CASE WHEN  sum(event_jin_jian_landing_page)  != 0 THEN  round(sum(event_credit_grant_landing_page)/sum(event_jin_jian_landing_page),2) ELSE 0 end as eventCreditGrantLandingPageRate \",\n" +
             "    \"comment\": \"落地页授信率\"\n" +
             "  },\n" +
             "  \"submit\": {\n" +
@@ -342,15 +342,15 @@ public class AccountReportConstants {
             "    \"comment\": \"按钮点击成本\"\n" +
             "  },\n" +
             "  \"submitRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN round(sum(submit)/sum(bclick)*100,2) else 0 end as submitRate \",\n" +
+            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN round(sum(submit)/sum(bclick),4) else 0 end as submitRate \",\n" +
             "    \"comment\": \"按钮点击率\"\n" +
             "  },\n" +
             "  \"play3sRate\": {\n" +
-            "    \"filed\": \"(CASE WHEN  sum(aclick) != 0 THEN round(sum(play_3s_ratio*aclick)/sum(aclick) * 100,2) ELSE 0 END )AS play3sRate \",\n" +
+            "    \"filed\": \"(CASE WHEN  sum(aclick) != 0 THEN round(sum(play_3s_ratio*aclick)/sum(aclick),4) ELSE 0 END )AS play3sRate \",\n" +
             "    \"comment\": \"3s播放率\"\n" +
             "  },\n" +
             "  \"activeRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(download_completed) != 0 THEN round(sum(activation)/sum(download_completed)*100,2) else 0 end as activeRate \",\n" +
+            "    \"filed\": \"CASE WHEN  sum(download_completed) != 0 THEN round(sum(activation)/sum(download_completed),4) else 0 end as activeRate \",\n" +
             "    \"comment\": \"下载完成激活率\"\n" +
             "  }\n" +
             "}";
@@ -384,11 +384,11 @@ public class AccountReportConstants {
             "    \"comment\": \"行为数\"\n" +
             "  },\n" +
             "  \"clickRate\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(`show`) != 0    THEN ROUND(sum(photo_click) / sum(`show`) * 100,2) else 0 END AS clickRate \",\n" +
+            "    \"filed\": \"CASE WHEN sum(`show`) != 0    THEN ROUND(sum(photo_click) / sum(`show`),4) else 0 END AS clickRate \",\n" +
             "    \"comment\": \"封面点击率\"\n" +
             "  },\n" +
             "  \"bClickRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(aclick) != 0 THEN ROUND(sum(bclick) / sum(aclick)*100,2) ELSE 0 END AS bClickRate \",\n" +
+            "    \"filed\": \"CASE WHEN  sum(aclick) != 0 THEN ROUND(sum(bclick) / sum(aclick),4) ELSE 0 END AS bClickRate \",\n" +
             "    \"comment\": \"行为率\"\n" +
             "  },\n" +
             "  \"cpm\": {\n" +
@@ -408,11 +408,11 @@ public class AccountReportConstants {
             "    \"comment\": \"安卓开始下载数\"\n" +
             "  },\n" +
             "  \"downloadStartCost\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(charge) / (download_started) IS NULL THEN 0 ELSE round(sum(charge)/sum(download_started),2) end AS downloadStartCost \",\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / (download_started) IS NULL THEN 0 ELSE round(sum(charge)/sum(download_started),3) end AS downloadStartCost \",\n" +
             "    \"comment\": \"安卓开始下载单价\"\n" +
             "  },\n" +
             "  \"downloadStartRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN round(sum(download_started) / sum(bclick)*100,2) else 0 end AS downloadStartRate\",\n" +
+            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN round(sum(download_started) / sum(bclick),4) else 0 end AS downloadStartRate\",\n" +
             "    \"comment\": \"安卓开始下载率\"\n" +
             "  },\n" +
             "  \"downloadFinish\": {\n" +
@@ -420,11 +420,11 @@ public class AccountReportConstants {
             "    \"comment\": \"安卓下载完成数\"\n" +
             "  },\n" +
             "  \"downloadFinishCost\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(charge) / sum(download_completed) IS NULL THEN 0 ELSE  round(sum(charge)/sum(download_completed),2) end AS downloadFinishCost \",\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(download_completed) IS NULL THEN 0 ELSE  round(sum(charge)/sum(download_completed),3) end AS downloadFinishCost \",\n" +
             "    \"comment\": \"安卓下载完成单价\"\n" +
             "  },\n" +
             "  \"downloadFinishRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(download_started) != 0 then round(sum(download_completed)/sum(download_started)*100,2) else 0 end AS downloadFinishRate  \",\n" +
+            "    \"filed\": \"CASE WHEN  sum(download_started) != 0 then round(sum(download_completed)/sum(download_started),4) else 0 end AS downloadFinishRate  \",\n" +
             "    \"comment\": \"安卓下载完成率\"\n" +
             "  },\n" +
             "  \"active\": {\n" +
@@ -440,7 +440,7 @@ public class AccountReportConstants {
             "    \"comment\": \"首日付费次数\"\n" +
             "  },\n" +
             "  \"firstDayPayAmount\": {\n" +
-            "    \"filed\": \"IFNULL(sum(event_pay_purchase_amount_first_day),0) as firstDayPayAmount  \",\n" +
+            "    \"filed\": \"IFNULL(sum(event_pay_purchase_amount_first_day),3) as firstDayPayAmount  \",\n" +
             "    \"comment\": \"首日付费金额\"\n" +
             "  },\n" +
             "  \"firstDayPayCost\": {\n" +
@@ -476,7 +476,7 @@ public class AccountReportConstants {
             "    \"comment\": \"注册成本\"\n" +
             "  },\n" +
             "  \"activeRegisterRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(activation) !=0  THEN round(sum(event_register)/sum(activation)*100,2) else 0 end as activeRegisterRate \",\n" +
+            "    \"filed\": \"CASE WHEN  sum(activation) !=0  THEN round(sum(event_register)/sum(activation),4) else 0 end as activeRegisterRate \",\n" +
             "    \"comment\": \"注册率\"\n" +
             "  },\n" +
             "  \"eventJinJianApp\": {\n" +
@@ -496,7 +496,7 @@ public class AccountReportConstants {
             "    \"comment\": \"授信成本\"\n" +
             "  },\n" +
             "  \"eventCreditGrantAppRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(event_jin_jian_app) !=0 THEN round(sum(event_credit_grant_app)/sum(event_jin_jian_app)*100,2) ELSE 0 end as eventCreditGrantAppRate\",\n" +
+            "    \"filed\": \"CASE WHEN  sum(event_jin_jian_app) !=0 THEN round(sum(event_credit_grant_app)/sum(event_jin_jian_app),4) ELSE 0 end as eventCreditGrantAppRate\",\n" +
             "    \"comment\": \"授信率\"\n" +
             "  },\n" +
             "  \"formCount\": {\n" +
@@ -504,7 +504,7 @@ public class AccountReportConstants {
             "    \"comment\": \"表单提交数\"\n" +
             "  },\n" +
             "  \"formCountRate\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(activation) != 0  THEN round(sum(form_count)/sum(activation)*100,2) else 0 end as formCountRate \",\n" +
+            "    \"filed\": \"CASE WHEN sum(activation) != 0  THEN round(sum(form_count)/sum(activation),4) else 0 end as formCountRate \",\n" +
             "    \"comment\": \"表单提交率\"\n" +
             "  },\n" +
             "  \"formCountCost\": {\n" +
@@ -520,7 +520,7 @@ public class AccountReportConstants {
             "    \"comment\": \"次留成本\"\n" +
             "  },\n" +
             "  \"nextDayOpenRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(activation) != 0 THEN round(sum(event_next_day_stay)/sum(activation)*100,2) ELSE 0 end as nextDayOpenRate\",\n" +
+            "    \"filed\": \"CASE WHEN  sum(activation) != 0 THEN round(sum(event_next_day_stay)/sum(activation),4) ELSE 0 end as nextDayOpenRate\",\n" +
             "    \"comment\": \"次留率\"\n" +
             "  },\n" +
             "  \"eventJinJianLandingPage\": {\n" +
@@ -540,7 +540,7 @@ public class AccountReportConstants {
             "    \"comment\": \"落地页授信成本\"\n" +
             "  },\n" +
             "  \"eventCreditGrantLandingPageRate\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(event_jin_jian_landing_page)!=0 THEN round(sum(event_credit_grant_landing_page)/sum(event_jin_jian_landing_page)*100,2) ELSE 0 end as eventCreditGrantLandingPageRate \",\n" +
+            "    \"filed\": \"CASE WHEN sum(event_jin_jian_landing_page)!=0 THEN round(sum(event_credit_grant_landing_page)/sum(event_jin_jian_landing_page),4) ELSE 0 end as eventCreditGrantLandingPageRate \",\n" +
             "    \"comment\": \"落地页授信率\"\n" +
             "  },\n" +
             "  \"submit\": {\n" +
@@ -552,11 +552,11 @@ public class AccountReportConstants {
             "    \"comment\": \"按钮点击成本\"\n" +
             "  },\n" +
             "  \"submitRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN round(sum(submit)/sum(bclick)*100,2) else 0 end as submitRate \",\n" +
+            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN round(sum(submit)/sum(bclick),4) else 0 end as submitRate \",\n" +
             "    \"comment\": \"按钮点击率\"\n" +
             "  },\n" +
             "  \"activeRate\": {\n" +
-            "    \"filed\": \"CASE WHEN  sum(download_completed) != 0 THEN round(sum(activation)/sum(download_completed)*100,2) else 0 end as activeRate \",\n" +
+            "    \"filed\": \"CASE WHEN  sum(download_completed) != 0 THEN round(sum(activation)/sum(download_completed),4) else 0 end as activeRate \",\n" +
             "    \"comment\": \"下载完成激活率\"\n" +
             "  },\n" +
             "  \"play3sCount\": {\n" +
@@ -564,7 +564,7 @@ public class AccountReportConstants {
             "    \"comment\": \"3s播放数\"\n" +
             "  },\n" +
             "  \"play3sRate\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(aclick) != 0 THEN ROUND(sum(play_3s_count)/sum(aclick)* 100,2 ) ELSE 0 END AS play3sRate\",\n" +
+            "    \"filed\": \"CASE WHEN sum(aclick) != 0 THEN ROUND(sum(play_3s_count)/sum(aclick),4 ) ELSE 0 END AS play3sRate\",\n" +
             "    \"comment\": \"3s播放率\"\n" +
             "  }\n" +
             "}";