ソースを参照

report模块代码提交

songyh 3 年 前
コミット
0bb75cc45b
63 ファイル変更8629 行追加109 行削除
  1. 0 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/MaterialInfoMapper.java
  2. 2 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java
  3. 16 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml
  4. 1 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java
  5. 23 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java
  6. 58 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  7. 940 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/constant/AccountReportConstants.java
  8. 96 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/constant/CtopAdConstant.java
  9. 138 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/entity/Project.java
  10. 119 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/entity/ProjectMember.java
  11. 1 1
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/SysRole.java
  12. 1 1
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/UserAllocation.java
  13. 21 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/ProjectMapper.java
  14. 59 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/ProjectMemberMapper.java
  15. 21 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/SysDepartMapper.java
  16. 2 2
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/SysRoleMapper.java
  17. 20 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/SysUserMapper.java
  18. 4 3
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/UserAllocationMapper.java
  19. 16 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/ProjectMapper.xml
  20. 295 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/ProjectMemberMapper.xml
  21. 19 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/SysDepartMapper.xml
  22. 2 2
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/SysRoleMapper.xml
  23. 8 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/SysUserMapper.xml
  24. 25 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/UserAllocationMapper.xml
  25. 51 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/service/IProjectMemberService.java
  26. 19 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/service/ISysUserService.java
  27. 8 2
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/IUserAllocationService.java
  28. 293 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/service/impl/ProjectMemberServiceImpl.java
  29. 49 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/service/impl/SysUserServiceImpl.java
  30. 62 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/service/impl/UserAllocationServiceImpl.java
  31. 137 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/Check.java
  32. 122 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/JsonResourceUtil.java
  33. 49 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/LinkUtils.java
  34. 31 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/ResultMapUtils.java
  35. 126 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/StatusCode.java
  36. 116 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/controller/KuaishouAccountReportDailyDwController.java
  37. 208 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/controller/KuaishouMaterialReportDailyDwController.java
  38. 0 60
      jeecg-boot-report/src/main/java/cn/com/ctop/report/controller/TestController.java
  39. 502 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouAccountReportHourlyDw.java
  40. 506 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouCampaignReportDailyDw.java
  41. 507 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouCampaignReportHourlyDw.java
  42. 510 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouCreativeReportDailyDw.java
  43. 511 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouCreativeReportHourlyDw.java
  44. 511 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouMaterialVideoReportDailyDw.java
  45. 526 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouMaterialVideoReportHourlyDw.java
  46. 508 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouUnitReportDailyDw.java
  47. 509 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouUnitReportHourlyDw.java
  48. 27 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/AccountAttributionInfoMapper.java
  49. 13 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/KuaishouAccountReportDailyDwMapper.java
  50. 13 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/KuaishouAccountReportHourlyDwMapper.java
  51. 18 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/KuaishouMaterialVideoReportDailyDwMapper.java
  52. 160 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/AccountAttributionInfoMapper.xml
  53. 26 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/KuaishouAccountReportDailyDwMapper.xml
  54. 22 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/KuaishouAccountReportHourlyDwMapper.xml
  55. 131 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/KuaishouMaterialVideoReportDailyDwMapper.xml
  56. 0 8
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/UserAllocationMapper.xml
  57. 20 1
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/AccountAttributionInfoService.java
  58. 14 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/IKuaishouAccountReportDailyDwService.java
  59. 17 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/IKuaishouMaterialVideoReportDailyDwService.java
  60. 307 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/impl/AccountAttributionInfoServiceImpl.java
  61. 78 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/impl/KuaishouAccountReportDailyDwServiceImpl.java
  62. 35 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/impl/KuaishouMaterialVideoReportDailyDwServiceImpl.java
  63. 0 28
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/impl/UserAllocationServiceImpl.java

+ 0 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/MaterialInfoMapper.java

@@ -25,7 +25,6 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> {
 
     Integer getToutiaoUpVideoCount(@Param("code") String code);
 
-
     List<String> getEffiSignature();
 
     MaterialInfo getMaterialInfoByCode(@Param("code") String code);

+ 2 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java

@@ -69,4 +69,6 @@ public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
     void updCwjsSettlementStatus(@Param("id") String id, @Param("status") Integer status);
 
     List<UserAllocation> getAccountInfoBySalesId(@Param("sales")Set<String> sales,@Param("mediaId")String mediaId,@Param("advertiserId")String advertiserId,@Param("productId")String productId);
+
+    List<JSONObject> getAccountListByProjectListV2(@Param("list")List list);
 }

+ 16 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml

@@ -265,6 +265,22 @@
             </foreach>
         </if>
     </select>
+    <select id="getAccountListByProjectListV2" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        t1.project_id as 'projectId',
+        t1.account_id as 'accountId',
+        (select realname from sys_user where id = t1.user_id ) as 'userName',
+        t1.auth_name as 'authName',
+        t1.account_status as 'accountStatus'
+        from ctop_user_allocation t1
+        where t1.project_id in
+        <foreach collection="list" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        and t1.account_status = 0
+        order by t1.create_time desc
+    </select>
     <!-- 修改状态 -->
     <update id="updCwjsSettlementStatus">
         UPDATE ctop_cwjs_settlement_info

+ 1 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java

@@ -71,4 +71,5 @@ public interface IUserAllocationService extends IService<UserAllocation> {
 
     Result<UserAllocation> editUserAlloCation(UserAllocation userAllocation);
 
+    Map<Long, List<JSONObject>> getAccountListByProjectListV2(List<JSONObject> projectList);
 }

+ 23 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java

@@ -195,6 +195,29 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
     }
 
     @Override
+    public Map<Long, List<JSONObject>> getAccountListByProjectListV2(List<JSONObject> projectList) {
+        Map<Long, List<JSONObject>> map = new HashMap<>();
+        List list = new ArrayList();
+        for (int i = 0; i < projectList.size(); i++) {
+            JSONObject jsonObject = projectList.get(i);
+            if (!Check.isNull(jsonObject)) {
+                list.add(jsonObject.getLong("projectId"));
+                map.put(jsonObject.getLong("projectId"), new ArrayList<>());
+            }
+        }
+        List<JSONObject> jsonList = userAllocationMapper.getAccountListByProjectListV2(list);
+        for (int i = 0; i < jsonList.size(); i++) {
+            JSONObject jsonObject = jsonList.get(i);
+            if (!Check.isNull(jsonObject)) {
+                Long projectId = jsonObject.getLong("projectId");
+                List<JSONObject> jsonObjects = map.get(projectId);
+                jsonObjects.add(jsonObject);
+            }
+        }
+        return map;
+    }
+
+    @Override
     public List<JSONObject> getUserIdListByProductId(Long productId) {
         return userAllocationMapper.getUserIdListByProductId(productId);
     }

+ 58 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java

@@ -326,6 +326,64 @@ public class ProjectMemberController {
         return result;
     }
 
+    /**
+     * 获取项目以及账户信息
+     *
+     * @param requestJson
+     * @return
+     */
+    @PostMapping(value = "/participateListByMediaIdV2")
+    public Result<List<JSONObject>> participateListByMediaIdV2(@RequestBody JSONObject requestJson) {
+        Result<List<JSONObject>> result = new Result<>();
+        try {
+            String userId = requestJson.getString("userId");
+            if (Check.isNull(userId)) {
+                throw new Exception("请选择userId");
+            }
+            List<Integer> mediaIds = new ArrayList<>();
+            String type = requestJson.getString("type");
+            if (!Check.isNull(type)) {
+                if ("kuaishou".equals(type)) {
+                    mediaIds.add(2);
+                    mediaIds.add(4);
+                } else if ("bytedance".equals(type)) {
+                    mediaIds.add(1);
+                    mediaIds.add(3);
+                }
+            }
+            //查询用户角色
+            String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+            //角色为 管理员 || 销售 || 媒介 查询全部
+            if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
+                userId = null;
+            }
+            //查询项目信息以及广告主
+            List<JSONObject> projectList = projectMemberService.getProjectByUserIdAndMediaIds(userId, mediaIds);
+            List<JSONObject> haveList = new ArrayList<>();
+            if (!Check.isNull(projectList)) {
+                //项目id 查询账户人员信息
+                Map<Long, List<JSONObject>> accountMap = userAllocationService.getAccountListByProjectListV2(projectList);
+                for (int i = 0; i < projectList.size(); i++) {
+                    JSONObject project = projectList.get(i);
+                    if (!Check.isNull(project)) {
+                        List<JSONObject> accountList = accountMap.get(project.getLong("projectId"));
+                        if (!Check.isNull(accountList)) {
+                            project.put("accountList", accountList);
+                            haveList.add(project);
+                        }
+                    }
+                }
+            }
+            result.setSuccess(true);
+            result.setResult(haveList);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
 
     @GetMapping("/projectList")
     public Map<String, Object> projectList(String userId) {

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

@@ -0,0 +1,940 @@
+package cn.com.ctop.common.constant;
+
+import cn.com.ctop.common.utils.JsonResourceUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.Map;
+
+/**
+ * Created by JQ.bi on 2020.5.30
+ */
+public class AccountReportConstants {
+    public static final String BYTEDANCE_FILED_MAPPING_JSON = "{\n" +
+            "  \"cost\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.cost),0) as cost \",\n" +
+            "    \"comment\": \"消耗\"\n" +
+            "  },\n" +
+            "  \"showMaterial\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.show_num),0) as showMaterial \",\n" +
+            "    \"comment\": \"展示数\"\n" +
+            "  },\n" +
+            "  \"cpm\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.show_num) IS NULL THEN 0 ELSE ROUND((sum(t1.cost) / sum(t1.show_num)) * 1000, 2 ) END AS cpm \",\n" +
+            "    \"comment\": \"平均千次展现费用\"\n" +
+            "  },\n" +
+            "  \"clickMaterial\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.click),0) as clickMaterial \",\n" +
+            "    \"comment\": \"点击数\"\n" +
+            "  },\n" +
+            "  \"ctr\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.show_num) != 0 THEN concat(CAST(round( sum(t1.click) /sum(t1.show_num)*100,2) AS CHAR),'%') ELSE '0%' end as ctr \",\n" +
+            "    \"comment\": \"点击率\"\n" +
+            "  },\n" +
+            "  \"cpc\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.click) / sum(t1.cost) IS NULL THEN 0 ELSE ROUND((sum(t1.cost) / sum(t1.click)), 2) END AS cpc \",\n" +
+            "    \"comment\": \"平均点击单价\"\n" +
+            "  },\n" +
+            "  \"convertMaterial\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.convert_num),0) as convertMaterial \",\n" +
+            "    \"comment\": \"转化数\"\n" +
+            "  },\n" +
+            "  \"convertCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.convert_num) IS NULL THEN 0 ELSE ROUND((sum(t1.cost) / sum(t1.convert_num)), 2 ) END AS convertCost \",\n" +
+            "    \"comment\": \"转化成本\"\n" +
+            "  },\n" +
+            "  \"convertRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) != 0 THEN concat(CAST(round(sum(t1.convert_num) / sum(t1.cost)*100,2) AS CHAR) ,'%') ELSE '0%' end AS convertRate\",\n" +
+            "    \"comment\": \"转化率\"\n" +
+            "  },\n" +
+            "  \"downloadStart\": {\n" +
+            "    \"filed\": \"IFNULL(sum(download_start),0) as downloadStart \",\n" +
+            "    \"comment\": \"安卓开始下载数\"\n" +
+            "  },\n" +
+            "  \"downloadStartCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / (t1.download_start) IS NULL THEN 0 ELSE sum(t1.cost) / sum(t1.download_start) end AS downloadStartCost \",\n" +
+            "    \"comment\": \"安卓开始下载成本\"\n" +
+            "  },\n" +
+            "  \"downloadStartRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.click) != 0 THEN concat(CAST(round(sum(t1.download_start) / sum(t1.click)*100,2) AS CHAR),'%') ELSE '0%' end AS downloadStartRate \",\n" +
+            "    \"comment\": \"安卓开始下载率\"\n" +
+            "  },\n" +
+            "  \"downloadFinish\": {\n" +
+            "    \"filed\": \"IFNULL(sum(download_finish),0) as downloadFinish \",\n" +
+            "    \"comment\": \"安卓下载完成数\"\n" +
+            "  },\n" +
+            "  \"downloadFinishCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.download_finish) IS NULL THEN 0 ELSE  sum(t1.cost) / sum(t1.download_finish) end AS downloadFinishCost \",\n" +
+            "    \"comment\": \"安卓下载完成成本\"\n" +
+            "  },\n" +
+            "  \"downloadFinishRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.download_finish) != 0 THEN  concat(CAST(round(sum(t1.install_finish) / sum(t1.download_finish)*100,2) AS CHAR) ,'%') ELSE '0%' end  AS downloadFinishRate \",\n" +
+            "    \"comment\": \"安卓下载完成率\"\n" +
+            "  },\n" +
+            "  \"active\": {\n" +
+            "    \"filed\": \"IFNULL(sum(active),0) as active \",\n" +
+            "    \"comment\": \"激活数\"\n" +
+            "  },\n" +
+            "  \"activeCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.active) IS NULL THEN 0 ELSE sum(t1.cost) / sum(t1.active) end AS activeCost \",\n" +
+            "    \"comment\": \"激活成本\"\n" +
+            "  },\n" +
+            "  \"activeRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.click) != 0 THEN concat(CAST(round(sum(t1.active) / sum(t1.click)*100,2) AS CHAR) ,'%') ELSE '0%' end as activeRate \",\n" +
+            "    \"comment\": \"激活率\"\n" +
+            "  },\n" +
+            "  \"register\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.register),0) as register\",\n" +
+            "    \"comment\": \"注册数\"\n" +
+            "  },\n" +
+            "  \"activeRegisterCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.register) IS NULL THEN 0 ELSE round(sum(t1.cost)/sum(t1.register),3) end as activeRegisterCost \",\n" +
+            "    \"comment\": \"注册成本\"\n" +
+            "  },\n" +
+            "  \"activeRegisterRate\": {\n" +
+            "    \"filed\": \" CASE WHEN sum(t1.active) != 0 THEN concat(CAST(round(sum(t1.register) / sum(t1.active)*100,2) AS CHAR) ,'%') ELSE '0%' end as activeRegisterRate \",\n" +
+            "    \"comment\": \"注册率\"\n" +
+            "  },\n" +
+            "  \"nextDayOpen\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.next_day_open),0) as nextDayOpen \",\n" +
+            "    \"comment\": \"次留数\"\n" +
+            "  },\n" +
+            "  \"nextDayOpenCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.next_day_open) IS NULL THEN 0 ELSE round(sum(t1.cost)/sum(t1.next_day_open),3) end as nextDayOpenCost \",\n" +
+            "    \"comment\": \"次留成本\"\n" +
+            "  },\n" +
+            "  \"nextDayOpenRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.active) != 0 THEN concat(CAST(round(sum(t1.next_day_open) / sum(t1.active)*100,2) AS CHAR) ,'%') ELSE '0%' end as nextDayOpenRate \",\n" +
+            "    \"comment\": \"次留率\"\n" +
+            "  },\n" +
+            "  \"activePayAmount\": {\n" +
+            "    \"filed\": \"IFNULL(sum(pay_count),0) as activePayAmount \",\n" +
+            "    \"comment\": \"付费数\"\n" +
+            "  },\n" +
+            "  \"activePayCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.pay_count) IS NULL THEN 0 ELSE round(sum(t1.cost)/sum(t1.pay_count),3) end as activePayCost \",\n" +
+            "    \"comment\": \"付费成本\"\n" +
+            "  },\n" +
+            "  \"form\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.form),0) as form \",\n" +
+            "    \"comment\": \"表单提交\"\n" +
+            "  },\n" +
+            "  \"validPlayCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.valid_play) IS NULL THEN 0 ELSE round(sum(t1.cost)/sum(t1.valid_play),3) end as validPlayCost \",\n" +
+            "    \"comment\": \"有效播放成本\"\n" +
+            "  },\n" +
+            "  \"play25FeedBreak\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.play25_feed_break),0) as play25FeedBreak \",\n" +
+            "    \"comment\": \"25%进度播放数\"\n" +
+            "  },\n" +
+            "  \"play50FeedBreak\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.play50_feed_break),0) as play50FeedBreak\",\n" +
+            "    \"comment\": \"50%进度播放数\"\n" +
+            "  },\n" +
+            "  \"play75FeedBreak\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.play75_feed_break),0) as play75FeedBreak\",\n" +
+            "    \"comment\": \"75%进度播放数\"\n" +
+            "  },\n" +
+            "  \"play100FeedBreak\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.play100_feed_break),0) as play100FeedBreak\",\n" +
+            "    \"comment\": \"100%进度播放数\"\n" +
+            "  },\n" +
+            "  \"follow\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.follow),0) as follow \",\n" +
+            "    \"comment\": \"新增关注数\"\n" +
+            "  },\n" +
+            "  \"likeMaterial\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.like_num),0) as likeMaterial \",\n" +
+            "    \"comment\": \"点赞数\"\n" +
+            "  },\n" +
+            "  \"shareMaterial\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.share),0) as shareMaterial \",\n" +
+            "    \"comment\": \"分享数\"\n" +
+            "  }\n" +
+            "}";
+    public static final String KUAISHOU_FILED_MAPPING_JSON = "{\n" +
+            "  \"cost\": {\n" +
+            "    \"filed\": \"IFNULL(sum(charge),0) as cost \",\n" +
+            "    \"comment\": \"消耗\"\n" +
+            "  },\n" +
+            "  \"photoShow\": {\n" +
+            "    \"filed\": \"IFNULL(sum(show),0) as photoShow \",\n" +
+            "    \"comment\": \"封面曝光数\"\n" +
+            "  },\n" +
+            "  \"photoClick\": {\n" +
+            "    \"filed\": \"IFNULL(sum(photo_click),0) as photoClick \",\n" +
+            "    \"comment\": \"封面点击数\"\n" +
+            "  },\n" +
+            "  \"aClick\": {\n" +
+            "    \"filed\": \"IFNULL(sum(aclick),0) as aClick \",\n" +
+            "    \"comment\": \"素材曝光数\"\n" +
+            "  },\n" +
+            "  \"bClick\": {\n" +
+            "    \"filed\": \"IFNULL(sum(bclick),0) as bClick \",\n" +
+            "    \"comment\": \"行为数\"\n" +
+            "  },\n" +
+            "  \"clickRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(show) != 0    THEN CONCAT( CAST(ROUND((sum(photo_click) / sum(show)) * 100,2) AS CHAR) ,'%') else '0%' END AS clickRate \",\n" +
+            "    \"comment\": \"封面点击率\"\n" +
+            "  },\n" +
+            "  \"bClickRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(aclick) != 0 THEN CONCAT( CAST(ROUND((sum(bclick) / sum(aclick)) * 100,2) AS CHAR) ,'%') ELSE '0%' END AS bClickRate \",\n" +
+            "    \"comment\": \"行为率\"\n" +
+            "  },\n" +
+            "  \"cpm\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(show) IS NULL THEN 0 ELSE ROUND((sum(charge) / sum(show)) * 1000, 2 ) END AS cpm \",\n" +
+            "    \"comment\": \"平均千次封面曝光花费\"\n" +
+            "  },\n" +
+            "  \"cpc\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(photo_click) IS NULL THEN 0 ELSE ROUND((sum(charge) / sum(photo_click)), 2) END AS cpc \",\n" +
+            "    \"comment\": \"平均封面点击单价\"\n" +
+            "  },\n" +
+            "  \"cpb\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(bclick) IS NULL THEN 0 ELSE ROUND((sum(charge) / sum(bclick)), 2) END AS cpb \",\n" +
+            "    \"comment\": \"平均行为单价\"\n" +
+            "  },\n" +
+            "  \"downloadStart\": {\n" +
+            "    \"filed\": \"IFNULL(sum(download_started),0) as downloadStart \",\n" +
+            "    \"comment\": \"安卓开始下载数\"\n" +
+            "  },\n" +
+            "  \"downloadStartCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / (download_started) IS NULL THEN 0 ELSE sum(charge) / sum(download_started) end AS downloadStartCost \",\n" +
+            "    \"comment\": \"安卓开始下载单价\"\n" +
+            "  },\n" +
+            "  \"downloadStartRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN concat(CAST(round(sum(download_started) / sum(bclick)*100,2) AS CHAR) ,'%') else '0%' end AS downloadStartRate\",\n" +
+            "    \"comment\": \"安卓开始下载率\"\n" +
+            "  },\n" +
+            "  \"downloadFinish\": {\n" +
+            "    \"filed\": \"IFNULL(sum(download_completed),0) as downloadFinish \",\n" +
+            "    \"comment\": \"安卓下载完成数\"\n" +
+            "  },\n" +
+            "  \"downloadFinishCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(download_completed) IS NULL THEN 0 ELSE  sum(charge) / sum(download_completed) end AS downloadFinishCost \",\n" +
+            "    \"comment\": \"安卓下载完成单价\"\n" +
+            "  },\n" +
+            "  \"downloadFinishRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(download_started) != 0 then  concat(CAST(round(sum(download_completed) / sum(download_started)*100,2) AS CHAR) ,'%') else '0%' end AS downloadFinishRate  \",\n" +
+            "    \"comment\": \"安卓下载完成率\"\n" +
+            "  },\n" +
+            "  \"active\": {\n" +
+            "    \"filed\": \"IFNULL(sum(activation),0) as active \",\n" +
+            "    \"comment\": \"激活数\"\n" +
+            "  },\n" +
+            "  \"activeCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(activation) IS NULL THEN 0 ELSE sum(charge) / sum(activation) end AS activeCost \",\n" +
+            "    \"comment\": \"激活单价\"\n" +
+            "  },\n" +
+            "  \"firstDayPay\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(event_pay_first_day) != 0 THEN sum(event_pay_first_day) ELSE 0  end as firstDayPay \",\n" +
+            "    \"comment\": \"首日付费次数\"\n" +
+            "  },\n" +
+            "  \"firstDayPayAmount\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_pay_purchase_amount_first_day),0) as firstDayPayAmount  \",\n" +
+            "    \"comment\": \"首日付费金额\"\n" +
+            "  },\n" +
+            "  \"firstDayPayCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_pay_first_day) IS NULL THEN 0 ELSE sum(charge) / sum(event_pay_first_day) end AS firstDayPayCost \",\n" +
+            "    \"comment\": \"首日付费成本\"\n" +
+            "  },\n" +
+            "  \"firstDayPayROI\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(event_pay_purchase_amount_first_day) / sum(charge) IS NULL THEN '0%' ELSE concat(CAST(round(sum(event_pay_purchase_amount_first_day) / sum(charge)*100,2) AS CHAR) ,'%') end AS firstDayPayROI \",\n" +
+            "    \"comment\": \"首日ROI\"\n" +
+            "  },\n" +
+            "  \"eventPay\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_pay),0) as eventPay  \",\n" +
+            "    \"comment\": \"付费次数\"\n" +
+            "  },\n" +
+            "  \"eventPayPurchaseAmount\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_pay_purchase_amount),0) as eventPayPurchaseAmount  \",\n" +
+            "    \"comment\": \"付费金额\"\n" +
+            "  },\n" +
+            "  \"eventPayCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_pay) IS NULL THEN 0 ELSE sum(charge) / sum(event_pay) end AS eventPayCost \",\n" +
+            "    \"comment\": \"付费次数成本\"\n" +
+            "  },\n" +
+            "  \"ROI\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(event_pay_purchase_amount) / sum(charge) IS NULL THEN '0%' ELSE concat(CAST(round(sum(event_pay_purchase_amount) / sum(charge)*100,2) AS CHAR) ,'%') end AS ROI \",\n" +
+            "    \"comment\": \"ROI\"\n" +
+            "  },\n" +
+            "  \"register\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_register),0) as register \",\n" +
+            "    \"comment\": \"注册数\"\n" +
+            "  },\n" +
+            "  \"activeRegisterCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_register) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_register),3) end as activeRegisterCost \",\n" +
+            "    \"comment\": \"注册成本\"\n" +
+            "  },\n" +
+            "  \"activeRegisterRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(activation) !=0  THEN concat(CAST(round(sum(event_register) / sum(activation)*100,2) AS CHAR) ,'%') else '0%' end as activeRegisterRate \",\n" +
+            "    \"comment\": \"注册率\"\n" +
+            "  },\n" +
+            "  \"eventJinJianApp\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_jin_jian_app),0) as eventJinJianApp \",\n" +
+            "    \"comment\": \"完件数\"\n" +
+            "  },\n" +
+            "  \"eventJinJianAppCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_jin_jian_app) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_jin_jian_app),3) end as eventJinJianAppCost \",\n" +
+            "    \"comment\": \"完件成本\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantApp\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_credit_grant_app),0) as eventCreditGrantApp \",\n" +
+            "    \"comment\": \"授信数\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantAppCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_credit_grant_app) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_credit_grant_app),3) end as eventCreditGrantAppCost \",\n" +
+            "    \"comment\": \"授信成本\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantAppRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(event_jin_jian_app) !=0 THEN concat(CAST(round(sum(event_credit_grant_app) / sum(event_jin_jian_app)*100,2) AS CHAR) ,'%') ELSE '0' end as eventCreditGrantAppRate\",\n" +
+            "    \"comment\": \"授信率\"\n" +
+            "  },\n" +
+            "  \"formCount\": {\n" +
+            "    \"filed\": \"IFNULL(sum(form_count),0) as formCount \",\n" +
+            "    \"comment\": \"表单提交数\"\n" +
+            "  },\n" +
+            "  \"formCountRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(activation) != 0  THEN  concat(CAST(round(sum(form_count) / sum(activation)*100,2) AS CHAR) ,'%') else '0%' end as formCountRate \",\n" +
+            "    \"comment\": \"表单提交率\"\n" +
+            "  },\n" +
+            "  \"formCountCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(form_count) IS NULL THEN 0 ELSE round(sum(charge)/sum(form_count),3) end as formCountCost \",\n" +
+            "    \"comment\": \"表单提交成本\"\n" +
+            "  },\n" +
+            "  \"nextDayOpen\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_next_day_stay),0) as nextDayOpen \",\n" +
+            "    \"comment\": \"次留数\"\n" +
+            "  },\n" +
+            "  \"nextDayOpenCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_next_day_stay) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_next_day_stay),3) end as nextDayOpenCost \",\n" +
+            "    \"comment\": \"次留成本\"\n" +
+            "  },\n" +
+            "  \"nextDayOpenRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(activation) != 0 THEN  concat(CAST(round(sum(event_next_day_stay) / sum(activation)*100,2) AS CHAR) ,'%') ELSE '0%' end as nextDayOpenRate\",\n" +
+            "    \"comment\": \"次留率\"\n" +
+            "  },\n" +
+            "  \"eventJinJianLandingPage\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_jin_jian_landing_page),0) as eventJinJianLandingPage \",\n" +
+            "    \"comment\": \"落地页完件数\"\n" +
+            "  },\n" +
+            "  \"eventJinJianLandingPageCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_jin_jian_landing_page) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_jin_jian_landing_page),3) end as eventJinJianLandingPageCost \",\n" +
+            "    \"comment\": \"落地页完件成本\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantLandingPage\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_credit_grant_landing_page),0) as eventCreditGrantLandingPage \",\n" +
+            "    \"comment\": \"落地页授信数\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantLandingPageCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_credit_grant_landing_page) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_credit_grant_landing_page),3) end as eventCreditGrantLandingPageCost \",\n" +
+            "    \"comment\": \"落地页授信成本\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantLandingPageRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(event_jin_jian_landing_page)  != 0 THEN  concat( CAST(round(sum(event_credit_grant_landing_page) / sum(event_jin_jian_landing_page)*100,2) AS CHAR),'%') ELSE '0%' end as eventCreditGrantLandingPageRate \",\n" +
+            "    \"comment\": \"落地页授信率\"\n" +
+            "  },\n" +
+            "  \"submit\": {\n" +
+            "    \"filed\": \"IFNULL(sum(submit),0) as submit \",\n" +
+            "    \"comment\": \"按钮点击数\"\n" +
+            "  },\n" +
+            "  \"submitCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(submit) IS NULL THEN 0 ELSE round(sum(charge)/sum(submit),3) end as submitCost \",\n" +
+            "    \"comment\": \"按钮点击成本\"\n" +
+            "  },\n" +
+            "  \"submitRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN concat(CAST(round(sum(submit) / sum(bclick)*100,2) AS CHAR) ,'%') 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" +
+            "    \"comment\": \"3s播放率\"\n" +
+            "  },\n" +
+            "  \"activeRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(download_completed) != 0 THEN concat(CAST(round(sum(activation) / sum(download_completed)*100,2) AS CHAR) ,'%') else '0%' end as activeRate \",\n" +
+            "    \"comment\": \"下载完成激活率\"\n" +
+            "  }\n" +
+            "}";
+    public static final String KUAISHOU_VIDEO_REPORT_FILED_MAPPING_JSON = "{\n" +
+            "  \"signature\": {\n" +
+            "    \"filed\": \"signature as signature \",\n" +
+            "    \"comment\": \"素材标识\"\n" +
+            "  },\n" +
+            "  \"projectName\": {\n" +
+            "    \"filed\": \"project_name as projectName \",\n" +
+            "    \"comment\": \"项目名称\"\n" +
+            "  },\n" +
+            "  \"cost\": {\n" +
+            "    \"filed\": \"IFNULL(sum(charge),0) as cost \",\n" +
+            "    \"comment\": \"消耗\"\n" +
+            "  },\n" +
+            "  \"photoShow\": {\n" +
+            "    \"filed\": \"IFNULL(sum(show),0) as photoShow \",\n" +
+            "    \"comment\": \"封面曝光数\"\n" +
+            "  },\n" +
+            "  \"photoClick\": {\n" +
+            "    \"filed\": \"IFNULL(sum(photo_click),0) as photoClick \",\n" +
+            "    \"comment\": \"封面点击数\"\n" +
+            "  },\n" +
+            "  \"aClick\": {\n" +
+            "    \"filed\": \"IFNULL(sum(aclick),0) as aClick \",\n" +
+            "    \"comment\": \"素材曝光数\"\n" +
+            "  },\n" +
+            "  \"bClick\": {\n" +
+            "    \"filed\": \"IFNULL(sum(bclick),0) as bClick \",\n" +
+            "    \"comment\": \"行为数\"\n" +
+            "  },\n" +
+            "  \"clickRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(show) != 0    THEN CONCAT( CAST(ROUND((sum(photo_click) / sum(show)) * 100,2) AS CHAR) ,'%') else '0%' END AS clickRate \",\n" +
+            "    \"comment\": \"封面点击率\"\n" +
+            "  },\n" +
+            "  \"bClickRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(aclick) != 0 THEN CONCAT( CAST(ROUND((sum(bclick) / sum(aclick)) * 100,2) AS CHAR) ,'%') ELSE '0%' END AS bClickRate \",\n" +
+            "    \"comment\": \"行为率\"\n" +
+            "  },\n" +
+            "  \"cpm\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(show) IS NULL THEN 0 ELSE ROUND((sum(charge) / sum(show)) * 1000, 2 ) END AS cpm \",\n" +
+            "    \"comment\": \"平均千次封面曝光花费\"\n" +
+            "  },\n" +
+            "  \"cpc\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(photo_click) IS NULL THEN 0 ELSE ROUND((sum(charge) / sum(photo_click)), 2) END AS cpc \",\n" +
+            "    \"comment\": \"平均封面点击单价\"\n" +
+            "  },\n" +
+            "  \"cpb\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(bclick) IS NULL THEN 0 ELSE ROUND((sum(charge) / sum(bclick)), 2) END AS cpb \",\n" +
+            "    \"comment\": \"平均行为单价\"\n" +
+            "  },\n" +
+            "  \"downloadStart\": {\n" +
+            "    \"filed\": \"IFNULL(sum(download_started),0) as downloadStart \",\n" +
+            "    \"comment\": \"安卓开始下载数\"\n" +
+            "  },\n" +
+            "  \"downloadStartCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / (download_started) IS NULL THEN 0 ELSE sum(charge) / sum(download_started) end AS downloadStartCost \",\n" +
+            "    \"comment\": \"安卓开始下载单价\"\n" +
+            "  },\n" +
+            "  \"downloadStartRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN concat(CAST(round(sum(download_started) / sum(bclick)*100,2) AS CHAR) ,'%') else '0%' end AS downloadStartRate\",\n" +
+            "    \"comment\": \"安卓开始下载率\"\n" +
+            "  },\n" +
+            "  \"downloadFinish\": {\n" +
+            "    \"filed\": \"IFNULL(sum(download_completed),0) as downloadFinish \",\n" +
+            "    \"comment\": \"安卓下载完成数\"\n" +
+            "  },\n" +
+            "  \"downloadFinishCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(download_completed) IS NULL THEN 0 ELSE  sum(charge) / sum(download_completed) end AS downloadFinishCost \",\n" +
+            "    \"comment\": \"安卓下载完成单价\"\n" +
+            "  },\n" +
+            "  \"downloadFinishRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(download_started) != 0 then  concat(CAST(round(sum(download_completed) / sum(download_started)*100,2) AS CHAR) ,'%') else '0%' end AS downloadFinishRate  \",\n" +
+            "    \"comment\": \"安卓下载完成率\"\n" +
+            "  },\n" +
+            "  \"active\": {\n" +
+            "    \"filed\": \"IFNULL(sum(activation),0) as active \",\n" +
+            "    \"comment\": \"激活数\"\n" +
+            "  },\n" +
+            "  \"activeCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(activation) IS NULL THEN 0 ELSE sum(charge) / sum(activation) end AS activeCost \",\n" +
+            "    \"comment\": \"激活单价\"\n" +
+            "  },\n" +
+            "  \"firstDayPay\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(event_pay_first_day) != 0 THEN sum(event_pay_first_day) ELSE 0  end as firstDayPay \",\n" +
+            "    \"comment\": \"首日付费次数\"\n" +
+            "  },\n" +
+            "  \"firstDayPayAmount\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_pay_purchase_amount_first_day),0) as firstDayPayAmount  \",\n" +
+            "    \"comment\": \"首日付费金额\"\n" +
+            "  },\n" +
+            "  \"firstDayPayCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_pay_first_day) IS NULL THEN 0 ELSE sum(charge) / sum(event_pay_first_day) end AS firstDayPayCost \",\n" +
+            "    \"comment\": \"首日付费成本\"\n" +
+            "  },\n" +
+            "  \"firstDayPayROI\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(event_pay_purchase_amount_first_day) / sum(charge) IS NULL THEN 0 ELSE sum(event_pay_purchase_amount_first_day) / sum(charge) end AS firstDayPayROI \",\n" +
+            "    \"comment\": \"首日ROI\"\n" +
+            "  },\n" +
+            "  \"eventPay\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_pay),0) as eventPay  \",\n" +
+            "    \"comment\": \"付费次数\"\n" +
+            "  },\n" +
+            "  \"eventPayPurchaseAmount\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_pay_purchase_amount),0) as eventPayPurchaseAmount  \",\n" +
+            "    \"comment\": \"付费金额\"\n" +
+            "  },\n" +
+            "  \"eventPayCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_pay) IS NULL THEN 0 ELSE sum(charge) / sum(event_pay) end AS eventPayCost \",\n" +
+            "    \"comment\": \"付费次数成本\"\n" +
+            "  },\n" +
+            "  \"ROI\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(event_pay_purchase_amount) / sum(charge) IS NULL THEN 0 ELSE sum(event_pay_purchase_amount) / sum(charge) end AS ROI \",\n" +
+            "    \"comment\": \"ROI\"\n" +
+            "  },\n" +
+            "  \"register\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_register),0) as register \",\n" +
+            "    \"comment\": \"注册数\"\n" +
+            "  },\n" +
+            "  \"activeRegisterCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_register) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_register),3) end as activeRegisterCost \",\n" +
+            "    \"comment\": \"注册成本\"\n" +
+            "  },\n" +
+            "  \"activeRegisterRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(activation) !=0  THEN concat(CAST(round(sum(event_register) / sum(activation)*100,2) AS CHAR) ,'%') else '0%' end as activeRegisterRate \",\n" +
+            "    \"comment\": \"注册率\"\n" +
+            "  },\n" +
+            "  \"eventJinJianApp\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_jin_jian_app),0) as eventJinJianApp \",\n" +
+            "    \"comment\": \"完件数\"\n" +
+            "  },\n" +
+            "  \"eventJinJianAppCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_jin_jian_app) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_jin_jian_app),3) end as eventJinJianAppCost \",\n" +
+            "    \"comment\": \"完件成本\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantApp\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_credit_grant_app),0) as eventCreditGrantApp \",\n" +
+            "    \"comment\": \"授信数\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantAppCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_credit_grant_app) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_credit_grant_app),3) end as eventCreditGrantAppCost \",\n" +
+            "    \"comment\": \"授信成本\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantAppRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(event_jin_jian_app) !=0 THEN concat(CAST(round(sum(event_credit_grant_app) / sum(event_jin_jian_app)*100,2) AS CHAR) ,'%') ELSE '0' end as eventCreditGrantAppRate\",\n" +
+            "    \"comment\": \"授信率\"\n" +
+            "  },\n" +
+            "  \"formCount\": {\n" +
+            "    \"filed\": \"IFNULL(sum(form_count),0) as formCount \",\n" +
+            "    \"comment\": \"表单提交数\"\n" +
+            "  },\n" +
+            "  \"formCountRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(activation) != 0  THEN  concat(CAST(round(sum(form_count) / sum(activation)*100,2) AS CHAR) ,'%') else '0%' end as formCountRate \",\n" +
+            "    \"comment\": \"表单提交率\"\n" +
+            "  },\n" +
+            "  \"formCountCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(form_count) IS NULL THEN 0 ELSE round(sum(charge)/sum(form_count),3) end as formCountCost \",\n" +
+            "    \"comment\": \"表单提交成本\"\n" +
+            "  },\n" +
+            "  \"nextDayOpen\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_next_day_stay),0) as nextDayOpen \",\n" +
+            "    \"comment\": \"次留数\"\n" +
+            "  },\n" +
+            "  \"nextDayOpenCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_next_day_stay) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_next_day_stay),3) end as nextDayOpenCost \",\n" +
+            "    \"comment\": \"次留成本\"\n" +
+            "  },\n" +
+            "  \"nextDayOpenRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(activation) != 0 THEN  concat(CAST(round(sum(event_next_day_stay) / sum(activation)*100,2) AS CHAR) ,'%') ELSE '0%' end as nextDayOpenRate\",\n" +
+            "    \"comment\": \"次留率\"\n" +
+            "  },\n" +
+            "  \"eventJinJianLandingPage\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_jin_jian_landing_page),0) as eventJinJianLandingPage \",\n" +
+            "    \"comment\": \"落地页完件数\"\n" +
+            "  },\n" +
+            "  \"eventJinJianLandingPageCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_jin_jian_landing_page) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_jin_jian_landing_page),3) end as eventJinJianLandingPageCost \",\n" +
+            "    \"comment\": \"落地页完件成本\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantLandingPage\": {\n" +
+            "    \"filed\": \"IFNULL(sum(event_credit_grant_landing_page),0) as eventCreditGrantLandingPage \",\n" +
+            "    \"comment\": \"落地页授信数\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantLandingPageCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(event_credit_grant_landing_page) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_credit_grant_landing_page),3) end as eventCreditGrantLandingPageCost \",\n" +
+            "    \"comment\": \"落地页授信成本\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantLandingPageRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(event_jin_jian_landing_page)  != 0 THEN  concat( CAST(round(sum(event_credit_grant_landing_page) / sum(event_jin_jian_landing_page)*100,2) AS CHAR),'%') ELSE '0%' end as eventCreditGrantLandingPageRate \",\n" +
+            "    \"comment\": \"落地页授信率\"\n" +
+            "  },\n" +
+            "  \"submit\": {\n" +
+            "    \"filed\": \"IFNULL(sum(submit),0) as submit \",\n" +
+            "    \"comment\": \"按钮点击数\"\n" +
+            "  },\n" +
+            "  \"submitCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge) / sum(submit) IS NULL THEN 0 ELSE round(sum(charge)/sum(submit),3) end as submitCost \",\n" +
+            "    \"comment\": \"按钮点击成本\"\n" +
+            "  },\n" +
+            "  \"submitRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN concat(CAST(round(sum(submit) / sum(bclick)*100,2) AS CHAR) ,'%') else '0%' end as submitRate \",\n" +
+            "    \"comment\": \"按钮点击率\"\n" +
+            "  },\n" +
+            "  \"activeRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(download_completed) != 0 THEN concat(CAST(round(sum(activation) / sum(download_completed)*100,2) AS CHAR) ,'%') else '0%' end as activeRate \",\n" +
+            "    \"comment\": \"下载完成激活率\"\n" +
+            "  },\n" +
+            "  \"play3sCount\": {\n" +
+            "    \"filed\": \"sum(play_3s_count) as play3sCount\",\n" +
+            "    \"comment\": \"3s播放数\"\n" +
+            "  },\n" +
+            "  \"play3sRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(aclick) != 0 THEN CONCAT(CAST(ROUND( sum(play_3s_count) / sum(aclick),2 )  * 100 AS CHAR),'%') ELSE '-' END AS play3sRate\",\n" +
+            "    \"comment\": \"3s播放率\"\n" +
+            "  }\n" +
+            "}";
+    public static final String KUAISHOU_VIDEO_REPORT_FILED_DICT_JSON = "{\n" +
+            "  \"clip\": {\n" +
+            "    \"comment\": \"剪辑\"\n" +
+            "  },\n" +
+            "  \"channel\": {\n" +
+            "    \"comment\": \"渠道\"\n" +
+            "  },\n" +
+            "  \"plan\": {\n" +
+            "    \"comment\": \"编导\"\n" +
+            "  },\n" +
+            "  \"shot\": {\n" +
+            "    \"comment\": \"拍摄\"\n" +
+            "  },\n" +
+            "  \"designLeader\": {\n" +
+            "    \"comment\": \"设计负责人\"\n" +
+            "  },\n" +
+            "  \"materialName\": {\n" +
+            "    \"comment\": \"素材名称\"\n" +
+            "  },\n" +
+            "  \"createTime\": {\n" +
+            "    \"comment\": \"创建时间\"\n" +
+            "  },\n" +
+            "  \"coverUrl\": {\n" +
+            "    \"comment\": \"封面链接\"\n" +
+            "  },\n" +
+            "  \"url\": {\n" +
+            "    \"comment\": \"素材链接\"\n" +
+            "  },\n" +
+            "  \"signature\": {\n" +
+            "    \"comment\": \"素材标识\"\n" +
+            "  },\n" +
+            "  \"projectName\": {\n" +
+            "    \"comment\": \"项目名称\"\n" +
+            "  },\n" +
+            "  \"cost\": {\n" +
+            "    \"comment\": \"消耗\"\n" +
+            "  },\n" +
+            "  \"photoShow\": {\n" +
+            "    \"comment\": \"封面曝光数\"\n" +
+            "  },\n" +
+            "  \"photoClick\": {\n" +
+            "    \"comment\": \"封面点击数\"\n" +
+            "  },\n" +
+            "  \"aClick\": {\n" +
+            "    \"comment\": \"素材曝光数\"\n" +
+            "  },\n" +
+            "  \"bClick\": {\n" +
+            "    \"comment\": \"行为数\"\n" +
+            "  },\n" +
+            "  \"clickRate\": {\n" +
+            "    \"comment\": \"封面点击率\"\n" +
+            "  },\n" +
+            "  \"bClickRate\": {\n" +
+            "    \"comment\": \"行为率\"\n" +
+            "  },\n" +
+            "  \"cpm\": {\n" +
+            "    \"comment\": \"平均千次封面曝光花费\"\n" +
+            "  },\n" +
+            "  \"cpc\": {\n" +
+            "    \"comment\": \"平均封面点击单价\"\n" +
+            "  },\n" +
+            "  \"cpb\": {\n" +
+            "    \"comment\": \"平均行为单价\"\n" +
+            "  },\n" +
+            "  \"downloadStart\": {\n" +
+            "    \"comment\": \"安卓开始下载数\"\n" +
+            "  },\n" +
+            "  \"downloadStartCost\": {\n" +
+            "    \"comment\": \"安卓开始下载单价\"\n" +
+            "  },\n" +
+            "  \"downloadStartRate\": {\n" +
+            "    \"comment\": \"安卓开始下载率\"\n" +
+            "  },\n" +
+            "  \"downloadFinish\": {\n" +
+            "    \"comment\": \"安卓下载完成数\"\n" +
+            "  },\n" +
+            "  \"downloadFinishCost\": {\n" +
+            "    \"comment\": \"安卓下载完成单价\"\n" +
+            "  },\n" +
+            "  \"downloadFinishRate\": {\n" +
+            "    \"comment\": \"安卓下载完成率\"\n" +
+            "  },\n" +
+            "  \"active\": {\n" +
+            "    \"comment\": \"激活数\"\n" +
+            "  },\n" +
+            "  \"activeCost\": {\n" +
+            "    \"comment\": \"激活单价\"\n" +
+            "  },\n" +
+            "  \"firstDayPay\": {\n" +
+            "    \"comment\": \"首日付费次数\"\n" +
+            "  },\n" +
+            "  \"firstDayPayAmount\": {\n" +
+            "    \"comment\": \"首日付费金额\"\n" +
+            "  },\n" +
+            "  \"firstDayPayCost\": {\n" +
+            "    \"comment\": \"首日付费成本\"\n" +
+            "  },\n" +
+            "  \"firstDayPayROI\": {\n" +
+            "    \"comment\": \"首日ROI\"\n" +
+            "  },\n" +
+            "  \"eventPay\": {\n" +
+            "    \"comment\": \"付费次数\"\n" +
+            "  },\n" +
+            "  \"eventPayPurchaseAmount\": {\n" +
+            "    \"comment\": \"付费金额\"\n" +
+            "  },\n" +
+            "  \"eventPayCost\": {\n" +
+            "    \"comment\": \"付费次数成本\"\n" +
+            "  },\n" +
+            "  \"ROI\": {\n" +
+            "    \"comment\": \"ROI\"\n" +
+            "  },\n" +
+            "  \"register\": {\n" +
+            "    \"comment\": \"注册数\"\n" +
+            "  },\n" +
+            "  \"activeRegisterCost\": {\n" +
+            "    \"comment\": \"注册成本\"\n" +
+            "  },\n" +
+            "  \"activeRegisterRate\": {\n" +
+            "    \"comment\": \"注册率\"\n" +
+            "  },\n" +
+            "  \"eventJinJianApp\": {\n" +
+            "    \"comment\": \"完件数\"\n" +
+            "  },\n" +
+            "  \"eventJinJianAppCost\": {\n" +
+            "    \"comment\": \"完件成本\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantApp\": {\n" +
+            "    \"comment\": \"授信数\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantAppCost\": {\n" +
+            "    \"comment\": \"授信成本\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantAppRate\": {\n" +
+            "    \"comment\": \"授信率\"\n" +
+            "  },\n" +
+            "  \"formCount\": {\n" +
+            "    \"comment\": \"表单提交数\"\n" +
+            "  },\n" +
+            "  \"formCountRate\": {\n" +
+            "    \"comment\": \"表单提交率\"\n" +
+            "  },\n" +
+            "  \"formCountCost\": {\n" +
+            "    \"comment\": \"表单提交成本\"\n" +
+            "  },\n" +
+            "  \"nextDayOpen\": {\n" +
+            "    \"comment\": \"次留数\"\n" +
+            "  },\n" +
+            "  \"nextDayOpenCost\": {\n" +
+            "    \"comment\": \"次留成本\"\n" +
+            "  },\n" +
+            "  \"nextDayOpenRate\": {\n" +
+            "    \"comment\": \"次留率\"\n" +
+            "  },\n" +
+            "  \"eventJinJianLandingPage\": {\n" +
+            "    \"comment\": \"落地页完件数\"\n" +
+            "  },\n" +
+            "  \"eventJinJianLandingPageCost\": {\n" +
+            "    \"comment\": \"落地页完件成本\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantLandingPage\": {\n" +
+            "    \"comment\": \"落地页授信数\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantLandingPageCost\": {\n" +
+            "    \"comment\": \"落地页授信成本\"\n" +
+            "  },\n" +
+            "  \"eventCreditGrantLandingPageRate\": {\n" +
+            "    \"comment\": \"落地页授信率\"\n" +
+            "  },\n" +
+            "  \"submit\": {\n" +
+            "    \"comment\": \"按钮点击数\"\n" +
+            "  },\n" +
+            "  \"submitCost\": {\n" +
+            "    \"comment\": \"按钮点击成本\"\n" +
+            "  },\n" +
+            "  \"submitRate\": {\n" +
+            "    \"comment\": \"按钮点击率\"\n" +
+            "  },\n" +
+            "  \"activeRate\": {\n" +
+            "    \"comment\": \"下载完成激活率\"\n" +
+            "  },\n" +
+            "  \"play3sCount\": {\n" +
+            "    \"comment\": \"3s播放数\"\n" +
+            "  },\n" +
+            "  \"play3sRate\": {\n" +
+            "    \"comment\": \"3s播放率\"\n" +
+            "  },\n" +
+            "  \"adScene\": {\n" +
+            "    \"comment\": \"投放场景\"\n" +
+            "  }\n" +
+            "}";
+
+    public static void main(String[] args) {
+        System.out.println(BYTEDANCE_VIDEO_REPORT_MAPPING_JSON);
+    }
+    public static final String BYTEDANCE_VIDEO_REPORT_MAPPING_JSON = "{\n" +
+            "  \"cost\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.cost),0) as cost \",\n" +
+            "    \"comment\": \"消耗\"\n" +
+            "  },\n" +
+            "  \"cpm\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.material_show) IS NULL THEN 0 ELSE ROUND((sum(t1.cost) / sum(t1.material_show)) * 1000, 2 ) END AS cpm \",\n" +
+            "    \"comment\": \"平均千次展现费用\"\n" +
+            "  },\n" +
+            "  \"clickMaterial\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.click),0) as clickMaterial \",\n" +
+            "    \"comment\": \"点击数\"\n" +
+            "  },\n" +
+            "  \"ctr\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.material_show) != 0 THEN CONCAT(CAST(ROUND((sum(t1.click) / sum(t1.material_show)) * 100,2) AS CHAR) ,'%') ELSE '0%' end  AS ctr\",\n" +
+            "    \"comment\": \"点击率\"\n" +
+            "  },\n" +
+            "  \"cpc\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.click) / sum(t1.cost) IS NULL THEN 0 ELSE ROUND((sum(t1.cost) / sum(t1.click)), 2) END AS cpc \",\n" +
+            "    \"comment\": \"平均点击单价\"\n" +
+            "  },\n" +
+            "  \"convertMaterial\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.convert_material),0) as convertMaterial \",\n" +
+            "    \"comment\": \"转化数\"\n" +
+            "  },\n" +
+            "  \"convertCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.convert_material) IS NULL THEN 0 ELSE ROUND((sum(t1.cost) / sum(t1.convert_material)), 2 ) END AS convertCost \",\n" +
+            "    \"comment\": \"转化成本\"\n" +
+            "  },\n" +
+            "  \"convertRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.material_show)!= 0 THEN concat(CAST(round(sum(t1.convert_material) / sum(t1.material_show)*100,2) AS CHAR) ,'%') ELSE '0%' end  AS convertRate \",\n" +
+            "    \"comment\": \"转化率\"\n" +
+            "  },\n" +
+            "  \"downloadStart\": {\n" +
+            "    \"filed\": \"IFNULL(sum(download_start),0) as downloadStart \",\n" +
+            "    \"comment\": \"安卓开始下载数\"\n" +
+            "  },\n" +
+            "  \"downloadStartCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / (t1.download_start) IS NULL THEN 0 ELSE sum(t1.cost) / sum(t1.download_start) end AS downloadStartCost \",\n" +
+            "    \"comment\": \"安卓开始下载成本\"\n" +
+            "  },\n" +
+            "  \"downloadStartRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.click) != 0 THEN concat(CAST(round(sum(t1.download_start) / sum(t1.click)*100,2) AS CHAR) ,'%') ELSE '0%' end  AS downloadStartRate \",\n" +
+            "    \"comment\": \"安卓开始下载率\"\n" +
+            "  },\n" +
+            "  \"downloadFinish\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.download_finish),0) as downloadFinish \",\n" +
+            "    \"comment\": \"安卓下载完成数\"\n" +
+            "  },\n" +
+            "  \"downloadFinishCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.download_finish) IS NULL THEN 0 ELSE  sum(t1.cost) / sum(t1.download_finish) end AS downloadFinishCost \",\n" +
+            "    \"comment\": \"安卓下载完成成本\"\n" +
+            "  },\n" +
+            "  \"downloadFinishRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.download_finish) != 0 THEN concat(CAST(round(sum(t1.install_finish) / sum(t1.download_finish)*100,2) AS CHAR),'%') ELSE '0%' end  AS downloadFinishRate \",\n" +
+            "    \"comment\": \"安卓下载完成率\"\n" +
+            "  },\n" +
+            "  \"active\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.active),0) as active \",\n" +
+            "    \"comment\": \"激活数\"\n" +
+            "  },\n" +
+            "  \"activeCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.active) IS NULL THEN 0 ELSE sum(t1.cost) / sum(t1.active) end AS activeCost \",\n" +
+            "    \"comment\": \"激活成本\"\n" +
+            "  },\n" +
+            "  \"activeRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.click)!= 0 THEN concat( CAST(round(sum(t1.active) / sum(t1.click)*100,2) AS CHAR),'%') ELSE '0%' end  as activeRate\",\n" +
+            "    \"comment\": \"激活率\"\n" +
+            "  },\n" +
+            "  \"register\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.register),0) as register  \",\n" +
+            "    \"comment\": \"注册数\"\n" +
+            "  },\n" +
+            "  \"activeRegisterCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.register) IS NULL THEN 0 ELSE round(sum(t1.cost)/sum(t1.register),3) end as activeRegisterCost \",\n" +
+            "    \"comment\": \"注册成本\"\n" +
+            "  },\n" +
+            "  \"activeRegisterRate\": {\n" +
+            "    \"filed\": \" CASE WHEN sum(t1.active) != 0 THEN concat(CAST(round(sum(t1.register) / sum(t1.active)*100,2) AS CHAR) ,'%') ELSE '0%' end  as activeRegisterRate \",\n" +
+            "    \"comment\": \"注册率\"\n" +
+            "  },\n" +
+            "  \"gameAddiction\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.game_addiction),0) as gameAddiction  \",\n" +
+            "    \"comment\": \"关键行为数\"\n" +
+            "  },\n" +
+            "  \"gameAddictionCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.game_addiction) IS NULL THEN 0 ELSE round(sum(t1.cost)/sum(t1.game_addiction),3) end as gameAddictionCost \",\n" +
+            "    \"comment\": \"关键行为成本\"\n" +
+            "  },\n" +
+            "  \"gameAddictionRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.active)!= 0 THEN concat(CAST(round(sum(t1.game_addiction) / sum(t1.active)*100,2) AS CHAR),'%') ELSE '0%' end  as gameAddictionRate\",\n" +
+            "    \"comment\": \"关键行为率\"\n" +
+            "  },\n" +
+            "  \"nextDayOpen\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.next_day_open),0) as nextDayOpen \",\n" +
+            "    \"comment\": \"次留数\"\n" +
+            "  },\n" +
+            "  \"nextDayOpenCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.next_day_open) IS NULL THEN 0 ELSE round(sum(t1.cost)/sum(t1.next_day_open),3) end as nextDayOpenCost \",\n" +
+            "    \"comment\": \"次留成本\"\n" +
+            "  },\n" +
+            "  \"nextDayOpenRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(t1.active)!= 0 THEN concat(CAST(round(sum(t1.next_day_open) / sum(t1.active)*100,2) AS CHAR) ,'%') ELSE '0%' end  as nextDayOpenRate \",\n" +
+            "    \"comment\": \"次留率\"\n" +
+            "  },\n" +
+            "  \"activePayAmount\": {\n" +
+            "    \"filed\": \"IFNULL(sum(pay_count),0) as activePayAmount \",\n" +
+            "    \"comment\": \"付费数\"\n" +
+            "  },\n" +
+            "  \"activePayCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.pay_count) IS NULL THEN 0 ELSE round(sum(t1.cost)/sum(t1.pay_count),3) end as activePayCost \",\n" +
+            "    \"comment\": \"付费成本\"\n" +
+            "  },\n" +
+            "  \"form\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.form),0) as form \",\n" +
+            "    \"comment\": \"表单提交\"\n" +
+            "  },\n" +
+            "  \"validPlayCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.valid_play) IS NULL THEN 0 ELSE round(sum(t1.cost)/sum(t1.valid_play),3) end as validPlayCost \",\n" +
+            "    \"comment\": \"有效播放成本\"\n" +
+            "  },\n" +
+            "  \"play25FeedBreak\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.play25_feed_break),0) as play25FeedBreak \",\n" +
+            "    \"comment\": \"25%进度播放数\"\n" +
+            "  },\n" +
+            "  \"play50FeedBreak\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.play50_feed_break),0) as play50FeedBreak\",\n" +
+            "    \"comment\": \"50%进度播放数\"\n" +
+            "  },\n" +
+            "  \"play75FeedBreak\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.play75_feed_break),0) as play75FeedBreak\",\n" +
+            "    \"comment\": \"75%进度播放数\"\n" +
+            "  },\n" +
+            "  \"play100FeedBreak\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.play100_feed_break),0) as play100FeedBreak\",\n" +
+            "    \"comment\": \"100%进度播放数\"\n" +
+            "  },\n" +
+            "  \"follow\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.follow),0) as follow \",\n" +
+            "    \"comment\": \"新增关注数\"\n" +
+            "  },\n" +
+            "  \"likeMaterial\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.like_material),0) as likeMaterial \",\n" +
+            "    \"comment\": \"点赞数\"\n" +
+            "  },\n" +
+            "  \"shareMaterial\": {\n" +
+            "    \"filed\": \"IFNULL(sum(t1.share_material),0) as shareMaterial \",\n" +
+            "    \"comment\": \"分享数\"\n" +
+            "  },\n" +
+             "  \"showMaterial\": {\n" +
+            "    \"filed\": \"IFNULL(t1.material_show, 0 ) AS material_show \",\n" +
+            "    \"comment\": \"展示数\"\n" +
+            "  }\n" +
+            "}";
+    public static Map<String, Map<String, Object>> getDictMapBy(){
+        JSONObject jsonBy = JSON.parseObject(BYTEDANCE_FILED_MAPPING_JSON);
+        return JsonResourceUtil.jsonToMap(jsonBy);
+    }
+    public static Map<String, Map<String, Object>> getDicMapKs(){
+        Object jsonKs = JSON.parseObject(KUAISHOU_FILED_MAPPING_JSON);
+        return JsonResourceUtil.jsonToMap(jsonKs);
+    }
+    public static Map<String, Map<String, Object>> getDicMapByVideo(){
+        Object jsonByVideo = JSON.parseObject(BYTEDANCE_VIDEO_REPORT_MAPPING_JSON);
+        return JsonResourceUtil.jsonToMap(jsonByVideo);
+    }
+    public static Map<String, Map<String, Object>> getKuaishouVideoReportMap(){
+        Object kuaiShouVideoJson = JSON.parseObject(KUAISHOU_VIDEO_REPORT_FILED_MAPPING_JSON);
+        return JsonResourceUtil.jsonToMap(kuaiShouVideoJson);
+    }
+    public static Map<String, Map<String, Object>> getKuaishouVideoReportDict(){
+        Object kuaiShouVideoDictJson = JSON.parseObject(KUAISHOU_VIDEO_REPORT_FILED_DICT_JSON);
+        return JsonResourceUtil.jsonToMap(kuaiShouVideoDictJson);
+    }
+}

+ 96 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/constant/CtopAdConstant.java

@@ -0,0 +1,96 @@
+package cn.com.ctop.common.constant;
+
+import java.math.BigDecimal;
+
+/**
+ * 广告相关常量数据
+ */
+public class CtopAdConstant {
+    //头条
+    public static final String PLATFORM_TYPE_BYTEDANCE = "1";
+    public static final  int PLATFORM_TYPE_BYTEDANCE_INT = 1;
+    //快手
+    public static final String PLATFORM_TYPE_KUAISHOU = "2";
+    public static final  int   PLATFORM_TYPE_KUAISHOU_INT = 2;
+    //头条内广
+    public static final String PLATFORM_TYPE_BYTEDANCE_INSIDE = "3";
+    public static final  int PLATFORM_TYPE_BYTEDANCE_INSIDE_INT = 3;
+    //头条内广
+    public static final String PLATFORM_TYPE_KUAISHOU_INSIDE = "4";
+    public static final  int PLATFORM_TYPE_KUAISHOU_INSIDE_INT = 4;
+
+    public static final String PLATFORM_TYPE_PANGOLIN = "5";
+
+    public static final String PLATFORM_TYPE_BYTEDANCE_PY = "bytedance";
+    public static final String PLATFORM_TYPE_KUAISHOU_PY = "kuaishou";
+    public static final String PLATFORM_TYPE_PANGOLIN_PY = "pangolin";
+
+    public static final String BYTEDANCE_REPORT_TYPE_DAILY = "STAT_TIME_GRANULARITY_DAILY";
+    public static final String BYTEDANCE_REPORT_TYPE_HOURLY = "STAT_TIME_GRANULARITY_HOURLY";
+
+    public static final String UREPORT_PREVIEW_URL_PREFIX = "/jeecg-boot/ureport/designer?_u=mysql:";
+
+
+    public static final String CTOP_ORGCODE_NORTH_CHINA_PREFIX = "A01";
+    public static final String CTOP_ORGCODE_EAST_CHINA_PREFIX = "A02";
+
+    public static final String KUAISHOU_LOAD_JOB_TYPE_HISTORY = "history";
+    public static final String KUAISHOU_LOAD_JOB_TYPE_DAILY = "daily";
+
+    public static final String BYTEDANCE_LOAD_JOB_TYPE_ASYNC = "async";
+    public static final String BYTEDANCE_LOAD_JOB_TYPE_DAILY = "daily";
+
+    /**
+     * 销售角色Id
+     */
+    public static final String SYSTEM_SALE_CODE = "75ee837e6f3de29c0e3ed75d4629438e";
+
+    /**
+     * 销售AM角色Id
+     */
+    public static final String SYSTEM_SALE_AM_CODE = "f5a68aa2acf86e842100f0fa4b050d28";
+
+    /**
+     * 头条销售媒体季度任务
+     */
+    public static final BigDecimal BYTEDANCE_MEDIA_TASK_COST = new BigDecimal("150000000");
+    /**
+     * 快手销售媒体季度任务
+     */
+    public static final BigDecimal KUAISHOU_MEDIA_TASK_COST = new BigDecimal("147000000");
+    /**
+     * 头条销售季度个人任务
+     */
+    public static final BigDecimal BYTEDANCE_PERSONAL_TASK_COST = new BigDecimal("2400000");
+    /**
+     * 快手销售季度个人任务
+     */
+    public static final BigDecimal KUAISHOU_PERSONAL_TASK_COST = new BigDecimal("2400000");
+
+    /**
+     * 华北快手销售机构号
+     */
+    public static final String HB_KUAISHOU_SALE_ORG_CODE = "A01A11A01";
+    /**
+     * 华北头条销售机构号
+     */
+    public static final String HB_BYTEDANCE_SALE_ORG_CODE = "A01A11A02";
+
+    public static final String BYTEDANCE_GENDER_TYPE_NONE = "NONE";
+    public static final String BYTEDANCE_GENDER_TYPE_GENDER_MALE = "GENDER_MALE";
+    public static final String BYTEDANCE_GENDER_TYPE_GENDER_FEMALE = "GENDER_FEMALE";
+
+
+    public static final Integer COMMON_STATUS_ENABLED = 1;
+
+    public static final Integer COMMON_STATUS_NOT_ENABLED = 0;
+
+    public static final String COMMON_ORDER_TYPE_ASC = "asc";
+    public static final String COMMON_ORDER_TYPE_DESC = "desc";
+
+    /**
+     * 视频类型
+     */
+    public static final String VIDEO_TYPR_ZR = "真人";
+    public static final String VIDEO_TYPR_ZZ = "制作";
+}

+ 138 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/entity/Project.java

@@ -0,0 +1,138 @@
+package cn.com.ctop.common.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 项目
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-19
+ */
+@Data
+@TableName("ctop_project")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_project对象", description = "项目")
+public class Project {
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 项目名称
+     */
+    @Excel(name = "项目名称", width = 15)
+    @ApiModelProperty(value = "项目名称")
+    private String projectName;
+    /**
+     * 广告主id
+     */
+    @Excel(name = "广告主id", width = 15)
+    @ApiModelProperty(value = "广告主id")
+    private String advertiserId;
+
+
+    @Excel(name = "产品id", width = 15)
+    @ApiModelProperty(value = "广告主id")
+    private Long productId;
+
+    /**
+     * 创建人
+     */
+    @Excel(name = "创建人", width = 15)
+    @ApiModelProperty(value = "创建人")
+    private String userId;
+    /**
+     * 负责人id
+     */
+    @Excel(name = "负责人id", width = 15)
+    @ApiModelProperty(value = "负责人id")
+    private String responsibleId;
+
+
+    @Excel(name = "设计负责人", width = 15)
+    @ApiModelProperty(value = "设计负责人")
+    private String designResponsibleId;
+
+
+    @Excel(name = "公司id", width = 15)
+    @ApiModelProperty(value = "公司id")
+    private String companyId;
+    /**
+     * 媒体类型
+     */
+    @Excel(name = "媒体类型", width = 15)
+    @ApiModelProperty(value = "媒体类型")
+    private String mediaId;
+
+    /**
+     * 最高出价
+     */
+    private Long maxBid;
+
+    private String supplierCode;
+
+
+    // 销售
+    private String saleId;
+    /**
+     * 最高深度转化出价
+     */
+    private BigDecimal maxDeepCpaBid;
+    private Integer checkLink;
+    private Integer materialShare;
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+
+
+    private String bidType;
+    private String ocpxActionType;
+
+    @TableField(exist = false)
+    private String responsibleId_dictText; // 运营负责人
+
+    @TableField(exist = false)
+    private String saleId_dictText; // 销售
+
+    @TableField(exist = false)
+    private String designResponsibleId_dictText; // 设计负责人
+    @TableField(exist = false)
+    private String advertiserId_dictText; // 广告主名称
+    @TableField(exist = false)
+    private String productId_dictText; // 产品名称
+    @TableField(exist = false)
+    private Integer needExamine;
+    @TableField(exist = false)
+    private String supplierCode_dictText;
+}

+ 119 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/entity/ProjectMember.java

@@ -0,0 +1,119 @@
+package cn.com.ctop.common.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 项目成员
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-19
+ */
+@Data
+@TableName("ctop_project_member")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_project_member对象", description = "项目成员")
+public class ProjectMember implements Serializable {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 项目id
+     */
+    @Excel(name = "项目id", width = 15)
+    @ApiModelProperty(value = "项目id")
+    private Long projectId;
+
+
+    @Excel(name = "项目名称", width = 15)
+    @ApiModelProperty(value = "项目名称")
+    private String projectName;
+
+
+    /**
+     * 成员id
+     */
+    @Excel(name = "成员id", width = 15)
+    @ApiModelProperty(value = "成员id")
+    private String userId;
+
+    @Excel(name = "成员名称", width = 15)
+    @ApiModelProperty(value = "成员名称")
+    private String userName;
+
+    private String roleCode;
+
+    @TableField(exist = false)
+    private Long maxBid;
+
+
+    @TableField(exist = false)
+    private String responsibleName;
+
+
+    @TableField(exist = false)
+    private String designResponsibleName;
+
+    @TableField(exist = false)
+    private String advertiserName;
+
+    @TableField(exist = false)
+    private String advertiserId;
+
+
+    @TableField(exist = false)
+    private String mediaId;
+
+    @TableField(exist = false)
+    private String saleId;
+
+    @TableField(exist = false)
+    private String saleName;
+
+    @TableField(exist = false)
+    private Long productId;
+
+    @TableField(exist = false)
+    private String productName;
+
+    @TableField(exist = false)
+    private List<UserAllocation> userAllocationList;
+
+
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 1 - 1
jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/SysRole.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.report.entity;
+package cn.com.ctop.common.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;

+ 1 - 1
jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/UserAllocation.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.report.entity;
+package cn.com.ctop.common.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;

+ 21 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/ProjectMapper.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.common.mapper;
+
+import cn.com.ctop.common.entity.Project;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 项目
+ *
+ * @author: jeecg-boot
+ * @date: 2019-11-19
+ * @cersion: V1.0
+ */
+public interface ProjectMapper extends BaseMapper<Project> {
+    List<Project> getListByParams(@Param(value = "mediaList") List<Integer> mediaList,@Param(value = "userId")String userId);
+}

+ 59 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/ProjectMemberMapper.java

@@ -0,0 +1,59 @@
+package cn.com.ctop.common.mapper;
+
+
+import cn.com.ctop.common.entity.Project;
+import cn.com.ctop.common.entity.ProjectMember;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+
+import java.util.List;
+
+/**
+ * 项目成员
+ *
+ * @author: jeecg-boot
+ * @date: 2019-11-19
+ * @cersion: V1.0
+ */
+public interface ProjectMemberMapper extends BaseMapper<ProjectMember> {
+
+    List<Long> selectProjectsByUserId(@Param("userId") String userId);
+
+    List<Long> selectProductsByUserId(@Param("userId") String userId);
+
+    List<ProjectMember> adminProjects(@Param("mediaIds") List<Integer> mediaIds);
+
+    List<ProjectMember> designLeaderProjects(@Param("companyId") String companyId, @Param("mediaIds") List<Integer> mediaIds);
+
+    List<ProjectMember> designProjects(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);
+
+    List<ProjectMember> operationProjects(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);
+
+    String getRoleCodeByUserId(@Param("userId") String userId);
+
+    String getCompanyIdByUserId(@Param("userId") String userId);
+
+    List<ProjectMember> queryProjectMemberByUserId(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);
+
+
+    List<ProjectMember> getSaleProjects(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);
+
+    List<Long> getProjectByMap(@Param("userId") String userId);
+
+    List<Project> getProjectByUserId(@Param("userId") String userId);
+
+    List<Long> getProjectByAccountIds(@Param("accountIds") JSONArray accountIds);
+
+    List<Long> getProductByAccountIds(@Param("accountIds") JSONArray accountIds);
+
+    List<JSONObject> getProjectByUserIdAndMediaIds(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);
+
+    List<ProjectMember> getProductIds(@Param("userId") String userId, @Param("mediaList") List<Integer> mediaList, @Param("productId") Long productId);
+
+    List<Long> getProjectIdsByProductId(@Param("productId") Long productId, @Param("userId") String userId);
+
+    List<ProjectMember> getlistByUserId(@Param("userId")String userId);
+}

+ 21 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/SysDepartMapper.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.common.mapper;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.jeecg.common.system.entity.SysDepart;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 部门 Mapper 接口
+ * <p>
+ *
+ * @Author: Steve
+ * @Since: 2019-01-22
+ */
+public interface SysDepartMapper extends BaseMapper<SysDepart> {
+    SysDepart getDepartByParams(@Param(value = "userId") String userId, @Param(value = "orgType")Integer orgType);
+}

+ 2 - 2
jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/SysRoleMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.report.mapper;
+package cn.com.ctop.common.mapper;
 
-import cn.com.ctop.report.entity.SysRole;
+import cn.com.ctop.common.entity.SysRole;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Delete;
 import org.apache.ibatis.annotations.Param;

+ 20 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/SysUserMapper.java

@@ -0,0 +1,20 @@
+package cn.com.ctop.common.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.common.system.entity.SysUser;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 用户表 Mapper 接口
+ * </p>
+ *
+ * @Author scott
+ * @since 2018-12-20
+ */
+public interface SysUserMapper extends BaseMapper<SysUser> {
+
+    List<SysUser> selectAllUser();
+
+}

+ 4 - 3
jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/UserAllocationMapper.java

@@ -1,11 +1,10 @@
-package cn.com.ctop.report.mapper;
+package cn.com.ctop.common.mapper;
 
-import cn.com.ctop.report.entity.UserAllocation;
+import cn.com.ctop.common.entity.UserAllocation;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -17,4 +16,6 @@ import java.util.List;
  */
 public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
     IPage<UserAllocation> queryListWithPermission(Page<UserAllocation> page, String sql);
+
+    List<JSONObject> getAccountListByProjectList(List list);
 }

+ 16 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/ProjectMapper.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.common.mapper.ProjectMapper">
+
+    <select id="getListByParams" resultType="cn.com.ctop.common.entity.Project">
+        select * from ctop_project where 1=1
+        and media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        <if test="userId!=null">
+            and responsible_id = #{userId}
+        </if>
+    </select>
+</mapper>

+ 295 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/ProjectMemberMapper.xml

@@ -0,0 +1,295 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.common.mapper.ProjectMemberMapper">
+
+    <select id="selectProjectsByUserId" resultType="java.lang.Long">
+        select
+        DISTINCT(project_id)
+         from ctop_project_member
+        where user_id = #{userId}
+    </select>
+
+    <select id="selectProductsByUserId" resultType="java.lang.Long">
+        select  DISTINCT(product_id) from ctop_project where product_id is not NULL  and id in
+         (select
+              DISTINCT(project_id)
+          from ctop_project_member where user_id = #{userId})
+    </select>
+
+    <!-- 设计师展示所有自己的角色下制作的视频 -->
+    <select id="adminProjects" resultType="cn.com.ctop.common.entity.ProjectMember">
+        select
+        t1.id as projectId,
+        t1.project_name as projectName,
+        t1.advertiser_id as advertiserId,
+        (
+        select name from ctop_advertiser where id = t1.advertiser_id
+        )
+        as advertiserName,
+        t1.media_id as mediaId,
+        t1.max_bid as maxBid,
+        t1.product_id as productId,
+        t1.responsible_name as responsibleName
+        from
+        ctop_project t1
+        where
+        media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        order by create_time desc
+    </select>
+
+    <!-- 视频报表设计师leader展示自己所在公司的所有项目 -->
+    <select id="designLeaderProjects" resultType="cn.com.ctop.common.entity.ProjectMember">
+        select
+        distinct b.id as projectId,
+        b.project_name as projectName,
+        b.advertiser_id as advertiserId,
+        b.advertiser_name as advertiserName,
+        b.product_id as productId,
+        b.media_id as mediaId
+        from
+        ctop_project_member a
+        left join ctop_project b on a.project_id = b.id
+        where
+        b.company_id = #{companyId}
+        and b.media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+    </select>
+
+    <!-- 设计师展示所有自己的角色下制作的视频 -->
+    <select id="designProjects" resultType="cn.com.ctop.common.entity.ProjectMember">
+        select
+        distinct a.project_id as projectId,
+        b.project_name as projectName,
+        b.advertiser_id as advertiserId,
+        b.advertiser_name as advertiserName,
+        b.media_id as mediaId,
+        b.product_id as productId
+        from
+        ctop_project_member a
+        left join ctop_project b on a.project_id = b.id
+        where a.user_id = #{userId}
+        and b.media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="getProductIds" resultType="cn.com.ctop.common.entity.ProjectMember">
+        select
+        a.project_id as projectId,
+        b.project_name as projectName,
+        b.advertiser_id as advertiserId,
+        b.advertiser_name as advertiserName,
+        b.media_id as mediaId,
+        b.product_id as productId
+        from
+        ctop_project_member a
+        left join ctop_project b on a.project_id = b.id
+        where b.product_id = #{productId}
+        <if test="userId !=null and userId!=''">
+            and a.user_id = #{userId}
+        </if>
+        and b.media_id in
+        <foreach collection="mediaList" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        group by a.project_id
+    </select>
+
+
+    <!-- 运营和运营负责人展示所在项目视频 -->
+    <select id="operationProjects" resultType="cn.com.ctop.common.entity.ProjectMember">
+        select
+        distinct b.id as projectId,
+        b.project_name as projectName,
+        b.advertiser_id as advertiserId,
+        b.advertiser_name as advertiserName,
+        b.product_id as productId,
+        b.media_id as mediaId
+        from
+        ctop_user_allocation a
+        left join ctop_project b on a.project_id = b.id
+        where a.user_id = #{userId}
+        and b.media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="getRoleCodeByUserId" resultType="string">
+        select
+        role_code
+        from
+        sys_user_role a
+        left join sys_role b on a.role_id = b.id
+        where a.user_id = #{userId}
+    </select>
+
+    <select id="getCompanyIdByUserId" resultType="string">
+            select
+            company_id
+        from
+        user_company
+        where user_id = #{userId}
+    </select>
+
+    <select id="queryProjectMemberByUserId" resultType="cn.com.ctop.common.entity.ProjectMember">
+        SELECT
+        t1.id AS 'projectId',
+        project_name AS 'projectName',
+        t1.advertiser_id AS 'advertiserId',
+        (
+        SELECT
+        NAME
+        FROM
+        ctop_advertiser
+        WHERE
+        id = t1.advertiser_id
+        ) AS 'advertiserName',
+        t1.media_id as 'mediaId'
+        FROM
+        ctop_project t1
+        WHERE
+        t1.id IN (
+        SELECT
+        project_id
+        FROM
+        ctop_project_member
+        where user_id = #{userId}
+        GROUP BY
+        project_id
+        )
+        AND t1.media_id IN
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        order by t1.create_time desc
+    </select>
+
+    <select id="getSaleProjects" resultType="cn.com.ctop.common.entity.ProjectMember">
+        select
+        distinct a.id as projectId,
+        a.project_name as projectName,
+        a.advertiser_id as advertiserId,
+        a.advertiser_name as advertiserName,
+        a.media_id as mediaId,
+        a.sale_id as saleId,
+        b.realname as saleName
+        from
+        ctop_project a
+        left join sys_user b on a.sale_id = b.id
+        where a.sale_id = #{userId}
+        and a.media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="getProjectByMap" resultType="java.lang.Long">
+        select project_id
+        from ctop_project_member
+        where user_id = #{userId}
+        group by project_id
+    </select>
+    <select id="getProjectByUserId" resultType="cn.com.ctop.common.entity.Project">
+        select
+            project.*
+        from
+            ctop_project_member member left join ctop_project project on project.id = member.project_id
+        where
+            member.user_id = #{userId}
+    </select>
+
+    <select id="getProjectByAccountIds" resultType="java.lang.Long">
+        SELECT
+        project_id
+        FROM
+        ctop_user_allocation
+        WHERE
+        account_id IN
+        <foreach collection="accountIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="getProductByAccountIds" resultType="java.lang.Long">
+        select DISTINCT(product_id) from ctop_project where product_id is not NULL and id in
+        (SELECT
+        project_id
+        FROM
+        ctop_user_allocation
+        WHERE
+        account_id IN
+        <foreach collection="accountIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>)
+    </select>
+
+
+    <select id="getProjectByUserIdAndMediaIds" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        t2.id as 'projectId',
+        t2.project_name as 'projectName',
+        t2.product_id as 'productId',
+        t2.product_name as 'productName',
+        t2.advertiser_id as 'advertiserId',
+        (select name from ctop_advertiser where id = t2.advertiser_id) as 'advertiserName'
+        from ctop_project_member t1
+        left join ctop_project t2
+        on t1.project_id = t2.id
+        where 1 = 1
+        <if test="userId !=null and userId!=''">
+            and t1.user_id = #{userId}
+        </if>
+        <if test="mediaIds != null and mediaIds.size() != 0 ">
+            and t2.media_id in
+            <foreach collection="mediaIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        group by t2.id
+        order by t2.create_time desc
+    </select>
+    <select id="getProjectIdsByProductId" resultType="java.lang.Long">
+        SELECT
+        t1.id
+        FROM
+        ctop_project t1
+        LEFT JOIN ctop_project_member t2 ON t1.id = t2.project_id
+        WHERE
+        t2.user_id = #{userId}
+        <if test="productId != null and productId != ''">
+            AND t1.product_id = #{productId}
+        </if>
+        GROUP BY
+        t1.id
+    </select>
+    <select id="getlistByUserId" resultType="cn.com.ctop.common.entity.ProjectMember">
+        select cp.id as id, cp.project_name as project_name, cp.media_id as media_id, ca.name as advertiser_name
+        from ctop_project_member cpm
+                 left join ctop_project cp on cpm.project_id = cp.id
+                 left join ctop_advertiser ca on ca.id = cp.advertiser_id
+        where 1=1
+        <if test="userId!=null">
+            and cpm.user_id = #{userId}
+        </if>
+        group by cp.id
+    </select>
+
+
+</mapper>

+ 19 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/SysDepartMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.common.mapper.SysDepartMapper">
+
+    <select id="getDepartByParams" resultType="org.jeecg.common.system.entity.SysDepart">
+        select
+               *
+        from
+             sys_depart
+        where
+              1=1
+              <if test="orgType!=null">
+                  and org_type=#{orgType}
+              </if>
+        and
+              leader_id = #{userId}
+        order by id desc limit 1
+    </select>
+</mapper>

+ 2 - 2
jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/SysRoleMapper.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.report.mapper.SysRoleMapper">
+<mapper namespace="cn.com.ctop.common.mapper.SysRoleMapper">
 
     <!-- 根据roleCode获取roleId -->
     <select id="getRoleIdByRoleCode" resultType="java.lang.String">
@@ -19,7 +19,7 @@
     </select>
 
 
-    <select id="queryRoleByUserId" resultType="cn.com.ctop.report.entity.SysRole">
+    <select id="queryRoleByUserId" resultType="cn.com.ctop.common.entity.SysRole">
         SELECT t2.role_name,t2.role_code
         FROM sys_user_role t1
                  LEFT JOIN sys_role t2 ON t1.role_id = t2.id

+ 8 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/SysUserMapper.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.common.mapper.SysUserMapper">
+
+    <select id="selectAllUser" resultType="org.jeecg.common.system.entity.SysUser">
+        select * from sys_user where del_flag = 0 and status = 1
+    </select>
+</mapper>

+ 25 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/UserAllocationMapper.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.common.mapper.UserAllocationMapper">
+
+    <select id="queryListWithPermission" resultType="cn.com.ctop.common.entity.UserAllocation">
+        select * from user_allocation where 1=1 ${permissionSql}
+    </select>
+    <select id="getAccountListByProjectList" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        t1.project_id as 'projectId',
+        t1.account_id as 'accountId',
+        (select realname from sys_user where id = t1.user_id ) as 'userName',
+        t1.auth_name as 'authName',
+        t1.account_status as 'accountStatus'
+        from ctop_user_allocation t1
+        where t1.project_id in
+        <foreach collection="list" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+
+
+        order by t1.create_time desc
+    </select>
+</mapper>

+ 51 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/service/IProjectMemberService.java

@@ -0,0 +1,51 @@
+package cn.com.ctop.common.service;
+
+
+import cn.com.ctop.common.entity.Project;
+import cn.com.ctop.common.entity.ProjectMember;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.system.entity.SysUser;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 项目成员
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-19
+ */
+public interface IProjectMemberService extends IService<ProjectMember> {
+    List<Long> selectProjectsByUserId(String userId);
+
+    List<Long> selectProductsByUserId(String userId);
+
+    List<ProjectMember> getProjects(List<Integer> mediaIds);
+
+    List<Map<String, Object>> getProjectAccountByUserId(String userId, String mediaType);
+
+    ProjectMember getProjectByParams(Long targetProject, String userId);
+
+    List<ProjectMember> getOwnProjects(List<Integer> mediaIds);
+
+    List<ProjectMember> getSaleOwnProjects(List<Integer> mediaIds);
+
+    List<Long> getProjectByMap(String userId);
+
+    List<Project> selectListByUserId(String userId);
+
+    List<Long> getProjectByAccountIds(JSONArray accountIds);
+
+    List<JSONObject> getProjectByUserIdAndMediaIds(String userId, List<Integer> mediaIds);
+
+    List<Map<String, Object>> getAllProjectAccount(String mediaType);
+
+    List<Long> getProductByAccountIds(JSONArray accountIds);
+
+    List<Long> getProjectIdsByProductId(Long productId, String userId);
+
+
+}

+ 19 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/service/ISysUserService.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.common.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.system.entity.SysUser;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 用户表 服务类
+ * </p>
+ *
+ * @Author scott
+ * @since 2018-12-20
+ */
+public interface ISysUserService extends IService<SysUser> {
+
+    List<String> treeUserInfo(String userId);
+}

+ 8 - 2
jeecg-boot-report/src/main/java/cn/com/ctop/report/service/IUserAllocationService.java

@@ -1,9 +1,13 @@
-package cn.com.ctop.report.service;
+package cn.com.ctop.common.service;
 
-import cn.com.ctop.report.entity.UserAllocation;
+import cn.com.ctop.common.entity.UserAllocation;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * @Description: 用户分配
  * @Author: jeecg-boot
@@ -12,4 +16,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IUserAllocationService extends IService<UserAllocation> {
     IPage<UserAllocation> queryListWithPermission(Integer pageSize, Integer pageNo);
+
+    Map<Long, List<JSONObject>> getAccountListByProjectList(List<JSONObject> projectList);
 }

+ 293 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/service/impl/ProjectMemberServiceImpl.java

@@ -0,0 +1,293 @@
+package cn.com.ctop.common.service.impl;
+
+
+import cn.com.ctop.common.constant.CtopAdConstant;
+import cn.com.ctop.common.entity.Project;
+import cn.com.ctop.common.entity.ProjectMember;
+import cn.com.ctop.common.entity.UserAllocation;
+import cn.com.ctop.common.mapper.ProjectMemberMapper;
+import cn.com.ctop.common.mapper.UserAllocationMapper;
+import cn.com.ctop.common.service.IProjectMemberService;
+import cn.com.ctop.common.service.ISysUserService;
+import cn.com.ctop.common.utils.Check;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.system.entity.SysUser;
+import org.jeecg.common.system.vo.LoginUser;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 项目成员
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-19
+ */
+@Service
+public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, ProjectMember> implements IProjectMemberService {
+    @Resource
+    private ProjectMemberMapper memberMapper;
+    @Resource
+    private UserAllocationMapper userAllocationMapper;
+
+    private static final String[] PERMISSION_VIEW_PROJECT = {"admin", "saleDirector", "sale", "saleAssistant", "saleAm", "meidaManager"};
+
+
+    /**
+     * 查询所有项目
+     *
+     * @param userId
+     * @return
+     */
+    @Override
+    public List<Long> selectProjectsByUserId(String userId) {
+        return memberMapper.selectProjectsByUserId(userId);
+    }
+
+    /**
+     * 查询所有产品
+     *
+     * @param userId
+     * @return
+     */
+    @Override
+    public List<Long> selectProductsByUserId(String userId) {
+        return memberMapper.selectProductsByUserId(userId);
+    }
+
+
+    //视频报表
+    @Override
+    public List<ProjectMember> getProjects(List<Integer> mediaIds) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String userId = sysUser.getId();
+        String roleCode = memberMapper.getRoleCodeByUserId(userId);
+        String companyId = memberMapper.getCompanyIdByUserId(userId);
+
+        //角色权限判断
+        List<ProjectMember> projectMemberList = null;
+        if ("plan".equals(roleCode) || "clip".equals(roleCode) || "shot".equals(roleCode) || "plane".equals(roleCode) || "planeLeader".equals(roleCode)) {
+            projectMemberList = memberMapper.designProjects(userId, mediaIds);
+        } else if ("designTeamLeader".equals(roleCode)) {
+            projectMemberList = memberMapper.designLeaderProjects(companyId, mediaIds);
+        } else if ("admin".equals(roleCode)) {
+            projectMemberList = memberMapper.adminProjects(mediaIds);
+        } else if ("operator".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
+            projectMemberList = memberMapper.designProjects(userId, mediaIds);
+        } else {
+            //如果以上角色都不是的话直接查询此角色所属项目
+            projectMemberList = memberMapper.designProjects(userId, mediaIds);
+        }
+
+        if (null == projectMemberList) {
+            projectMemberList = new ArrayList<>();
+        }
+
+        return projectMemberList;
+    }
+    @Override
+    public List<Map<String, Object>> getProjectAccountByUserId(String userId, String mediaType) {
+        List<Map<String, Object>> result = new ArrayList<>();
+        List<Integer> mediaList = new ArrayList<>();
+        if (mediaType.equals(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE)) {
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT);
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INSIDE_INT);
+        } else if (mediaType.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU)) {
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT);
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INSIDE_INT);
+        }
+        //查询登录账号下的项目
+        List<ProjectMember> projectMemberList = this.queryProjectMemberBy(userId, mediaList);
+        if (projectMemberList.isEmpty()) {
+            return result;
+        }
+        Map<Long, List<JSONObject>> accountMap = this.getAccountListByProjectMemberList(projectMemberList);
+        for (ProjectMember member : projectMemberList) {
+            Map<String, Object> temp = new HashMap<>();
+            temp.put("project", member);
+            List<JSONObject> jsonObjects = accountMap.get(member.getProjectId());
+            if (Check.isNull(jsonObjects)) {
+                continue;
+            }
+            temp.put("account", jsonObjects);
+            result.add(temp);
+        }
+
+        return result;
+    }
+
+    private Map<Long, List<JSONObject>> getAccountListByProjectMemberList(List<ProjectMember> projectMemberList) {
+        Map<Long, List<JSONObject>> map = new HashMap<>();
+        List list = new ArrayList();
+        for (ProjectMember member : projectMemberList) {
+            list.add(member.getProjectId());
+            map.put(member.getProjectId(), new ArrayList<>());
+        }
+
+        List<JSONObject> jsonList = userAllocationMapper.getAccountListByProjectList(list);
+        for (int i = 0; i < jsonList.size(); i++) {
+            JSONObject jsonObject = jsonList.get(i);
+            Long projectId = jsonObject.getLong("projectId");
+            List<JSONObject> jsonObjects = map.get(projectId);
+            jsonObjects.add(jsonObject);
+        }
+        return map;
+
+
+    }
+
+    @Override
+    public ProjectMember getProjectByParams(Long targetProject, String userId) {
+        QueryWrapper<ProjectMember> queryWrapper = new QueryWrapper<>();
+        if (null != targetProject) {
+            queryWrapper.eq("project_id", targetProject);
+        }
+        if (null != userId) {
+            queryWrapper.eq("user_id", userId);
+        }
+        queryWrapper.last("limit 1");
+        return null;
+    }
+
+
+    private Map<String, Object> queryAccountByProjectId(ProjectMember projectMember) {
+        Map<String, Object> temp = new HashMap<>();
+        temp.put("project", projectMember);
+        QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("project_id", projectMember.getProjectId());
+        queryWrapper.isNotNull("account_id");
+        List<UserAllocation> userAllocations = userAllocationMapper.selectList(queryWrapper);
+        if (userAllocations.isEmpty()) {
+            temp = null;
+        } else {
+            temp.put("account", userAllocations);
+        }
+        return temp;
+    }
+
+    private List<ProjectMember> queryProjectMemberBy(String userId, List<Integer> mediaIds) {
+        String roleCode = memberMapper.getRoleCodeByUserId(userId);
+        if (ArrayUtils.contains(PERMISSION_VIEW_PROJECT, roleCode)) {
+            return memberMapper.adminProjects(mediaIds);
+        }
+        return memberMapper.queryProjectMemberByUserId(userId, mediaIds);
+    }
+
+
+    //查看销售所在平台项目
+    @Override
+    public List<ProjectMember> getSaleOwnProjects(List<Integer> mediaIds) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String userId = sysUser.getId();
+        String roleCode = memberMapper.getRoleCodeByUserId(userId);
+
+        //角色权限判断
+        List<ProjectMember> projectMemberList = null;
+        if ("admin".equals(roleCode)) {
+            projectMemberList = memberMapper.adminProjects(mediaIds);
+        } else {
+            //如果以上角色都不是的话直接查询此角色所属项目
+            projectMemberList = memberMapper.getSaleProjects(userId, mediaIds);
+        }
+
+        if (null == projectMemberList) {
+            projectMemberList = new ArrayList<>();
+        }
+
+        return projectMemberList;
+    }
+
+    @Override
+    public List<Long> getProjectByMap(String userId) {
+        return memberMapper.getProjectByMap(userId);
+    }
+
+    @Override
+    public List<Project> selectListByUserId(String userId) {
+        return memberMapper.getProjectByUserId(userId);
+    }
+
+    @Override
+    public List<Long> getProjectByAccountIds(JSONArray accountIds) {
+        return memberMapper.getProjectByAccountIds(accountIds);
+    }
+
+    @Override
+    public List<Long> getProductByAccountIds(JSONArray accountIds) {
+        return memberMapper.getProductByAccountIds(accountIds);
+    }
+
+    //视频报表
+    @Override
+    public List<ProjectMember> getOwnProjects(List<Integer> mediaIds) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String userId = sysUser.getId();
+        String roleCode = memberMapper.getRoleCodeByUserId(userId);
+
+        //角色权限判断
+        List<ProjectMember> projectMemberList = null;
+        if ("admin".equals(roleCode)) {
+            projectMemberList = memberMapper.adminProjects(mediaIds);
+        } else {
+            //如果以上角色都不是的话直接查询此角色所属项目
+            projectMemberList = memberMapper.designProjects(userId, mediaIds);
+        }
+
+        if (null == projectMemberList) {
+            projectMemberList = new ArrayList<>();
+        }
+
+        return projectMemberList;
+    }
+
+    @Override
+    public List<JSONObject> getProjectByUserIdAndMediaIds(String userId, List<Integer> mediaIds) {
+        return memberMapper.getProjectByUserIdAndMediaIds(userId, mediaIds);
+    }
+
+    @Override
+    public List<Map<String, Object>> getAllProjectAccount(String mediaType) {
+        List<Map<String, Object>> result = new ArrayList<>();
+        List<Integer> mediaList = new ArrayList<>();
+        if (mediaType.equals(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE)) {
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT);
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INSIDE_INT);
+        } else if (mediaType.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU)) {
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT);
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INSIDE_INT);
+        }
+
+        //查询登录账号下的项目
+        List<ProjectMember> projectMemberList = this.memberMapper.adminProjects(mediaList);
+        if (projectMemberList.isEmpty()) {
+            return result;
+        }
+        projectMemberList.forEach(ProjectMember -> {
+            Map<String, Object> temp = this.queryAccountByProjectId(ProjectMember);
+            if (temp != null) {
+                result.add(temp);
+            }
+        });
+        return result;
+    }
+
+    @Override
+    public List<Long> getProjectIdsByProductId(Long productId, String userId) {
+        return memberMapper.getProjectIdsByProductId(productId, userId);
+    }
+
+}
+
+
+

+ 49 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/service/impl/SysUserServiceImpl.java

@@ -0,0 +1,49 @@
+package cn.com.ctop.common.service.impl;
+
+import cn.com.ctop.common.mapper.SysUserMapper;
+import cn.com.ctop.common.service.ISysUserService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.system.entity.SysUser;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * 用户表 服务实现类
+ * </p>
+ *
+ * @Author: scott
+ * @Date: 2018-12-20
+ */
+@Service
+@Slf4j
+public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
+    @Resource
+    private SysUserMapper sysUserMapper;
+    @Override
+    public List<String> treeUserInfo(String userId) {
+        List<SysUser> allList = sysUserMapper.selectAllUser();
+        List<SysUser> mulUserList = treeCategoryData(allList, userId);
+        List<String> userIds = new ArrayList<>();
+        userIds.add(userId);
+        mulUserList.forEach(mulUser -> userIds.add(mulUser.getId()));
+        return userIds;
+    }
+
+    public List<SysUser> treeCategoryData(List<SysUser> allList, String leaderId) {
+        List<SysUser> mapList = new ArrayList<>();
+        for (SysUser vo : allList) {
+            if (leaderId.equals(vo.getLeaderId())){
+                mapList.add(vo);
+                mapList.addAll(treeCategoryData(allList,vo.getId()));
+            }
+        }
+        return mapList;
+
+    }
+}

+ 62 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/service/impl/UserAllocationServiceImpl.java

@@ -0,0 +1,62 @@
+package cn.com.ctop.common.service.impl;
+
+import cn.com.ctop.common.entity.UserAllocation;
+import cn.com.ctop.common.mapper.UserAllocationMapper;
+import cn.com.ctop.common.service.IUserAllocationService;
+import cn.com.ctop.common.utils.Check;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 用户分配
+ * @Author: jeecg-boot
+ * @Date: 2019-08-08
+ * @Version: V1.0
+ */
+@Service
+public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper, UserAllocation> implements IUserAllocationService {
+    @Resource
+    private UserAllocationMapper userAllocationMapper;
+
+    @Override
+    public IPage<UserAllocation> queryListWithPermission(Integer pageSize, Integer pageNo) {
+        Page<UserAllocation> page = new Page<>(pageNo, pageSize);
+        //就是调用这个QueryGenerator.installAuthJdbc方法获取权限sql
+        String sql = QueryGenerator.installAuthJdbc(UserAllocation.class);
+        return this.baseMapper.queryListWithPermission(page, sql);
+    }
+
+    @Override
+    public Map<Long, List<JSONObject>> getAccountListByProjectList(List<JSONObject> projectList) {
+        Map<Long, List<JSONObject>> map = new HashMap<>();
+        List list = new ArrayList();
+        for (int i = 0; i < projectList.size(); i++) {
+            JSONObject jsonObject = projectList.get(i);
+            if (!Check.isNull(jsonObject)) {
+                list.add(jsonObject.getLong("projectId"));
+                map.put(jsonObject.getLong("projectId"), new ArrayList<>());
+            }
+        }
+        List<JSONObject> jsonList = userAllocationMapper.getAccountListByProjectList(list);
+        for (int i = 0; i < jsonList.size(); i++) {
+            JSONObject jsonObject = jsonList.get(i);
+            if (!Check.isNull(jsonObject)) {
+                Long projectId = jsonObject.getLong("projectId");
+                List<JSONObject> jsonObjects = map.get(projectId);
+                jsonObjects.add(jsonObject);
+            }
+        }
+        return map;
+    }
+}

+ 137 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/Check.java

@@ -0,0 +1,137 @@
+package cn.com.ctop.common.utils;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.beanutils.BeanUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+public class Check {
+    private Check() {
+    }
+
+    public static boolean isNull(List<?> list) {
+        return list == null || list.isEmpty();
+    }
+
+    public static boolean isNull(Long l) {
+        return l == null || l == 0;
+    }
+
+    public static boolean isNull(Collection<?> collection) {
+        return collection == null || collection.isEmpty();
+    }
+
+    public static boolean isNull(JSONArray jsonArray) {
+        return jsonArray == null || jsonArray.isEmpty();
+    }
+
+
+    public static boolean isNull(String str) {
+        return str == null || str.isEmpty();
+    }
+
+    public static boolean isNull(byte[] bytes) {
+        return bytes == null || bytes.length == 0;
+    }
+
+    public static boolean hasNull(Object... objects) {
+        for (Object obj : objects) {
+            if (obj == null) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static boolean allEmpty(String... strs) {
+        for (String str : strs) {
+            if (StringUtils.isNotEmpty(str)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public static boolean isNull(Object object) {
+        return object == null;
+    }
+
+    public static boolean isNullMap(Map<?, ?> map) {
+        return map == null || map.isEmpty();
+    }
+
+
+    /**
+     * 移除 JSONObject 中 value 为空的 key
+     * @param
+     * @return
+     */
+    public static JSONObject jsonRemoveEmpty(JSONObject jsonObject){
+        JSONObject jsonResult = new JSONObject();
+        for (Object key :jsonObject.keySet() ) {
+            if (!Check.isNull(jsonObject.get(key)) && !"".equals(jsonObject.get(key))){
+                jsonResult.put(key.toString(), jsonObject.get(key));
+            }
+        }
+        return jsonResult;
+    }
+
+
+
+    /**
+     * 将 Map对象转化为JavaBean
+     * @author loulan
+     * @param map
+     * @return Object对象
+     */
+    public static <T> T convertMap2Bean(Map map, Class T) throws Exception {
+        if(map==null || map.size()==0){
+            return null;
+        }
+        BeanInfo beanInfo = Introspector.getBeanInfo(T);
+        T bean = (T)T.newInstance();
+        PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
+        for (int i = 0, n = propertyDescriptors.length; i <n ; i++) {
+            PropertyDescriptor descriptor = propertyDescriptors[i];
+            String propertyName = descriptor.getName();
+            //将字母大写,这里先注掉,因为本例子直接读取名字匹配即可。
+            //String upperPropertyName = propertyName.toUpperCase();
+            if (map.containsKey(propertyName)) {
+                Object value = map.get(propertyName);
+                //这个方法不会报参数类型不匹配的错误。
+                BeanUtils.copyProperty(bean, propertyName, value);
+                //用这个方法对int等类型会报参数类型不匹配错误,需要我们手动判断类型进行转换,比较麻烦。
+                //descriptor.getWriteMethod().invoke(bean, value);
+                //用这个方法对时间等类型会报参数类型不匹配错误,也需要我们手动判断类型进行转换,比较麻烦。
+                //BeanUtils.setProperty(bean, propertyName, value);
+            }
+        }
+        return bean;
+    }
+
+    /**
+     * 将 List<Map>对象转化为List<JavaBean>
+     * @author loulan
+
+     * @return Object对象
+     */
+    public static <T> List<T> convertListMap2ListBean(List<Map<String,Object>> listMap, Class T) throws Exception {
+        List<T> beanList = new ArrayList<T>();
+        for(int i=0, n=listMap.size(); i<n; i++){
+            Map<String,Object> map = listMap.get(i);
+            T bean = convertMap2Bean(map,T);
+            beanList.add(bean);
+        }
+        return beanList;
+    }
+}

+ 122 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/JsonResourceUtil.java

@@ -0,0 +1,122 @@
+package cn.com.ctop.common.utils;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.core.io.ClassPathResource;
+
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by JQ.bi on 2020.06.03
+ */
+public class JsonResourceUtil {
+
+    private static Logger logger = LoggerFactory.getLogger(JsonResourceUtil.class);
+
+    private JsonResourceUtil() {
+
+    }
+
+    //filename 为文件名字 如 “/json/app_version_info.json”
+    public static JSONObject getJsonObjFromResource(String filename) {
+        JSONObject json = null;
+        if (!filename.contains(".json")) {
+            filename += ".json";
+        }
+        try {
+            ClassPathResource classPathResource = new ClassPathResource(filename);
+            if (classPathResource.exists()) {
+                InputStream inputStream = classPathResource.getInputStream();
+                String content = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
+                json = JSON.parseObject(content);
+            } else {
+                logger.info("file not exist!");
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.info("readFileToString" + e.getMessage());
+        }
+        return json;
+    }
+
+    //json文件转化为JSONArray
+    public static JSONArray getJsonArrFromResource(String filename) {
+        JSONArray json = null;
+        if (!filename.contains(".json")) {
+            filename += ".json";
+        }
+        try {
+            ClassPathResource classPathResource = new ClassPathResource(filename);
+            if (classPathResource.exists()) {
+                InputStream inputStream = classPathResource.getInputStream();
+                String content = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
+                json = JSON.parseArray(content);
+            } else {
+                logger.info("file not exist!");
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.info("readFileToString" + e.getMessage());
+        }
+        return json;
+    }
+
+    public static Map<String, Map<String, Object>> jsonToMap(Object jsonObj) {
+        JSONObject jsonObject = JSONObject.parseObject(jsonObj.toString());
+        Map<String, Map<String, Object>> mapMap = new HashMap<>();
+        jsonObject.forEach((key, value) -> mapMap.put(key, JSONObject.parseObject(value.toString())));
+        return mapMap;
+    }
+
+    /**
+     * 拼接字段
+     */
+    public static String joinFiled(Map<String, Map<String,Object>> mapMap,JSONArray array) {
+        StringBuilder sb = new StringBuilder();
+        array.forEach(it -> {
+            String filedName = it.toString();
+            if (null== mapMap.get(filedName)||mapMap.get(filedName).isEmpty()) {
+                sb.append(it).append(",");
+            } else {
+                sb.append(mapMap.get(filedName).get("filed")).append(",");
+            }
+        });
+        return sb.deleteCharAt(sb.length() - 1).toString();
+    }
+
+    /**
+     * 拼接title
+     */
+    public static List<String> joinTitle(Map<String, Map<String,Object>> mapMap,JSONArray array) {
+        List<String> titles = new ArrayList<>(20);
+        array.forEach(it -> {
+            String titleName = it.toString();
+            if (null== mapMap.get(titleName)||mapMap.get(titleName).isEmpty()) {
+                titles.add(it.toString());
+            } else {
+                titles.add(mapMap.get(it.toString()).get("comment").toString());
+            }
+        });
+        return titles;
+    }
+
+    /**
+     * 拼接字段
+     */
+    public static String joinAllFiled(Map<String, Map<String,Object>> mapMap) {
+        StringBuilder sb = new StringBuilder();
+        mapMap.forEach((k, v) -> sb.append(v.get("filed")).append(","));
+        return sb.deleteCharAt(sb.length() - 1).toString();
+    }
+}

+ 49 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/LinkUtils.java

@@ -0,0 +1,49 @@
+package cn.com.ctop.common.utils;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by JQ.bi on 2020.08.23
+ */
+public class LinkUtils {
+
+
+    //数据对比,环比计算
+    public static List<JSONObject> getCompareDate(List<JSONObject> beforeData, List<JSONObject> AfterData, String standard) {
+        List<JSONObject> result = new ArrayList<>();
+        beforeData.forEach(before -> {
+            String yesStat = String.valueOf(before.get(standard));
+            AfterData.forEach(after -> {
+                if ((String.valueOf(after.get(standard))).equals(yesStat)) {
+                    //消耗较昨日环比
+                    after.put("costProportion", countLink(after.getBigDecimal("cost"), before.getBigDecimal("cost")));
+                    //展示量较昨日环比
+                    after.put("photoShowProportion", countLink(BigDecimal.valueOf(after.getLong("photoShow")), BigDecimal.valueOf(before.getLong("photoShow"))));
+                    //点击量较昨日环比
+                    after.put("photoClickProportion", countLink(BigDecimal.valueOf(after.getLong("photoClick")), BigDecimal.valueOf(before.getLong("photoClick"))));
+                    if(after.getLong("aClick")!=null){
+                        after.put("aClickProportion", countLink(BigDecimal.valueOf(after.getLong("aClick")), BigDecimal.valueOf(before.getLong("aClick"))));
+                    }
+                    before.put("afterData", after);
+                }
+            });
+            result.add(before);
+        });
+        return result;
+    }
+
+    //环比计算
+    public static BigDecimal countLink(BigDecimal numA, BigDecimal numB) {
+        BigDecimal link = new BigDecimal(0);
+        if (numB.compareTo(BigDecimal.ZERO)!=0) {
+            link = (numA.subtract(numB)).divide(numB, 4, RoundingMode.HALF_UP);
+        }
+        return link;
+    }
+
+}

+ 31 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/ResultMapUtils.java

@@ -0,0 +1,31 @@
+package cn.com.ctop.common.utils;
+
+import java.util.Map;
+
+/**
+ * @author jeecg-boot
+ * 2019年12月5日19:57:58
+ */
+public class ResultMapUtils {
+    private static final String MAP_CODE = "code";
+    private static final String MAP_MESSAGE = "message";
+    private static final String MAP_SUCCESS = "success";
+
+    public static void setResultMap(Map<String, Object> map, Integer statusCode) {
+        map.put(MAP_CODE, statusCode);
+        map.put(MAP_MESSAGE, StatusCode.getDesc(statusCode));
+        map.put(MAP_SUCCESS, StatusCode.getFlag(statusCode));
+    }
+
+    public static void setResultMap(Map<String, Object> map, StatusCode statusCode) {
+        map.put(MAP_CODE, statusCode.getCode());
+        map.put(MAP_MESSAGE, statusCode.getDesc());
+        map.put(MAP_SUCCESS, statusCode.getFlag());
+    }
+
+    public static void setResultMap(Map<String, Object> map, int statusCode,String message,boolean flag) {
+        map.put(MAP_CODE, statusCode);
+        map.put(MAP_MESSAGE, message);
+        map.put(MAP_SUCCESS, flag);
+    }
+}

+ 126 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/StatusCode.java

@@ -0,0 +1,126 @@
+package cn.com.ctop.common.utils;
+
+/**
+ * @author jeecg-boot
+ * 2019年12月5日19:57:58
+ */
+public enum StatusCode {
+    /**
+     * 0   请求成功
+     * -101 参数异常
+     * -102 服务器异常
+     * -103 数据不存在
+     * -104 渠道不存在
+     * -105 规则尚未配置
+     * -106 规则为空
+     * -107 同盾数据为空
+     * -108 模型服务异常
+     * -109 深度搜索服务异常
+     * -201 探针数据为空
+     */
+    COMMON_SUCCESS("操作成功", 0, true),
+    COMMON_PARAM_ERROR("参数异常", -1, false),
+    COMMON_ACCOUNT_ERROR("参数异常", -2, false),
+    COMMON_INTERNET_ERROR("网络请求异常", -3, false),
+    COMMON_DATA_NOT_EXIST("数据不存在或者已经被删除", -101, false),
+    BYTEDANCE_PLAN_DATA_NOT_EXIST("此计划不存在或者已经被删除", -101, false),
+    BYTEDANCE_ACCOUNT_DATA_NOT_EXIST("此账户尚未绑定或已停投", -101, false),
+    COMMON_VERSION_NOT_EXIST("版本号不存在", -102, false),
+    BYTEDANCE_VIDEO_UPLOAD_FAIL("今日头条视频文件上传失败", -201, false),
+    MATERIAL_UPLOAD_FAIL("素材文件上传失败", -201, false),
+    IMAGE_NUMBER_SHORTAGE("今日头条图片文件上传失败", -202, false),
+    BYTEDANCE_IMAGE_UPLOAD_FAIL("今日头条图片文件上传失败", -203, false),
+    TEMPLATE_NAME_HAS_EXIST("模板名称已存在", -204, false),
+    TEMPLATE_NAME_IS_NULL("模板名称为空", -205, false),
+    FILE_HAS_NOT_UPLOAD("文件尚未上传", -206, false),
+    ACCOUNT_HAS_NOT_EXIST("该用户信息不存在", -207, false),
+    USERNAME_OR_PASSWORD_ERROR("登录用户名或密码错误", -208, false),
+    ACCOUNT_HAS_NO_AUTHORIZE("该用户尚未进行授权", -209, false),
+    FILE_HAS_UPLOAD("文件已经上传过", 0, false),
+    COMMON_SERVER_ERROR("服务器内部错误", -102, false),
+    CTOP_HAS_NO_PERFORMANCE_STATISTIC_LOGIC("绩效统计逻辑尚未确定", -103, false),
+    CTOP_SCRIPT_FILE_NOT_EXIST("脚本文件不存在", -104, false),
+    CTOP_PROJECT_NOT_EXIST("项目不存在", -105, false),
+    CTOP_FEISHU_EMAIL_NOT_EXIST("飞书账户未绑定邮箱", -106, false),
+    CTOP_FEISHU_ACCOUNT_NOT_EXIST("该用户未注册系统账户,请联系管理员", -107, false),
+
+    KUAISHOU_CRAWLER_APP_EXIT("快手app异常退出", -1001, false),
+    KUAISHOU_CRAWLER_APP_ELEMENT_ERROR("快手元素异常", -1002, false),
+    KUAISHOU_CRAWLER_APP_ELEMENT_IS_NULL("此快手元素获取不到", -1003, false),
+    KUAISHOU_CRAWLER_APP_MOBILE_CODE_IS_NULL("短信验证码未获取到", -1004, false),
+    KUAISHOU_CRAWLER_APP_ELEMENT_DETAIL_ERROR("快手元素内容异常", -1005, false),
+    KUAISHOU_CRAWLER_APP_NO_ENABLED_DEVICE("暂无可用设备", -2001, false),
+    KUAISHOU_OPTINIZER_CONFIG_IS_NULL("快手媒体优化师配置信息不全", -3001, false),
+    KUAISHOU_OPTINIZER_PERSONNAL_DATA_IS_NULL("快手媒体优化师个人消耗数据不存在", -3002, false),
+    BYTEDANCE_OPTINIZER_PERSONNAL_DATA_IS_NULL("头条媒体优化师个人消耗数据不存在", -3003, false),
+    OPTINIZER_PERSONNAL_DATA_IS_NULL("优化师个人消耗数据不存在", -3004, false),
+
+    BYTEDACNE_API_GROUP_CREATE_ERROR("头条API创建广告组异常",-4001,false),
+
+    KUAISHOU_API_ACCOUNT_SPEED_EXPLORING("此账户加速探索尚未完成",-5001,false),
+    KUAISHOU_SPEED_EXPLORE_ACTION_TYPE_NOT_CONFIG("加速探索尚不支持此类优化目标",-5002,false),
+    KUAISHOU_SPEED_EXPLORE_FAIL("加速探索失败",-5003,false),
+
+    KUAISHOU_AI_STRATEGY_HAS_NOT_EXIST("账户策略未配置或者已经被关闭",-6001,false),
+    KUAISHOU_AI_STRATEGY_HAS_NO_HISTORY_MATERIAL("历史素材不存在",-6002,false),
+
+    BYTEDANCE_IMAGE_UPLOAD_ERROR("头条图片素材上传异常",-7001,false),
+
+    KUAISHOU_CRAWLER_APP_SUCCESS("爬虫运行正常", 0, true),
+    KUAISHOU_CRAWLER_APP_TASK_END("爬虫任务运行结束", 1, true),
+    KUAISHOU_CRAWLER_APP_JOB_StART("任务开始执行开始", 0, true),
+    KUAISHOU_CRAWLER_APP_JOB_END("任务运行结束", 1, true),
+    MODEL_VIDEO_NOT_EXIST("模板视频不存在或者已经被删除", 0, false);
+    private String desc;
+    private int code;
+    private boolean flag;
+
+    StatusCode(String desc, int code, boolean flag) {
+        this.desc = desc;
+        this.code = code;
+        this.flag = flag;
+    }
+
+    public static String getDesc(int code) {
+        for (StatusCode error : StatusCode.values()) {
+            if (error.getCode() == code) {
+                return error.getDesc();
+            }
+        }
+        return null;
+    }
+
+    public static Boolean getFlag(int code) {
+        for (StatusCode error : StatusCode.values()) {
+            if (error.getCode() == code) {
+                return error.getFlag();
+            }
+        }
+        return null;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public boolean getFlag() {
+        return flag;
+    }
+
+    public void setFlag(boolean flag) {
+        this.flag = flag;
+    }
+
+}

+ 116 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/controller/KuaishouAccountReportDailyDwController.java

@@ -0,0 +1,116 @@
+package cn.com.ctop.report.controller;
+
+import cn.com.ctop.common.utils.ResultMapUtils;
+import cn.com.ctop.common.utils.StatusCode;
+import cn.com.ctop.report.entity.AccountAttributionInfo;
+import cn.com.ctop.report.service.AccountAttributionInfoService;
+import cn.com.ctop.report.service.IKuaishouAccountReportDailyDwService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("account/report")
+@Slf4j
+public class KuaishouAccountReportDailyDwController {
+    @Autowired
+    IKuaishouAccountReportDailyDwService accountReportDailyDwService;
+    @Autowired
+    private AccountAttributionInfoService accountAttributionInfoService;
+    @PostMapping("getProjectAccountByUserId")
+    public Map<String,Object> getProjectAccount(@RequestBody JSONObject params) {
+        Map<String,Object> resultMap = new HashMap<>();
+        String userId = params.getString("userId");
+        String type = params.getString("type");
+        if(null == userId||"".equals(userId.trim())||null == type||"".equals(type.trim())){
+            ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_PARAM_ERROR);
+            return resultMap;
+        }
+        JSONArray dataList = accountAttributionInfoService.getProjectAccountByUserId(userId, type);
+        resultMap.put("message","获取数据成功");
+        resultMap.put("code","0");
+        resultMap.put("success",true);
+        resultMap.put("result",dataList);
+        return resultMap;
+    }
+
+    /**
+     * 查询账户报表数据
+     */
+    @PostMapping("/kuaishou/list")
+    public Result<List<JSONObject>> getListReport(@RequestBody JSONObject requestBody) {
+        Result<List<JSONObject>> result = new Result<>();
+        if (requestBody.isEmpty()) {
+            log.error("request body is empty");
+            result.setSuccess(false);
+        }
+        BigDecimal discount = requestBody.getBigDecimal("discount");
+        JSONArray accounts = requestBody.getJSONArray("accountIds");
+        String userId = requestBody.getString("userId");
+        if (accounts.isEmpty()) {
+            List<AccountAttributionInfo> accountAttributionInfos = accountAttributionInfoService.getAccountInfoList(userId,"1");
+            accounts = new JSONArray();
+            for (AccountAttributionInfo account:accountAttributionInfos) {
+                accounts.add(account.getAccountId());
+            }
+        }
+        String startDate = requestBody.getString("startDate");
+        String endDate = requestBody.getString("endDate");
+        int hour = requestBody.getInteger("hour");
+        String target = requestBody.getString("target");
+        String order = requestBody.getString("order");
+        try {
+            List<JSONObject> listData = accountReportDailyDwService.getListDataByParams("1", discount, accounts, startDate, endDate, hour, target, order);
+            result.setResult(listData);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.setSuccess(false);
+        }
+        return result;
+    }
+
+    /**
+     * 查询素材报表chart数据
+     */
+    @PostMapping("/kuaishou/chart")
+    public Result<Map<String, Object>> getAccountChartReport(@RequestBody JSONObject requestBody) {
+        Result<Map<String, Object>> resultBody = new Result<>();
+        Map<String, Object> result = new HashMap<>();
+        if (requestBody.isEmpty()) {
+            log.error("request body is empty");
+            resultBody.setSuccess(false);
+        }
+        String mediaId = requestBody.getString("mediaId");
+        BigDecimal discount = requestBody.getBigDecimal("discount");
+        JSONArray accounts = requestBody.getJSONArray("accountIds");
+        if (accounts.isEmpty()) {
+            return resultBody;
+        }
+        String startDate = requestBody.getString("startDate");
+        String endDate = requestBody.getString("endDate");
+        try {
+            Map<String, Object> sumData = accountAttributionInfoService.getSumDataBy(mediaId, discount, accounts, startDate, endDate);
+            List<JSONObject> chartData = accountAttributionInfoService.getChartDataBy(mediaId, discount, accounts, startDate, endDate);
+            result.put("sumData", sumData);
+            result.put("chartData", chartData);
+            resultBody.setResult(result);
+            resultBody.setSuccess(true);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            resultBody.setSuccess(false);
+        }
+        return resultBody;
+    }
+}

+ 208 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/controller/KuaishouMaterialReportDailyDwController.java

@@ -0,0 +1,208 @@
+package cn.com.ctop.report.controller;
+
+import cn.com.ctop.common.constant.AccountReportConstants;
+import cn.com.ctop.common.mapper.SysRoleMapper;
+import cn.com.ctop.common.service.IProjectMemberService;
+import cn.com.ctop.common.service.IUserAllocationService;
+import cn.com.ctop.common.utils.Check;
+import cn.com.ctop.common.utils.JsonResourceUtil;
+import cn.com.ctop.common.utils.ResultMapUtils;
+import cn.com.ctop.common.utils.StatusCode;
+import cn.com.ctop.report.entity.AccountAttributionInfo;
+import cn.com.ctop.report.service.AccountAttributionInfoService;
+import cn.com.ctop.report.service.IKuaishouAccountReportDailyDwService;
+import cn.com.ctop.report.service.IKuaishouMaterialVideoReportDailyDwService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.entity.SysUser;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("material/report")
+@Slf4j
+public class KuaishouMaterialReportDailyDwController {
+    @Autowired
+    IKuaishouMaterialVideoReportDailyDwService materialVideoReportDailyDwService;
+    @Resource
+    private SysRoleMapper sysRoleMapper;
+    @Autowired
+    private IProjectMemberService projectMemberService;
+    @Autowired
+    private IUserAllocationService userAllocationService;
+
+    /**
+     * 获取项目以及账户信息
+     *
+     * @param params
+     * @return
+     */
+    @PostMapping(value = "/getProjectAccountByUserId")
+    public Map<String, Object> getProjectAccount(@RequestBody JSONObject params) {
+        Map<String, Object> resultMap = new HashMap<>();
+        String userId = params.getString("userId");
+        String type = params.getString("type");
+        if (null == userId || "".equals(userId.trim()) || null == type || "".equals(type.trim())) {
+            ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_PARAM_ERROR);
+            return resultMap;
+        }
+        List<Integer> mediaIds = new ArrayList<>();
+        if ("kuaishou".equals(type)) {
+            mediaIds.add(2);
+            mediaIds.add(4);
+        } else {
+            mediaIds.add(1);
+            mediaIds.add(3);
+        }
+        //查询用户角色
+        String roleCode = sysRoleMapper.getRoleCodeByUserId(userId);
+        //角色为 管理员 || 销售 || 媒介 查询全部
+        if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
+            userId = null;
+        }
+        //查询项目信息以及广告主
+        List<JSONObject> projectList = projectMemberService.getProjectByUserIdAndMediaIds(userId, mediaIds);
+        List<JSONObject> haveList = new ArrayList<>();
+        if (!Check.isNull(projectList)) {
+            //项目id 查询账户人员信息
+            Map<Long, List<JSONObject>> accountMap = userAllocationService.getAccountListByProjectList(projectList);
+            for (int i = 0; i < projectList.size(); i++) {
+                JSONObject project = projectList.get(i);
+                if (!Check.isNull(project)) {
+                    List<JSONObject> accountList = accountMap.get(project.getLong("projectId"));
+                    if (!Check.isNull(accountList)) {
+                        project.put("accountList", accountList);
+                        haveList.add(project);
+                    }
+                }
+            }
+        }
+        ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS);
+        resultMap.put("data", haveList);
+        return resultMap;
+    }
+
+    @PostMapping("/kuaishou/list")
+    public Result<PageInfo<JSONObject>> getListReport(@RequestBody JSONObject requestBody) {
+        Result<PageInfo<JSONObject>> result = new Result<>();
+        try {
+            int pageSize = requestBody.getInteger("pageSize");
+            int pageNo = requestBody.getInteger("pageNo");
+            String startDate = requestBody.getString("startDate");
+            String mediaType = requestBody.getString("mediaType");
+            if (Check.isNull(startDate)) {
+                throw new Exception("请输入查询开始时间");
+            }
+            String endDate = requestBody.getString("endDate");
+            if (Check.isNull(endDate)) {
+                throw new Exception("请输入查询结束时间");
+            }
+            String filedAll = JsonResourceUtil.joinAllFiled(AccountReportConstants.getKuaishouVideoReportMap());
+            if (Check.isNull(filedAll)) {
+                throw new Exception("初始化查询 字段返回为空");
+            }
+            String userId = requestBody.getString("userId");
+            if (Check.isNull(userId)) {
+                throw new Exception("用户id不能为空");
+            }
+            Map<String, Object> requestMap = new HashMap<>();
+            requestMap.put("filed", filedAll);
+            requestMap.put("startDate", startDate);
+            requestMap.put("endDate", endDate);
+
+            if (!Check.isNull(requestBody.getJSONArray("accountIds"))) {
+                requestMap.put("accountIds", requestBody.getJSONArray("accountIds"));
+            }
+
+            if (!Check.isNull(requestBody.getString("target"))) {
+                requestMap.put("target", requestBody.getString("target"));
+            }
+            if (!Check.isNull(requestBody.getString("order"))) {
+                requestMap.put("order", requestBody.getString("order"));
+            }
+            if (!Check.isNull(requestBody.getString("channelType"))) {
+                requestMap.put("channelType", requestBody.getString("channelType"));
+            }
+            String roleCode = sysRoleMapper.getRoleCodeByUserId(userId);
+            if ("admin".equals(roleCode)) {
+                //管理员
+            } else if ("clip".equals(roleCode)) {
+                requestMap.put("clipId", userId);
+            } else if (!Check.isNull(requestBody.getString("clipId"))) {
+                requestMap.put("clipId", requestBody.getString("clipId"));
+            }
+
+            if ("shot".equals(roleCode)) {
+                requestMap.put("shotId", userId);
+            } else if (!Check.isNull(requestBody.getString("shotId"))) {
+                requestMap.put("shotId", requestBody.getString("shotId"));
+            }
+
+            if ("plan".equals(roleCode)) {
+                requestMap.put("planId", userId);
+            } else if (!Check.isNull(requestBody.getString("planId"))) {
+                requestMap.put("planId", requestBody.getString("planId"));
+            }
+
+            if ("designTeamLeader".equals(roleCode)) {
+                requestMap.put("leaderId", userId);
+            } else if (!Check.isNull(requestBody.getString("leaderId"))) {
+                requestMap.put("leaderId", requestBody.getString("leaderId"));
+            }
+            PageInfo<JSONObject> listData = materialVideoReportDailyDwService.getKuaiShouVideoPageReportByMap(requestMap, pageSize, pageNo);
+            if (Check.isNull(listData)) {
+                throw new Exception("暂无素材相关信息,请检查账户");
+            }
+            result.setSuccess(true);
+            result.setResult(listData);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.setSuccess(false);
+            result.setMessage(e.toString());
+        }
+        return result;
+    }
+
+
+
+    @PostMapping("/detail")
+    public Result<List<JSONObject>> getReportDetail(@RequestBody JSONObject requestBody) {
+        Result<List<JSONObject>> result = new Result<>();
+        if (requestBody.isEmpty()) {
+            log.error("request body is empty");
+            result.setSuccess(false);
+        } else {
+
+            JSONArray accountIds = requestBody.getJSONArray("accountIds");
+            String signature = requestBody.getString("signature");
+            String startDate = requestBody.getString("startDate");
+            String endDate = requestBody.getString("endDate");
+            String filedAll = JsonResourceUtil.joinAllFiled(AccountReportConstants.getDicMapKs());
+            try {
+                if (accountIds.isEmpty()) {
+                    accountIds = null;
+                }
+                List<JSONObject> listData = materialVideoReportDailyDwService.getVideoDetailBy(accountIds, startDate, endDate, filedAll, signature);
+                result.setResult(listData);
+                result.setSuccess(true);
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                result.setSuccess(false);
+            }
+        }
+        return result;
+    }
+}

+ 0 - 60
jeecg-boot-report/src/main/java/cn/com/ctop/report/controller/TestController.java

@@ -1,60 +0,0 @@
-package cn.com.ctop.report.controller;
-
-import cn.com.ctop.report.entity.UserAllocation;
-import cn.com.ctop.report.mapper.SysRoleMapper;
-import cn.com.ctop.report.service.IUserAllocationService;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.apache.shiro.SecurityUtils;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.aspect.annotation.PermissionData;
-import org.jeecg.common.system.vo.LoginUser;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-
-@RestController
-@RequestMapping("report")
-public class TestController {
-    @Autowired
-    private IUserAllocationService userAllocationService;
-
-    @GetMapping(value = "/sqlList")
-    @PermissionData(pageComponent="jeecg/JeecgDemoList")
-    public Result<IPage<UserAllocation>> loadSqlPermissonList(UserAllocation jeecgDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                              HttpServletRequest req) {
-        Result<IPage<UserAllocation>> result = new Result<IPage<UserAllocation>>();
-        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        String sql = joinSql(user);
-        IPage<UserAllocation> pageList = userAllocationService.queryListWithPermission(pageSize, pageNo);
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
-    }
-
-    //运营角色
-    private String joinSql(LoginUser user) {
-        String sql = "";
-        //判定账户角色
-        String roleCode = sysRoleMapper.getRoleCodeByUserId(user.getId());
-        if("admin".equals(roleCode)){
-            //管理员,全角色权限
-            return sql;
-        }
-        //TODO 公司负责人角色没有
-        if("company".equals(roleCode)){
-            //查询公司orgCode
-            String companyCode = "";
-            sql = " and org_code like '"+companyCode+"%' ";
-            return sql;
-        }
-        return sql;
-    }
-
-    @Resource
-    private SysRoleMapper sysRoleMapper;
-}

+ 502 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouAccountReportHourlyDw.java

@@ -0,0 +1,502 @@
+package cn.com.ctop.report.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+
+@Data
+@TableName("kuaishou_account_report_hourly_dw")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class KuaishouAccountReportHourlyDw {
+    private Long accountId;
+    private Long statDate;
+    private int hour;
+    /**
+     * 项目id
+     */
+    private Long projectId;
+    /**
+     * 产品id
+     */
+    private Long productId;
+    /**
+     * 广告主id
+     */
+    private String advertiserId;
+    /**
+     * 公司id
+     */
+    private String companyId;
+    /**
+     * 账户名称
+     */
+    private String accountName;
+    /**
+     * 项目名称
+     */
+    private String projectName;
+    /**
+     * 广告主名称
+     */
+    private String advertiserName;
+    /**
+     * 公司名称
+     */
+    private String companyName;
+    /**
+     * 销售id
+     */
+    private String saleId;
+    /**
+     * 运营id
+     */
+    private String userId;
+    /**
+     * 机构编码
+     */
+    private String orgCode;
+    /**
+     * 花费(元)
+     */
+    private BigDecimal charge;
+    /**
+     * 封面曝光数
+     */
+    private Long show;
+    /**
+     * 封面点击数
+     */
+    private Long photoClick;
+    /**
+     * 素材曝光数
+     */
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    private Long bclick;
+    /**
+     * 封面点击率
+     */
+    private BigDecimal photoClickRatio;
+    /**
+     * 3s播放率
+     */
+    private BigDecimal play3sRatio;
+    /**
+     * 行为率
+     */
+    private BigDecimal actionRatio;
+    /**
+     * 平均千次曝光花费(元)
+     */
+    private BigDecimal impression1kCost;
+    /**
+     * 平均点击单价(元)
+     */
+    private BigDecimal photoClickCost;
+    /**
+     * 平均行为单价(元)
+     */
+    private BigDecimal actionCost;
+    /**
+     * 分享数
+     */
+    private Long share;
+    /**
+     * 评论数
+     */
+    private Long comment;
+    /**
+     * 点赞数
+     */
+    private Long like;
+    /**
+     * 新增关注数
+     */
+    private Long follow;
+    /**
+     * 取消关注数
+     */
+    private Long cancelFollow;
+    /**
+     * 举报数
+     */
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    private Long block;
+    /**
+     * 减少此类作品数
+     */
+    private Long negative;
+    /**
+     * 提交按钮点击数(历史字段,同下方“表单提交数”,预计年底删除该字段)
+     */
+    private Long submit;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    private Long downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    private Long downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    private Long activation;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    private Long eventPayFirstDay;
+    /**
+     * 应用下载数据-首日付费金额
+     */
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * 应用下载数据-首日ROI
+     */
+    private BigDecimal eventPayFirstDayRoi;
+    /**
+     * 应用下载数据-付费次数
+     */
+    private Long eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-ROI
+     */
+    private BigDecimal eventPayRoi;
+    /**
+     * 应用下载数据-注册数
+     */
+    private Long eventRegister;
+    /**
+     * 应用下载数据-注册成本
+     */
+    private BigDecimal eventRegisterCost;
+    /**
+     * 应用下载数据-注册率
+     */
+    private BigDecimal eventRegisterRatio;
+    /**
+     * 应用下载数据-完件数
+     */
+    private Long eventJinJianApp;
+    /**
+     * 应用下载数据-完件成本
+     */
+    private BigDecimal eventJinJianAppCost;
+    /**
+     * 应用下载数据-授信数
+     */
+    private Long eventCreditGrantApp;
+    /**
+     * 应用下载数据-授信成本
+     */
+    private BigDecimal eventCreditGrantAppCost;
+    /**
+     * 应用下载数据-授信率
+     */
+    private BigDecimal eventCreditGrantAppRatio;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    private Long eventOrderPaid;
+    /**
+     * 应用下载数据-付款成功金额
+     */
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * 应用下载数据-单次付款成本
+     */
+    private BigDecimal eventOrderPaidCost;
+    /**
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    private Long eventNextDayStay;
+    /**
+     * 应用下载数据-次留成本(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayCost;
+    /**
+     * 应用下载数据-次留率(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayRatio;
+    /**
+     * 落地页数据-表单提交数
+     */
+    private Long formCount;
+    /**
+     * 落地页数据-表单提交单价
+     */
+    private BigDecimal formCost;
+    /**
+     * 落地页数据-表单提交点击率
+     */
+    private BigDecimal formActionRatio;
+    /**
+     * 落地页数据-落地页完件数
+     */
+    private Long eventJinJianLandingPage;
+    /**
+     * 落地页数据-落地页完件成本
+     */
+    private BigDecimal eventJinJianLandingPageCost;
+    /**
+     * 落地页数据-落地页授信数
+     */
+    private Long eventCreditGrantLandingPage;
+    /**
+     * 落地页数据-落地页授信成本
+     */
+    private BigDecimal eventCreditGrantLandingPageCost;
+    /**
+     * 落地页数据-落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingPageRatio;
+    /**
+     * 落地页数据-有效线索数
+     */
+    private Long eventValidClues;
+    /**
+     * 落地页数据-有效线索成本
+     */
+    private BigDecimal eventValidCluesCost;
+    /**
+     * 微信复制数
+     */
+    private Long eventAddWechat;
+    /**
+     * 微信复制成本
+     */
+    private BigDecimal eventAddWechatCost;
+    /**
+     * 微信复制率
+     */
+    private BigDecimal eventAddWechatRatio;
+    /**
+     * 智能电话-确认接通数
+     */
+    private Long eventGetThrough;
+    /**
+     * 智能电话-确认接通成本
+     */
+    private BigDecimal eventGetThroughCost;
+    /**
+     * 智能电话-确认接通率
+     */
+    private BigDecimal eventGetThroughRatio;
+    /**
+     * 唤醒应用数
+     */
+    private Long eventAppInvoked;
+    /**
+     * 唤醒应用成本
+     */
+    private BigDecimal eventAppInvokedCost;
+    /**
+     * 唤醒应用率
+     */
+    private BigDecimal eventAppInvokedRatio;
+    /**
+     * 落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingRatio;
+    /**
+     * 5s播放率
+     */
+    private BigDecimal play5sRatio;
+    /**
+     * 完播率
+     */
+    private BigDecimal playEndRatio;
+    /**
+     * 新增付费人数
+     */
+    private BigDecimal eventNewUserPay;
+    /**
+     * 新增付费人数成本
+     */
+    private BigDecimal eventNewUserPayCost;
+    /**
+     * 新增付费人数率
+     */
+    private BigDecimal eventNewUserPayRatio;
+    /**
+     * 平均千次素材曝光花费(元)
+     */
+    private BigDecimal click1kCost;
+    /**
+     * 商品成交数
+     */
+    private Long adProductCnt;
+    /**
+     * 商品访问数
+     */
+    private Long eventGoodsView;
+    /**
+     * 涨粉量
+     */
+    private Long merchantRecoFans;
+    /**
+     * 小店推广roi
+     */
+    private BigDecimal eventOrderAmountRoi;
+    /**
+     * 商品访问成本
+     */
+    private BigDecimal eventGoodsViewCost;
+    /**
+     * 涨粉成本
+     */
+    private BigDecimal merchantRecoFansCost;
+    /**
+     * 按钮点击数
+     */
+    private Long eventButtonClick;
+    /**
+     * 按钮点击成本
+     */
+    private BigDecimal eventButtonClickCost;
+    /**
+     * 按钮点击率
+     */
+    private BigDecimal eventButtonClickRatio;
+    /**
+     * 订单支付率
+     */
+    private BigDecimal eventOrderPaidRoi;
+    /**
+     * 新增完件人数
+     */
+    private Long eventNewUserJinjianApp;
+    /**
+     * 新增完件成本
+     */
+    private BigDecimal eventNewUserJinjianAppCost;
+    /**
+     * 新增完件人数率
+     */
+    private BigDecimal eventNewUserJinjianAppRoi;
+    /**
+     * 新增授信人数
+     */
+    private Long eventNewUserCreditGrantApp;
+    /**
+     * 新增授信人数成本
+     */
+    private BigDecimal eventNewUserCreditGrantAppCost;
+    /**
+     * 新增授信人数率
+     */
+    private BigDecimal eventNewUserCreditGrantAppRoi;
+
+    private Long eventNewUserJinjianPage;
+    private BigDecimal eventNewUserJinjianPageCost;
+    private BigDecimal eventNewUserJinjianPageRoi;
+    private Long eventNewUserCreditGrantPage;
+    private BigDecimal eventNewUserCreditGrantPageCost;
+    private BigDecimal eventNewUserCreditGrantPageRoi;
+    /**
+     * 预约表单数
+     */
+    private Long eventAppointForm;
+    /**
+     * 预约表单点击成本
+     */
+    private BigDecimal eventAppointFormCost;
+    /**
+     * 预约表单点击率
+     */
+    private BigDecimal eventAppointFormRatio;
+    /**
+     * 预约跳转点击数
+     */
+    private Long eventAppointJumpClick;
+    /**
+     * 预约跳转点击成本
+     */
+    private BigDecimal eventAppointJumpClickCost;
+    /**
+     * 预约跳转点击率
+     */
+    private BigDecimal eventAppointJumpClickRatio;
+    /**
+     * 联盟广告收入
+     */
+    private Long unionEventPayPurchaseAmount7d;
+    /**
+     * 联盟变现ROI
+     */
+    private BigDecimal unionEventPayPurchaseAmount7dRoi;
+    private String placementType;
+    private String adScene;
+    private Long eventOrderSuccessed;
+    private BigDecimal adPhotoPlayed10sRatio;
+    private BigDecimal keyActionCost;
+    /**
+     * 添加购物车成本
+     */
+    private BigDecimal eventAddShoppingCartCost;
+
+    /**
+     * 广告观看次数转化率
+     */
+    private BigDecimal eventAdWatchTimesRatio;
+    private BigDecimal eventOutboundCallCost;
+    private Long eventOutboundCall;
+    private BigDecimal actionNewRatio;
+
+    /**
+     * 广告观看
+     */
+    private Long eventWatchAppAd;
+    /**
+     * 落地页多转化成本
+     */
+    private BigDecimal eventMultiConversionCost;
+    private Long eventPhoneCardActivate;
+    private BigDecimal adPhotoPlayed75percentRatio;
+    private BigDecimal keyActionRatio;
+    /**
+     * 广告观看次数成本
+     */
+    private BigDecimal eventAdWatchTimesCost;
+    /**
+     * 添加购物车数
+     */
+    private Long eventAddShoppingCart;
+    private Long keyAction;
+
+    /**
+     * 落地页多转化次数
+     */
+    private Long eventMultiConversion;
+    private Long eventWechatConnected;
+    /**
+     * 附加组件表单提交
+     */
+    private Long eventDspGiftForm;
+    private Long eventIntentionConfirmed;
+    private Long eventPhoneGetThrough;
+    /**
+     * 落地页多转化率
+     */
+    private BigDecimal eventMultiConversionRatio;
+    private BigDecimal eventMeasurementHouse;
+    private BigDecimal adPhotoPlayed2sRatio;
+    private BigDecimal eventOutboundCallRatio;
+    /**
+     * 广告观看次数
+     */
+    private Long eventAdWatchTimes;
+}

+ 506 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouCampaignReportDailyDw.java

@@ -0,0 +1,506 @@
+package cn.com.ctop.report.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+
+@Data
+@TableName("kuaishou_campaign_report_daily_dw")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class KuaishouCampaignReportDailyDw {
+    private Long accountId;
+    private Long statDate;
+    /**
+     * 项目id
+     */
+    private Long projectId;
+    /**
+     * 产品id
+     */
+    private Long productId;
+    /**
+     * 广告主id
+     */
+    private String advertiserId;
+    /**
+     * 公司id
+     */
+    private String companyId;
+    /**
+     * 账户名称
+     */
+    private String accountName;
+    /**
+     * 项目名称
+     */
+    private String projectName;
+    /**
+     * 广告主名称
+     */
+    private String advertiserName;
+    /**
+     * 公司名称
+     */
+    private String companyName;
+    /**
+     * 销售id
+     */
+    private String saleId;
+    /**
+     * 运营id
+     */
+    private String userId;
+    /**
+     * 机构编码
+     */
+    private String orgCode;
+    private Long campaignId;
+    private String campaignName;
+    /**
+     * 花费(元)
+     */
+    private BigDecimal charge;
+    /**
+     * 封面曝光数
+     */
+    private Long show;
+    /**
+     * 封面点击数
+     */
+    private Long photoClick;
+    /**
+     * 素材曝光数
+     */
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    private Long bclick;
+    /**
+     * 封面点击率
+     */
+    private BigDecimal photoClickRatio;
+    /**
+     * 3s播放率
+     */
+    private BigDecimal play3sRatio;
+    /**
+     * 行为率
+     */
+    private BigDecimal actionRatio;
+    /**
+     * 平均千次曝光花费(元)
+     */
+    private BigDecimal impression1kCost;
+    /**
+     * 平均点击单价(元)
+     */
+    private BigDecimal photoClickCost;
+    /**
+     * 平均行为单价(元)
+     */
+    private BigDecimal actionCost;
+    /**
+     * 分享数
+     */
+    private Long share;
+    /**
+     * 评论数
+     */
+    private Long comment;
+    /**
+     * 点赞数
+     */
+    private Long like;
+    /**
+     * 新增关注数
+     */
+    private Long follow;
+    /**
+     * 取消关注数
+     */
+    private Long cancelFollow;
+    /**
+     * 举报数
+     */
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    private Long block;
+    /**
+     * 减少此类作品数
+     */
+    private Long negative;
+    /**
+     * 提交按钮点击数(历史字段,同下方“表单提交数”,预计年底删除该字段)
+     */
+    private Long submit;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    private Long downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    private Long downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    private Long activation;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    private Long eventPayFirstDay;
+    /**
+     * 应用下载数据-首日付费金额
+     */
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * 应用下载数据-首日ROI
+     */
+    private BigDecimal eventPayFirstDayRoi;
+    /**
+     * 应用下载数据-付费次数
+     */
+    private Long eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-ROI
+     */
+    private BigDecimal eventPayRoi;
+    /**
+     * 应用下载数据-注册数
+     */
+    private Long eventRegister;
+    /**
+     * 应用下载数据-注册成本
+     */
+    private BigDecimal eventRegisterCost;
+    /**
+     * 应用下载数据-注册率
+     */
+    private BigDecimal eventRegisterRatio;
+    /**
+     * 应用下载数据-完件数
+     */
+    private Long eventJinJianApp;
+    /**
+     * 应用下载数据-完件成本
+     */
+    private BigDecimal eventJinJianAppCost;
+    /**
+     * 应用下载数据-授信数
+     */
+    private Long eventCreditGrantApp;
+    /**
+     * 应用下载数据-授信成本
+     */
+    private BigDecimal eventCreditGrantAppCost;
+    /**
+     * 应用下载数据-授信率
+     */
+    private BigDecimal eventCreditGrantAppRatio;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    private Long eventOrderPaid;
+    /**
+     * 应用下载数据-付款成功金额
+     */
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * 应用下载数据-单次付款成本
+     */
+    private BigDecimal eventOrderPaidCost;
+    /**
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    private Long eventNextDayStay;
+    /**
+     * 应用下载数据-次留成本(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayCost;
+    /**
+     * 应用下载数据-次留率(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayRatio;
+    /**
+     * 落地页数据-表单提交数
+     */
+    private Long formCount;
+    /**
+     * 落地页数据-表单提交单价
+     */
+    private BigDecimal formCost;
+    /**
+     * 落地页数据-表单提交点击率
+     */
+    private BigDecimal formActionRatio;
+    /**
+     * 落地页数据-落地页完件数
+     */
+    private Long eventJinJianLandingPage;
+    /**
+     * 落地页数据-落地页完件成本
+     */
+    private BigDecimal eventJinJianLandingPageCost;
+    /**
+     * 落地页数据-落地页授信数
+     */
+    private Long eventCreditGrantLandingPage;
+    /**
+     * 落地页数据-落地页授信成本
+     */
+    private BigDecimal eventCreditGrantLandingPageCost;
+    /**
+     * 落地页数据-落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingPageRatio;
+    /**
+     * 落地页数据-有效线索数
+     */
+    private Long eventValidClues;
+    /**
+     * 落地页数据-有效线索成本
+     */
+    private BigDecimal eventValidCluesCost;
+    /**
+     * 微信复制数
+     */
+    private Long eventAddWechat;
+    /**
+     * 微信复制成本
+     */
+    private BigDecimal eventAddWechatCost;
+    /**
+     * 微信复制率
+     */
+    private BigDecimal eventAddWechatRatio;
+    /**
+     * 智能电话-确认接通数
+     */
+    private Long eventGetThrough;
+    /**
+     * 智能电话-确认接通成本
+     */
+    private BigDecimal eventGetThroughCost;
+    /**
+     * 智能电话-确认接通率
+     */
+    private BigDecimal eventGetThroughRatio;
+    /**
+     * 唤醒应用数
+     */
+    private Long eventAppInvoked;
+    /**
+     * 唤醒应用成本
+     */
+    private BigDecimal eventAppInvokedCost;
+    /**
+     * 唤醒应用率
+     */
+    private BigDecimal eventAppInvokedRatio;
+    /**
+     * 落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingRatio;
+    /**
+     * 5s播放率
+     */
+    private BigDecimal play5sRatio;
+    /**
+     * 完播率
+     */
+    private BigDecimal playEndRatio;
+    /**
+     * 新增付费人数
+     */
+    private BigDecimal eventNewUserPay;
+    /**
+     * 新增付费人数成本
+     */
+    private BigDecimal eventNewUserPayCost;
+    /**
+     * 新增付费人数率
+     */
+    private BigDecimal eventNewUserPayRatio;
+    /**
+     * 平均千次素材曝光花费(元)
+     */
+    private BigDecimal click1kCost;
+    /**
+     * 商品成交数
+     */
+    private Long adProductCnt;
+    /**
+     * 商品访问数
+     */
+    private Long eventGoodsView;
+    /**
+     * 涨粉量
+     */
+    private Long merchantRecoFans;
+    /**
+     * 小店推广roi
+     */
+    private BigDecimal eventOrderAmountRoi;
+    /**
+     * 商品访问成本
+     */
+    private BigDecimal eventGoodsViewCost;
+    /**
+     * 涨粉成本
+     */
+    private BigDecimal merchantRecoFansCost;
+    /**
+     * 按钮点击数
+     */
+    private Long eventButtonClick;
+    /**
+     * 按钮点击成本
+     */
+    private BigDecimal eventButtonClickCost;
+    /**
+     * 按钮点击率
+     */
+    private BigDecimal eventButtonClickRatio;
+    /**
+     * 订单支付率
+     */
+    private BigDecimal eventOrderPaidRoi;
+    /**
+     * 新增完件人数
+     */
+    private Long eventNewUserJinjianApp;
+    /**
+     * 新增完件成本
+     */
+    private BigDecimal eventNewUserJinjianAppCost;
+    /**
+     * 新增完件人数率
+     */
+    private BigDecimal eventNewUserJinjianAppRoi;
+    /**
+     * 新增授信人数
+     */
+    private Long eventNewUserCreditGrantApp;
+    /**
+     * 新增授信人数成本
+     */
+    private BigDecimal eventNewUserCreditGrantAppCost;
+    /**
+     * 新增授信人数率
+     */
+    private BigDecimal eventNewUserCreditGrantAppRoi;
+
+    private Long eventNewUserJinjianPage;
+    private BigDecimal eventNewUserJinjianPageCost;
+    private BigDecimal eventNewUserJinjianPageRoi;
+    private Long eventNewUserCreditGrantPage;
+    private BigDecimal eventNewUserCreditGrantPageCost;
+    private BigDecimal eventNewUserCreditGrantPageRoi;
+    /**
+     * 预约表单数
+     */
+    private Long eventAppointForm;
+    /**
+     * 预约表单点击成本
+     */
+    private BigDecimal eventAppointFormCost;
+    /**
+     * 预约表单点击率
+     */
+    private BigDecimal eventAppointFormRatio;
+    /**
+     * 预约跳转点击数
+     */
+    private Long eventAppointJumpClick;
+    /**
+     * 预约跳转点击成本
+     */
+    private BigDecimal eventAppointJumpClickCost;
+    /**
+     * 预约跳转点击率
+     */
+    private BigDecimal eventAppointJumpClickRatio;
+    /**
+     * 联盟广告收入
+     */
+    private Long unionEventPayPurchaseAmount7d;
+    /**
+     * 联盟变现ROI
+     */
+    private BigDecimal unionEventPayPurchaseAmount7dRoi;
+
+    private String placementType;
+
+    private String adScene;
+
+    private Long eventOrderSuccessed;
+    private BigDecimal adPhotoPlayed10sRatio;
+    private BigDecimal keyActionCost;
+    /**
+     * 添加购物车成本
+     */
+    private BigDecimal eventAddShoppingCartCost;
+
+    /**
+     * 广告观看次数转化率
+     */
+    private BigDecimal eventAdWatchTimesRatio;
+    private BigDecimal eventOutboundCallCost;
+    private Long eventOutboundCall;
+    private BigDecimal actionNewRatio;
+
+    /**
+     * 广告观看
+     */
+    private Long eventWatchAppAd;
+    /**
+     * 落地页多转化成本
+     */
+    private BigDecimal eventMultiConversionCost;
+    private Long eventPhoneCardActivate;
+    private BigDecimal adPhotoPlayed75percentRatio;
+    private BigDecimal keyActionRatio;
+    /**
+     * 广告观看次数成本
+     */
+    private BigDecimal eventAdWatchTimesCost;
+    /**
+     * 添加购物车数
+     */
+    private Long eventAddShoppingCart;
+    private Long keyAction;
+
+    /**
+     * 落地页多转化次数
+     */
+    private Long eventMultiConversion;
+    private Long eventWechatConnected;
+    /**
+     * 附加组件表单提交
+     */
+    private Long eventDspGiftForm;
+    private Long eventIntentionConfirmed;
+    private Long eventPhoneGetThrough;
+    /**
+     * 落地页多转化率
+     */
+    private BigDecimal eventMultiConversionRatio;
+    private BigDecimal eventMeasurementHouse;
+    private BigDecimal adPhotoPlayed2sRatio;
+    private BigDecimal eventOutboundCallRatio;
+    /**
+     * 广告观看次数
+     */
+    private Long eventAdWatchTimes;
+}

+ 507 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouCampaignReportHourlyDw.java

@@ -0,0 +1,507 @@
+package cn.com.ctop.report.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+
+@Data
+@TableName("kuaishou_campaign_report_daily_dw")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class KuaishouCampaignReportHourlyDw {
+    private Long accountId;
+    private Long statDate;
+    private int hour;
+    /**
+     * 项目id
+     */
+    private Long projectId;
+    /**
+     * 产品id
+     */
+    private Long productId;
+    /**
+     * 广告主id
+     */
+    private String advertiserId;
+    /**
+     * 公司id
+     */
+    private String companyId;
+    /**
+     * 账户名称
+     */
+    private String accountName;
+    /**
+     * 项目名称
+     */
+    private String projectName;
+    /**
+     * 广告主名称
+     */
+    private String advertiserName;
+    /**
+     * 公司名称
+     */
+    private String companyName;
+    /**
+     * 销售id
+     */
+    private String saleId;
+    /**
+     * 运营id
+     */
+    private String userId;
+    /**
+     * 机构编码
+     */
+    private String orgCode;
+    private Long campaignId;
+    private String campaignName;
+    /**
+     * 花费(元)
+     */
+    private BigDecimal charge;
+    /**
+     * 封面曝光数
+     */
+    private Long show;
+    /**
+     * 封面点击数
+     */
+    private Long photoClick;
+    /**
+     * 素材曝光数
+     */
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    private Long bclick;
+    /**
+     * 封面点击率
+     */
+    private BigDecimal photoClickRatio;
+    /**
+     * 3s播放率
+     */
+    private BigDecimal play3sRatio;
+    /**
+     * 行为率
+     */
+    private BigDecimal actionRatio;
+    /**
+     * 平均千次曝光花费(元)
+     */
+    private BigDecimal impression1kCost;
+    /**
+     * 平均点击单价(元)
+     */
+    private BigDecimal photoClickCost;
+    /**
+     * 平均行为单价(元)
+     */
+    private BigDecimal actionCost;
+    /**
+     * 分享数
+     */
+    private Long share;
+    /**
+     * 评论数
+     */
+    private Long comment;
+    /**
+     * 点赞数
+     */
+    private Long like;
+    /**
+     * 新增关注数
+     */
+    private Long follow;
+    /**
+     * 取消关注数
+     */
+    private Long cancelFollow;
+    /**
+     * 举报数
+     */
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    private Long block;
+    /**
+     * 减少此类作品数
+     */
+    private Long negative;
+    /**
+     * 提交按钮点击数(历史字段,同下方“表单提交数”,预计年底删除该字段)
+     */
+    private Long submit;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    private Long downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    private Long downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    private Long activation;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    private Long eventPayFirstDay;
+    /**
+     * 应用下载数据-首日付费金额
+     */
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * 应用下载数据-首日ROI
+     */
+    private BigDecimal eventPayFirstDayRoi;
+    /**
+     * 应用下载数据-付费次数
+     */
+    private Long eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-ROI
+     */
+    private BigDecimal eventPayRoi;
+    /**
+     * 应用下载数据-注册数
+     */
+    private Long eventRegister;
+    /**
+     * 应用下载数据-注册成本
+     */
+    private BigDecimal eventRegisterCost;
+    /**
+     * 应用下载数据-注册率
+     */
+    private BigDecimal eventRegisterRatio;
+    /**
+     * 应用下载数据-完件数
+     */
+    private Long eventJinJianApp;
+    /**
+     * 应用下载数据-完件成本
+     */
+    private BigDecimal eventJinJianAppCost;
+    /**
+     * 应用下载数据-授信数
+     */
+    private Long eventCreditGrantApp;
+    /**
+     * 应用下载数据-授信成本
+     */
+    private BigDecimal eventCreditGrantAppCost;
+    /**
+     * 应用下载数据-授信率
+     */
+    private BigDecimal eventCreditGrantAppRatio;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    private Long eventOrderPaid;
+    /**
+     * 应用下载数据-付款成功金额
+     */
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * 应用下载数据-单次付款成本
+     */
+    private BigDecimal eventOrderPaidCost;
+    /**
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    private Long eventNextDayStay;
+    /**
+     * 应用下载数据-次留成本(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayCost;
+    /**
+     * 应用下载数据-次留率(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayRatio;
+    /**
+     * 落地页数据-表单提交数
+     */
+    private Long formCount;
+    /**
+     * 落地页数据-表单提交单价
+     */
+    private BigDecimal formCost;
+    /**
+     * 落地页数据-表单提交点击率
+     */
+    private BigDecimal formActionRatio;
+    /**
+     * 落地页数据-落地页完件数
+     */
+    private Long eventJinJianLandingPage;
+    /**
+     * 落地页数据-落地页完件成本
+     */
+    private BigDecimal eventJinJianLandingPageCost;
+    /**
+     * 落地页数据-落地页授信数
+     */
+    private Long eventCreditGrantLandingPage;
+    /**
+     * 落地页数据-落地页授信成本
+     */
+    private BigDecimal eventCreditGrantLandingPageCost;
+    /**
+     * 落地页数据-落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingPageRatio;
+    /**
+     * 落地页数据-有效线索数
+     */
+    private Long eventValidClues;
+    /**
+     * 落地页数据-有效线索成本
+     */
+    private BigDecimal eventValidCluesCost;
+    /**
+     * 微信复制数
+     */
+    private Long eventAddWechat;
+    /**
+     * 微信复制成本
+     */
+    private BigDecimal eventAddWechatCost;
+    /**
+     * 微信复制率
+     */
+    private BigDecimal eventAddWechatRatio;
+    /**
+     * 智能电话-确认接通数
+     */
+    private Long eventGetThrough;
+    /**
+     * 智能电话-确认接通成本
+     */
+    private BigDecimal eventGetThroughCost;
+    /**
+     * 智能电话-确认接通率
+     */
+    private BigDecimal eventGetThroughRatio;
+    /**
+     * 唤醒应用数
+     */
+    private Long eventAppInvoked;
+    /**
+     * 唤醒应用成本
+     */
+    private BigDecimal eventAppInvokedCost;
+    /**
+     * 唤醒应用率
+     */
+    private BigDecimal eventAppInvokedRatio;
+    /**
+     * 落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingRatio;
+    /**
+     * 5s播放率
+     */
+    private BigDecimal play5sRatio;
+    /**
+     * 完播率
+     */
+    private BigDecimal playEndRatio;
+    /**
+     * 新增付费人数
+     */
+    private BigDecimal eventNewUserPay;
+    /**
+     * 新增付费人数成本
+     */
+    private BigDecimal eventNewUserPayCost;
+    /**
+     * 新增付费人数率
+     */
+    private BigDecimal eventNewUserPayRatio;
+    /**
+     * 平均千次素材曝光花费(元)
+     */
+    private BigDecimal click1kCost;
+    /**
+     * 商品成交数
+     */
+    private Long adProductCnt;
+    /**
+     * 商品访问数
+     */
+    private Long eventGoodsView;
+    /**
+     * 涨粉量
+     */
+    private Long merchantRecoFans;
+    /**
+     * 小店推广roi
+     */
+    private BigDecimal eventOrderAmountRoi;
+    /**
+     * 商品访问成本
+     */
+    private BigDecimal eventGoodsViewCost;
+    /**
+     * 涨粉成本
+     */
+    private BigDecimal merchantRecoFansCost;
+    /**
+     * 按钮点击数
+     */
+    private Long eventButtonClick;
+    /**
+     * 按钮点击成本
+     */
+    private BigDecimal eventButtonClickCost;
+    /**
+     * 按钮点击率
+     */
+    private BigDecimal eventButtonClickRatio;
+    /**
+     * 订单支付率
+     */
+    private BigDecimal eventOrderPaidRoi;
+    /**
+     * 新增完件人数
+     */
+    private Long eventNewUserJinjianApp;
+    /**
+     * 新增完件成本
+     */
+    private BigDecimal eventNewUserJinjianAppCost;
+    /**
+     * 新增完件人数率
+     */
+    private BigDecimal eventNewUserJinjianAppRoi;
+    /**
+     * 新增授信人数
+     */
+    private Long eventNewUserCreditGrantApp;
+    /**
+     * 新增授信人数成本
+     */
+    private BigDecimal eventNewUserCreditGrantAppCost;
+    /**
+     * 新增授信人数率
+     */
+    private BigDecimal eventNewUserCreditGrantAppRoi;
+
+    private Long eventNewUserJinjianPage;
+    private BigDecimal eventNewUserJinjianPageCost;
+    private BigDecimal eventNewUserJinjianPageRoi;
+    private Long eventNewUserCreditGrantPage;
+    private BigDecimal eventNewUserCreditGrantPageCost;
+    private BigDecimal eventNewUserCreditGrantPageRoi;
+    /**
+     * 预约表单数
+     */
+    private Long eventAppointForm;
+    /**
+     * 预约表单点击成本
+     */
+    private BigDecimal eventAppointFormCost;
+    /**
+     * 预约表单点击率
+     */
+    private BigDecimal eventAppointFormRatio;
+    /**
+     * 预约跳转点击数
+     */
+    private Long eventAppointJumpClick;
+    /**
+     * 预约跳转点击成本
+     */
+    private BigDecimal eventAppointJumpClickCost;
+    /**
+     * 预约跳转点击率
+     */
+    private BigDecimal eventAppointJumpClickRatio;
+    /**
+     * 联盟广告收入
+     */
+    private Long unionEventPayPurchaseAmount7d;
+    /**
+     * 联盟变现ROI
+     */
+    private BigDecimal unionEventPayPurchaseAmount7dRoi;
+
+    private String placementType;
+
+    private String adScene;
+
+    private Long eventOrderSuccessed;
+    private BigDecimal adPhotoPlayed10sRatio;
+    private BigDecimal keyActionCost;
+    /**
+     * 添加购物车成本
+     */
+    private BigDecimal eventAddShoppingCartCost;
+
+    /**
+     * 广告观看次数转化率
+     */
+    private BigDecimal eventAdWatchTimesRatio;
+    private BigDecimal eventOutboundCallCost;
+    private Long eventOutboundCall;
+    private BigDecimal actionNewRatio;
+
+    /**
+     * 广告观看
+     */
+    private Long eventWatchAppAd;
+    /**
+     * 落地页多转化成本
+     */
+    private BigDecimal eventMultiConversionCost;
+    private Long eventPhoneCardActivate;
+    private BigDecimal adPhotoPlayed75percentRatio;
+    private BigDecimal keyActionRatio;
+    /**
+     * 广告观看次数成本
+     */
+    private BigDecimal eventAdWatchTimesCost;
+    /**
+     * 添加购物车数
+     */
+    private Long eventAddShoppingCart;
+    private Long keyAction;
+
+    /**
+     * 落地页多转化次数
+     */
+    private Long eventMultiConversion;
+    private Long eventWechatConnected;
+    /**
+     * 附加组件表单提交
+     */
+    private Long eventDspGiftForm;
+    private Long eventIntentionConfirmed;
+    private Long eventPhoneGetThrough;
+    /**
+     * 落地页多转化率
+     */
+    private BigDecimal eventMultiConversionRatio;
+    private BigDecimal eventMeasurementHouse;
+    private BigDecimal adPhotoPlayed2sRatio;
+    private BigDecimal eventOutboundCallRatio;
+    /**
+     * 广告观看次数
+     */
+    private Long eventAdWatchTimes;
+}

+ 510 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouCreativeReportDailyDw.java

@@ -0,0 +1,510 @@
+package cn.com.ctop.report.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+
+@Data
+@TableName("kuaishou_creative_report_daily_dw")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class KuaishouCreativeReportDailyDw {
+    private Long accountId;
+    private Long statDate;
+    /**
+     * 项目id
+     */
+    private Long projectId;
+    /**
+     * 产品id
+     */
+    private Long productId;
+    /**
+     * 广告主id
+     */
+    private String advertiserId;
+    /**
+     * 公司id
+     */
+    private String companyId;
+    /**
+     * 账户名称
+     */
+    private String accountName;
+    /**
+     * 项目名称
+     */
+    private String projectName;
+    /**
+     * 广告主名称
+     */
+    private String advertiserName;
+    /**
+     * 公司名称
+     */
+    private String companyName;
+    /**
+     * 销售id
+     */
+    private String saleId;
+    /**
+     * 运营id
+     */
+    private String userId;
+    /**
+     * 机构编码
+     */
+    private String orgCode;
+    private Long campaignId;
+    private String campaignName;
+    private Long unitId ;
+    private String unitName;
+    private Long creativeId ;
+    private String  creativeName;
+    /**
+     * 花费(元)
+     */
+    private BigDecimal charge;
+    /**
+     * 封面曝光数
+     */
+    private Long show;
+    /**
+     * 封面点击数
+     */
+    private Long photoClick;
+    /**
+     * 素材曝光数
+     */
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    private Long bclick;
+    /**
+     * 封面点击率
+     */
+    private BigDecimal photoClickRatio;
+    /**
+     * 3s播放率
+     */
+    private BigDecimal play3sRatio;
+    /**
+     * 行为率
+     */
+    private BigDecimal actionRatio;
+    /**
+     * 平均千次曝光花费(元)
+     */
+    private BigDecimal impression1kCost;
+    /**
+     * 平均点击单价(元)
+     */
+    private BigDecimal photoClickCost;
+    /**
+     * 平均行为单价(元)
+     */
+    private BigDecimal actionCost;
+    /**
+     * 分享数
+     */
+    private Long share;
+    /**
+     * 评论数
+     */
+    private Long comment;
+    /**
+     * 点赞数
+     */
+    private Long like;
+    /**
+     * 新增关注数
+     */
+    private Long follow;
+    /**
+     * 取消关注数
+     */
+    private Long cancelFollow;
+    /**
+     * 举报数
+     */
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    private Long block;
+    /**
+     * 减少此类作品数
+     */
+    private Long negative;
+    /**
+     * 提交按钮点击数(历史字段,同下方“表单提交数”,预计年底删除该字段)
+     */
+    private Long submit;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    private Long downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    private Long downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    private Long activation;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    private Long eventPayFirstDay;
+    /**
+     * 应用下载数据-首日付费金额
+     */
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * 应用下载数据-首日ROI
+     */
+    private BigDecimal eventPayFirstDayRoi;
+    /**
+     * 应用下载数据-付费次数
+     */
+    private Long eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-ROI
+     */
+    private BigDecimal eventPayRoi;
+    /**
+     * 应用下载数据-注册数
+     */
+    private Long eventRegister;
+    /**
+     * 应用下载数据-注册成本
+     */
+    private BigDecimal eventRegisterCost;
+    /**
+     * 应用下载数据-注册率
+     */
+    private BigDecimal eventRegisterRatio;
+    /**
+     * 应用下载数据-完件数
+     */
+    private Long eventJinJianApp;
+    /**
+     * 应用下载数据-完件成本
+     */
+    private BigDecimal eventJinJianAppCost;
+    /**
+     * 应用下载数据-授信数
+     */
+    private Long eventCreditGrantApp;
+    /**
+     * 应用下载数据-授信成本
+     */
+    private BigDecimal eventCreditGrantAppCost;
+    /**
+     * 应用下载数据-授信率
+     */
+    private BigDecimal eventCreditGrantAppRatio;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    private Long eventOrderPaid;
+    /**
+     * 应用下载数据-付款成功金额
+     */
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * 应用下载数据-单次付款成本
+     */
+    private BigDecimal eventOrderPaidCost;
+    /**
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    private Long eventNextDayStay;
+    /**
+     * 应用下载数据-次留成本(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayCost;
+    /**
+     * 应用下载数据-次留率(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayRatio;
+    /**
+     * 落地页数据-表单提交数
+     */
+    private Long formCount;
+    /**
+     * 落地页数据-表单提交单价
+     */
+    private BigDecimal formCost;
+    /**
+     * 落地页数据-表单提交点击率
+     */
+    private BigDecimal formActionRatio;
+    /**
+     * 落地页数据-落地页完件数
+     */
+    private Long eventJinJianLandingPage;
+    /**
+     * 落地页数据-落地页完件成本
+     */
+    private BigDecimal eventJinJianLandingPageCost;
+    /**
+     * 落地页数据-落地页授信数
+     */
+    private Long eventCreditGrantLandingPage;
+    /**
+     * 落地页数据-落地页授信成本
+     */
+    private BigDecimal eventCreditGrantLandingPageCost;
+    /**
+     * 落地页数据-落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingPageRatio;
+    /**
+     * 落地页数据-有效线索数
+     */
+    private Long eventValidClues;
+    /**
+     * 落地页数据-有效线索成本
+     */
+    private BigDecimal eventValidCluesCost;
+    /**
+     * 微信复制数
+     */
+    private Long eventAddWechat;
+    /**
+     * 微信复制成本
+     */
+    private BigDecimal eventAddWechatCost;
+    /**
+     * 微信复制率
+     */
+    private BigDecimal eventAddWechatRatio;
+    /**
+     * 智能电话-确认接通数
+     */
+    private Long eventGetThrough;
+    /**
+     * 智能电话-确认接通成本
+     */
+    private BigDecimal eventGetThroughCost;
+    /**
+     * 智能电话-确认接通率
+     */
+    private BigDecimal eventGetThroughRatio;
+    /**
+     * 唤醒应用数
+     */
+    private Long eventAppInvoked;
+    /**
+     * 唤醒应用成本
+     */
+    private BigDecimal eventAppInvokedCost;
+    /**
+     * 唤醒应用率
+     */
+    private BigDecimal eventAppInvokedRatio;
+    /**
+     * 落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingRatio;
+    /**
+     * 5s播放率
+     */
+    private BigDecimal play5sRatio;
+    /**
+     * 完播率
+     */
+    private BigDecimal playEndRatio;
+    /**
+     * 新增付费人数
+     */
+    private BigDecimal eventNewUserPay;
+    /**
+     * 新增付费人数成本
+     */
+    private BigDecimal eventNewUserPayCost;
+    /**
+     * 新增付费人数率
+     */
+    private BigDecimal eventNewUserPayRatio;
+    /**
+     * 平均千次素材曝光花费(元)
+     */
+    private BigDecimal click1kCost;
+    /**
+     * 商品成交数
+     */
+    private Long adProductCnt;
+    /**
+     * 商品访问数
+     */
+    private Long eventGoodsView;
+    /**
+     * 涨粉量
+     */
+    private Long merchantRecoFans;
+    /**
+     * 小店推广roi
+     */
+    private BigDecimal eventOrderAmountRoi;
+    /**
+     * 商品访问成本
+     */
+    private BigDecimal eventGoodsViewCost;
+    /**
+     * 涨粉成本
+     */
+    private BigDecimal merchantRecoFansCost;
+    /**
+     * 按钮点击数
+     */
+    private Long eventButtonClick;
+    /**
+     * 按钮点击成本
+     */
+    private BigDecimal eventButtonClickCost;
+    /**
+     * 按钮点击率
+     */
+    private BigDecimal eventButtonClickRatio;
+    /**
+     * 订单支付率
+     */
+    private BigDecimal eventOrderPaidRoi;
+    /**
+     * 新增完件人数
+     */
+    private Long eventNewUserJinjianApp;
+    /**
+     * 新增完件成本
+     */
+    private BigDecimal eventNewUserJinjianAppCost;
+    /**
+     * 新增完件人数率
+     */
+    private BigDecimal eventNewUserJinjianAppRoi;
+    /**
+     * 新增授信人数
+     */
+    private Long eventNewUserCreditGrantApp;
+    /**
+     * 新增授信人数成本
+     */
+    private BigDecimal eventNewUserCreditGrantAppCost;
+    /**
+     * 新增授信人数率
+     */
+    private BigDecimal eventNewUserCreditGrantAppRoi;
+
+    private Long eventNewUserJinjianPage;
+    private BigDecimal eventNewUserJinjianPageCost;
+    private BigDecimal eventNewUserJinjianPageRoi;
+    private Long eventNewUserCreditGrantPage;
+    private BigDecimal eventNewUserCreditGrantPageCost;
+    private BigDecimal eventNewUserCreditGrantPageRoi;
+    /**
+     * 预约表单数
+     */
+    private Long eventAppointForm;
+    /**
+     * 预约表单点击成本
+     */
+    private BigDecimal eventAppointFormCost;
+    /**
+     * 预约表单点击率
+     */
+    private BigDecimal eventAppointFormRatio;
+    /**
+     * 预约跳转点击数
+     */
+    private Long eventAppointJumpClick;
+    /**
+     * 预约跳转点击成本
+     */
+    private BigDecimal eventAppointJumpClickCost;
+    /**
+     * 预约跳转点击率
+     */
+    private BigDecimal eventAppointJumpClickRatio;
+    /**
+     * 联盟广告收入
+     */
+    private Long unionEventPayPurchaseAmount7d;
+    /**
+     * 联盟变现ROI
+     */
+    private BigDecimal unionEventPayPurchaseAmount7dRoi;
+
+    private String placementType;
+
+    private String adScene;
+
+    private Long eventOrderSuccessed;
+    private BigDecimal adPhotoPlayed10sRatio;
+    private BigDecimal keyActionCost;
+    /**
+     * 添加购物车成本
+     */
+    private BigDecimal eventAddShoppingCartCost;
+
+    /**
+     * 广告观看次数转化率
+     */
+    private BigDecimal eventAdWatchTimesRatio;
+    private BigDecimal eventOutboundCallCost;
+    private Long eventOutboundCall;
+    private BigDecimal actionNewRatio;
+
+    /**
+     * 广告观看
+     */
+    private Long eventWatchAppAd;
+    /**
+     * 落地页多转化成本
+     */
+    private BigDecimal eventMultiConversionCost;
+    private Long eventPhoneCardActivate;
+    private BigDecimal adPhotoPlayed75percentRatio;
+    private BigDecimal keyActionRatio;
+    /**
+     * 广告观看次数成本
+     */
+    private BigDecimal eventAdWatchTimesCost;
+    /**
+     * 添加购物车数
+     */
+    private Long eventAddShoppingCart;
+    private Long keyAction;
+
+    /**
+     * 落地页多转化次数
+     */
+    private Long eventMultiConversion;
+    private Long eventWechatConnected;
+    /**
+     * 附加组件表单提交
+     */
+    private Long eventDspGiftForm;
+    private Long eventIntentionConfirmed;
+    private Long eventPhoneGetThrough;
+    /**
+     * 落地页多转化率
+     */
+    private BigDecimal eventMultiConversionRatio;
+    private BigDecimal eventMeasurementHouse;
+    private BigDecimal adPhotoPlayed2sRatio;
+    private BigDecimal eventOutboundCallRatio;
+    /**
+     * 广告观看次数
+     */
+    private Long eventAdWatchTimes;
+}

+ 511 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouCreativeReportHourlyDw.java

@@ -0,0 +1,511 @@
+package cn.com.ctop.report.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+
+@Data
+@TableName("kuaishou_creative_report_hourly_dw")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class KuaishouCreativeReportHourlyDw {
+    private Long accountId;
+    private Long statDate;
+    private int hour;
+    /**
+     * 项目id
+     */
+    private Long projectId;
+    /**
+     * 产品id
+     */
+    private Long productId;
+    /**
+     * 广告主id
+     */
+    private String advertiserId;
+    /**
+     * 公司id
+     */
+    private String companyId;
+    /**
+     * 账户名称
+     */
+    private String accountName;
+    /**
+     * 项目名称
+     */
+    private String projectName;
+    /**
+     * 广告主名称
+     */
+    private String advertiserName;
+    /**
+     * 公司名称
+     */
+    private String companyName;
+    /**
+     * 销售id
+     */
+    private String saleId;
+    /**
+     * 运营id
+     */
+    private String userId;
+    /**
+     * 机构编码
+     */
+    private String orgCode;
+    private Long campaignId;
+    private String campaignName;
+    private Long unitId ;
+    private String unitName;
+    private Long creativeId ;
+    private String  creativeName;
+    /**
+     * 花费(元)
+     */
+    private BigDecimal charge;
+    /**
+     * 封面曝光数
+     */
+    private Long show;
+    /**
+     * 封面点击数
+     */
+    private Long photoClick;
+    /**
+     * 素材曝光数
+     */
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    private Long bclick;
+    /**
+     * 封面点击率
+     */
+    private BigDecimal photoClickRatio;
+    /**
+     * 3s播放率
+     */
+    private BigDecimal play3sRatio;
+    /**
+     * 行为率
+     */
+    private BigDecimal actionRatio;
+    /**
+     * 平均千次曝光花费(元)
+     */
+    private BigDecimal impression1kCost;
+    /**
+     * 平均点击单价(元)
+     */
+    private BigDecimal photoClickCost;
+    /**
+     * 平均行为单价(元)
+     */
+    private BigDecimal actionCost;
+    /**
+     * 分享数
+     */
+    private Long share;
+    /**
+     * 评论数
+     */
+    private Long comment;
+    /**
+     * 点赞数
+     */
+    private Long like;
+    /**
+     * 新增关注数
+     */
+    private Long follow;
+    /**
+     * 取消关注数
+     */
+    private Long cancelFollow;
+    /**
+     * 举报数
+     */
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    private Long block;
+    /**
+     * 减少此类作品数
+     */
+    private Long negative;
+    /**
+     * 提交按钮点击数(历史字段,同下方“表单提交数”,预计年底删除该字段)
+     */
+    private Long submit;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    private Long downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    private Long downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    private Long activation;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    private Long eventPayFirstDay;
+    /**
+     * 应用下载数据-首日付费金额
+     */
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * 应用下载数据-首日ROI
+     */
+    private BigDecimal eventPayFirstDayRoi;
+    /**
+     * 应用下载数据-付费次数
+     */
+    private Long eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-ROI
+     */
+    private BigDecimal eventPayRoi;
+    /**
+     * 应用下载数据-注册数
+     */
+    private Long eventRegister;
+    /**
+     * 应用下载数据-注册成本
+     */
+    private BigDecimal eventRegisterCost;
+    /**
+     * 应用下载数据-注册率
+     */
+    private BigDecimal eventRegisterRatio;
+    /**
+     * 应用下载数据-完件数
+     */
+    private Long eventJinJianApp;
+    /**
+     * 应用下载数据-完件成本
+     */
+    private BigDecimal eventJinJianAppCost;
+    /**
+     * 应用下载数据-授信数
+     */
+    private Long eventCreditGrantApp;
+    /**
+     * 应用下载数据-授信成本
+     */
+    private BigDecimal eventCreditGrantAppCost;
+    /**
+     * 应用下载数据-授信率
+     */
+    private BigDecimal eventCreditGrantAppRatio;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    private Long eventOrderPaid;
+    /**
+     * 应用下载数据-付款成功金额
+     */
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * 应用下载数据-单次付款成本
+     */
+    private BigDecimal eventOrderPaidCost;
+    /**
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    private Long eventNextDayStay;
+    /**
+     * 应用下载数据-次留成本(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayCost;
+    /**
+     * 应用下载数据-次留率(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayRatio;
+    /**
+     * 落地页数据-表单提交数
+     */
+    private Long formCount;
+    /**
+     * 落地页数据-表单提交单价
+     */
+    private BigDecimal formCost;
+    /**
+     * 落地页数据-表单提交点击率
+     */
+    private BigDecimal formActionRatio;
+    /**
+     * 落地页数据-落地页完件数
+     */
+    private Long eventJinJianLandingPage;
+    /**
+     * 落地页数据-落地页完件成本
+     */
+    private BigDecimal eventJinJianLandingPageCost;
+    /**
+     * 落地页数据-落地页授信数
+     */
+    private Long eventCreditGrantLandingPage;
+    /**
+     * 落地页数据-落地页授信成本
+     */
+    private BigDecimal eventCreditGrantLandingPageCost;
+    /**
+     * 落地页数据-落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingPageRatio;
+    /**
+     * 落地页数据-有效线索数
+     */
+    private Long eventValidClues;
+    /**
+     * 落地页数据-有效线索成本
+     */
+    private BigDecimal eventValidCluesCost;
+    /**
+     * 微信复制数
+     */
+    private Long eventAddWechat;
+    /**
+     * 微信复制成本
+     */
+    private BigDecimal eventAddWechatCost;
+    /**
+     * 微信复制率
+     */
+    private BigDecimal eventAddWechatRatio;
+    /**
+     * 智能电话-确认接通数
+     */
+    private Long eventGetThrough;
+    /**
+     * 智能电话-确认接通成本
+     */
+    private BigDecimal eventGetThroughCost;
+    /**
+     * 智能电话-确认接通率
+     */
+    private BigDecimal eventGetThroughRatio;
+    /**
+     * 唤醒应用数
+     */
+    private Long eventAppInvoked;
+    /**
+     * 唤醒应用成本
+     */
+    private BigDecimal eventAppInvokedCost;
+    /**
+     * 唤醒应用率
+     */
+    private BigDecimal eventAppInvokedRatio;
+    /**
+     * 落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingRatio;
+    /**
+     * 5s播放率
+     */
+    private BigDecimal play5sRatio;
+    /**
+     * 完播率
+     */
+    private BigDecimal playEndRatio;
+    /**
+     * 新增付费人数
+     */
+    private BigDecimal eventNewUserPay;
+    /**
+     * 新增付费人数成本
+     */
+    private BigDecimal eventNewUserPayCost;
+    /**
+     * 新增付费人数率
+     */
+    private BigDecimal eventNewUserPayRatio;
+    /**
+     * 平均千次素材曝光花费(元)
+     */
+    private BigDecimal click1kCost;
+    /**
+     * 商品成交数
+     */
+    private Long adProductCnt;
+    /**
+     * 商品访问数
+     */
+    private Long eventGoodsView;
+    /**
+     * 涨粉量
+     */
+    private Long merchantRecoFans;
+    /**
+     * 小店推广roi
+     */
+    private BigDecimal eventOrderAmountRoi;
+    /**
+     * 商品访问成本
+     */
+    private BigDecimal eventGoodsViewCost;
+    /**
+     * 涨粉成本
+     */
+    private BigDecimal merchantRecoFansCost;
+    /**
+     * 按钮点击数
+     */
+    private Long eventButtonClick;
+    /**
+     * 按钮点击成本
+     */
+    private BigDecimal eventButtonClickCost;
+    /**
+     * 按钮点击率
+     */
+    private BigDecimal eventButtonClickRatio;
+    /**
+     * 订单支付率
+     */
+    private BigDecimal eventOrderPaidRoi;
+    /**
+     * 新增完件人数
+     */
+    private Long eventNewUserJinjianApp;
+    /**
+     * 新增完件成本
+     */
+    private BigDecimal eventNewUserJinjianAppCost;
+    /**
+     * 新增完件人数率
+     */
+    private BigDecimal eventNewUserJinjianAppRoi;
+    /**
+     * 新增授信人数
+     */
+    private Long eventNewUserCreditGrantApp;
+    /**
+     * 新增授信人数成本
+     */
+    private BigDecimal eventNewUserCreditGrantAppCost;
+    /**
+     * 新增授信人数率
+     */
+    private BigDecimal eventNewUserCreditGrantAppRoi;
+
+    private Long eventNewUserJinjianPage;
+    private BigDecimal eventNewUserJinjianPageCost;
+    private BigDecimal eventNewUserJinjianPageRoi;
+    private Long eventNewUserCreditGrantPage;
+    private BigDecimal eventNewUserCreditGrantPageCost;
+    private BigDecimal eventNewUserCreditGrantPageRoi;
+    /**
+     * 预约表单数
+     */
+    private Long eventAppointForm;
+    /**
+     * 预约表单点击成本
+     */
+    private BigDecimal eventAppointFormCost;
+    /**
+     * 预约表单点击率
+     */
+    private BigDecimal eventAppointFormRatio;
+    /**
+     * 预约跳转点击数
+     */
+    private Long eventAppointJumpClick;
+    /**
+     * 预约跳转点击成本
+     */
+    private BigDecimal eventAppointJumpClickCost;
+    /**
+     * 预约跳转点击率
+     */
+    private BigDecimal eventAppointJumpClickRatio;
+    /**
+     * 联盟广告收入
+     */
+    private Long unionEventPayPurchaseAmount7d;
+    /**
+     * 联盟变现ROI
+     */
+    private BigDecimal unionEventPayPurchaseAmount7dRoi;
+
+    private String placementType;
+
+    private String adScene;
+
+    private Long eventOrderSuccessed;
+    private BigDecimal adPhotoPlayed10sRatio;
+    private BigDecimal keyActionCost;
+    /**
+     * 添加购物车成本
+     */
+    private BigDecimal eventAddShoppingCartCost;
+
+    /**
+     * 广告观看次数转化率
+     */
+    private BigDecimal eventAdWatchTimesRatio;
+    private BigDecimal eventOutboundCallCost;
+    private Long eventOutboundCall;
+    private BigDecimal actionNewRatio;
+
+    /**
+     * 广告观看
+     */
+    private Long eventWatchAppAd;
+    /**
+     * 落地页多转化成本
+     */
+    private BigDecimal eventMultiConversionCost;
+    private Long eventPhoneCardActivate;
+    private BigDecimal adPhotoPlayed75percentRatio;
+    private BigDecimal keyActionRatio;
+    /**
+     * 广告观看次数成本
+     */
+    private BigDecimal eventAdWatchTimesCost;
+    /**
+     * 添加购物车数
+     */
+    private Long eventAddShoppingCart;
+    private Long keyAction;
+
+    /**
+     * 落地页多转化次数
+     */
+    private Long eventMultiConversion;
+    private Long eventWechatConnected;
+    /**
+     * 附加组件表单提交
+     */
+    private Long eventDspGiftForm;
+    private Long eventIntentionConfirmed;
+    private Long eventPhoneGetThrough;
+    /**
+     * 落地页多转化率
+     */
+    private BigDecimal eventMultiConversionRatio;
+    private BigDecimal eventMeasurementHouse;
+    private BigDecimal adPhotoPlayed2sRatio;
+    private BigDecimal eventOutboundCallRatio;
+    /**
+     * 广告观看次数
+     */
+    private Long eventAdWatchTimes;
+}

+ 511 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouMaterialVideoReportDailyDw.java

@@ -0,0 +1,511 @@
+package cn.com.ctop.report.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+
+@Data
+@TableName("kuaishou_material_video_report_daily_dw")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class KuaishouMaterialVideoReportDailyDw {
+    private Long accountId;
+    private Long statDate;
+    private int hour;
+    /**
+     * 项目id
+     */
+    private Long projectId;
+    /**
+     * 产品id
+     */
+    private Long productId;
+    /**
+     * 广告主id
+     */
+    private String advertiserId;
+    /**
+     * 公司id
+     */
+    private String companyId;
+    /**
+     * 账户名称
+     */
+    private String accountName;
+    /**
+     * 项目名称
+     */
+    private String projectName;
+    /**
+     * 广告主名称
+     */
+    private String advertiserName;
+    /**
+     * 公司名称
+     */
+    private String companyName;
+    /**
+     * 销售id
+     */
+    private String saleId;
+    /**
+     * 运营id
+     */
+    private String userId;
+    /**
+     * 机构编码
+     */
+    private String orgCode;
+    private Long campaignId;
+    private String campaignName;
+    private Long unitId ;
+    private String unitName;
+    private Long creativeId ;
+    private String  creativeName;
+    /**
+     * 花费(元)
+     */
+    private BigDecimal charge;
+    /**
+     * 封面曝光数
+     */
+    private Long show;
+    /**
+     * 封面点击数
+     */
+    private Long photoClick;
+    /**
+     * 素材曝光数
+     */
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    private Long bclick;
+    /**
+     * 封面点击率
+     */
+    private BigDecimal photoClickRatio;
+    /**
+     * 3s播放率
+     */
+    private BigDecimal play3sRatio;
+    /**
+     * 行为率
+     */
+    private BigDecimal actionRatio;
+    /**
+     * 平均千次曝光花费(元)
+     */
+    private BigDecimal impression1kCost;
+    /**
+     * 平均点击单价(元)
+     */
+    private BigDecimal photoClickCost;
+    /**
+     * 平均行为单价(元)
+     */
+    private BigDecimal actionCost;
+    /**
+     * 分享数
+     */
+    private Long share;
+    /**
+     * 评论数
+     */
+    private Long comment;
+    /**
+     * 点赞数
+     */
+    private Long like;
+    /**
+     * 新增关注数
+     */
+    private Long follow;
+    /**
+     * 取消关注数
+     */
+    private Long cancelFollow;
+    /**
+     * 举报数
+     */
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    private Long block;
+    /**
+     * 减少此类作品数
+     */
+    private Long negative;
+    /**
+     * 提交按钮点击数(历史字段,同下方“表单提交数”,预计年底删除该字段)
+     */
+    private Long submit;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    private Long downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    private Long downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    private Long activation;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    private Long eventPayFirstDay;
+    /**
+     * 应用下载数据-首日付费金额
+     */
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * 应用下载数据-首日ROI
+     */
+    private BigDecimal eventPayFirstDayRoi;
+    /**
+     * 应用下载数据-付费次数
+     */
+    private Long eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-ROI
+     */
+    private BigDecimal eventPayRoi;
+    /**
+     * 应用下载数据-注册数
+     */
+    private Long eventRegister;
+    /**
+     * 应用下载数据-注册成本
+     */
+    private BigDecimal eventRegisterCost;
+    /**
+     * 应用下载数据-注册率
+     */
+    private BigDecimal eventRegisterRatio;
+    /**
+     * 应用下载数据-完件数
+     */
+    private Long eventJinJianApp;
+    /**
+     * 应用下载数据-完件成本
+     */
+    private BigDecimal eventJinJianAppCost;
+    /**
+     * 应用下载数据-授信数
+     */
+    private Long eventCreditGrantApp;
+    /**
+     * 应用下载数据-授信成本
+     */
+    private BigDecimal eventCreditGrantAppCost;
+    /**
+     * 应用下载数据-授信率
+     */
+    private BigDecimal eventCreditGrantAppRatio;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    private Long eventOrderPaid;
+    /**
+     * 应用下载数据-付款成功金额
+     */
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * 应用下载数据-单次付款成本
+     */
+    private BigDecimal eventOrderPaidCost;
+    /**
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    private Long eventNextDayStay;
+    /**
+     * 应用下载数据-次留成本(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayCost;
+    /**
+     * 应用下载数据-次留率(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayRatio;
+    /**
+     * 落地页数据-表单提交数
+     */
+    private Long formCount;
+    /**
+     * 落地页数据-表单提交单价
+     */
+    private BigDecimal formCost;
+    /**
+     * 落地页数据-表单提交点击率
+     */
+    private BigDecimal formActionRatio;
+    /**
+     * 落地页数据-落地页完件数
+     */
+    private Long eventJinJianLandingPage;
+    /**
+     * 落地页数据-落地页完件成本
+     */
+    private BigDecimal eventJinJianLandingPageCost;
+    /**
+     * 落地页数据-落地页授信数
+     */
+    private Long eventCreditGrantLandingPage;
+    /**
+     * 落地页数据-落地页授信成本
+     */
+    private BigDecimal eventCreditGrantLandingPageCost;
+    /**
+     * 落地页数据-落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingPageRatio;
+    /**
+     * 落地页数据-有效线索数
+     */
+    private Long eventValidClues;
+    /**
+     * 落地页数据-有效线索成本
+     */
+    private BigDecimal eventValidCluesCost;
+    /**
+     * 微信复制数
+     */
+    private Long eventAddWechat;
+    /**
+     * 微信复制成本
+     */
+    private BigDecimal eventAddWechatCost;
+    /**
+     * 微信复制率
+     */
+    private BigDecimal eventAddWechatRatio;
+    /**
+     * 智能电话-确认接通数
+     */
+    private Long eventGetThrough;
+    /**
+     * 智能电话-确认接通成本
+     */
+    private BigDecimal eventGetThroughCost;
+    /**
+     * 智能电话-确认接通率
+     */
+    private BigDecimal eventGetThroughRatio;
+    /**
+     * 唤醒应用数
+     */
+    private Long eventAppInvoked;
+    /**
+     * 唤醒应用成本
+     */
+    private BigDecimal eventAppInvokedCost;
+    /**
+     * 唤醒应用率
+     */
+    private BigDecimal eventAppInvokedRatio;
+    /**
+     * 落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingRatio;
+    /**
+     * 5s播放率
+     */
+    private BigDecimal play5sRatio;
+    /**
+     * 完播率
+     */
+    private BigDecimal playEndRatio;
+    /**
+     * 新增付费人数
+     */
+    private BigDecimal eventNewUserPay;
+    /**
+     * 新增付费人数成本
+     */
+    private BigDecimal eventNewUserPayCost;
+    /**
+     * 新增付费人数率
+     */
+    private BigDecimal eventNewUserPayRatio;
+    /**
+     * 平均千次素材曝光花费(元)
+     */
+    private BigDecimal click1kCost;
+    /**
+     * 商品成交数
+     */
+    private Long adProductCnt;
+    /**
+     * 商品访问数
+     */
+    private Long eventGoodsView;
+    /**
+     * 涨粉量
+     */
+    private Long merchantRecoFans;
+    /**
+     * 小店推广roi
+     */
+    private BigDecimal eventOrderAmountRoi;
+    /**
+     * 商品访问成本
+     */
+    private BigDecimal eventGoodsViewCost;
+    /**
+     * 涨粉成本
+     */
+    private BigDecimal merchantRecoFansCost;
+    /**
+     * 按钮点击数
+     */
+    private Long eventButtonClick;
+    /**
+     * 按钮点击成本
+     */
+    private BigDecimal eventButtonClickCost;
+    /**
+     * 按钮点击率
+     */
+    private BigDecimal eventButtonClickRatio;
+    /**
+     * 订单支付率
+     */
+    private BigDecimal eventOrderPaidRoi;
+    /**
+     * 新增完件人数
+     */
+    private Long eventNewUserJinjianApp;
+    /**
+     * 新增完件成本
+     */
+    private BigDecimal eventNewUserJinjianAppCost;
+    /**
+     * 新增完件人数率
+     */
+    private BigDecimal eventNewUserJinjianAppRoi;
+    /**
+     * 新增授信人数
+     */
+    private Long eventNewUserCreditGrantApp;
+    /**
+     * 新增授信人数成本
+     */
+    private BigDecimal eventNewUserCreditGrantAppCost;
+    /**
+     * 新增授信人数率
+     */
+    private BigDecimal eventNewUserCreditGrantAppRoi;
+
+    private Long eventNewUserJinjianPage;
+    private BigDecimal eventNewUserJinjianPageCost;
+    private BigDecimal eventNewUserJinjianPageRoi;
+    private Long eventNewUserCreditGrantPage;
+    private BigDecimal eventNewUserCreditGrantPageCost;
+    private BigDecimal eventNewUserCreditGrantPageRoi;
+    /**
+     * 预约表单数
+     */
+    private Long eventAppointForm;
+    /**
+     * 预约表单点击成本
+     */
+    private BigDecimal eventAppointFormCost;
+    /**
+     * 预约表单点击率
+     */
+    private BigDecimal eventAppointFormRatio;
+    /**
+     * 预约跳转点击数
+     */
+    private Long eventAppointJumpClick;
+    /**
+     * 预约跳转点击成本
+     */
+    private BigDecimal eventAppointJumpClickCost;
+    /**
+     * 预约跳转点击率
+     */
+    private BigDecimal eventAppointJumpClickRatio;
+    /**
+     * 联盟广告收入
+     */
+    private Long unionEventPayPurchaseAmount7d;
+    /**
+     * 联盟变现ROI
+     */
+    private BigDecimal unionEventPayPurchaseAmount7dRoi;
+
+    private String placementType;
+
+    private String adScene;
+
+    private Long eventOrderSuccessed;
+    private BigDecimal adPhotoPlayed10sRatio;
+    private BigDecimal keyActionCost;
+    /**
+     * 添加购物车成本
+     */
+    private BigDecimal eventAddShoppingCartCost;
+
+    /**
+     * 广告观看次数转化率
+     */
+    private BigDecimal eventAdWatchTimesRatio;
+    private BigDecimal eventOutboundCallCost;
+    private Long eventOutboundCall;
+    private BigDecimal actionNewRatio;
+
+    /**
+     * 广告观看
+     */
+    private Long eventWatchAppAd;
+    /**
+     * 落地页多转化成本
+     */
+    private BigDecimal eventMultiConversionCost;
+    private Long eventPhoneCardActivate;
+    private BigDecimal adPhotoPlayed75percentRatio;
+    private BigDecimal keyActionRatio;
+    /**
+     * 广告观看次数成本
+     */
+    private BigDecimal eventAdWatchTimesCost;
+    /**
+     * 添加购物车数
+     */
+    private Long eventAddShoppingCart;
+    private Long keyAction;
+
+    /**
+     * 落地页多转化次数
+     */
+    private Long eventMultiConversion;
+    private Long eventWechatConnected;
+    /**
+     * 附加组件表单提交
+     */
+    private Long eventDspGiftForm;
+    private Long eventIntentionConfirmed;
+    private Long eventPhoneGetThrough;
+    /**
+     * 落地页多转化率
+     */
+    private BigDecimal eventMultiConversionRatio;
+    private BigDecimal eventMeasurementHouse;
+    private BigDecimal adPhotoPlayed2sRatio;
+    private BigDecimal eventOutboundCallRatio;
+    /**
+     * 广告观看次数
+     */
+    private Long eventAdWatchTimes;
+}

+ 526 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouMaterialVideoReportHourlyDw.java

@@ -0,0 +1,526 @@
+package cn.com.ctop.report.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+
+@Data
+@TableName("kuaishou_material_video_report_hourly_dw")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class KuaishouMaterialVideoReportHourlyDw {
+    private Long accountId;
+    private Long statDate;
+    private int hour;
+    /**
+     * 项目id
+     */
+    private Long projectId;
+    /**
+     * 产品id
+     */
+    private Long productId;
+    /**
+     * 广告主id
+     */
+    private String advertiserId;
+    /**
+     * 公司id
+     */
+    private String companyId;
+    /**
+     * 账户名称
+     */
+    private String accountName;
+    /**
+     * 项目名称
+     */
+    private String projectName;
+    /**
+     * 广告主名称
+     */
+    private String advertiserName;
+    /**
+     * 公司名称
+     */
+    private String companyName;
+    /**
+     * 销售id
+     */
+    private String saleId;
+    /**
+     * 运营id
+     */
+    private String userId;
+    /**
+     * 剪辑id
+     */
+    private String clipId;
+    /**
+     * 拍摄id
+     */
+    private String shotId;
+    /**
+     * 编导id
+     */
+    private String planId;
+    /**
+     * 负责人id
+     */
+    private String leaderId;
+    /**
+     * 机构编码
+     */
+    private String orgCode;
+    private String photoUrl;
+    private String photoId;
+    private String coverUrl;
+    private String imageToken;
+    private String photoCaption;
+    /**
+     * 花费(元)
+     */
+    private BigDecimal charge;
+    /**
+     * 封面曝光数
+     */
+    private Long show;
+    /**
+     * 封面点击数
+     */
+    private Long photoClick;
+    /**
+     * 素材曝光数
+     */
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    private Long bclick;
+    /**
+     * 封面点击率
+     */
+    private BigDecimal photoClickRatio;
+    /**
+     * 3s播放率
+     */
+    private BigDecimal play3sRatio;
+    /**
+     * 行为率
+     */
+    private BigDecimal actionRatio;
+    /**
+     * 平均千次曝光花费(元)
+     */
+    private BigDecimal impression1kCost;
+    /**
+     * 平均点击单价(元)
+     */
+    private BigDecimal photoClickCost;
+    /**
+     * 平均行为单价(元)
+     */
+    private BigDecimal actionCost;
+    /**
+     * 分享数
+     */
+    private Long share;
+    /**
+     * 评论数
+     */
+    private Long comment;
+    /**
+     * 点赞数
+     */
+    private Long like;
+    /**
+     * 新增关注数
+     */
+    private Long follow;
+    /**
+     * 取消关注数
+     */
+    private Long cancelFollow;
+    /**
+     * 举报数
+     */
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    private Long block;
+    /**
+     * 减少此类作品数
+     */
+    private Long negative;
+    /**
+     * 提交按钮点击数(历史字段,同下方“表单提交数”,预计年底删除该字段)
+     */
+    private Long submit;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    private Long downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    private Long downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    private Long activation;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    private Long eventPayFirstDay;
+    /**
+     * 应用下载数据-首日付费金额
+     */
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * 应用下载数据-首日ROI
+     */
+    private BigDecimal eventPayFirstDayRoi;
+    /**
+     * 应用下载数据-付费次数
+     */
+    private Long eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-ROI
+     */
+    private BigDecimal eventPayRoi;
+    /**
+     * 应用下载数据-注册数
+     */
+    private Long eventRegister;
+    /**
+     * 应用下载数据-注册成本
+     */
+    private BigDecimal eventRegisterCost;
+    /**
+     * 应用下载数据-注册率
+     */
+    private BigDecimal eventRegisterRatio;
+    /**
+     * 应用下载数据-完件数
+     */
+    private Long eventJinJianApp;
+    /**
+     * 应用下载数据-完件成本
+     */
+    private BigDecimal eventJinJianAppCost;
+    /**
+     * 应用下载数据-授信数
+     */
+    private Long eventCreditGrantApp;
+    /**
+     * 应用下载数据-授信成本
+     */
+    private BigDecimal eventCreditGrantAppCost;
+    /**
+     * 应用下载数据-授信率
+     */
+    private BigDecimal eventCreditGrantAppRatio;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    private Long eventOrderPaid;
+    /**
+     * 应用下载数据-付款成功金额
+     */
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * 应用下载数据-单次付款成本
+     */
+    private BigDecimal eventOrderPaidCost;
+    /**
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    private Long eventNextDayStay;
+    /**
+     * 应用下载数据-次留成本(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayCost;
+    /**
+     * 应用下载数据-次留率(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayRatio;
+    /**
+     * 落地页数据-表单提交数
+     */
+    private Long formCount;
+    /**
+     * 落地页数据-表单提交单价
+     */
+    private BigDecimal formCost;
+    /**
+     * 落地页数据-表单提交点击率
+     */
+    private BigDecimal formActionRatio;
+    /**
+     * 落地页数据-落地页完件数
+     */
+    private Long eventJinJianLandingPage;
+    /**
+     * 落地页数据-落地页完件成本
+     */
+    private BigDecimal eventJinJianLandingPageCost;
+    /**
+     * 落地页数据-落地页授信数
+     */
+    private Long eventCreditGrantLandingPage;
+    /**
+     * 落地页数据-落地页授信成本
+     */
+    private BigDecimal eventCreditGrantLandingPageCost;
+    /**
+     * 落地页数据-落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingPageRatio;
+    /**
+     * 落地页数据-有效线索数
+     */
+    private Long eventValidClues;
+    /**
+     * 落地页数据-有效线索成本
+     */
+    private BigDecimal eventValidCluesCost;
+    /**
+     * 微信复制数
+     */
+    private Long eventAddWechat;
+    /**
+     * 微信复制成本
+     */
+    private BigDecimal eventAddWechatCost;
+    /**
+     * 微信复制率
+     */
+    private BigDecimal eventAddWechatRatio;
+    /**
+     * 智能电话-确认接通数
+     */
+    private Long eventGetThrough;
+    /**
+     * 智能电话-确认接通成本
+     */
+    private BigDecimal eventGetThroughCost;
+    /**
+     * 智能电话-确认接通率
+     */
+    private BigDecimal eventGetThroughRatio;
+    /**
+     * 唤醒应用数
+     */
+    private Long eventAppInvoked;
+    /**
+     * 唤醒应用成本
+     */
+    private BigDecimal eventAppInvokedCost;
+    /**
+     * 唤醒应用率
+     */
+    private BigDecimal eventAppInvokedRatio;
+    /**
+     * 落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingRatio;
+    /**
+     * 5s播放率
+     */
+    private BigDecimal play5sRatio;
+    /**
+     * 完播率
+     */
+    private BigDecimal playEndRatio;
+    /**
+     * 新增付费人数
+     */
+    private BigDecimal eventNewUserPay;
+    /**
+     * 新增付费人数成本
+     */
+    private BigDecimal eventNewUserPayCost;
+    /**
+     * 新增付费人数率
+     */
+    private BigDecimal eventNewUserPayRatio;
+    /**
+     * 平均千次素材曝光花费(元)
+     */
+    private BigDecimal click1kCost;
+    /**
+     * 商品成交数
+     */
+    private Long adProductCnt;
+    /**
+     * 商品访问数
+     */
+    private Long eventGoodsView;
+    /**
+     * 涨粉量
+     */
+    private Long merchantRecoFans;
+    /**
+     * 小店推广roi
+     */
+    private BigDecimal eventOrderAmountRoi;
+    /**
+     * 商品访问成本
+     */
+    private BigDecimal eventGoodsViewCost;
+    /**
+     * 涨粉成本
+     */
+    private BigDecimal merchantRecoFansCost;
+    /**
+     * 按钮点击数
+     */
+    private Long eventButtonClick;
+    /**
+     * 按钮点击成本
+     */
+    private BigDecimal eventButtonClickCost;
+    /**
+     * 按钮点击率
+     */
+    private BigDecimal eventButtonClickRatio;
+    /**
+     * 订单支付率
+     */
+    private BigDecimal eventOrderPaidRoi;
+    /**
+     * 新增完件人数
+     */
+    private Long eventNewUserJinjianApp;
+    /**
+     * 新增完件成本
+     */
+    private BigDecimal eventNewUserJinjianAppCost;
+    /**
+     * 新增完件人数率
+     */
+    private BigDecimal eventNewUserJinjianAppRoi;
+    /**
+     * 新增授信人数
+     */
+    private Long eventNewUserCreditGrantApp;
+    /**
+     * 新增授信人数成本
+     */
+    private BigDecimal eventNewUserCreditGrantAppCost;
+    /**
+     * 新增授信人数率
+     */
+    private BigDecimal eventNewUserCreditGrantAppRoi;
+
+    private Long eventNewUserJinjianPage;
+    private BigDecimal eventNewUserJinjianPageCost;
+    private BigDecimal eventNewUserJinjianPageRoi;
+    private Long eventNewUserCreditGrantPage;
+    private BigDecimal eventNewUserCreditGrantPageCost;
+    private BigDecimal eventNewUserCreditGrantPageRoi;
+    /**
+     * 预约表单数
+     */
+    private Long eventAppointForm;
+    /**
+     * 预约表单点击成本
+     */
+    private BigDecimal eventAppointFormCost;
+    /**
+     * 预约表单点击率
+     */
+    private BigDecimal eventAppointFormRatio;
+    /**
+     * 预约跳转点击数
+     */
+    private Long eventAppointJumpClick;
+    /**
+     * 预约跳转点击成本
+     */
+    private BigDecimal eventAppointJumpClickCost;
+    /**
+     * 预约跳转点击率
+     */
+    private BigDecimal eventAppointJumpClickRatio;
+    /**
+     * 联盟广告收入
+     */
+    private Long unionEventPayPurchaseAmount7d;
+    /**
+     * 联盟变现ROI
+     */
+    private BigDecimal unionEventPayPurchaseAmount7dRoi;
+
+    private String placementType;
+
+    private String adScene;
+
+    private Long eventOrderSuccessed;
+    private BigDecimal adPhotoPlayed10sRatio;
+    private BigDecimal keyActionCost;
+    /**
+     * 添加购物车成本
+     */
+    private BigDecimal eventAddShoppingCartCost;
+
+    /**
+     * 广告观看次数转化率
+     */
+    private BigDecimal eventAdWatchTimesRatio;
+    private BigDecimal eventOutboundCallCost;
+    private Long eventOutboundCall;
+    private BigDecimal actionNewRatio;
+
+    /**
+     * 广告观看
+     */
+    private Long eventWatchAppAd;
+    /**
+     * 落地页多转化成本
+     */
+    private BigDecimal eventMultiConversionCost;
+    private Long eventPhoneCardActivate;
+    private BigDecimal adPhotoPlayed75percentRatio;
+    private BigDecimal keyActionRatio;
+    /**
+     * 广告观看次数成本
+     */
+    private BigDecimal eventAdWatchTimesCost;
+    /**
+     * 添加购物车数
+     */
+    private Long eventAddShoppingCart;
+    private Long keyAction;
+
+    /**
+     * 落地页多转化次数
+     */
+    private Long eventMultiConversion;
+    private Long eventWechatConnected;
+    /**
+     * 附加组件表单提交
+     */
+    private Long eventDspGiftForm;
+    private Long eventIntentionConfirmed;
+    private Long eventPhoneGetThrough;
+    /**
+     * 落地页多转化率
+     */
+    private BigDecimal eventMultiConversionRatio;
+    private BigDecimal eventMeasurementHouse;
+    private BigDecimal adPhotoPlayed2sRatio;
+    private BigDecimal eventOutboundCallRatio;
+    /**
+     * 广告观看次数
+     */
+    private Long eventAdWatchTimes;
+}

+ 508 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouUnitReportDailyDw.java

@@ -0,0 +1,508 @@
+package cn.com.ctop.report.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+
+@Data
+@TableName("kuaishou_unit_report_daily_dw")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class KuaishouUnitReportDailyDw {
+    private Long accountId;
+    private Long statDate;
+    /**
+     * 项目id
+     */
+    private Long projectId;
+    /**
+     * 产品id
+     */
+    private Long productId;
+    /**
+     * 广告主id
+     */
+    private String advertiserId;
+    /**
+     * 公司id
+     */
+    private String companyId;
+    /**
+     * 账户名称
+     */
+    private String accountName;
+    /**
+     * 项目名称
+     */
+    private String projectName;
+    /**
+     * 广告主名称
+     */
+    private String advertiserName;
+    /**
+     * 公司名称
+     */
+    private String companyName;
+    /**
+     * 销售id
+     */
+    private String saleId;
+    /**
+     * 运营id
+     */
+    private String userId;
+    /**
+     * 机构编码
+     */
+    private String orgCode;
+    private Long campaignId;
+    private String campaignName;
+    private Long unitId ;
+    private String unitName;
+    /**
+     * 花费(元)
+     */
+    private BigDecimal charge;
+    /**
+     * 封面曝光数
+     */
+    private Long show;
+    /**
+     * 封面点击数
+     */
+    private Long photoClick;
+    /**
+     * 素材曝光数
+     */
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    private Long bclick;
+    /**
+     * 封面点击率
+     */
+    private BigDecimal photoClickRatio;
+    /**
+     * 3s播放率
+     */
+    private BigDecimal play3sRatio;
+    /**
+     * 行为率
+     */
+    private BigDecimal actionRatio;
+    /**
+     * 平均千次曝光花费(元)
+     */
+    private BigDecimal impression1kCost;
+    /**
+     * 平均点击单价(元)
+     */
+    private BigDecimal photoClickCost;
+    /**
+     * 平均行为单价(元)
+     */
+    private BigDecimal actionCost;
+    /**
+     * 分享数
+     */
+    private Long share;
+    /**
+     * 评论数
+     */
+    private Long comment;
+    /**
+     * 点赞数
+     */
+    private Long like;
+    /**
+     * 新增关注数
+     */
+    private Long follow;
+    /**
+     * 取消关注数
+     */
+    private Long cancelFollow;
+    /**
+     * 举报数
+     */
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    private Long block;
+    /**
+     * 减少此类作品数
+     */
+    private Long negative;
+    /**
+     * 提交按钮点击数(历史字段,同下方“表单提交数”,预计年底删除该字段)
+     */
+    private Long submit;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    private Long downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    private Long downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    private Long activation;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    private Long eventPayFirstDay;
+    /**
+     * 应用下载数据-首日付费金额
+     */
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * 应用下载数据-首日ROI
+     */
+    private BigDecimal eventPayFirstDayRoi;
+    /**
+     * 应用下载数据-付费次数
+     */
+    private Long eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-ROI
+     */
+    private BigDecimal eventPayRoi;
+    /**
+     * 应用下载数据-注册数
+     */
+    private Long eventRegister;
+    /**
+     * 应用下载数据-注册成本
+     */
+    private BigDecimal eventRegisterCost;
+    /**
+     * 应用下载数据-注册率
+     */
+    private BigDecimal eventRegisterRatio;
+    /**
+     * 应用下载数据-完件数
+     */
+    private Long eventJinJianApp;
+    /**
+     * 应用下载数据-完件成本
+     */
+    private BigDecimal eventJinJianAppCost;
+    /**
+     * 应用下载数据-授信数
+     */
+    private Long eventCreditGrantApp;
+    /**
+     * 应用下载数据-授信成本
+     */
+    private BigDecimal eventCreditGrantAppCost;
+    /**
+     * 应用下载数据-授信率
+     */
+    private BigDecimal eventCreditGrantAppRatio;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    private Long eventOrderPaid;
+    /**
+     * 应用下载数据-付款成功金额
+     */
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * 应用下载数据-单次付款成本
+     */
+    private BigDecimal eventOrderPaidCost;
+    /**
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    private Long eventNextDayStay;
+    /**
+     * 应用下载数据-次留成本(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayCost;
+    /**
+     * 应用下载数据-次留率(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayRatio;
+    /**
+     * 落地页数据-表单提交数
+     */
+    private Long formCount;
+    /**
+     * 落地页数据-表单提交单价
+     */
+    private BigDecimal formCost;
+    /**
+     * 落地页数据-表单提交点击率
+     */
+    private BigDecimal formActionRatio;
+    /**
+     * 落地页数据-落地页完件数
+     */
+    private Long eventJinJianLandingPage;
+    /**
+     * 落地页数据-落地页完件成本
+     */
+    private BigDecimal eventJinJianLandingPageCost;
+    /**
+     * 落地页数据-落地页授信数
+     */
+    private Long eventCreditGrantLandingPage;
+    /**
+     * 落地页数据-落地页授信成本
+     */
+    private BigDecimal eventCreditGrantLandingPageCost;
+    /**
+     * 落地页数据-落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingPageRatio;
+    /**
+     * 落地页数据-有效线索数
+     */
+    private Long eventValidClues;
+    /**
+     * 落地页数据-有效线索成本
+     */
+    private BigDecimal eventValidCluesCost;
+    /**
+     * 微信复制数
+     */
+    private Long eventAddWechat;
+    /**
+     * 微信复制成本
+     */
+    private BigDecimal eventAddWechatCost;
+    /**
+     * 微信复制率
+     */
+    private BigDecimal eventAddWechatRatio;
+    /**
+     * 智能电话-确认接通数
+     */
+    private Long eventGetThrough;
+    /**
+     * 智能电话-确认接通成本
+     */
+    private BigDecimal eventGetThroughCost;
+    /**
+     * 智能电话-确认接通率
+     */
+    private BigDecimal eventGetThroughRatio;
+    /**
+     * 唤醒应用数
+     */
+    private Long eventAppInvoked;
+    /**
+     * 唤醒应用成本
+     */
+    private BigDecimal eventAppInvokedCost;
+    /**
+     * 唤醒应用率
+     */
+    private BigDecimal eventAppInvokedRatio;
+    /**
+     * 落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingRatio;
+    /**
+     * 5s播放率
+     */
+    private BigDecimal play5sRatio;
+    /**
+     * 完播率
+     */
+    private BigDecimal playEndRatio;
+    /**
+     * 新增付费人数
+     */
+    private BigDecimal eventNewUserPay;
+    /**
+     * 新增付费人数成本
+     */
+    private BigDecimal eventNewUserPayCost;
+    /**
+     * 新增付费人数率
+     */
+    private BigDecimal eventNewUserPayRatio;
+    /**
+     * 平均千次素材曝光花费(元)
+     */
+    private BigDecimal click1kCost;
+    /**
+     * 商品成交数
+     */
+    private Long adProductCnt;
+    /**
+     * 商品访问数
+     */
+    private Long eventGoodsView;
+    /**
+     * 涨粉量
+     */
+    private Long merchantRecoFans;
+    /**
+     * 小店推广roi
+     */
+    private BigDecimal eventOrderAmountRoi;
+    /**
+     * 商品访问成本
+     */
+    private BigDecimal eventGoodsViewCost;
+    /**
+     * 涨粉成本
+     */
+    private BigDecimal merchantRecoFansCost;
+    /**
+     * 按钮点击数
+     */
+    private Long eventButtonClick;
+    /**
+     * 按钮点击成本
+     */
+    private BigDecimal eventButtonClickCost;
+    /**
+     * 按钮点击率
+     */
+    private BigDecimal eventButtonClickRatio;
+    /**
+     * 订单支付率
+     */
+    private BigDecimal eventOrderPaidRoi;
+    /**
+     * 新增完件人数
+     */
+    private Long eventNewUserJinjianApp;
+    /**
+     * 新增完件成本
+     */
+    private BigDecimal eventNewUserJinjianAppCost;
+    /**
+     * 新增完件人数率
+     */
+    private BigDecimal eventNewUserJinjianAppRoi;
+    /**
+     * 新增授信人数
+     */
+    private Long eventNewUserCreditGrantApp;
+    /**
+     * 新增授信人数成本
+     */
+    private BigDecimal eventNewUserCreditGrantAppCost;
+    /**
+     * 新增授信人数率
+     */
+    private BigDecimal eventNewUserCreditGrantAppRoi;
+
+    private Long eventNewUserJinjianPage;
+    private BigDecimal eventNewUserJinjianPageCost;
+    private BigDecimal eventNewUserJinjianPageRoi;
+    private Long eventNewUserCreditGrantPage;
+    private BigDecimal eventNewUserCreditGrantPageCost;
+    private BigDecimal eventNewUserCreditGrantPageRoi;
+    /**
+     * 预约表单数
+     */
+    private Long eventAppointForm;
+    /**
+     * 预约表单点击成本
+     */
+    private BigDecimal eventAppointFormCost;
+    /**
+     * 预约表单点击率
+     */
+    private BigDecimal eventAppointFormRatio;
+    /**
+     * 预约跳转点击数
+     */
+    private Long eventAppointJumpClick;
+    /**
+     * 预约跳转点击成本
+     */
+    private BigDecimal eventAppointJumpClickCost;
+    /**
+     * 预约跳转点击率
+     */
+    private BigDecimal eventAppointJumpClickRatio;
+    /**
+     * 联盟广告收入
+     */
+    private Long unionEventPayPurchaseAmount7d;
+    /**
+     * 联盟变现ROI
+     */
+    private BigDecimal unionEventPayPurchaseAmount7dRoi;
+
+    private String placementType;
+
+    private String adScene;
+
+    private Long eventOrderSuccessed;
+    private BigDecimal adPhotoPlayed10sRatio;
+    private BigDecimal keyActionCost;
+    /**
+     * 添加购物车成本
+     */
+    private BigDecimal eventAddShoppingCartCost;
+
+    /**
+     * 广告观看次数转化率
+     */
+    private BigDecimal eventAdWatchTimesRatio;
+    private BigDecimal eventOutboundCallCost;
+    private Long eventOutboundCall;
+    private BigDecimal actionNewRatio;
+
+    /**
+     * 广告观看
+     */
+    private Long eventWatchAppAd;
+    /**
+     * 落地页多转化成本
+     */
+    private BigDecimal eventMultiConversionCost;
+    private Long eventPhoneCardActivate;
+    private BigDecimal adPhotoPlayed75percentRatio;
+    private BigDecimal keyActionRatio;
+    /**
+     * 广告观看次数成本
+     */
+    private BigDecimal eventAdWatchTimesCost;
+    /**
+     * 添加购物车数
+     */
+    private Long eventAddShoppingCart;
+    private Long keyAction;
+
+    /**
+     * 落地页多转化次数
+     */
+    private Long eventMultiConversion;
+    private Long eventWechatConnected;
+    /**
+     * 附加组件表单提交
+     */
+    private Long eventDspGiftForm;
+    private Long eventIntentionConfirmed;
+    private Long eventPhoneGetThrough;
+    /**
+     * 落地页多转化率
+     */
+    private BigDecimal eventMultiConversionRatio;
+    private BigDecimal eventMeasurementHouse;
+    private BigDecimal adPhotoPlayed2sRatio;
+    private BigDecimal eventOutboundCallRatio;
+    /**
+     * 广告观看次数
+     */
+    private Long eventAdWatchTimes;
+}

+ 509 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouUnitReportHourlyDw.java

@@ -0,0 +1,509 @@
+package cn.com.ctop.report.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+
+@Data
+@TableName("kuaishou_unit_report_hourly_dw")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class KuaishouUnitReportHourlyDw {
+    private Long accountId;
+    private Long statDate;
+    private int hour;
+    /**
+     * 项目id
+     */
+    private Long projectId;
+    /**
+     * 产品id
+     */
+    private Long productId;
+    /**
+     * 广告主id
+     */
+    private String advertiserId;
+    /**
+     * 公司id
+     */
+    private String companyId;
+    /**
+     * 账户名称
+     */
+    private String accountName;
+    /**
+     * 项目名称
+     */
+    private String projectName;
+    /**
+     * 广告主名称
+     */
+    private String advertiserName;
+    /**
+     * 公司名称
+     */
+    private String companyName;
+    /**
+     * 销售id
+     */
+    private String saleId;
+    /**
+     * 运营id
+     */
+    private String userId;
+    /**
+     * 机构编码
+     */
+    private String orgCode;
+    private Long campaignId;
+    private String campaignName;
+    private Long unitId ;
+    private String unitName;
+    /**
+     * 花费(元)
+     */
+    private BigDecimal charge;
+    /**
+     * 封面曝光数
+     */
+    private Long show;
+    /**
+     * 封面点击数
+     */
+    private Long photoClick;
+    /**
+     * 素材曝光数
+     */
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    private Long bclick;
+    /**
+     * 封面点击率
+     */
+    private BigDecimal photoClickRatio;
+    /**
+     * 3s播放率
+     */
+    private BigDecimal play3sRatio;
+    /**
+     * 行为率
+     */
+    private BigDecimal actionRatio;
+    /**
+     * 平均千次曝光花费(元)
+     */
+    private BigDecimal impression1kCost;
+    /**
+     * 平均点击单价(元)
+     */
+    private BigDecimal photoClickCost;
+    /**
+     * 平均行为单价(元)
+     */
+    private BigDecimal actionCost;
+    /**
+     * 分享数
+     */
+    private Long share;
+    /**
+     * 评论数
+     */
+    private Long comment;
+    /**
+     * 点赞数
+     */
+    private Long like;
+    /**
+     * 新增关注数
+     */
+    private Long follow;
+    /**
+     * 取消关注数
+     */
+    private Long cancelFollow;
+    /**
+     * 举报数
+     */
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    private Long block;
+    /**
+     * 减少此类作品数
+     */
+    private Long negative;
+    /**
+     * 提交按钮点击数(历史字段,同下方“表单提交数”,预计年底删除该字段)
+     */
+    private Long submit;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    private Long downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    private Long downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    private Long activation;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    private Long eventPayFirstDay;
+    /**
+     * 应用下载数据-首日付费金额
+     */
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * 应用下载数据-首日ROI
+     */
+    private BigDecimal eventPayFirstDayRoi;
+    /**
+     * 应用下载数据-付费次数
+     */
+    private Long eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-ROI
+     */
+    private BigDecimal eventPayRoi;
+    /**
+     * 应用下载数据-注册数
+     */
+    private Long eventRegister;
+    /**
+     * 应用下载数据-注册成本
+     */
+    private BigDecimal eventRegisterCost;
+    /**
+     * 应用下载数据-注册率
+     */
+    private BigDecimal eventRegisterRatio;
+    /**
+     * 应用下载数据-完件数
+     */
+    private Long eventJinJianApp;
+    /**
+     * 应用下载数据-完件成本
+     */
+    private BigDecimal eventJinJianAppCost;
+    /**
+     * 应用下载数据-授信数
+     */
+    private Long eventCreditGrantApp;
+    /**
+     * 应用下载数据-授信成本
+     */
+    private BigDecimal eventCreditGrantAppCost;
+    /**
+     * 应用下载数据-授信率
+     */
+    private BigDecimal eventCreditGrantAppRatio;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    private Long eventOrderPaid;
+    /**
+     * 应用下载数据-付款成功金额
+     */
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * 应用下载数据-单次付款成本
+     */
+    private BigDecimal eventOrderPaidCost;
+    /**
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    private Long eventNextDayStay;
+    /**
+     * 应用下载数据-次留成本(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayCost;
+    /**
+     * 应用下载数据-次留率(仅支持分日查询)
+     */
+    private BigDecimal eventNextDayStayRatio;
+    /**
+     * 落地页数据-表单提交数
+     */
+    private Long formCount;
+    /**
+     * 落地页数据-表单提交单价
+     */
+    private BigDecimal formCost;
+    /**
+     * 落地页数据-表单提交点击率
+     */
+    private BigDecimal formActionRatio;
+    /**
+     * 落地页数据-落地页完件数
+     */
+    private Long eventJinJianLandingPage;
+    /**
+     * 落地页数据-落地页完件成本
+     */
+    private BigDecimal eventJinJianLandingPageCost;
+    /**
+     * 落地页数据-落地页授信数
+     */
+    private Long eventCreditGrantLandingPage;
+    /**
+     * 落地页数据-落地页授信成本
+     */
+    private BigDecimal eventCreditGrantLandingPageCost;
+    /**
+     * 落地页数据-落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingPageRatio;
+    /**
+     * 落地页数据-有效线索数
+     */
+    private Long eventValidClues;
+    /**
+     * 落地页数据-有效线索成本
+     */
+    private BigDecimal eventValidCluesCost;
+    /**
+     * 微信复制数
+     */
+    private Long eventAddWechat;
+    /**
+     * 微信复制成本
+     */
+    private BigDecimal eventAddWechatCost;
+    /**
+     * 微信复制率
+     */
+    private BigDecimal eventAddWechatRatio;
+    /**
+     * 智能电话-确认接通数
+     */
+    private Long eventGetThrough;
+    /**
+     * 智能电话-确认接通成本
+     */
+    private BigDecimal eventGetThroughCost;
+    /**
+     * 智能电话-确认接通率
+     */
+    private BigDecimal eventGetThroughRatio;
+    /**
+     * 唤醒应用数
+     */
+    private Long eventAppInvoked;
+    /**
+     * 唤醒应用成本
+     */
+    private BigDecimal eventAppInvokedCost;
+    /**
+     * 唤醒应用率
+     */
+    private BigDecimal eventAppInvokedRatio;
+    /**
+     * 落地页授信率
+     */
+    private BigDecimal eventCreditGrantLandingRatio;
+    /**
+     * 5s播放率
+     */
+    private BigDecimal play5sRatio;
+    /**
+     * 完播率
+     */
+    private BigDecimal playEndRatio;
+    /**
+     * 新增付费人数
+     */
+    private BigDecimal eventNewUserPay;
+    /**
+     * 新增付费人数成本
+     */
+    private BigDecimal eventNewUserPayCost;
+    /**
+     * 新增付费人数率
+     */
+    private BigDecimal eventNewUserPayRatio;
+    /**
+     * 平均千次素材曝光花费(元)
+     */
+    private BigDecimal click1kCost;
+    /**
+     * 商品成交数
+     */
+    private Long adProductCnt;
+    /**
+     * 商品访问数
+     */
+    private Long eventGoodsView;
+    /**
+     * 涨粉量
+     */
+    private Long merchantRecoFans;
+    /**
+     * 小店推广roi
+     */
+    private BigDecimal eventOrderAmountRoi;
+    /**
+     * 商品访问成本
+     */
+    private BigDecimal eventGoodsViewCost;
+    /**
+     * 涨粉成本
+     */
+    private BigDecimal merchantRecoFansCost;
+    /**
+     * 按钮点击数
+     */
+    private Long eventButtonClick;
+    /**
+     * 按钮点击成本
+     */
+    private BigDecimal eventButtonClickCost;
+    /**
+     * 按钮点击率
+     */
+    private BigDecimal eventButtonClickRatio;
+    /**
+     * 订单支付率
+     */
+    private BigDecimal eventOrderPaidRoi;
+    /**
+     * 新增完件人数
+     */
+    private Long eventNewUserJinjianApp;
+    /**
+     * 新增完件成本
+     */
+    private BigDecimal eventNewUserJinjianAppCost;
+    /**
+     * 新增完件人数率
+     */
+    private BigDecimal eventNewUserJinjianAppRoi;
+    /**
+     * 新增授信人数
+     */
+    private Long eventNewUserCreditGrantApp;
+    /**
+     * 新增授信人数成本
+     */
+    private BigDecimal eventNewUserCreditGrantAppCost;
+    /**
+     * 新增授信人数率
+     */
+    private BigDecimal eventNewUserCreditGrantAppRoi;
+
+    private Long eventNewUserJinjianPage;
+    private BigDecimal eventNewUserJinjianPageCost;
+    private BigDecimal eventNewUserJinjianPageRoi;
+    private Long eventNewUserCreditGrantPage;
+    private BigDecimal eventNewUserCreditGrantPageCost;
+    private BigDecimal eventNewUserCreditGrantPageRoi;
+    /**
+     * 预约表单数
+     */
+    private Long eventAppointForm;
+    /**
+     * 预约表单点击成本
+     */
+    private BigDecimal eventAppointFormCost;
+    /**
+     * 预约表单点击率
+     */
+    private BigDecimal eventAppointFormRatio;
+    /**
+     * 预约跳转点击数
+     */
+    private Long eventAppointJumpClick;
+    /**
+     * 预约跳转点击成本
+     */
+    private BigDecimal eventAppointJumpClickCost;
+    /**
+     * 预约跳转点击率
+     */
+    private BigDecimal eventAppointJumpClickRatio;
+    /**
+     * 联盟广告收入
+     */
+    private Long unionEventPayPurchaseAmount7d;
+    /**
+     * 联盟变现ROI
+     */
+    private BigDecimal unionEventPayPurchaseAmount7dRoi;
+
+    private String placementType;
+
+    private String adScene;
+
+    private Long eventOrderSuccessed;
+    private BigDecimal adPhotoPlayed10sRatio;
+    private BigDecimal keyActionCost;
+    /**
+     * 添加购物车成本
+     */
+    private BigDecimal eventAddShoppingCartCost;
+
+    /**
+     * 广告观看次数转化率
+     */
+    private BigDecimal eventAdWatchTimesRatio;
+    private BigDecimal eventOutboundCallCost;
+    private Long eventOutboundCall;
+    private BigDecimal actionNewRatio;
+
+    /**
+     * 广告观看
+     */
+    private Long eventWatchAppAd;
+    /**
+     * 落地页多转化成本
+     */
+    private BigDecimal eventMultiConversionCost;
+    private Long eventPhoneCardActivate;
+    private BigDecimal adPhotoPlayed75percentRatio;
+    private BigDecimal keyActionRatio;
+    /**
+     * 广告观看次数成本
+     */
+    private BigDecimal eventAdWatchTimesCost;
+    /**
+     * 添加购物车数
+     */
+    private Long eventAddShoppingCart;
+    private Long keyAction;
+
+    /**
+     * 落地页多转化次数
+     */
+    private Long eventMultiConversion;
+    private Long eventWechatConnected;
+    /**
+     * 附加组件表单提交
+     */
+    private Long eventDspGiftForm;
+    private Long eventIntentionConfirmed;
+    private Long eventPhoneGetThrough;
+    /**
+     * 落地页多转化率
+     */
+    private BigDecimal eventMultiConversionRatio;
+    private BigDecimal eventMeasurementHouse;
+    private BigDecimal adPhotoPlayed2sRatio;
+    private BigDecimal eventOutboundCallRatio;
+    /**
+     * 广告观看次数
+     */
+    private Long eventAdWatchTimes;
+}

+ 27 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/AccountAttributionInfoMapper.java

@@ -1,8 +1,35 @@
 package cn.com.ctop.report.mapper;
 
 import cn.com.ctop.report.entity.AccountAttributionInfo;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface AccountAttributionInfoMapper extends BaseMapper<AccountAttributionInfo> {
     void reloadData();
+
+    List<AccountAttributionInfo> selectByParams(@Param(value = "mediaList") List<Integer> mediaList,@Param(value = "orgCode")String orgCode,@Param(value = "projectIds") List<Long>projectIds,@Param(value = "userIds") List<String>userIds);
+
+    List<AccountAttributionInfo> selectDesignAccuntsByParams(@Param(value = "mediaList")List<Integer> mediaList, @Param(value = "designUserId")String designUserId);
+
+    //今日汇总数据
+    JSONObject queryTodaySumReportBy(@Param("statDate") String statDate, @Param("accountIds") JSONArray accountIds);
+
+    //根据小时区间查询今日汇总数据
+    JSONObject queryTodaySumByHour(@Param("statDate") String statDate, @Param("hour") int hour, @Param("accountIds") JSONArray accountIds);
+
+    //根据开始、结束时间 查询汇总数据
+    JSONObject querySumByStartEndDate(@Param("endDate") String endDate, @Param("startDate") String startDate, @Param("accountIds") JSONArray accountIds);
+
+    //今日明细数据
+    List<JSONObject> queryTodayDetailReportBy(@Param("filed") String filed, @Param("statDate") String statDate, @Param("accountIds") JSONArray accountIds);
+
+    //按月分组查询明细数据
+    List<JSONObject> queryDetailGroupMonthByDate(@Param("endDate") String endDate, @Param("startDate") String startDate, @Param("accountIds") JSONArray accountIds);
+
+    //根据开始、结束时间 查询明细数据
+    List<JSONObject> queryDetailByStartEndDate(@Param("endDate") String endDate, @Param("startDate") String startDate, @Param("accountIds") JSONArray accountIds);
 }

+ 13 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/KuaishouAccountReportDailyDwMapper.java

@@ -0,0 +1,13 @@
+package cn.com.ctop.report.mapper;
+
+import cn.com.ctop.report.entity.KuaishouAccountReportDailyDw;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface KuaishouAccountReportDailyDwMapper extends BaseMapper<KuaishouAccountReportDailyDw> {
+    List<JSONObject> getReportByParams(@Param(value = "filedAll") String filedAll, @Param(value = "endDate")String endDate, @Param(value = "startDate")String startDate, @Param(value = "accounts")JSONArray accounts, @Param(value = "target")String target, @Param(value = "order")String order, @Param(value = "hasGroupBy")int hasGroupBy,@Param(value = "groupBy")String groupBy);
+}

+ 13 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/KuaishouAccountReportHourlyDwMapper.java

@@ -0,0 +1,13 @@
+package cn.com.ctop.report.mapper;
+
+import cn.com.ctop.report.entity.KuaishouAccountReportHourlyDw;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface KuaishouAccountReportHourlyDwMapper extends BaseMapper<KuaishouAccountReportHourlyDw> {
+    List<JSONObject> getReportByParams(@Param(value = "filedAll") String filedAll, @Param(value = "startDate")String startDate, @Param(value = "hour")int hour, @Param(value = "accounts")JSONArray accounts, @Param(value = "target")String target, @Param(value = "order")String order, @Param(value = "hasGroupBy")int hasGroupBy,@Param(value = "groupBy")String groupBy);
+}

+ 18 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/KuaishouMaterialVideoReportDailyDwMapper.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.report.mapper;
+
+import cn.com.ctop.report.entity.KuaishouMaterialVideoReportDailyDw;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface KuaishouMaterialVideoReportDailyDwMapper extends BaseMapper<KuaishouMaterialVideoReportDailyDw> {
+    Long getTotalByMap(Map<String, Object> requestMap);
+
+    List getKuaiShouVideoReportByMap(Map<String, Object> requestMap);
+
+    List<JSONObject> queryVideoDetailBy(@Param("accountIds") JSONArray accountIds, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("filed") String filed, @Param("signature") String signature);
+}

+ 160 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/AccountAttributionInfoMapper.xml

@@ -26,4 +26,164 @@
                  left join user_company uc on uc.user_id = cua.user_id
                  left join ctop_product product on product.id = cp.product_id where cua.account_id is not null;
     </insert>
+    <select id="selectByParams" resultType="cn.com.ctop.report.entity.AccountAttributionInfo">
+        select
+               caai.*
+        from ctop_user_allocation cua
+        left join ctop_account_attribution_info caai on caai.account_id = cua.account_id
+        where cua.media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        <if test="orgCode!=null">
+            and caai.org_code like '${orgCode}'
+        </if>
+        <if test="projectIds!=null">
+            and cua.project_id in
+            <foreach collection="projectIds" item="projectId" separator=","
+                     open="(" close=")">
+                #{projectId}
+            </foreach>
+        </if>
+        <if test="userIds!=null">
+            and cua.user_id in
+            <foreach collection="userIds" item="userId" separator=","
+                     open="(" close=")">
+                #{userId}
+            </foreach>
+        </if>
+        and cua.account_status = 0
+    </select>
+    <select id="selectDesignAccuntsByParams" resultType="cn.com.ctop.report.entity.AccountAttributionInfo">
+        select caai.*
+        from ctop_user_allocation cua
+                 left join ctop_account_attribution_info caai on cua.account_id = caai.account_id
+        where cua.account_status = 0
+        <if test="mediaList != null">
+            and cua.media_id in
+            <foreach collection="mediaIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+          and cua.project_id in (select distinct project_id from ctop_project_member where user_id = #{designUserId})
+    </select>
+
+        <select id="queryTodaySumReportBy" resultType="com.alibaba.fastjson.JSONObject">
+            SELECT
+            ROUND(sum(charge),3) cost,
+            sum(photo_show) photoShow,
+            sum(photo_click) photoClick,
+            sum(aClick) as aClick,
+            max(stat_hour) maxHour
+            FROM
+            kuaishou_account_report_hourly_dw
+            WHERE
+            stat_date = #{statDate}
+            AND account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </select>
+
+        <select id="queryTodaySumByHour" resultType="com.alibaba.fastjson.JSONObject">
+            SELECT
+            ROUND(sum(charge),2) cost,
+            sum(photo_show) photoShow,
+            sum(photo_click) photoClick,
+            sum(aClick) as aClick
+            FROM
+            kuaishou_account_report_hourly_dw
+            WHERE
+            stat_date = #{statDate}
+            AND stat_hour &lt;= #{hour}
+            AND account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </select>
+
+
+        <select id="queryTodayDetailReportBy" resultType="com.alibaba.fastjson.JSONObject">
+            SELECT
+            ROUND(sum(charge),3) cost,
+            sum(photo_show) photoShow,
+            sum(photo_click) photoClick,
+            sum(aClick) as aClick,
+            stat_hour as statHour
+            FROM
+            kuaishou_account_report_hourly_dw
+            WHERE
+            stat_date = #{statDate}
+            AND account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
+            GROUP BY
+            stat_hour
+            ORDER BY
+            stat_hour ASC
+        </select>
+
+
+        <select id="querySumByStartEndDate" resultType="com.alibaba.fastjson.JSONObject">
+            SELECT
+            ROUND(sum(charge),3) cost,
+            sum(photo_show) photoShow,
+            sum(photo_click) photoClick,
+            sum(aClick) as aClick
+            FROM kuaishou_account_report_daily_dw t1
+            WHERE t1.stat_date &lt;= #{endDate}
+            AND t1.stat_date &gt;= #{startDate}
+            AND account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </select>
+
+
+
+        <select id="queryDetailByStartEndDate" resultType="com.alibaba.fastjson.JSONObject">
+            SELECT
+            ROUND(sum(charge),3) cost,
+            sum(photo_show) photoShow,
+            sum(photo_click) photoClick,
+            sum(aClick) as aClick,
+            stat_date as statDate
+            FROM
+            kuaishou_account_report_daily_dw
+            WHERE stat_date &lt;= #{endDate}
+            AND stat_date &gt;= #{startDate}
+            AND account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
+            group by stat_date
+            order by stat_date asc
+        </select>
+
+        <select id="queryDetailGroupMonthByDate" resultType="com.alibaba.fastjson.JSONObject">
+            SELECT
+            ROUND(sum(charge),3) cost,
+            sum(photo_show) photoShow,
+            sum(photo_click) photoClick,
+            sum(aClick) as aClick,
+            DATE_FORMAT(t1.stat_date, '%Y-%m') statDate
+            FROM kuaishou_account_report_daily_dw t1
+            WHERE t1.stat_date &lt;= #{endDate}
+            AND t1.stat_date &gt;= #{startDate}
+            AND t1.account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
+            group by DATE_FORMAT(t1.stat_date, '%Y-%m')
+            order by t1.stat_date asc
+        </select>
 </mapper>

+ 26 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/KuaishouAccountReportDailyDwMapper.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.report.mapper.KuaishouAccountReportDailyDwMapper">
+
+    <select id="getReportByParams" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        stat_date as statDate,
+        account_id as accountId,
+        auth_name as authName,
+        ${filed}
+        FROM
+        ctop_kuaishou_report_daily_account
+        WHERE
+        stat_date &lt;= #{endDate}
+        AND stat_date &gt;= #{startDate}
+        AND account_id in
+        <foreach item="item" index="index" collection="accountIds"
+                 open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        <if test="hasGroupBy == 1">
+            group by ${groupBy}
+            order by ${target} ${order}
+        </if>
+    </select>
+</mapper>

+ 22 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/KuaishouAccountReportHourlyDwMapper.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.report.mapper.KuaishouAccountReportHourlyDwMapper">
+
+    <select id="getReportByParams" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        account_id as accountId,
+        account_name as authName,
+        ${filedAll}
+        FROM ctop_kuaishou_report_hourly_account t1
+        WHERE stat_date = #{statDate}
+        and stat_hour &lt;= #{hour}
+        AND account_id in
+        <foreach item="item" index="index" collection="accountIds"
+                 open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        <if test="hasGroupBy == 1"></if>
+        group by t1.account_id
+        order by ${target} ${order}
+    </select>
+</mapper>

+ 131 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/KuaishouMaterialVideoReportDailyDwMapper.xml

@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.report.mapper.KuaishouMaterialVideoReportDailyDwMapper">
+
+    <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="channelType != null">
+            AND t2.channel_type = #{channelType}
+        </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>
+        <if test="companyId !=null and companyId != ''">
+            AND t2.company_id = #{companyId}
+        </if>
+    </select>
+    <select id="getKuaiShouVideoReportByMap" resultType="java.util.List">
+        SELECT
+        t1.*,
+        IFNULL(t1.clip_name,'-') as clip,
+        IFNULL(t1.plan_name,'-') as plan,
+        IFNULL(t1.shot_name,'-') as shot,
+        IFNULL(t1.design_team_leader_name,'-') as designLeader,
+        IFNULL(t1.video_name,'-') as materialName,
+        IFNULL(t1.cover_url,'-') as coverUrl,
+        IFNULL(t1.url,'-') as url ,
+        IFNULL(t1.channel_name,'-') AS channel,
+        IFNULL(t1.state_date,'-') as createTime
+        FROM
+        (select ${filed}
+        from kuaishou_material_video_report_daily_dw
+        where 1 = 1
+        <if test="accountIds !=null and accountIds != ''">
+            and account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="startDate !=null and startDate != ''">
+            AND stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate !=null and endDate != ''">
+            AND stat_date &lt;= #{endDate}
+        </if>
+        <if test="leaderId !=null and leaderId != ''">
+            AND leader_id = #{leaderId}
+        </if>
+        <if test="channelType != null">
+            AND channel_type = #{channelType}
+        </if>
+        <if test="clipId !=null and clipId != ''">
+            AND clip_id = #{clipId}
+        </if>
+        <if test="planId !=null and planId != ''">
+            AND plan_id = #{planId}
+        </if>
+        <if test="shotId !=null and shotId != ''">
+            AND shot_id = #{shotId}
+        </if>
+        <if test="companyId !=null and companyId != ''">
+            AND clip_company_id = #{companyId}
+        </if>
+        GROUP BY signature
+        ORDER BY ${target} ${order}
+        ) t1
+
+
+
+    </select>
+    <select id="queryVideoDetailBy" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        t1.stat_date as statDate,
+        t1.signature,
+        t1.photo_url as url,
+        t1.cover_url as converUrl,
+        (select t2.material_name from ctop_material_info t2 where t2.code=t1.signature limit 1) AS materialName,
+        t1.project_name AS projectName,
+        t1.advertiser_name AS advertiserName,
+        (select t2.create_time from ctop_material_info t2 where t2.code=t1.signature limit 1) as createTime,
+        ${filed}
+        FROM
+        kuaishou_material_video_report_daily_dw t1
+        WHERE t1.signature=#{signature}
+        AND t1.stat_date >= #{startDate}
+        AND t1.stat_date &lt;= #{endDate}
+        <if test="accountIds != null">
+            AND t1.account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        GROUP BY t1.signature,t1.stat_date
+        order by t1.stat_date desc
+    </select>
+</mapper>

+ 0 - 8
jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/UserAllocationMapper.xml

@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.report.mapper.UserAllocationMapper">
-
-    <select id="queryListWithPermission" resultType="cn.com.ctop.report.entity.UserAllocation">
-        select * from user_allocation where 1=1 ${permissionSql}
-    </select>
-</mapper>

+ 20 - 1
jeecg-boot-report/src/main/java/cn/com/ctop/report/service/AccountAttributionInfoService.java

@@ -1,9 +1,28 @@
 package cn.com.ctop.report.service;
 
 import cn.com.ctop.report.entity.AccountAttributionInfo;
-import cn.com.ctop.report.entity.UserAllocation;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
+
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.util.List;
+import java.util.Map;
 
 public interface AccountAttributionInfoService extends IService<AccountAttributionInfo> {
     void reloadData();
+
+    List<AccountAttributionInfo> getAccountInfoList(String userId, String mediaType);
+
+    JSONArray getProjectAccountByUserId(String userId, String mediaType);
+
+    JSONArray getMaterialProjectAccountByUserId(String userId, String mediaType);
+
+    List<AccountAttributionInfo> getMaterialAccountInfoList(String userId, String mediaType);
+
+    Map<String,Object> getSumDataBy(String mediaId, BigDecimal discount, JSONArray accounts, String startDate, String endDate);
+
+    List<JSONObject> getChartDataBy(String mediaId, BigDecimal discount, JSONArray accounts, String startDate, String endDate) throws ParseException, ParseException;
 }

+ 14 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/service/IKuaishouAccountReportDailyDwService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.report.service;
+
+import cn.com.ctop.report.entity.KuaishouAccountReportDailyDw;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+public interface IKuaishouAccountReportDailyDwService extends IService<KuaishouAccountReportDailyDw> {
+
+    List<JSONObject> getListDataByParams(String mediaId, BigDecimal discount, JSONArray accounts, String startDate, String endDate, int hour, String target, String order);
+}

+ 17 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/service/IKuaishouMaterialVideoReportDailyDwService.java

@@ -0,0 +1,17 @@
+package cn.com.ctop.report.service;
+
+import cn.com.ctop.report.entity.KuaishouAccountReportDailyDw;
+import cn.com.ctop.report.entity.KuaishouMaterialVideoReportDailyDw;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.pagehelper.PageInfo;
+
+import java.util.List;
+import java.util.Map;
+
+public interface IKuaishouMaterialVideoReportDailyDwService extends IService<KuaishouMaterialVideoReportDailyDw> {
+    PageInfo<JSONObject> getKuaiShouVideoPageReportByMap(Map<String, Object> requestMap, int pageSize, int pageNo);
+
+    List<JSONObject> getVideoDetailBy(JSONArray accountIds, String startDate, String endDate, String filedAll, String signature);
+}

+ 307 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/service/impl/AccountAttributionInfoServiceImpl.java

@@ -1,17 +1,324 @@
 package cn.com.ctop.report.service.impl;
 
+import cn.com.ctop.common.constant.AccountReportConstants;
+import cn.com.ctop.common.constant.CtopAdConstant;
+import cn.com.ctop.common.entity.Project;
+import cn.com.ctop.common.mapper.ProjectMapper;
+import cn.com.ctop.common.mapper.SysDepartMapper;
+import cn.com.ctop.common.mapper.SysRoleMapper;
+import cn.com.ctop.common.service.ISysUserService;
+import cn.com.ctop.common.utils.JsonResourceUtil;
+import cn.com.ctop.common.utils.LinkUtils;
 import cn.com.ctop.report.entity.AccountAttributionInfo;
 import cn.com.ctop.report.mapper.AccountAttributionInfoMapper;
 import cn.com.ctop.report.service.AccountAttributionInfoService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.SystemDateConstant;
+import org.jeecg.common.system.entity.SysDepart;
+import org.jeecg.common.system.entity.SysUser;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
+@Service
 public class AccountAttributionInfoServiceImpl extends ServiceImpl<AccountAttributionInfoMapper, AccountAttributionInfo> implements AccountAttributionInfoService {
     @Resource
     private AccountAttributionInfoMapper accountAttributionInfoMapper;
+    @Autowired
+    private ISysUserService sysUserService;
+    @Resource
+    private SysRoleMapper sysRoleMapper;
+    @Resource
+    private SysDepartMapper sysDepartMapper;
+    @Resource
+    private ProjectMapper projectMapper;
     @Override
     public void reloadData() {
         accountAttributionInfoMapper.reloadData();
     }
+
+    @Override
+    public List<AccountAttributionInfo> getAccountInfoList(String userId, String type){
+        List<Integer> mediaList = new ArrayList<>();
+        if (type.equals(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_PY)) {
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT);
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INSIDE_INT);
+        } else if (type.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY)) {
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT);
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INSIDE_INT);
+        }
+        String roleCode = sysRoleMapper.getRoleCodeByUserId(userId);
+        //管理员查所有
+        if("admin".equals(roleCode)){
+            return accountAttributionInfoMapper.selectByParams(mediaList,null,null,null);
+        }
+        //公司负责人
+        SysDepart company = sysDepartMapper.getDepartByParams(userId,1);
+        if(null != company){
+            return accountAttributionInfoMapper.selectByParams(mediaList,company.getOrgCode()+"%",null,null);
+        }
+        //部门负责人
+        SysDepart orgInfo = sysDepartMapper.getDepartByParams(userId,null);
+        if(null!=orgInfo){
+            return accountAttributionInfoMapper.selectByParams(mediaList,orgInfo.getOrgCode()+"%",null,null);
+        }
+        //项目负责人
+        List<Project> projectList = projectMapper.getListByParams(mediaList,userId);
+        if(null!=projectList&&!projectList.isEmpty()){
+            List<Long> projectIds = new ArrayList<>();
+            for (Project p:projectList) {
+                projectIds.add(p.getId());
+            }
+            return accountAttributionInfoMapper.selectByParams(mediaList,null,projectIds,null);
+        }
+        //查询是否存在下级
+        List<String> userIds = sysUserService.treeUserInfo(userId);
+        return accountAttributionInfoMapper.selectByParams(mediaList,null,null,userIds);
+    }
+
+    @Override
+    public JSONArray getProjectAccountByUserId(String userId, String mediaType) {
+        List<AccountAttributionInfo>accountAttributionInfos = getAccountInfoList(userId,mediaType);
+        Map<Long,Long> projectIdMaps = new HashMap<>();
+        for(AccountAttributionInfo attributionInfo:accountAttributionInfos){
+            projectIdMaps.putIfAbsent(attributionInfo.getProjectId(),attributionInfo.getProjectId());
+        }
+        JSONArray projectInfos = new JSONArray();
+        if(projectIdMaps.isEmpty()){
+            return projectInfos;
+        }
+        for (Long key : projectIdMaps.keySet()) {
+            List<AccountAttributionInfo>accountInfos = accountAttributionInfos.stream().filter(a->a.getProjectId().equals(key)).collect(Collectors.toList());
+            JSONObject projectInfo = new JSONObject();
+            projectInfo.put("projectId",accountInfos.get(0).getProjectId());
+            projectInfo.put("projectName",accountInfos.get(0).getProjectName());
+            projectInfo.put("advertiserName",accountInfos.get(0).getAdvertiserName());
+            projectInfo.put("advertiserId",accountInfos.get(0).getAdvertiserId());
+            projectInfo.put("accountList",accountInfos);
+            projectInfos.add(projectInfo);
+        }
+        return projectInfos;
+    }
+
+    @Override
+    public JSONArray getMaterialProjectAccountByUserId(String userId, String mediaType) {
+        List<AccountAttributionInfo>accountAttributionInfos = getAccountInfoList(userId,mediaType);
+        Map<Long,Long> projectIdMaps = new HashMap<>();
+        for(AccountAttributionInfo attributionInfo:accountAttributionInfos){
+            projectIdMaps.putIfAbsent(attributionInfo.getProjectId(),attributionInfo.getProjectId());
+        }
+        JSONArray projectInfos = new JSONArray();
+        if(projectIdMaps.isEmpty()){
+            return projectInfos;
+        }
+        for (Long key : projectIdMaps.keySet()) {
+            List<AccountAttributionInfo>accountInfos = accountAttributionInfos.stream().filter(a->a.getProjectId().equals(key)).collect(Collectors.toList());
+            JSONObject projectInfo = new JSONObject();
+            projectInfo.put("projectId",accountInfos.get(0).getProjectId());
+            projectInfo.put("projectName",accountInfos.get(0).getProjectName());
+            projectInfo.put("advertiserName",accountInfos.get(0).getAdvertiserName());
+            projectInfo.put("advertiserId",accountInfos.get(0).getAdvertiserId());
+            projectInfo.put("accountInfos",accountInfos);
+            projectInfos.add(projectInfo);
+        }
+        return projectInfos;
+    }
+
+    @Override
+    public List<AccountAttributionInfo> getMaterialAccountInfoList(String userId, String mediaType) {
+        List<Integer> mediaList = new ArrayList<>();
+        if (mediaType.equals(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE)) {
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT);
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INSIDE_INT);
+        } else if (mediaType.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU)) {
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT);
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INSIDE_INT);
+        }
+        String roleCode = sysRoleMapper.getRoleCodeByUserId(userId);
+        //管理员查所有
+        if("admin".equals(roleCode)){
+            return accountAttributionInfoMapper.selectByParams(mediaList,null,null,null);
+        }
+        //公司负责人
+        SysDepart company = sysDepartMapper.getDepartByParams(userId,1);
+        if(null != company){
+            return accountAttributionInfoMapper.selectByParams(mediaList,company.getOrgCode()+"%",null,null);
+        }
+        //部门负责人
+        SysDepart orgInfo = sysDepartMapper.getDepartByParams(userId,null);
+        if(null!=orgInfo){
+            return accountAttributionInfoMapper.selectByParams(mediaList,orgInfo.getOrgCode()+"%",null,null);
+        }
+        //项目负责人
+        List<Project> projectList = projectMapper.getListByParams(mediaList,userId);
+        if(null!=projectList&&!projectList.isEmpty()){
+            List<Long> projectIds = new ArrayList<>();
+            for (Project p:projectList) {
+                projectIds.add(p.getId());
+            }
+            return accountAttributionInfoMapper.selectByParams(mediaList,null,projectIds,null);
+        }
+        //设计组长,剪辑,编导,拍摄
+        if("designTeamLeader".equals(roleCode)||"plan".equals(roleCode)||"clip".equals(roleCode)||"shot".equals(roleCode)){
+            return this.selectDesignAccountByParams(mediaList,userId);
+        }
+
+        //查询是否存在下级
+        List<String> userIds = sysUserService.treeUserInfo(userId);
+        return accountAttributionInfoMapper.selectByParams(mediaList,null,null,userIds);
+    }
+
+    private List<AccountAttributionInfo> selectDesignAccountByParams(List<Integer> mediaList, String designUserId) {
+        return accountAttributionInfoMapper.selectDesignAccuntsByParams(mediaList,designUserId);
+    }
+
+    @Override
+    public Map<String, Object> getSumDataBy(String mediaId, BigDecimal discount, JSONArray accounts, String startDate, String endDate) {
+        Map<String, Object> result = new HashMap<>();
+        JSONObject after;
+        JSONObject before;
+        if (startDate.equals(endDate)) {
+            after = accountAttributionInfoMapper.queryTodaySumReportBy(startDate, accounts);
+            if (after == null) {
+                return result;
+            }
+            before = accountAttributionInfoMapper.queryTodaySumByHour(DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1), after.getInteger("maxHour"), accounts);
+            if (before == null) {
+                before = after;
+            }
+        } else {
+            after = accountAttributionInfoMapper.querySumByStartEndDate(endDate, startDate, accounts);
+            if (after == null) {
+                return result;
+            }
+            before = after;
+        }
+        return getSumLink(mediaId, discount, after, before);
+
+    }
+
+    @Override
+    public List<JSONObject> getChartDataBy(String mediaId, BigDecimal discount, JSONArray accounts, String startDate, String endDate) throws ParseException {
+        List<JSONObject> result = new ArrayList<>();
+        String filedAll = JsonResourceUtil.joinAllFiled(AccountReportConstants.getDicMapKs());
+        if (startDate.equals(endDate)) {
+            List<JSONObject> after = accountAttributionInfoMapper.queryTodayDetailReportBy(filedAll, startDate, accounts);
+            List<JSONObject> before = accountAttributionInfoMapper.queryTodayDetailReportBy(filedAll, DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1), accounts);
+            if (after.size() == 0) {
+                return result;
+            }
+            if (before.size() == 0) {
+                before = nullDataHandle();
+            }
+            List<JSONObject> afterDis = this.countDiscountCost(mediaId, discount, after);
+            List<JSONObject> beforeDis = this.countDiscountCost(mediaId, discount, before);
+            result = LinkUtils.getCompareDate(beforeDis, afterDis, "statHour");
+        } else {
+            List<JSONObject> after;
+            //判断是不是日期间隔大于半年
+            if (DateUtils.isMoreSixMonth(startDate, endDate)) {
+                after = accountAttributionInfoMapper.queryDetailGroupMonthByDate(endDate, startDate, accounts);
+            } else {
+                after = accountAttributionInfoMapper.queryDetailByStartEndDate(endDate, startDate, accounts);
+            }
+            if (after == null) {
+                return result;
+            }
+            result = this.countDiscountCost(mediaId, discount, after);
+        }
+        return result;
+    }
+
+    //计算汇总数据环比
+    private Map<String, Object> getSumLink(String mediaId, BigDecimal discount, JSONObject after, JSONObject before) {
+
+        Map<String, Object> result = new HashMap<>();
+
+        JSONObject costLink = new JSONObject();
+        JSONObject discountCostLink = new JSONObject();
+        JSONObject photoClickLink = new JSONObject();
+        JSONObject photoShowLink = new JSONObject();
+        JSONObject aClickLink = new JSONObject();
+
+        costLink.put("cost", after.getBigDecimal("cost"));
+        costLink.put("CostSumLink", LinkUtils.countLink(after.getBigDecimal("cost"), before.getBigDecimal("cost")));
+        if (mediaId.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU)) {
+            discountCostLink.put("discountCost", after.getBigDecimal("cost").divide(discount, 4, RoundingMode.HALF_UP));
+            discountCostLink.put("discountCostLink", LinkUtils.countLink(after.getBigDecimal("cost").divide(discount, 4, RoundingMode.HALF_UP), before.getBigDecimal("cost").divide(discount, 4, RoundingMode.HALF_UP)));
+        } else {
+            discountCostLink.put("discountCost", after.getBigDecimal("cost").multiply(discount));
+            discountCostLink.put("discountCostLink", LinkUtils.countLink(after.getBigDecimal("cost").multiply(discount), before.getBigDecimal("cost").multiply(discount)));
+        }
+        photoClickLink.put("photoClick", after.getBigDecimal("photoClick"));
+        photoClickLink.put("photoClickLink", LinkUtils.countLink(after.getBigDecimal("photoClick"), before.getBigDecimal("photoClick")));
+        photoShowLink.put("photoShow", after.getBigDecimal("photoShow"));
+        photoShowLink.put("photoShowLink", LinkUtils.countLink(after.getBigDecimal("photoShow"), before.getBigDecimal("photoShow")));
+        aClickLink.put("aClick", after.getBigDecimal("aClick"));
+        aClickLink.put("aClickLink", LinkUtils.countLink(after.getBigDecimal("aClick"), before.getBigDecimal("aClick")));
+        result.put("costLink", costLink);
+        result.put("discountCostLink", discountCostLink);
+        result.put("photoClickLink", photoClickLink);
+        result.put("photoShowLink", photoShowLink);
+        result.put("aClickLink", aClickLink);
+        return result;
+    }
+
+    //计算折后消耗
+    private List<JSONObject> countDiscountCost(String mediaId, BigDecimal discount, List<JSONObject> data) {
+        if (data.isEmpty()) {
+            return data;
+        }
+        if (mediaId.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU)) {
+            data.forEach(it -> {
+                it.put("discountCost", it.getBigDecimal("cost").divide(discount, 4, RoundingMode.HALF_UP));
+            });
+        } else {
+            data.forEach(it -> {
+                it.put("discountCost", it.getBigDecimal("cost").multiply(discount));
+            });
+        }
+        return data;
+    }
+
+    //计算总计环比
+    private JSONObject countTotal(JSONObject after, JSONObject before) {
+        JSONObject jsonObject = new JSONObject();
+        after.forEach((k, v) -> {
+            //去除没法计算的字段
+            if ("accountId".equals(k) || "authName".equals(k) || v.toString().contains("%") || before.getString(k).contains("%")) {
+                jsonObject.put(k, "-");
+            } else {
+                jsonObject.put(k, (LinkUtils.countLink(after.getBigDecimal(k) == null ? BigDecimal.ZERO : after.getBigDecimal(k), before.getBigDecimal(k) == null ? BigDecimal.ZERO : before.getBigDecimal(k))).multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%");
+            }
+        });
+        return jsonObject;
+    }
+
+    private List<JSONObject> nullDataHandle() {
+        List<JSONObject> objectList = new ArrayList<>();
+        JSONObject jsonObject;
+        for (int i = 0; i < 24; i++) {
+            jsonObject = new JSONObject();
+            jsonObject.put("cost", 0);
+            jsonObject.put("photoShow", 0);
+            jsonObject.put("photoClick", 0);
+            jsonObject.put("aClick", 0);
+            jsonObject.put("statHour", i);
+            objectList.add(jsonObject);
+        }
+        return objectList;
+    }
 }

+ 78 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/service/impl/KuaishouAccountReportDailyDwServiceImpl.java

@@ -0,0 +1,78 @@
+package cn.com.ctop.report.service.impl;
+
+import cn.com.ctop.common.constant.AccountReportConstants;
+import cn.com.ctop.common.utils.JsonResourceUtil;
+import cn.com.ctop.common.utils.LinkUtils;
+import cn.com.ctop.report.entity.KuaishouAccountReportDailyDw;
+import cn.com.ctop.report.entity.KuaishouAccountReportHourlyDw;
+import cn.com.ctop.report.mapper.KuaishouAccountReportDailyDwMapper;
+import cn.com.ctop.report.mapper.KuaishouAccountReportHourlyDwMapper;
+import cn.com.ctop.report.service.IKuaishouAccountReportDailyDwService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.common.constant.SystemDateConstant;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.List;
+
+@Service
+public class KuaishouAccountReportDailyDwServiceImpl extends ServiceImpl<KuaishouAccountReportDailyDwMapper, KuaishouAccountReportDailyDw> implements IKuaishouAccountReportDailyDwService {
+    @Resource
+    private KuaishouAccountReportDailyDwMapper kuaishouAccountReportDailyDwMapper;
+    @Resource
+    private KuaishouAccountReportHourlyDwMapper kuaishouAccountReportHourlyDwMapper;
+
+    @Override
+    public List<JSONObject> getListDataByParams(String mediaId, BigDecimal discount, JSONArray accounts, String startDate, String endDate, int hour, String target, String order) {
+        List<JSONObject> result;
+        String filedAll = JsonResourceUtil.joinAllFiled(AccountReportConstants.getDicMapKs());
+        if (startDate.equals(endDate)) {
+            String groupBy = "account_id";
+            if (startDate.equals(DateUtils.date2Str())) {
+                result = kuaishouAccountReportHourlyDwMapper.getReportByParams(filedAll, startDate, hour, accounts, target, order,1,groupBy);
+                JSONObject afterSum = kuaishouAccountReportHourlyDwMapper.getReportByParams(filedAll, startDate, hour, accounts,target,order,0,groupBy).get(0);
+                JSONObject beforeSum = kuaishouAccountReportHourlyDwMapper.getReportByParams(filedAll, DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1), hour, accounts,target,order,0,groupBy).get(0);
+                result.add(afterSum);
+                result.add(beforeSum);
+                result.add(countTotal(afterSum, beforeSum));
+            } else {
+                result = kuaishouAccountReportDailyDwMapper.getReportByParams(filedAll, endDate, startDate, accounts, target, order,1,groupBy);
+                JSONObject afterSum = kuaishouAccountReportDailyDwMapper.getReportByParams(filedAll, endDate, startDate, accounts,target,order,0,groupBy).get(0);
+                JSONObject beforeSum = kuaishouAccountReportDailyDwMapper.getReportByParams(filedAll, DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, endDate, -1), DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1), accounts,target,order,0,groupBy).get(0);
+                result.add(afterSum);
+                result.add(beforeSum);
+                result.add(countTotal(afterSum, beforeSum));
+            }
+        } else {
+            String groupBy = "stat_date";
+            if (accounts.size() > 1) {
+                groupBy = "account_id";
+            }
+            result = kuaishouAccountReportDailyDwMapper.getReportByParams(filedAll, endDate, startDate, accounts, target, order,1,groupBy);
+            List<JSONObject> totalList = kuaishouAccountReportDailyDwMapper.getReportByParams(filedAll, endDate, startDate, accounts,target,order,0,groupBy);
+            if(null!=totalList&&!totalList.isEmpty()){
+                result.add(totalList.get(0));
+            }
+        }
+        return result;
+    }
+
+    //计算总计环比
+    private JSONObject countTotal(JSONObject after, JSONObject before) {
+        JSONObject jsonObject = new JSONObject();
+        after.forEach((k, v) -> {
+            //去除没法计算的字段
+            if ("accountId".equals(k) || "authName".equals(k) || v.toString().contains("%") || before.getString(k).contains("%")) {
+                jsonObject.put(k, "-");
+            } else {
+                jsonObject.put(k, (LinkUtils.countLink(after.getBigDecimal(k) == null ? BigDecimal.ZERO : after.getBigDecimal(k), before.getBigDecimal(k) == null ? BigDecimal.ZERO : before.getBigDecimal(k))).multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%");
+            }
+        });
+        return jsonObject;
+    }
+}

+ 35 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/service/impl/KuaishouMaterialVideoReportDailyDwServiceImpl.java

@@ -0,0 +1,35 @@
+package cn.com.ctop.report.service.impl;
+
+import cn.com.ctop.report.entity.KuaishouMaterialVideoReportDailyDw;
+import cn.com.ctop.report.mapper.KuaishouMaterialVideoReportDailyDwMapper;
+import cn.com.ctop.report.service.IKuaishouMaterialVideoReportDailyDwService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class KuaishouMaterialVideoReportDailyDwServiceImpl extends ServiceImpl<KuaishouMaterialVideoReportDailyDwMapper, KuaishouMaterialVideoReportDailyDw> implements IKuaishouMaterialVideoReportDailyDwService {
+    @Resource
+    private KuaishouMaterialVideoReportDailyDwMapper materialVideoReportDailyDwMapper;
+
+    @Override
+    public PageInfo<JSONObject> getKuaiShouVideoPageReportByMap(Map<String, Object> requestMap, int pageSize, int pageNo) {
+        Long total = materialVideoReportDailyDwMapper.getTotalByMap(requestMap);
+        PageHelper.startPage(pageNo, pageSize, false);
+        PageInfo pageInfo = new PageInfo(materialVideoReportDailyDwMapper.getKuaiShouVideoReportByMap(requestMap));
+        pageInfo.setTotal(total);
+        return pageInfo;
+    }
+
+    @Override
+    public List<JSONObject> getVideoDetailBy(JSONArray accountIds, String startDate, String endDate, String filedAll, String signature) {
+        return materialVideoReportDailyDwMapper.queryVideoDetailBy(accountIds, startDate, endDate, filedAll, signature);
+    }
+}

+ 0 - 28
jeecg-boot-report/src/main/java/cn/com/ctop/report/service/impl/UserAllocationServiceImpl.java

@@ -1,28 +0,0 @@
-package cn.com.ctop.report.service.impl;
-
-import cn.com.ctop.report.entity.UserAllocation;
-import cn.com.ctop.report.mapper.UserAllocationMapper;
-import cn.com.ctop.report.service.IUserAllocationService;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.springframework.stereotype.Service;
-
-/**
- * @Description: 用户分配
- * @Author: jeecg-boot
- * @Date: 2019-08-08
- * @Version: V1.0
- */
-@Service
-public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper, UserAllocation> implements IUserAllocationService {
-
-    @Override
-    public IPage<UserAllocation> queryListWithPermission(Integer pageSize, Integer pageNo) {
-        Page<UserAllocation> page = new Page<>(pageNo, pageSize);
-        //就是调用这个QueryGenerator.installAuthJdbc方法获取权限sql
-        String sql = QueryGenerator.installAuthJdbc(UserAllocation.class);
-        return this.baseMapper.queryListWithPermission(page, sql);
-    }
-}