浏览代码

Merge branch 'V2.0.1' into test

zhaoxian 3 年之前
父节点
当前提交
6f2e3ee842

+ 4 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaiShouAccountReportCtrl.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.report.controller;
 
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.ExportExcelUtils;
 import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouAccountReportService;
@@ -130,6 +131,9 @@ public class KuaiShouAccountReportCtrl {
         String startDate = requestBody.getString("startDate");
         String endDate = requestBody.getString("endDate");
         String target = requestBody.getString("target");
+        if (!Check.isNull(target) && "photo_show".equals(target)) {
+            target = "`show`";
+        }
         String order = requestBody.getString("order");
         int hour = requestBody.getInteger("hour");
         List<JSONObject> excelData = kuaiShouAccountReportService.getExcelDataBy(filed, mediaId, accounts, startDate, endDate, hour, target, order);

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaiShouAccountReportServiceImpl.java

@@ -97,7 +97,7 @@ public class KuaiShouAccountReportServiceImpl implements IKuaiShouAccountReportS
             target = "`show`";
         }
         String filedAll = JsonResourceUtil.joinAllFiled(AccountReportConstants.getDicMapKs());
-        filedAll = filedAll.replace("t1.photo_show", "`show`");
+        filedAll = filedAll.replace("photo_show", "`show`");
         if (startDate.equals(endDate)) {
             if (startDate.equals(DateUtils.date2Str())) {
                 result = kuaiShouAccountReportMapper.queryTodaySumByHourGroupAccount(filedAll, startDate, hour, accounts, target, order);

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/common/constant/AccountReportConstants.java

@@ -350,6 +350,14 @@ public class AccountReportConstants {
             "    \"filed\": \"(CASE WHEN  sum(t1.aclick) != 0 THEN round( sum(t1.play_3s_ratio * t1.aclick) / sum(t1.aclick) * 100,2) ELSE 0 END )AS play3sRate \",\n" +
             "    \"comment\": \"3s播放率\"\n" +
             "  },\n" +
+            "  \"keyAction\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.key_action),0) as keyAction \",\n" +
+            "    \"comment\": \"关键行为数\"\n" +
+            "  },\n" +
+            "  \"keyActionCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.charge) / sum(t1.key_action) IS NULL THEN 0 ELSE round(sum(t1.charge)/sum(t1.key_action),3) end as keyActionCost \",\n" +
+            "    \"comment\": \"关键行为成本\"\n" +
+            "  },\n" +
             "  \"activeRate\": {\n" +
             "    \"filed\": \"CASE WHEN  sum(t1.download_completed) != 0 THEN concat(CAST(round(sum(t1.activation) / sum(t1.download_completed)*100,2) AS CHAR) ,'%') else '0%' end as activeRate \",\n" +
             "    \"comment\": \"下载完成激活率\"\n" +
@@ -971,6 +979,12 @@ public class AccountReportConstants {
             "  \"play3sRate\": {\n" +
             "    \"comment\": \"3s播放率\"\n" +
             "  },\n" +
+            "  \"keyAction\": {\n" +
+            "    \"comment\": \"关键行为数\"\n" +
+            "  },\n" +
+            "  \"keyActionCost\": {\n" +
+            "    \"comment\": \"关键行为成本\"\n" +
+            "  },\n" +
             "  \"adScene\": {\n" +
             "    \"comment\": \"投放场景\"\n" +
             "  }\n" +