Browse Source

Merge branch 'master' into test

yangzian 3 năm trước cách đây
mục cha
commit
48b7512d59
100 tập tin đã thay đổi với 11798 bổ sung379 xóa
  1. 1 1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java
  2. 7 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  3. 1 1
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/xml/ReportSettlementMapper.xml
  4. 0 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/MaterialInfoMapper.java
  5. 8 4
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java
  6. 81 21
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml
  7. 2 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/IMessageTemplate.java
  8. 7 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java
  9. 11 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/MessageTemplateImpl.java
  10. 33 5
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java
  11. 221 223
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java
  12. 4 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/vo/ConvertVo.java
  13. 5 5
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouImageGetMapper.xml
  14. 5 15
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelItemsServiceImpl.java
  15. 94 73
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelServiceImpl.java
  16. 302 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/controller/ProjectMonitorWhiteListController.java
  17. 305 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/controller/TrackMonitorConfigureController.java
  18. 325 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/controller/TrackMonitorLogsController.java
  19. 65 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/entity/ProjectMonitorWhiteList.java
  20. 89 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/entity/TrackMonitorConfigure.java
  21. 69 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/entity/TrackMonitorLogs.java
  22. 20 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/ProjectMonitorWhiteListMapper.java
  23. 15 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/TrackMonitorConfigureMapper.java
  24. 21 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/TrackMonitorLogsMapper.java
  25. 30 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/xml/ProjectMonitorWhiteListMapper.xml
  26. 5 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/xml/TrackMonitorConfigureMapper.xml
  27. 29 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/xml/TrackMonitorLogsMapper.xml
  28. 19 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/IProjectMonitorWhiteListService.java
  29. 16 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/ITrackMonitorConfigureService.java
  30. 19 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/ITrackMonitorLogsService.java
  31. 50 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/impl/ProjectMonitorWhiteListServiceImpl.java
  32. 26 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/impl/TrackMonitorConfigureServiceImpl.java
  33. 286 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/impl/TrackMonitorLogsServiceImpl.java
  34. 12 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountDailyMapper.xml
  35. 14 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountHourlyMapper.xml
  36. 3 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/EtlKuaishouReportAccountHourlyServiceImpl.java
  37. 27 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectController.java
  38. 58 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  39. 6 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java
  40. 937 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/constant/AccountReportConstants.java
  41. 96 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/constant/CtopAdConstant.java
  42. 138 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/entity/Project.java
  43. 119 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/entity/ProjectMember.java
  44. 77 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/entity/SysRole.java
  45. 164 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/entity/UserAllocation.java
  46. 21 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/ProjectMapper.java
  47. 59 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/ProjectMemberMapper.java
  48. 21 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/SysDepartMapper.java
  49. 38 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/SysRoleMapper.java
  50. 20 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/SysUserMapper.java
  51. 22 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/UserAllocationMapper.java
  52. 16 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/ProjectMapper.xml
  53. 301 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/ProjectMemberMapper.xml
  54. 19 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/SysDepartMapper.xml
  55. 29 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/SysRoleMapper.xml
  56. 8 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/SysUserMapper.xml
  57. 26 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/UserAllocationMapper.xml
  58. 51 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/service/IProjectMemberService.java
  59. 19 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/service/ISysUserService.java
  60. 21 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/service/IUserAllocationService.java
  61. 293 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/service/impl/ProjectMemberServiceImpl.java
  62. 49 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/service/impl/SysUserServiceImpl.java
  63. 62 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/service/impl/UserAllocationServiceImpl.java
  64. 137 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/Check.java
  65. 122 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/JsonResourceUtil.java
  66. 49 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/LinkUtils.java
  67. 31 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/ResultMapUtils.java
  68. 126 0
      jeecg-boot-report/src/main/java/cn/com/ctop/common/utils/StatusCode.java
  69. 0 2
      jeecg-boot-report/src/main/java/cn/com/ctop/report/JeecgBootReportApplication.java
  70. 121 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/controller/KuaishouAccountReportDailyDwController.java
  71. 208 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/controller/KuaishouMaterialReportDailyDwController.java
  72. 33 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/AccountAttributionInfo.java
  73. 504 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouAccountReportDailyDw.java
  74. 502 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouAccountReportHourlyDw.java
  75. 506 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouCampaignReportDailyDw.java
  76. 507 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouCampaignReportHourlyDw.java
  77. 510 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouCreativeReportDailyDw.java
  78. 511 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouCreativeReportHourlyDw.java
  79. 511 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouMaterialVideoReportDailyDw.java
  80. 526 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouMaterialVideoReportHourlyDw.java
  81. 508 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouUnitReportDailyDw.java
  82. 509 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouUnitReportHourlyDw.java
  83. 35 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/AccountAttributionInfoMapper.java
  84. 13 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/KuaishouAccountReportDailyDwMapper.java
  85. 13 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/KuaishouAccountReportHourlyDwMapper.java
  86. 18 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/KuaishouMaterialVideoReportDailyDwMapper.java
  87. 190 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/AccountAttributionInfoMapper.xml
  88. 26 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/KuaishouAccountReportDailyDwMapper.xml
  89. 23 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/KuaishouAccountReportHourlyDwMapper.xml
  90. 128 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/mapper/xml/KuaishouMaterialVideoReportDailyDwMapper.xml
  91. 28 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/AccountAttributionInfoService.java
  92. 14 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/IKuaishouAccountReportDailyDwService.java
  93. 17 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/IKuaishouMaterialVideoReportDailyDwService.java
  94. 348 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/impl/AccountAttributionInfoServiceImpl.java
  95. 84 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/impl/KuaishouAccountReportDailyDwServiceImpl.java
  96. 35 0
      jeecg-boot-report/src/main/java/cn/com/ctop/report/service/impl/KuaishouMaterialVideoReportDailyDwServiceImpl.java
  97. 4 11
      jeecg-boot-report/src/main/resources/application-dev.yml
  98. 2 3
      jeecg-boot-report/src/main/resources/application-prod.yml
  99. 2 2
      jeecg-boot-report/src/main/resources/application-test.yml
  100. 0 0
      jeecg-boot-report/src/main/resources/application.yml

+ 1 - 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java

@@ -854,7 +854,7 @@ public class QueryGenerator {
 				return "'"+str.substring(0,str.length()-1)+"%'";
 			}
 		}else {
-			if(str.indexOf("%")>=0) {
+			if(str.contains("%")) {
 				if(DataBaseConstant.DB_TYPE_SQLSERVER.equals(getDbType())){
 					if(str.startsWith("'") && str.endsWith("'")){
 						return "N"+str;

+ 7 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java

@@ -114,6 +114,12 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ctop/material/top/cost", "anon");
         filterChainDefinitionMap.put("/dimension/report/*", "anon");
         filterChainDefinitionMap.put("/userAllocation/updateAuthName", "anon");
+        filterChainDefinitionMap.put("/account/report/getProjectAccountByUserId", "anon");
+        filterChainDefinitionMap.put("/account/report/kuaishou/list", "anon");
+        filterChainDefinitionMap.put("/account/report/kuaishou/chart", "anon");
+        filterChainDefinitionMap.put("/material/report/getProjectAccountByUserId", "anon");
+        filterChainDefinitionMap.put("/material/report/kuaishou/list", "anon");
+        filterChainDefinitionMap.put("/material/report/kuaishou/detail", "anon");
 
         filterChainDefinitionMap.put("/v1/**", "anon");
 
@@ -217,6 +223,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/estimatePeopleNumber/**", "anon");
 
         filterChainDefinitionMap.put("/exportReportController/**", "anon");
+        filterChainDefinitionMap.put("/monitor/trackMonitorLogs/**", "anon");
 
         filterChainDefinitionMap.put("/importPolicyController/importPolicyInit", "anon");
         //filterChainDefinitionMap.put("/settLementController/**", "anon");

+ 1 - 1
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/xml/ReportSettlementMapper.xml

@@ -98,7 +98,7 @@
      <if test="uploadYears !=null and uploadYears != ''">
         AND DATE_FORMAT( date_time, '%Y-%m' ) =  #{uploadYears}
     </if>
-    <if test="accountIds !=null and accountIds != ''">
+    <if test='accountIds != null and accountIds.size() > 0'>
         AND account_id in
         <foreach collection="accountIds" item="item" separator=","
                  open="(" close=")">

+ 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);

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

@@ -51,7 +51,7 @@ public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
 
     List<UserAllocation> getAccountListByUserIdAndProductId(@Param("userId") String userId, @Param("projectId") Long projectId, @Param("productId") Long productId);
 
-    List<JSONObject> getUserIdListByProductId(@Param("productId") Long productId);
+    List<JSONObject> getUserIdListByProductId(@Param("productId") Long productId, @Param("userId") String userId);
 
     List<JSONObject> getByAccountIds(@Param("accountIds") JSONArray accountIds);
 
@@ -59,16 +59,20 @@ public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
 
     List<JSONObject> selectAccountsByKuaishouUserId(@Param("userId") Long userId);
 
-    int updateProjectStrategyStatus(@Param("accountId") Long accountId,@Param("projectStrategy") Integer projectStrategy);
+    int updateProjectStrategyStatus(@Param("accountId") Long accountId, @Param("projectStrategy") Integer projectStrategy);
 
     List<Long> queryAutomaticAccounts(@Param("projectId") Long projectId);
 
 
+    Map<String, Object> getCwjsSettlementByAccountId(String accountId);
 
-    Map<String,Object>getCwjsSettlementByAccountId(String accountId);
     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<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);
+
+    List<JSONObject> getAccountListByProjectAndUserId(@Param("projectId") Long projectId, @Param("userId") String userId);
 
     List<Long> getAccountListByProjectId(@Param("projectId") Long projectId);
 }

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

@@ -46,8 +46,9 @@
     <select id="getAccountListByProject" resultType="com.alibaba.fastjson.JSONObject">
        select
        t1.account_id as 'accountId',
-       (select  realname  from sys_user where  id = t1.user_id ) as 'userName',
-       t1.auth_name as 'authName'
+       t1.user_name as 'userName',
+       t1.auth_name as 'authName',
+       t1.account_status as 'accountStatus'
        from ctop_user_allocation t1
        where t1.project_id = #{projectId}
        order by t1.create_time desc
@@ -84,18 +85,47 @@
     GROUP BY t1.user_id;
     </select>
     <select id="getUserIdListByProductId" resultType="com.alibaba.fastjson.JSONObject">
-        SELECT t1.user_id as 'userId',
-               t1.account_id as 'accountId',
-               t1.user_name  as 'userName'
-        from  ctop_kuaishou_advertiser_base_info t1  LEFT JOIN
-              ctop_user_allocation  t2
-              ON t1.account_id = t2.account_id
-                                                     left join
-              ctop_project t3
-                on t2.project_id=t3.id
-        WHERE t3.product_id = #{productId}
-          AND t2.account_status = 0
-        GROUP BY t1.user_id;
+       SELECT
+	*
+FROM
+	(
+		SELECT
+			t4.user_id AS 'userId',
+			t3.account_id AS 'accountId',
+			t3.auth_name AS 'userName',
+			t1.project_name AS 'projectName'
+		FROM
+			ctop_project t1
+		INNER JOIN (
+			SELECT
+				project_id
+			FROM
+				ctop_project_member
+			WHERE
+				project_id IN (
+					SELECT
+						id
+					FROM
+						ctop_project
+					WHERE
+						product_id = #{productId}
+					AND media_id IN (2, 4)
+				)
+        <if test="userId != null and userId != ''">
+            AND user_id = #{userId}
+        </if>
+		) t2 ON t1.id = t2.project_id
+		LEFT JOIN ctop_user_allocation t3 ON t1.id = t3.project_id
+		LEFT JOIN ctop_kuaishou_advertiser_base_info t4 ON t3.account_id = t4.account_id
+		WHERE
+			t1.product_id = #{productId}
+		AND t3.account_status = 0
+		GROUP BY
+			t4.user_id
+	) t
+ORDER BY
+	t.projectName,
+	t.userId
     </select>
 
     <select id="getValidProjectIds" resultType="java.lang.Long">
@@ -246,12 +276,7 @@
           and account_id = #{accountId}
     </select>
 
-    <!-- 根据账户id 查看财务账户 -->
-    <select id="getAccountListByProjectId" resultType="java.lang.Long">
-        select account_id from ctop_user_allocation
-        WHERE account_status = 0
-          AND project_id = #{projectId}
-    </select>
+
 
     <select id="getAccountInfoBySalesId" resultType="cn.com.ctop.common.module.entity.UserAllocation">
         select cua.*
@@ -273,6 +298,37 @@
             </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>
+    <select id="getAccountListByProjectAndUserId" resultType="com.alibaba.fastjson.JSONObject">
+        select
+       t1.account_id as 'accountId',
+       t1.user_name as 'userName',
+       t1.auth_name as 'authName',
+       t1.account_status as 'accountStatus'
+       from ctop_user_allocation t1
+       where t1.project_id = #{projectId}
+        <if test="userId !=null and userId != '' ">
+            and t1.user_id = #{userId}
+        </if>
+       order by t1.create_time desc
+
+
+    </select>
     <!-- 修改状态 -->
     <update id="updCwjsSettlementStatus">
         UPDATE ctop_cwjs_settlement_info
@@ -281,7 +337,11 @@
             id = #{id}
     </update>
 
-
+    <select id="getAccountListByProjectId" resultType="java.lang.Long">
+        select account_id from ctop_user_allocation
+        WHERE account_status = 0
+          AND project_id = #{projectId}
+    </select>
 
 
 </mapper>

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

@@ -83,4 +83,6 @@ public interface IMessageTemplate {
     String getKuaiShouBidMessage(String projectName, Long advertiserId, Long unitId, String unit_name);
 
     String getCopyCampaignMessage(String oldName, String state);
+
+    String getTrackMessage(Long accountId, Long unitId);
 }

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

@@ -4,7 +4,6 @@ import cn.com.ctop.common.module.entity.UserAllocation;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
-import org.apache.ibatis.annotations.Param;
 import org.jeecg.common.api.vo.Result;
 
 import java.util.List;
@@ -46,11 +45,11 @@ public interface IUserAllocationService extends IService<UserAllocation> {
 
     List<Long> getAccountsByDeleteComment();
 
-    List<UserAllocation> getAccountListByUserIdAndProductId(String userId,Long projectId,Long productId);
+    List<UserAllocation> getAccountListByUserIdAndProductId(String userId, Long projectId, Long productId);
 
     Map<Long, List<JSONObject>> getAccountListByProjectList(List<JSONObject> projectList);
 
-    List<JSONObject> getUserIdListByProductId(Long productId);
+    List<JSONObject> getUserIdListByProductId(Long productId, String userId);
 
     /**
      * 获取有效的项目ID集合
@@ -65,11 +64,16 @@ public interface IUserAllocationService extends IService<UserAllocation> {
     List<Long> getKuaiShouUserIdListByProjectId(Long projectId);
 
     List<JSONObject> selectAccountsByKuaishouUserId(Long userId);
+
     boolean updateProjectStrategyStatus(Long accountId, Integer projectStrategy);
 
     List<Long> queryAutomaticAccounts(Long projectId);
 
     Result<UserAllocation> editUserAlloCation(UserAllocation userAllocation);
 
+    Map<Long, List<JSONObject>> getAccountListByProjectListV2(List<JSONObject> projectList);
+
+    List<JSONObject> getAccountListByProjectAndUserId(Long projectId, String userId);
+
     List<Long> getAccountListByProjectId(Long projectId);
 }

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

@@ -208,5 +208,16 @@ public class MessageTemplateImpl implements IMessageTemplate {
         return text.toString();
     }
 
+    @Override
+    public String getTrackMessage(Long accountId, Long unitId) {
+        StringBuilder text = new StringBuilder();
+        text.append("监测链接错误预警").append("<br/>")
+                .append("您的账户:").append(accountId + ",").append("<br/>")
+                .append("下的组:").append(unitId + ",").append("<br/>")
+                .append("监测链接设置错误。").append("<br/>")
+                .append("系统已执行暂停此组操作,请您及时查看!");
+        return text.toString();
+    }
+
 
 }

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

@@ -195,8 +195,36 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
     }
 
     @Override
-    public List<JSONObject> getUserIdListByProductId(Long productId) {
-        return userAllocationMapper.getUserIdListByProductId(productId);
+    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> getAccountListByProjectAndUserId(Long projectId, String userId) {
+        return userAllocationMapper.getAccountListByProjectAndUserId(projectId, userId);
+    }
+
+    @Override
+    public List<JSONObject> getUserIdListByProductId(Long productId,String userId) {
+        return userAllocationMapper.getUserIdListByProductId(productId,userId);
     }
 
     @Override
@@ -287,9 +315,9 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
             }
 
             //同步 财务结算 状态
-            Map<String,Object> cwjs = userAllocationMapper.getCwjsSettlementByAccountId(String.valueOf(userAllocationEntity.getAccountId()));
-            if (!Check.isNull(cwjs)){
-                userAllocationMapper.updCwjsSettlementStatus(cwjs.get("id").toString(),accountStatus);
+            Map<String, Object> cwjs = userAllocationMapper.getCwjsSettlementByAccountId(String.valueOf(userAllocationEntity.getAccountId()));
+            if (!Check.isNull(cwjs)) {
+                userAllocationMapper.updCwjsSettlementStatus(cwjs.get("id").toString(), accountStatus);
             }
             LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
             SysLog sysLog = new SysLog();

+ 221 - 223
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java

@@ -8,35 +8,14 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
 import cn.com.ctop.common.module.utils.PropertiesUtils;
-import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaiShouAppInfo;
-import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
-import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouCampaignLevelOperationRecord;
-import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouCreativeLevelOperationRecord;
-import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouUnitLevelOperationRecord;
-import cn.com.ctop.kuaishou.modules.ai.entity.KuaiShouAppMultipleBids;
-import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountCreativeOverrunInfo;
+import cn.com.ctop.kuaishou.modules.ai.entity.*;
 import cn.com.ctop.kuaishou.modules.ai.enums.KuaishouCreativeAdsenceTypeEnum;
 import cn.com.ctop.kuaishou.modules.ai.enums.KuaishouCreativeMatTypeEnum;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaiShouAppInfoService;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCampaignLevelOperationRecordService;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCreateCreativeService;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCreativeLevelOperationRecordService;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouUnitLevelOperationRecordService;
-import cn.com.ctop.kuaishou.modules.ai.service.IKuaiShouAppMultipleBidsService;
-import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAccountCreativeOverrunInfoService;
-import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouLandpagePackageService;
+import cn.com.ctop.kuaishou.modules.ai.service.*;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAppList;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouImageGet;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouAppListService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCampaignService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupTemplateService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouImageGetService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouMaterialUploadService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouUpdateService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouVideoGetService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannel;
 import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannelItems;
 import cn.com.ctop.kuaishou.modules.channel.service.IKuaishouChannelService;
@@ -54,14 +33,7 @@ import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.UUID;
+import java.util.*;
 
 @Slf4j
 @Service
@@ -302,12 +274,14 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                     appName = appInfo.getAppName();
                 }
             }
+            KuaishouChannel channel = null;
+            KuaishouChannel usedchannel = null;
+            Long newCampaignId = null;
             //渠道号应用层级,account-账户,plan-计划,group-组
             String level = strategy.getUsageLevel();
             Integer useChannel = strategy.getUseChannel();//0不使用,1使用
-            KuaishouChannel channel = null;
-            if (!Check.isNull(useChannel) && useChannel == 1 && ("account".equals(level) || "plan".equals(level))) {
-                try {
+            try {
+                if (!Check.isNull(useChannel) && useChannel == 1 && ("account".equals(level) || "plan".equals(level))) {
                     Result<Object> result = channelService.queryChannel(accountId, level, appName, null);
                     Integer code = result.getCode();
                     if (code == 200) {
@@ -322,113 +296,123 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                         log.error("通过账户(" + accountId + ")未获取到渠道号!!!");
                         return videoCnt;
                     }
-                } catch (Exception e) {
-                    e.printStackTrace();
                 }
-            }
-            Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid, channel);
-            if (null == newCampaignId) {
-                return videoCnt;
-            }
-            KuaishouChannel usedchannel = null;
-            if (useChannel == 1) {
-                strategy.setMaterialKeyword(null);
-                if (!"group".equals(level)) {
-                    usedchannel = channelService.queryUsedChannel(accountId, newCampaignId, level);
-                    if (Check.isNull(usedchannel)) {
-                        if ("account".equals(level)) {
-                            usedchannel = channel;
-                        } else {
-                            return videoCnt;
-                        }
+                newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid, channel);
+                if (null == newCampaignId) {
+                    if (!Check.isNull(channel)) {
+                        channelService.callBackUpdateChannelRel(level, channel.getChannelCode(), accountId, newCampaignId, null, 0);
                     }
-                    List<KuaishouChannelItems> items = usedchannel.getItems();
-                    if (!Check.isNull(items) && !items.isEmpty()) {
-                        strategy.setMaterialKeyword(items.get(0).getKeyword());
+                    return videoCnt;
+                }
+                if (useChannel == 1) {
+                    strategy.setMaterialKeyword(null);
+                    if (!"group".equals(level)) {
+                        usedchannel = channelService.queryUsedChannel(accountId, newCampaignId, level);
+                        if (Check.isNull(usedchannel)) {
+                            if ("account".equals(level)) {
+                                usedchannel = channel;
+                            } else {
+                                if (!Check.isNull(channel)) {
+                                    channelService.callBackUpdateChannelRel(level, channel.getChannelCode(), accountId, newCampaignId, null, 0);
+                                }
+                                return videoCnt;
+                            }
+                        }
+                        List<KuaishouChannelItems> items = usedchannel.getItems();
+                        if (!Check.isNull(items) && !items.isEmpty()) {
+                            strategy.setMaterialKeyword(items.get(0).getKeyword());
+                        }
                     }
                 }
-            }
-            List<KuaiShouVideoGet> newVideos = getVideosByParams(strategy, startTime, endTime, null, createType, videoCnt);
-            if (null == newVideos || newVideos.isEmpty()) {
-                log.info("账户:{},{} 到 {} 未获取到相应素材({})", accountId, startTime, endTime, replaceString);
-                return videoCnt;
-            }
-            //3、在“上新”计划中新增广告组,一个素材搭配n张封面,组成一个广告组
-            for (KuaiShouVideoGet videoItem : newVideos) {
-                Boolean unitOverrun = getUnitOverrun(accountId);
-                if (unitOverrun) {
-                    log.error("组创建超限,accountId:{}", accountId);
-                    return 0L;
+                List<KuaiShouVideoGet> newVideos = getVideosByParams(strategy, startTime, endTime, null, createType, videoCnt);
+                if (null == newVideos || newVideos.isEmpty()) {
+                    log.info("账户:{},{} 到 {} 未获取到相应素材({})", accountId, startTime, endTime, replaceString);
+                    return videoCnt;
                 }
+                //3、在“上新”计划中新增广告组,一个素材搭配n张封面,组成一个广告组
+                for (KuaiShouVideoGet videoItem : newVideos) {
+                    Boolean unitOverrun = getUnitOverrun(accountId);
+                    if (unitOverrun) {
+                        log.error("组创建超限,accountId:{}", accountId);
+                        return 0L;
+                    }
 
-                KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId, DateUtils.formatDate(new Date()));
-                if (null != overrunInfo) {
-                    return 0L;
-                }
-                // 每个组,搭配5个创意
-                List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
-                if ((null == cutFrameList || cutFrameList.isEmpty())) {
-                    log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
-                    continue;
-                }
-                //获取组级渠道号
-                if (!Check.isNull(useChannel) && useChannel == 1 && "group".equals(level)) {
-                    try {
-                        Result<Object> result = channelService.queryChannel(accountId, level, appName, videoItem.getPhotoName());
-                        Integer code = result.getCode();
-                        if (code == 200) {
-                            usedchannel = (KuaishouChannel) result.getResult();
-                            if (Check.isNull(usedchannel)) {
-                                log.info("(组级)账户:{}素材名称({}),{}",accountId,videoItem.getPhotoName(), result.getMessage());
-                                continue;
+                    KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId, DateUtils.formatDate(new Date()));
+                    if (null != overrunInfo) {
+                        return 0L;
+                    }
+                    // 每个组,搭配5个创意
+                    List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
+                    if ((null == cutFrameList || cutFrameList.isEmpty())) {
+                        log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
+                        continue;
+                    }
+                    //获取组级渠道号
+                    if (!Check.isNull(useChannel) && useChannel == 1 && "group".equals(level)) {
+                        try {
+                            Result<Object> result = channelService.queryChannel(accountId, level, appName, videoItem.getPhotoName());
+                            Integer code = result.getCode();
+                            if (code == 200) {
+                                usedchannel = (KuaishouChannel) result.getResult();
+                                if (Check.isNull(usedchannel)) {
+                                    log.info("(组级)账户:{}素材名称({}),{}", accountId, videoItem.getPhotoName(), result.getMessage());
+                                    continue;
+                                } else {
+                                    log.info("(组级)获取到渠道号:{}", usedchannel.getChannelCode());
+                                }
                             } else {
-                                log.info("(组级)获取到渠道号:{}", usedchannel.getChannelCode());
+                                log.error("(组级)账户:{}素材名称({}),未获取到渠道号!!!", accountId, videoItem.getPhotoName());
+                                continue;
                             }
-                        } else {
-                            log.error("(组级)账户:{}素材名称({}),未获取到渠道号!!!",accountId,videoItem.getPhotoName());
-                            continue;
+                        } catch (Exception e) {
+                            e.printStackTrace();
                         }
-                    } catch (Exception e) {
-                        e.printStackTrace();
                     }
-                }
-                String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appId, usedchannel);
-                JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId, usedchannel);
-                log.info("创建广告组入参:{}", unitParams);
-                Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
-                Integer unitCode = (Integer) unitCreateResult.get("code");
-                String unitMessage = (String) unitCreateResult.get("message");
-                AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
-                BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
-                unitLevelOperationRecord.setGroupName(unitName);
-                unitLevelOperationRecord.setCampaignId(newCampaignId);
-                unitLevelOperationRecord.setCpaBid(unitParams.getInteger("cpa_bid"));
-                unitLevelOperationRecord.setBid(unitParams.getInteger("bid"));
-                unitLevelOperationRecord.setDeepConversionBid(unitParams.getInteger("deep_conversion_bid"));
-                unitLevelOperationRecord.setCreateTime(new Date());
-                unitLevelOperationRecord.setStatus(unitCode);
-                unitLevelOperationRecord.setMessage(unitMessage);
-                unitLevelOperationRecord.setCampaignId(newCampaignId);
-                unitLevelOperationRecord.setAiStrategyUuid(strategyUuid);
-                if (unitCode != 0) {
-                    log.info("组创建失败=>accountId:{};message:{}", accountId, unitMessage);
+                    String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appId, usedchannel);
+                    JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId, usedchannel);
+                    log.info("创建广告组入参:{}", unitParams);
+                    Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
+                    Integer unitCode = (Integer) unitCreateResult.get("code");
+                    String unitMessage = (String) unitCreateResult.get("message");
+                    AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
+                    BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
+                    unitLevelOperationRecord.setGroupName(unitName);
+                    unitLevelOperationRecord.setCampaignId(newCampaignId);
+                    unitLevelOperationRecord.setCpaBid(unitParams.getInteger("cpa_bid"));
+                    unitLevelOperationRecord.setBid(unitParams.getInteger("bid"));
+                    unitLevelOperationRecord.setDeepConversionBid(unitParams.getInteger("deep_conversion_bid"));
+                    unitLevelOperationRecord.setCreateTime(new Date());
+                    unitLevelOperationRecord.setStatus(unitCode);
+                    unitLevelOperationRecord.setMessage(unitMessage);
+                    unitLevelOperationRecord.setCampaignId(newCampaignId);
+                    unitLevelOperationRecord.setAiStrategyUuid(strategyUuid);
+                    if (unitCode != 0) {
+                        log.info("组创建失败=>accountId:{};message:{}", accountId, unitMessage);
+                        unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
+                        if (!Check.isNull(usedchannel)) {
+                            channelService.callBackUpdateChannelRel(level, usedchannel.getChannelCode(), accountId, newCampaignId, null, 0);
+                        }
+                        continue;
+                    }
+                    Long unitId = (Long) unitCreateResult.get("unitId");
+                    unitLevelOperationRecord.setUnitId(unitId);
                     unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
+                    videoCnt--;
                     if (!Check.isNull(usedchannel)) {
-                        channelService.callBackUpdateChannelRel(level, usedchannel.getChannelCode(), accountId, newCampaignId, null, 0);
+                        channelService.callBackUpdateChannelRel(level, usedchannel.getChannelCode(), accountId, newCampaignId, unitId, 1);
                     }
-                    continue;
+                    JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy, usedchannel);//TODO 添加素材
+                    createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, null);
+                    if (videoCnt <= 0) {
+                        return 0L;
+                    }
+
                 }
-                Long unitId = (Long) unitCreateResult.get("unitId");
-                unitLevelOperationRecord.setUnitId(unitId);
-                unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
-                videoCnt--;
+            } catch (Exception e) {
+                e.printStackTrace();
+                log.error("创建自定义广告组异常", e);
                 if (!Check.isNull(usedchannel)) {
-                    channelService.callBackUpdateChannelRel(level, usedchannel.getChannelCode(), accountId, newCampaignId, unitId, 1);
-                }
-                JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy, usedchannel);//TODO 添加素材
-                createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, null);
-                if (videoCnt <= 0) {
-                    return 0L;
+                    channelService.callBackUpdateChannelRel(level, usedchannel.getChannelCode(), accountId, newCampaignId, null, 0);
                 }
             }
         }
@@ -662,8 +646,10 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
             String level = strategy.getUsageLevel();
             Integer useChannel = strategy.getUseChannel();//0不使用,1使用
             KuaishouChannel channel = null;
-            if (!Check.isNull(useChannel) && useChannel == 1 && ("account".equals(level) || "plan".equals(level))) {
-                try {
+            KuaishouChannel usedchannel = null;
+            Long newCampaignId = null;
+            try {
+                if (!Check.isNull(useChannel) && useChannel == 1 && ("account".equals(level) || "plan".equals(level))) {
                     Result<Object> result = channelService.queryChannel(accountId, level, appName, null);
                     Integer code = result.getCode();
                     if (code == 200) {
@@ -678,114 +664,123 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                         log.error("通过账户(" + accountId + ")未获取到渠道号!!!");
                         return;
                     }
-                } catch (Exception e) {
-                    e.printStackTrace();
                 }
-            }
-            Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid, channel);
-            if (null == newCampaignId) {
-                return;
-            }
-            KuaishouChannel usedchannel = null;
-            if (useChannel == 1) {
-                strategy.setMaterialKeyword(null);
-                if (!"group".equals(level)) {
-                    usedchannel = channelService.queryUsedChannel(accountId, newCampaignId, level);
-                    if (Check.isNull(usedchannel)) {
-                        if ("account".equals(level)) {
-                            usedchannel = channel;
-                        } else {
-                            return;
-                        }
+                newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid, channel);
+                if (null == newCampaignId) {
+                    if (!Check.isNull(channel)) {
+                        channelService.callBackUpdateChannelRel(level, channel.getChannelCode(), accountId, newCampaignId, null, 0);
                     }
-                    List<KuaishouChannelItems> items = usedchannel.getItems();
-                    if (!Check.isNull(items) && !items.isEmpty()) {
-                        strategy.setMaterialKeyword(items.get(0).getKeyword());
+                    return;
+                }
+                if (useChannel == 1) {
+                    strategy.setMaterialKeyword(null);
+                    if (!"group".equals(level)) {
+                        usedchannel = channelService.queryUsedChannel(accountId, newCampaignId, level);
+                        if (Check.isNull(usedchannel)) {
+                            if ("account".equals(level)) {
+                                usedchannel = channel;
+                            } else {
+                                if (!Check.isNull(channel)) {
+                                    channelService.callBackUpdateChannelRel(level, channel.getChannelCode(), accountId, newCampaignId, null, 0);
+                                }
+                                return;
+                            }
+                        }
+                        List<KuaishouChannelItems> items = usedchannel.getItems();
+                        if (!Check.isNull(items) && !items.isEmpty()) {
+                            strategy.setMaterialKeyword(items.get(0).getKeyword());
+                        }
                     }
                 }
-            }
-            List<KuaiShouVideoGet> allVideos = getVideosByParams(strategy, startTime, endTime, null, createType, videoCnt);
-            if (null == allVideos) {
-                return;
-            }
-            //创意
-            List<List<KuaiShouVideoGet>> splitVideos = Lists.partition(allVideos, 5);
-            for (int j = 1; j < splitVideos.size() + 1; j++) {
-                Boolean unitOverrun = getUnitOverrun(accountId);
-                if (unitOverrun) {
-                    log.error("组创建超限,accountId:{}", accountId);
+                List<KuaiShouVideoGet> allVideos = getVideosByParams(strategy, startTime, endTime, null, createType, videoCnt);
+                if (null == allVideos) {
                     return;
                 }
-
-                Object redisObj = redisUtil.get(key);
-                if (!Check.isNull(redisObj)) {
-                    Integer value = (Integer) redisObj;
-                    if (value == 1) {
-                        log.error("程序化创意创建超限,accountId:{}", strategy.getAccountId());
+                //创意
+                List<List<KuaiShouVideoGet>> splitVideos = Lists.partition(allVideos, 5);
+                for (int j = 1; j < splitVideos.size() + 1; j++) {
+                    Boolean unitOverrun = getUnitOverrun(accountId);
+                    if (unitOverrun) {
+                        log.error("组创建超限,accountId:{}", accountId);
                         return;
                     }
-                }
-                //获取组级渠道号
-                if (!Check.isNull(useChannel) && useChannel == 1 && "group".equals(level)) {
-                    try {
-                        KuaiShouVideoGet videoGet = splitVideos.get(1).get(0);
-                        if (Check.isNull(videoGet)) {
+
+                    Object redisObj = redisUtil.get(key);
+                    if (!Check.isNull(redisObj)) {
+                        Integer value = (Integer) redisObj;
+                        if (value == 1) {
+                            log.error("程序化创意创建超限,accountId:{}", strategy.getAccountId());
                             return;
                         }
-                        Result<Object> result = channelService.queryChannel(accountId, level, appName, videoGet.getPhotoName());
-                        Integer code = result.getCode();
-                        if (code == 200) {
-                            usedchannel = (KuaishouChannel) result.getResult();
-                            if (Check.isNull(usedchannel)) {
-                                log.info("(组级)账户:{}素材名称({}),{}",accountId,videoGet.getPhotoName(), result.getMessage());
-                                continue;
+                    }
+                    //获取组级渠道号
+                    if (!Check.isNull(useChannel) && useChannel == 1 && "group".equals(level)) {
+                        try {
+                            KuaiShouVideoGet videoGet = splitVideos.get(1).get(0);
+                            if (Check.isNull(videoGet)) {
+                                return;
+                            }
+                            Result<Object> result = channelService.queryChannel(accountId, level, appName, videoGet.getPhotoName());
+                            Integer code = result.getCode();
+                            if (code == 200) {
+                                usedchannel = (KuaishouChannel) result.getResult();
+                                if (Check.isNull(usedchannel)) {
+                                    log.info("(组级)账户:{}素材名称({}),{}", accountId, videoGet.getPhotoName(), result.getMessage());
+                                    continue;
+                                } else {
+                                    log.info("(组级)获取到渠道号:{}", usedchannel.getChannelCode());
+                                }
                             } else {
-                                log.info("(组级)获取到渠道号:{}", usedchannel.getChannelCode());
+                                log.error("(组级)账户:{}素材名称({}),未获取到渠道号!!!", accountId, videoGet.getPhotoName());
+                                continue;
                             }
-                        } else {
-                            log.error("(组级)账户:{}素材名称({}),未获取到渠道号!!!",accountId,videoGet.getPhotoName());
-                            continue;
+                        } catch (Exception e) {
+                            e.printStackTrace();
                         }
-                    } catch (Exception e) {
-                        e.printStackTrace();
                     }
-                }
 
-                //创建组
-                String unitName = getName(strategy.getGroupName(), strategy, createType, null, "unit", newCampaignId, appId, usedchannel);
-                JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId, usedchannel);
-                log.info("创建广告组入参:{}", unitParams);
-                Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
-                Integer unitCode = (Integer) unitCreateResult.get("code");
-                String unitMessage = (String) unitCreateResult.get("message");
-                AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
-                BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
-                unitLevelOperationRecord.setGroupName(unitName);
-                unitLevelOperationRecord.setCampaignId(newCampaignId);
-                unitLevelOperationRecord.setCpaBid(unitParams.getInteger("cpa_bid"));
-                unitLevelOperationRecord.setBid(unitParams.getInteger("bid"));
-                unitLevelOperationRecord.setDeepConversionBid(unitParams.getInteger("deep_conversion_bid"));
-                unitLevelOperationRecord.setCreateTime(new Date());
-                unitLevelOperationRecord.setStatus(unitCode);
-                unitLevelOperationRecord.setMessage(unitMessage);
-                unitLevelOperationRecord.setCampaignId(newCampaignId);
-                unitLevelOperationRecord.setAiStrategyUuid(strategyUuid);
-                if (unitCode != 0) {
-                    log.info("组创建失败=>accountId:{};message:{}", accountId, unitMessage);
+                    //创建组
+                    String unitName = getName(strategy.getGroupName(), strategy, createType, null, "unit", newCampaignId, appId, usedchannel);
+                    JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId, usedchannel);
+                    log.info("创建广告组入参:{}", unitParams);
+                    Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
+                    Integer unitCode = (Integer) unitCreateResult.get("code");
+                    String unitMessage = (String) unitCreateResult.get("message");
+                    AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
+                    BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
+                    unitLevelOperationRecord.setGroupName(unitName);
+                    unitLevelOperationRecord.setCampaignId(newCampaignId);
+                    unitLevelOperationRecord.setCpaBid(unitParams.getInteger("cpa_bid"));
+                    unitLevelOperationRecord.setBid(unitParams.getInteger("bid"));
+                    unitLevelOperationRecord.setDeepConversionBid(unitParams.getInteger("deep_conversion_bid"));
+                    unitLevelOperationRecord.setCreateTime(new Date());
+                    unitLevelOperationRecord.setStatus(unitCode);
+                    unitLevelOperationRecord.setMessage(unitMessage);
+                    unitLevelOperationRecord.setCampaignId(newCampaignId);
+                    unitLevelOperationRecord.setAiStrategyUuid(strategyUuid);
+                    if (unitCode != 0) {
+                        log.info("组创建失败=>accountId:{};message:{}", accountId, unitMessage);
+                        unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
+                        if (!Check.isNull(usedchannel)) {
+                            channelService.callBackUpdateChannelRel(level, usedchannel.getChannelCode(), accountId, newCampaignId, null, 0);
+                        }
+                        continue;
+                    }
+                    Long unitId = (Long) unitCreateResult.get("unitId");
+                    unitLevelOperationRecord.setUnitId(unitId);
                     unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
                     if (!Check.isNull(usedchannel)) {
-                        channelService.callBackUpdateChannelRel(level, usedchannel.getChannelCode(), accountId, newCampaignId, null, 0);
+                        channelService.callBackUpdateChannelRel(level, usedchannel.getChannelCode(), accountId, newCampaignId, unitId, 1);
                     }
-                    return;
+                    JSONObject creativeParams = programCreativeParams(token, unitId, splitVideos.get(j - 1), strategy, j, null, usedchannel);
+                    createProgramCreative(token, creativeParams, strategy);
                 }
-                Long unitId = (Long) unitCreateResult.get("unitId");
-                unitLevelOperationRecord.setUnitId(unitId);
-                unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
-                if (!Check.isNull(channel)) {
-                    channelService.callBackUpdateChannelRel(level, channel.getChannelCode(), accountId, newCampaignId, unitId, 1);
+            } catch (Exception e) {
+                e.printStackTrace();
+                log.error("创建程序化广告组异常", e);
+                if (!Check.isNull(usedchannel)) {
+                    channelService.callBackUpdateChannelRel(level, usedchannel.getChannelCode(), accountId, newCampaignId, null, 0);
                 }
-                JSONObject creativeParams = programCreativeParams(token, unitId, splitVideos.get(j - 1), strategy, j, null, usedchannel);
-                createProgramCreative(token, creativeParams, strategy);
             }
         }
 
@@ -1058,14 +1053,17 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         }
         String appVersion = null;
         if (Check.isNull(strategy.getMaterialKeyword())) {
-            if (!Check.isNull(appInfo.getAppVersion())) {
-                String[] split = appInfo.getAppVersion().split("-");
-                if (split.length > 1) {
-                    appVersion = split[1];
-                } else {
-                    return null;
+            if (!Check.isNull(appInfo)) {
+                if (!Check.isNull(appInfo.getAppVersion())) {
+                    String[] split = appInfo.getAppVersion().split("-");
+                    if (split.length > 1) {
+                        appVersion = split[1];
+                    } else {
+                        return null;
+                    }
                 }
             }
+
         } else { //  tt语音 特殊素材查询
             appVersion = strategy.getMaterialKeyword();
         }

+ 4 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/vo/ConvertVo.java

@@ -31,5 +31,9 @@ public class ConvertVo implements Serializable {
     private String createTime;
     @JsonProperty("update_time")
     private String updateTime;
+    @JsonProperty("sdk_id")
+    private Integer sdkId;
+    @JsonProperty("activation")
+    private Integer activation;
 
 }

+ 5 - 5
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouImageGetMapper.xml

@@ -6,11 +6,11 @@
         replace into ctop_kuaishou_image_get(
         id,
         account_id,
-        url,
-        width,
-        height,
-        size,
-        format,
+        `url`,
+        `width`,
+        `height`,
+        `size`,
+        `format`,
         material_type,
         signature,
         image_token,

+ 5 - 15
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelItemsServiceImpl.java

@@ -3,7 +3,6 @@ package cn.com.ctop.kuaishou.modules.channel.service.impl;
 import cn.com.ctop.common.module.mapper.ProjectMapper;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.ExportExcelUtils;
-import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAppPackage;
 import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannelItems;
 import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannelItemsRel;
 import cn.com.ctop.kuaishou.modules.channel.mapper.KuaishouChannelItemsMapper;
@@ -14,10 +13,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.PageInfo;
-import org.apache.poi.hssf.usermodel.HSSFCell;
-import org.apache.poi.hssf.usermodel.HSSFDateUtil;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
@@ -26,16 +22,11 @@ import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.common.util.MD5Util;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
-import java.io.IOException;
-import java.text.DecimalFormat;
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -108,15 +99,14 @@ public class KuaishouChannelItemsServiceImpl extends ServiceImpl<KuaishouChannel
                 continue;
             }
             QueryWrapper<KuaishouChannelItemsRel> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("channel_id", object.getLong("channelId"));
-            queryWrapper.eq("item_id", object.getLong("id")).last("limit 1");
+            queryWrapper.eq("channel_id", object.getLong("channelId")).last("limit 1");
             KuaishouChannelItemsRel one = channelItemsRelService.getOne(queryWrapper);
             if (Check.isNull(one)) {
-                KuaishouChannelItemsRel rel = new KuaishouChannelItemsRel();
-                rel.setItemId(object.getLong("id"));
-                rel.setChannelId(object.getLong("channelId"));
-                channelItemsRelService.save(rel);
+                one = new KuaishouChannelItemsRel();
             }
+            one.setItemId(object.getLong("id"));
+            one.setChannelId(object.getLong("channelId"));
+            channelItemsRelService.saveOrUpdate(one);
         }
         return Result.ok("绑定成功");
     }

+ 94 - 73
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelServiceImpl.java

@@ -54,12 +54,10 @@ import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
 
 /**
  * 渠道号信息表
@@ -123,8 +121,6 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
     private static final String NUMBER_STR = "{{编号}}";
     private static final String CHANNEL = "_channel_FLAG";
 
-    static ExecutorService executorService = Executors.newFixedThreadPool(5);
-
 
     @Override
     public Result<Object> channelManagementHome(Long productId, Long projectId, Long accountId, String userId) {
@@ -329,41 +325,47 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
                     }
                 } else {
                     /**-----------------项目维度:使用层级是计划、组-----------------*/
-                    accountList.forEach(accountId -> executorService.submit(() -> {
-                        //获取token
-                        CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
-                        //获取应用图片token
-                        JSONObject tokenJson = appInfoService.uploadAppIconImage(strategy.getAppIconUrl(), token.getAccountId(), token.getAccessToken());
-                        if (!Check.isNull(tokenJson) && tokenJson.getInteger("code") != 0) {
-                            log.error("通过账户ID(" + token.getAccountId() + ")获取图片Token失败,返回信息:" + tokenJson.getString("message"));
-                        }
-                        //使用范围是账户时,查询旧app来做匹配
-                        kuaishouInterfaceService.getAppList(accountId, token.getAccessToken());
-                        List<KuaiShouAppList> oldAppList = kuaiShouAppListService.getAppListByAccountId(accountId);
-                        strategy.setImageToken(tokenJson.getString("imageToken"));
-                        strategy.setAccountId(accountId);
-                        if (url.contains(CHANNEL_STR)) {
-                            for (int i = numberMin; i <= numberMax; i++) {
-                                try {
-                                    KuaishouChannelCreateStrategy replaceData = replaceWildcard(strategy, i);
-                                    createApp(replaceData, token, oldAppList);
-                                    createChannel(replaceData, i, 1);
-                                } catch (Exception e) {
-                                    e.printStackTrace();
+                    Thread thread = new Thread() {
+                        @Override
+                        public void run() {
+                            for (Long accountId : accountList) {
+                                //获取token
+                                CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+                                //获取应用图片token
+                                JSONObject tokenJson = appInfoService.uploadAppIconImage(strategy.getAppIconUrl(), token.getAccountId(), token.getAccessToken());
+                                if (!Check.isNull(tokenJson) && tokenJson.getInteger("code") != 0) {
+                                    log.error("通过账户ID(" + token.getAccountId() + ")获取图片Token失败,返回信息:" + tokenJson.getString("message"));
                                 }
-                            }
-                        } else {
-                            try {
-                                createApp(strategy, token, oldAppList);
-                                for (int i = numberMin; i <= numberMax; i++) {
-                                    KuaishouChannelCreateStrategy replaceData = replaceWildcard(strategy, i);
-                                    createChannel(replaceData, i, 1);
+                                //使用范围是账户时,查询旧app来做匹配
+                                kuaishouInterfaceService.getAppList(accountId, token.getAccessToken());
+                                List<KuaiShouAppList> oldAppList = kuaiShouAppListService.getAppListByAccountId(accountId);
+                                strategy.setImageToken(tokenJson.getString("imageToken"));
+                                strategy.setAccountId(accountId);
+                                if (url.contains(CHANNEL_STR)) {
+                                    for (int i = numberMin; i <= numberMax; i++) {
+                                        try {
+                                            KuaishouChannelCreateStrategy replaceData = replaceWildcard(strategy, i);
+                                            createApp(replaceData, token, oldAppList);
+                                            createChannel(replaceData, i, 1);
+                                        } catch (Exception e) {
+                                            e.printStackTrace();
+                                        }
+                                    }
+                                } else {
+                                    try {
+                                        createApp(strategy, token, oldAppList);
+                                        for (int i = numberMin; i <= numberMax; i++) {
+                                            KuaishouChannelCreateStrategy replaceData = replaceWildcard(strategy, i);
+                                            createChannel(replaceData, i, 1);
+                                        }
+                                    } catch (Exception e) {
+                                        e.printStackTrace();
+                                    }
                                 }
-                            } catch (Exception e) {
-                                e.printStackTrace();
                             }
                         }
-                    }));
+                    };
+                    thread.start();
                 }
             } else {
                 /**==========================范围是 账户==========================*/
@@ -379,25 +381,38 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
                 List<KuaiShouAppList> oldAppList = kuaiShouAppListService.getAppListByAccountId(token.getAccountId());
                 strategy.setImageToken(tokenJson.getString("imageToken"));
                 if (url.contains(CHANNEL_STR)) {
-                    ilist.forEach(i -> executorService.submit(() -> {
-                        try {
-                            KuaishouChannelCreateStrategy replaceData = replaceWildcard(strategy, i);
-                            createApp(replaceData, token, oldAppList);
-                            createChannel(replaceData, i, 1);
-                        } catch (Exception e) {
-                            e.printStackTrace();
+                    Thread thread = new Thread() {
+                        @Override
+                        public void run() {
+                            try {
+                                for (int i = numberMin; i <= numberMax; i++) {
+                                    KuaishouChannelCreateStrategy replaceData = replaceWildcard(strategy, i);
+                                    createApp(replaceData, token, oldAppList);
+                                    createChannel(replaceData, i, 1);
+                                }
+
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
                         }
-                    }));
+                    };
+                    thread.start();
                 } else {
                     createApp(strategy, token, oldAppList);
-                    ilist.forEach(i -> executorService.submit(() -> {
-                        try {
-                            KuaishouChannelCreateStrategy replaceData = replaceWildcard(strategy, i);
-                            createChannel(replaceData, i, 1);
-                        } catch (Exception e) {
-                            e.printStackTrace();
+                    Thread thread = new Thread() {
+                        @Override
+                        public void run() {
+                            try {
+                                for (int i = numberMin; i <= numberMax; i++) {
+                                    KuaishouChannelCreateStrategy replaceData = replaceWildcard(strategy, i);
+                                    createChannel(replaceData, i, 1);
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
                         }
-                    }));
+                    };
+                    thread.start();
                 }
             }
         } catch (Exception e) {
@@ -913,26 +928,32 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
                         }
                     } else {
                         /**-----------------项目维度:使用层级是计划、组-----------------*/
-                        accountList.forEach(accountId -> executorService.submit(() -> {
-                            //获取token
-                            CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
-                            //获取应用图片token
-                            JSONObject tokenJson = appInfoService.uploadAppIconImage(strategy.getAppIconUrl(), token.getAccountId(), token.getAccessToken());
-                            if (!Check.isNull(tokenJson) && tokenJson.getInteger("code") != 0) {
-                                log.error("通过账户ID(" + token.getAccountId() + ")获取图片Token失败,返回信息:" + tokenJson.getString("message"));
-                            }
-                            //使用范围是账户时,查询旧app来做匹配
-                            kuaishouInterfaceService.getAppList(token.getAccountId(), token.getAccessToken());
-                            List<KuaiShouAppList> oldAppList = kuaiShouAppListService.getAppListByAccountId(accountId);
-                            strategy.setImageToken(tokenJson.getString("imageToken"));
-                            strategy.setAccountId(accountId);
-                            try {
-                                createApp(strategy, token, oldAppList);
-                                createChannel(strategy, 0, 1);
-                            } catch (Exception e) {
-                                e.printStackTrace();
+                        Thread thread = new Thread() {
+                            @Override
+                            public void run() {
+                                for (Long accountId : accountList) {
+                                    //获取token
+                                    CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+                                    //获取应用图片token
+                                    JSONObject tokenJson = appInfoService.uploadAppIconImage(strategy.getAppIconUrl(), token.getAccountId(), token.getAccessToken());
+                                    if (!Check.isNull(tokenJson) && tokenJson.getInteger("code") != 0) {
+                                        log.error("通过账户ID(" + token.getAccountId() + ")获取图片Token失败,返回信息:" + tokenJson.getString("message"));
+                                    }
+                                    //使用范围是账户时,查询旧app来做匹配
+                                    kuaishouInterfaceService.getAppList(token.getAccountId(), token.getAccessToken());
+                                    List<KuaiShouAppList> oldAppList = kuaiShouAppListService.getAppListByAccountId(accountId);
+                                    strategy.setImageToken(tokenJson.getString("imageToken"));
+                                    strategy.setAccountId(accountId);
+                                    try {
+                                        createApp(strategy, token, oldAppList);
+                                        createChannel(strategy, 0, 1);
+                                    } catch (Exception e) {
+                                        e.printStackTrace();
+                                    }
+                                }
                             }
-                        }));
+                        };
+                        thread.start();
                     }
                 } else {
                     /**==========================范围是 账户==========================*/
@@ -1035,8 +1056,9 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
             queryWrapper.eq("channel_code", channelCode).last("limit 1");
             KuaishouChannel one = this.getOne(queryWrapper);
             if (!Check.isNull(one)) {
+                one.setUpdateTime(new Date());
+                one.setChannelLock(1);
                 if (0 == state) {
-                    one.setChannelLock(1);
                     this.saveOrUpdate(one);
                 } else {
                     QueryWrapper<KuaishouChannelRel> relqueryWrapper = new QueryWrapper<>();
@@ -1049,16 +1071,15 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
                         }
                         rel.setCampaignId(planId);
                         rel.setUnitId(groupId);
+                        rel.setUpdateTime(new Date());
                         channelRelService.save(rel);
                         if ("plan".equals(level)) {
                             Integer usageTimes = channelRelService.queryUsePlanCount(accountId, channelCode);
                             one.setUsageTimes(usageTimes);
-                            one.setChannelLock(1);
                             this.saveOrUpdate(one);
                         } else if ("group".equals(level)) {
                             Integer usageTimes = channelRelService.queryUseGroupCount(accountId, channelCode);
                             one.setUsageTimes(usageTimes);
-                            one.setChannelLock(1);
                             this.saveOrUpdate(one);
                         }
                     }

+ 302 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/controller/ProjectMonitorWhiteListController.java

@@ -0,0 +1,302 @@
+package cn.com.ctop.kuaishou.modules.clean.controller;
+
+
+import cn.com.ctop.common.module.entity.Project;
+import cn.com.ctop.common.module.service.IProjectService;
+import cn.com.ctop.common.module.service.ISysUserService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.clean.entity.ProjectMonitorWhiteList;
+import cn.com.ctop.kuaishou.modules.clean.service.IProjectMonitorWhiteListService;
+import cn.com.ctop.kuaishou.modules.clean.service.ITrackMonitorConfigureService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.entity.SysUser;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 监测链接预警-项目白名单
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-09-23
+ */
+@Slf4j
+@Api(tags = "监测链接预警-项目白名单")
+@RestController
+@RequestMapping("/monitor/projectMonitorWhiteList")
+public class ProjectMonitorWhiteListController {
+    @Autowired
+    private IProjectMonitorWhiteListService projectMonitorWhiteListService;
+    @Autowired
+    private ISysUserService userService;
+    @Autowired
+    private IProjectService projectService;
+    @Autowired
+    private ITrackMonitorConfigureService configureService;
+
+
+    @PostMapping(value = "/getProjectAndAccountIds")
+    public Result<List<JSONObject>> getProjectAndAccountIds(@RequestBody JSONObject requestBody) {
+        Result<List<JSONObject>> result = new Result<>();
+        String userId = requestBody.getString("userId");
+        List<JSONObject> list = projectMonitorWhiteListService.getProjectAndAccountIds(userId);
+        result.setSuccess(true);
+        result.setResult(list);
+        return result;
+    }
+
+
+    /**
+     * 分页列表查询
+     *
+     * @param projectMonitorWhiteList
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-项目白名单-分页列表查询", notes = "监测链接预警-项目白名单-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<ProjectMonitorWhiteList>> queryPageList(ProjectMonitorWhiteList projectMonitorWhiteList,
+                                                                @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                HttpServletRequest req) {
+        Result<IPage<ProjectMonitorWhiteList>> result = new Result<>();
+        QueryWrapper<ProjectMonitorWhiteList> queryWrapper = QueryGenerator.initQueryWrapper(projectMonitorWhiteList, req.getParameterMap());
+        Page<ProjectMonitorWhiteList> page = new Page<ProjectMonitorWhiteList>(pageNo, pageSize);
+        IPage<ProjectMonitorWhiteList> pageList = projectMonitorWhiteListService.page(page, queryWrapper);
+        List<ProjectMonitorWhiteList> records = pageList.getRecords();
+        for (ProjectMonitorWhiteList whiteList : records) {
+            String userId = whiteList.getUserId();
+            Long projectId = whiteList.getProjectId();
+            SysUser user = userService.getById(userId);
+            if (!Check.isNull(user)) {
+                whiteList.setUserName(user.getRealname());
+            }
+            Project project = projectService.getById(projectId);
+            if (!Check.isNull(project)) {
+                whiteList.setProjectName(project.getProjectName());
+
+            }
+
+        }
+
+
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param projectMonitorWhiteList
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-项目白名单-添加", notes = "监测链接预警-项目白名单-添加")
+    @PostMapping(value = "/add")
+    public Result<ProjectMonitorWhiteList> add(@RequestBody ProjectMonitorWhiteList projectMonitorWhiteList) {
+        Result<ProjectMonitorWhiteList> result = new Result<>();
+        try {
+            Long projectId = projectMonitorWhiteList.getProjectId();
+            QueryWrapper<ProjectMonitorWhiteList> monitorWhiteListQueryWrapper = new QueryWrapper<>();
+            monitorWhiteListQueryWrapper.eq("project_id", projectId);
+            monitorWhiteListQueryWrapper.last("limit 1");
+            ProjectMonitorWhiteList one = projectMonitorWhiteListService.getOne(monitorWhiteListQueryWrapper);
+            if (!Check.isNull(one)) {
+                result.error("该项目已在白名单中");
+                return result;
+            }
+            projectMonitorWhiteListService.save(projectMonitorWhiteList);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param projectMonitorWhiteList
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-项目白名单-编辑", notes = "监测链接预警-项目白名单-编辑")
+    @PutMapping(value = "/edit")
+    public Result<ProjectMonitorWhiteList> edit(@RequestBody ProjectMonitorWhiteList projectMonitorWhiteList) {
+        Result<ProjectMonitorWhiteList> result = new Result<ProjectMonitorWhiteList>();
+        ProjectMonitorWhiteList projectMonitorWhiteListEntity = projectMonitorWhiteListService.getById(projectMonitorWhiteList.getId());
+        if (projectMonitorWhiteListEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = projectMonitorWhiteListService.updateById(projectMonitorWhiteList);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-项目白名单-通过id删除", notes = "监测链接预警-项目白名单-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id") String id) {
+        try {
+            ProjectMonitorWhiteList byId = projectMonitorWhiteListService.getById(id);
+            if (!Check.isNull(byId)) {
+                Map<String, Object> deleteMap = new HashMap<>();
+                deleteMap.put("project_id", byId.getProjectId());
+                configureService.removeByMap(deleteMap);
+                projectMonitorWhiteListService.removeById(id);
+            }
+
+
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-项目白名单-批量删除", notes = "监测链接预警-项目白名单-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<ProjectMonitorWhiteList> deleteBatch(@RequestParam(name = "ids") String ids) {
+        Result<ProjectMonitorWhiteList> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.projectMonitorWhiteListService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-项目白名单-通过id查询", notes = "监测链接预警-项目白名单-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<ProjectMonitorWhiteList> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<ProjectMonitorWhiteList> result = new Result<>();
+        ProjectMonitorWhiteList projectMonitorWhiteList = projectMonitorWhiteListService.getById(id);
+        if (projectMonitorWhiteList == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(projectMonitorWhiteList);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<ProjectMonitorWhiteList> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                ProjectMonitorWhiteList projectMonitorWhiteList = JSON.parseObject(deString, ProjectMonitorWhiteList.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(projectMonitorWhiteList, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<ProjectMonitorWhiteList> pageList = projectMonitorWhiteListService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "监测链接预警-项目白名单列表");
+        mv.addObject(NormalExcelConstants.CLASS, ProjectMonitorWhiteList.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("监测链接预警-项目白名单列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<ProjectMonitorWhiteList> listProjectMonitorWhiteLists = ExcelImportUtil.importExcel(file.getInputStream(), ProjectMonitorWhiteList.class, params);
+                projectMonitorWhiteListService.saveBatch(listProjectMonitorWhiteLists);
+                return Result.ok("文件导入成功!数据行数:" + listProjectMonitorWhiteLists.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 305 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/controller/TrackMonitorConfigureController.java

@@ -0,0 +1,305 @@
+package cn.com.ctop.kuaishou.modules.clean.controller;
+
+import cn.com.ctop.common.module.entity.Project;
+import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.service.IProjectService;
+import cn.com.ctop.common.module.service.ISysUserService;
+import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.clean.entity.TrackMonitorConfigure;
+import cn.com.ctop.kuaishou.modules.clean.service.ITrackMonitorConfigureService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.entity.SysUser;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.system.service.ISysRoleService;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 监测链接预警-配置
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-09-23
+ */
+@Slf4j
+@Api(tags = "监测链接预警-配置")
+@RestController
+@RequestMapping("/monitor/trackMonitorConfigure")
+public class TrackMonitorConfigureController {
+    @Autowired
+    private ITrackMonitorConfigureService trackMonitorConfigureService;
+    @Autowired
+    private ISysRoleService sysRoleService;
+    @Autowired
+    private IUserAllocationService allocationService;
+    @Autowired
+    private IProjectService projectService;
+    @Autowired
+    private ISysUserService userService;
+
+
+    /**
+     * 分页列表查询
+     *
+     * @param trackMonitorConfigure
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-配置-分页列表查询", notes = "监测链接预警-配置-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<TrackMonitorConfigure>> queryPageList(TrackMonitorConfigure trackMonitorConfigure,
+                                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                              @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                              HttpServletRequest req) {
+        Result<IPage<TrackMonitorConfigure>> result = new Result<>();
+
+        String userId = trackMonitorConfigure.getUserId();
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+        if (roleCode.equals("admin")) {
+            trackMonitorConfigure.setUserId(null);
+        }
+        QueryWrapper<TrackMonitorConfigure> queryWrapper = QueryGenerator.initQueryWrapper(trackMonitorConfigure, req.getParameterMap());
+        Page<TrackMonitorConfigure> page = new Page<TrackMonitorConfigure>(pageNo, pageSize);
+        IPage<TrackMonitorConfigure> pageList = trackMonitorConfigureService.page(page, queryWrapper);
+        List<TrackMonitorConfigure> records = pageList.getRecords();
+        for (TrackMonitorConfigure configure : records) {
+            Long accountId = configure.getAccountId();
+            if (!Check.isNull(accountId)) {
+                UserAllocation userAllocation = allocationService.getByAccountId(accountId);
+                if (!Check.isNull(userAllocation)) {
+                    configure.setAccountName(userAllocation.getAuthName());
+                    configure.setAccountStatus(userAllocation.getAccountStatus());
+                }
+            }
+            Long projectId = configure.getProjectId();
+            if (!Check.isNull(projectId)) {
+                Project project = projectService.getById(projectId);
+                if (!Check.isNull(project)) {
+                    configure.setProjectName(project.getProjectName());
+                }
+            }
+            String createUserId = configure.getUserId();
+            if (!Check.isNull(createUserId)) {
+                SysUser user = userService.getById(createUserId);
+                if (!Check.isNull(user)) {
+                    configure.setUserName(user.getRealname());
+                }
+            }
+        }
+
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param trackMonitorConfigure
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-配置-添加", notes = "监测链接预警-配置-添加")
+    @PostMapping(value = "/add")
+    public Result<TrackMonitorConfigure> add(@RequestBody TrackMonitorConfigure trackMonitorConfigure) {
+        Result<TrackMonitorConfigure> result = new Result<>();
+        try {
+            Long accountId = trackMonitorConfigure.getAccountId();
+            QueryWrapper<TrackMonitorConfigure> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("account_id", accountId);
+            queryWrapper.last("limit 1");
+            TrackMonitorConfigure one = trackMonitorConfigureService.getOne(queryWrapper);
+            if (!Check.isNull(one)) {
+                result.error500("该账户预警已绑定");
+                return result;
+            }
+            UserAllocation userAllocation = allocationService.getByAccountId(accountId);
+            if (Check.isNull(userAllocation)) {
+                result.error500("该账户未获取到关联项目");
+                return result;
+            }
+            trackMonitorConfigure.setProjectId(userAllocation.getProjectId());
+            trackMonitorConfigureService.save(trackMonitorConfigure);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param trackMonitorConfigure
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-配置-编辑", notes = "监测链接预警-配置-编辑")
+    @PostMapping(value = "/edit")
+    public Result<TrackMonitorConfigure> edit(@RequestBody TrackMonitorConfigure trackMonitorConfigure) {
+        Result<TrackMonitorConfigure> result = new Result<TrackMonitorConfigure>();
+        TrackMonitorConfigure trackMonitorConfigureEntity = trackMonitorConfigureService.getById(trackMonitorConfigure.getId());
+        if (trackMonitorConfigureEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = trackMonitorConfigureService.updateById(trackMonitorConfigure);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-配置-通过id删除", notes = "监测链接预警-配置-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id") String id) {
+        try {
+            trackMonitorConfigureService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-配置-批量删除", notes = "监测链接预警-配置-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<TrackMonitorConfigure> deleteBatch(@RequestParam(name = "ids") String ids) {
+        Result<TrackMonitorConfigure> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.trackMonitorConfigureService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-配置-通过id查询", notes = "监测链接预警-配置-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<TrackMonitorConfigure> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<TrackMonitorConfigure> result = new Result<>();
+        TrackMonitorConfigure trackMonitorConfigure = trackMonitorConfigureService.getById(id);
+        if (trackMonitorConfigure == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(trackMonitorConfigure);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<TrackMonitorConfigure> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                TrackMonitorConfigure trackMonitorConfigure = JSON.parseObject(deString, TrackMonitorConfigure.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(trackMonitorConfigure, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<TrackMonitorConfigure> pageList = trackMonitorConfigureService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "监测链接预警-配置列表");
+        mv.addObject(NormalExcelConstants.CLASS, TrackMonitorConfigure.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("监测链接预警-配置列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<TrackMonitorConfigure> listTrackMonitorConfigures = ExcelImportUtil.importExcel(file.getInputStream(), TrackMonitorConfigure.class, params);
+                trackMonitorConfigureService.saveBatch(listTrackMonitorConfigures);
+                return Result.ok("文件导入成功!数据行数:" + listTrackMonitorConfigures.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 325 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/controller/TrackMonitorLogsController.java

@@ -0,0 +1,325 @@
+package cn.com.ctop.kuaishou.modules.clean.controller;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.clean.entity.TrackMonitorConfigure;
+import cn.com.ctop.kuaishou.modules.clean.entity.TrackMonitorLogs;
+import cn.com.ctop.kuaishou.modules.clean.service.ITrackMonitorConfigureService;
+import cn.com.ctop.kuaishou.modules.clean.service.ITrackMonitorLogsService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.DateUtils;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * 监测链接预警-日志
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-09-23
+ */
+@Slf4j
+@Api(tags = "监测链接预警-日志")
+@RestController
+@RequestMapping("/monitor/trackMonitorLogs")
+public class TrackMonitorLogsController {
+    @Autowired
+    private ITrackMonitorLogsService trackMonitorLogsService;
+    @Autowired
+    private IUserAllocationService userAllocationService;
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private ITrackMonitorConfigureService trackMonitorConfigureService;
+    static ExecutorService creativeExecutorService = Executors.newFixedThreadPool(3);
+    static ExecutorService programCreativeExecutorService = Executors.newFixedThreadPool(3);
+
+    /**
+     * 自定义创意预警监测
+     */
+
+    @GetMapping(value = "/monitorCreative")
+    public void monitorCreative(Long accountId) {
+        UserAllocation userAllocation = userAllocationService.getByAccountId(accountId);
+        if (Check.isNull(userAllocation)) {
+            log.error("未获取到账户分配信息,accountId:{}", accountId);
+            return;
+        }
+        if (userAllocation.getAccountStatus() == 1) {
+            log.error("该账户已暂停投放,accountId:{}", accountId);
+            return;
+        }
+
+        CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+        if (Check.isNull(token)) {
+            log.error("该账户未获取到token信息,accountId:{}", accountId);
+            return;
+        }
+        TrackMonitorConfigure configure = trackMonitorConfigureService.getByAccountId(accountId);
+        if (Check.isNull(configure)) {
+            log.error("该账户预警配置信息为空,accountId:{}", accountId);
+            return;
+        }
+
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        creativeExecutorService.submit(new Runnable() {
+            @Override
+            public void run() {
+                trackMonitorLogsService.monitorCreative(configure, accountId, token.getAccessToken(), userAllocation.getUserId(), nowDate, nowDate, 1);
+            }
+        });
+    }
+
+
+    /**
+     * 程序化创意预警监测
+     *
+     * @param accountId
+     */
+    @GetMapping(value = "/monitorProgramCreative")
+    public void monitorProgramCreative(Long accountId) {
+        UserAllocation userAllocation = userAllocationService.getByAccountId(accountId);
+        if (Check.isNull(userAllocation)) {
+            log.error("未获取到账户分配信息,accountId:{}", accountId);
+            return;
+        }
+        if (userAllocation.getAccountStatus() == 1) {
+            log.error("该账户已暂停投放,accountId:{}", accountId);
+            return;
+        }
+
+        CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+        if (Check.isNull(token)) {
+            log.error("该账户未获取到token信息,accountId:{}", accountId);
+            return;
+        }
+        TrackMonitorConfigure configure = trackMonitorConfigureService.getByAccountId(accountId);
+        if (Check.isNull(configure)) {
+            log.error("该账户预警配置信息为空,accountId:{}", accountId);
+            return;
+        }
+
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        programCreativeExecutorService.submit(new Runnable() {
+            @Override
+            public void run() {
+                trackMonitorLogsService.monitorProgramCreative(configure, accountId, token.getAccessToken(), userAllocation.getUserId(), nowDate, nowDate, 1);
+            }
+        });
+
+    }
+
+
+    @GetMapping(value = "/list")
+    public Result<IPage<TrackMonitorLogs>> queryPageList(TrackMonitorLogs trackMonitorLogs,
+                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                         HttpServletRequest req) {
+        Result<IPage<TrackMonitorLogs>> result = new Result<>();
+        QueryWrapper<TrackMonitorLogs> queryWrapper = QueryGenerator.initQueryWrapper(trackMonitorLogs, req.getParameterMap());
+        Page<TrackMonitorLogs> page = new Page<TrackMonitorLogs>(pageNo, pageSize);
+        IPage<TrackMonitorLogs> pageList = trackMonitorLogsService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param trackMonitorLogs
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-日志-添加", notes = "监测链接预警-日志-添加")
+    @PostMapping(value = "/add")
+    public Result<TrackMonitorLogs> add(@RequestBody TrackMonitorLogs trackMonitorLogs) {
+        Result<TrackMonitorLogs> result = new Result<>();
+        try {
+            trackMonitorLogsService.save(trackMonitorLogs);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param trackMonitorLogs
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-日志-编辑", notes = "监测链接预警-日志-编辑")
+    @PutMapping(value = "/edit")
+    public Result<TrackMonitorLogs> edit(@RequestBody TrackMonitorLogs trackMonitorLogs) {
+        Result<TrackMonitorLogs> result = new Result<TrackMonitorLogs>();
+        TrackMonitorLogs trackMonitorLogsEntity = trackMonitorLogsService.getById(trackMonitorLogs.getId());
+        if (trackMonitorLogsEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = trackMonitorLogsService.updateById(trackMonitorLogs);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-日志-通过id删除", notes = "监测链接预警-日志-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id") String id) {
+        try {
+            trackMonitorLogsService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-日志-批量删除", notes = "监测链接预警-日志-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<TrackMonitorLogs> deleteBatch(@RequestParam(name = "ids") String ids) {
+        Result<TrackMonitorLogs> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.trackMonitorLogsService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "监测链接预警-日志-通过id查询", notes = "监测链接预警-日志-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<TrackMonitorLogs> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<TrackMonitorLogs> result = new Result<>();
+        TrackMonitorLogs trackMonitorLogs = trackMonitorLogsService.getById(id);
+        if (trackMonitorLogs == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(trackMonitorLogs);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<TrackMonitorLogs> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                TrackMonitorLogs trackMonitorLogs = JSON.parseObject(deString, TrackMonitorLogs.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(trackMonitorLogs, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<TrackMonitorLogs> pageList = trackMonitorLogsService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "监测链接预警-日志列表");
+        mv.addObject(NormalExcelConstants.CLASS, TrackMonitorLogs.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("监测链接预警-日志列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<TrackMonitorLogs> listTrackMonitorLogss = ExcelImportUtil.importExcel(file.getInputStream(), TrackMonitorLogs.class, params);
+                trackMonitorLogsService.saveBatch(listTrackMonitorLogss);
+                return Result.ok("文件导入成功!数据行数:" + listTrackMonitorLogss.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 65 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/entity/ProjectMonitorWhiteList.java

@@ -0,0 +1,65 @@
+package cn.com.ctop.kuaishou.modules.clean.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 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 java.util.Date;
+
+/**
+ * 监测链接预警-项目白名单
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-09-23
+ */
+@Data
+@TableName("ctop_project_monitor_white_list")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_project_monitor_white_list对象", description = "监测链接预警-项目白名单")
+public class ProjectMonitorWhiteList {
+
+    /**
+     * 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 userId;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+
+    @TableField(exist = false)
+    private String projectName;
+
+    @TableField(exist = false)
+    private String userName;
+}

+ 89 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/entity/TrackMonitorConfigure.java

@@ -0,0 +1,89 @@
+package cn.com.ctop.kuaishou.modules.clean.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 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 java.util.Date;
+
+/**
+ * 监测链接预警-配置
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-09-23
+ */
+@Data
+@TableName("ctop_track_monitor_configure")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_track_monitor_configure对象", description = "监测链接预警-配置")
+public class TrackMonitorConfigure {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 项目id
+     */
+    @Excel(name = "项目id", width = 15)
+    @ApiModelProperty(value = "项目id")
+    private Long projectId;
+    private Long accountId;
+    /**
+     * 状态 0 开启 1 暂停
+     */
+    @Excel(name = "状态 0 开启 1 暂停", width = 15)
+    @ApiModelProperty(value = "状态 0 开启 1 暂停")
+    private Integer status;
+    /**
+     * 第三方点击检测链接
+     */
+    @Excel(name = "第三方点击检测链接", width = 15)
+    @ApiModelProperty(value = "第三方点击检测链接")
+    private String clickTrackUrl;
+    /**
+     * 第三方点击按钮监测链接
+     */
+    @Excel(name = "第三方点击按钮监测链接", width = 15)
+    @ApiModelProperty(value = "第三方点击按钮监测链接")
+    private String actionbarClickUrl;
+    /**
+     * 操作人
+     */
+    @Excel(name = "操作人", width = 15)
+    @ApiModelProperty(value = "操作人")
+    private String userId;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private String accountName;
+
+    @TableField(exist = false)
+    private String userName;
+    @TableField(exist = false)
+    private String projectName;
+
+
+    @TableField(exist = false)
+    private Integer accountStatus;
+}

+ 69 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/entity/TrackMonitorLogs.java

@@ -0,0 +1,69 @@
+package cn.com.ctop.kuaishou.modules.clean.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+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 java.util.Date;
+
+/**
+ * 监测链接预警-日志
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-09-23
+ */
+@Data
+@TableName("ctop_track_monitor_logs")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_track_monitor_logs对象", description = "监测链接预警-日志")
+public class TrackMonitorLogs {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 项目id
+     */
+    @Excel(name = "项目id", width = 15)
+    @ApiModelProperty(value = "项目id")
+    private Long accountId;
+    /**
+     * 项目id
+     */
+    @Excel(name = "项目id", width = 15)
+    @ApiModelProperty(value = "项目id")
+    private Long unitId;
+    /**
+     * 错误第三方点击检测链接
+     */
+    @Excel(name = "错误第三方点击检测链接	", width = 15)
+    @ApiModelProperty(value = "错误第三方点击检测链接	")
+    private String clickTrackUrl;
+    /**
+     * 第三方点击按钮监测链接
+     */
+    @Excel(name = "第三方点击按钮监测链接", width = 15)
+    @ApiModelProperty(value = "第三方点击按钮监测链接")
+    private String actionbarClickUrl;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 20 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/ProjectMonitorWhiteListMapper.java

@@ -0,0 +1,20 @@
+package cn.com.ctop.kuaishou.modules.clean.mapper;
+
+import cn.com.ctop.kuaishou.modules.clean.entity.ProjectMonitorWhiteList;
+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
+ * 2021-09-23
+ * @version V1.0
+ */
+public interface ProjectMonitorWhiteListMapper extends BaseMapper<ProjectMonitorWhiteList> {
+
+    List<JSONObject> getProjectIds(@Param("userId") String userId);
+}

+ 15 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/TrackMonitorConfigureMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.clean.mapper;
+
+import cn.com.ctop.kuaishou.modules.clean.entity.TrackMonitorConfigure;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 监测链接预警-配置
+ *
+ * @author jeecg-boot
+ * 2021-09-23
+ * @version V1.0
+ */
+public interface TrackMonitorConfigureMapper extends BaseMapper<TrackMonitorConfigure> {
+
+}

+ 21 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/TrackMonitorLogsMapper.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.kuaishou.modules.clean.mapper;
+
+import cn.com.ctop.kuaishou.modules.clean.entity.TrackMonitorLogs;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 监测链接预警-日志
+ *
+ * @author jeecg-boot
+ * 2021-09-23
+ * @version V1.0
+ */
+public interface TrackMonitorLogsMapper extends BaseMapper<TrackMonitorLogs> {
+
+    void replaceBatch(@Param("addList") List<TrackMonitorLogs> addList);
+
+    Integer getCount(@Param("accountId") Long accountId, @Param("unitId") Long unit_id);
+}

+ 30 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/xml/ProjectMonitorWhiteListMapper.xml

@@ -0,0 +1,30 @@
+<?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.kuaishou.modules.clean.mapper.ProjectMonitorWhiteListMapper">
+
+    <select id="getProjectIds" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        project.id as 'projectId',
+        project.project_name as 'projectName'
+        FROM
+        (
+        SELECT
+        t1.project_id
+        FROM
+        ctop_project_monitor_white_list t1
+        INNER JOIN (
+        SELECT DISTINCT
+        project_id
+        FROM
+        ctop_project_member
+        WHERE 1 = 1
+        <if test="userId != null and userId != ''">
+            AND user_id = #{userId}
+        </if>
+
+        ) t2 ON t1.project_id = t2.project_id
+        ) white INNER JOIN ctop_project project
+        ON white.project_id = project.id
+
+    </select>
+</mapper>

+ 5 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/xml/TrackMonitorConfigureMapper.xml

@@ -0,0 +1,5 @@
+<?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.kuaishou.modules.clean.mapper.TrackMonitorConfigureMapper">
+
+</mapper>

+ 29 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/xml/TrackMonitorLogsMapper.xml

@@ -0,0 +1,29 @@
+<?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.kuaishou.modules.clean.mapper.TrackMonitorLogsMapper">
+
+    <insert id="replaceBatch">
+        insert into ctop_track_monitor_logs(
+        account_id,
+        unit_id,
+        click_track_url,
+        actionbar_click_url
+        )
+        values
+        <foreach collection="addList" item="add" separator=",">
+            (
+            #{add.accountId},
+            #{add.unitId},
+            #{add.clickTrackUrl},
+            #{add.actionbarClickUrl}
+            )
+        </foreach>
+
+    </insert>
+    <select id="getCount" resultType="java.lang.Integer">
+        select  count(1)  from ctop_track_monitor_logs
+        where  account_id = #{accountId}
+        and unit_id = #{unitId}
+
+    </select>
+</mapper>

+ 19 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/IProjectMonitorWhiteListService.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.clean.service;
+
+import cn.com.ctop.kuaishou.modules.clean.entity.ProjectMonitorWhiteList;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * 监测链接预警-项目白名单
+ *
+ * @author jeecg-boot
+ * 2021-09-23
+ * @version V1.0
+ */
+public interface IProjectMonitorWhiteListService extends IService<ProjectMonitorWhiteList> {
+
+    List<JSONObject> getProjectAndAccountIds(String userId);
+}

+ 16 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/ITrackMonitorConfigureService.java

@@ -0,0 +1,16 @@
+package cn.com.ctop.kuaishou.modules.clean.service;
+
+import cn.com.ctop.kuaishou.modules.clean.entity.TrackMonitorConfigure;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 监测链接预警-配置
+ *
+ * @author jeecg-boot
+ * 2021-09-23
+ * @version V1.0
+ */
+public interface ITrackMonitorConfigureService extends IService<TrackMonitorConfigure> {
+
+    TrackMonitorConfigure getByAccountId(Long accountId);
+}

+ 19 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/ITrackMonitorLogsService.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.clean.service;
+
+import cn.com.ctop.kuaishou.modules.clean.entity.TrackMonitorConfigure;
+import cn.com.ctop.kuaishou.modules.clean.entity.TrackMonitorLogs;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 监测链接预警-日志
+ *
+ * @author jeecg-boot
+ * 2021-09-23
+ * @version V1.0
+ */
+public interface ITrackMonitorLogsService extends IService<TrackMonitorLogs> {
+
+    void monitorCreative(TrackMonitorConfigure configure,Long accountId, String accessToken, String userId, String startDate, String endDate, Integer page);
+
+    void monitorProgramCreative(TrackMonitorConfigure configure, Long accountId, String accessToken, String userId, String nowDate, String nowDate1, Integer page);
+}

+ 50 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/impl/ProjectMonitorWhiteListServiceImpl.java

@@ -0,0 +1,50 @@
+package cn.com.ctop.kuaishou.modules.clean.service.impl;
+
+import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.clean.entity.ProjectMonitorWhiteList;
+import cn.com.ctop.kuaishou.modules.clean.mapper.ProjectMonitorWhiteListMapper;
+import cn.com.ctop.kuaishou.modules.clean.service.IProjectMonitorWhiteListService;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.system.service.ISysRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 监测链接预警-项目白名单
+ *
+ * @author jeecg-boot
+ * 2021-09-23
+ * @version V1.0
+ */
+@Service
+public class ProjectMonitorWhiteListServiceImpl extends ServiceImpl<ProjectMonitorWhiteListMapper, ProjectMonitorWhiteList> implements IProjectMonitorWhiteListService {
+    @Autowired
+    private ProjectMonitorWhiteListMapper monitorWhiteListMapper;
+    @Autowired
+    private ISysRoleService sysRoleService;
+    @Autowired
+    private IUserAllocationService userAllocationService;
+
+    @Override
+    public List<JSONObject> getProjectAndAccountIds(String userId) {
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+        if (roleCode.equals("admin")) {
+            userId = null;
+        }
+        List<JSONObject> projectIds = monitorWhiteListMapper.getProjectIds(userId);
+        if (Check.isNull(projectIds)) {
+            return null;
+        }
+        for (int i = 0; i < projectIds.size(); i++) {
+            JSONObject projectJson = projectIds.get(i);
+            Long projectId = projectJson.getLong("projectId");
+            List<JSONObject> accountListByProject = userAllocationService.getAccountListByProjectAndUserId(projectId, userId);
+            projectJson.put("accountList", accountListByProject);
+        }
+        return projectIds;
+    }
+}

+ 26 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/impl/TrackMonitorConfigureServiceImpl.java

@@ -0,0 +1,26 @@
+package cn.com.ctop.kuaishou.modules.clean.service.impl;
+
+import cn.com.ctop.kuaishou.modules.clean.entity.TrackMonitorConfigure;
+import cn.com.ctop.kuaishou.modules.clean.mapper.TrackMonitorConfigureMapper;
+import cn.com.ctop.kuaishou.modules.clean.service.ITrackMonitorConfigureService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 监测链接预警-配置
+ *
+ * @author jeecg-boot
+ * 2021-09-23
+ * @version V1.0
+ */
+@Service
+public class TrackMonitorConfigureServiceImpl extends ServiceImpl<TrackMonitorConfigureMapper, TrackMonitorConfigure> implements ITrackMonitorConfigureService {
+
+    @Override
+    public TrackMonitorConfigure getByAccountId(Long accountId) {
+        QueryWrapper<TrackMonitorConfigure> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("account_id", accountId);
+        return this.getOne(queryWrapper);
+    }
+}

+ 286 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/impl/TrackMonitorLogsServiceImpl.java

@@ -0,0 +1,286 @@
+package cn.com.ctop.kuaishou.modules.clean.service.impl;
+
+import cn.com.ctop.common.module.service.IMessageTemplate;
+import cn.com.ctop.common.module.service.ISendMessageService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
+import cn.com.ctop.common.module.utils.PropertiesUtils;
+import cn.com.ctop.kuaishou.modules.clean.entity.TrackMonitorConfigure;
+import cn.com.ctop.kuaishou.modules.clean.entity.TrackMonitorLogs;
+import cn.com.ctop.kuaishou.modules.clean.mapper.TrackMonitorLogsMapper;
+import cn.com.ctop.kuaishou.modules.clean.service.ITrackMonitorLogsService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 监测链接预警-日志
+ *
+ * @author jeecg-boot
+ * 2021-09-23
+ * @version V1.0
+ */
+@Slf4j
+@Service
+public class TrackMonitorLogsServiceImpl extends ServiceImpl<TrackMonitorLogsMapper, TrackMonitorLogs> implements ITrackMonitorLogsService {
+    @Autowired
+    private ISendMessageService sendMessageService;
+    @Autowired
+    private IMessageTemplate messageTemplate;
+    @Autowired
+    private TrackMonitorLogsMapper monitorLogsMapper;
+
+
+    @Override
+    public void monitorCreative(TrackMonitorConfigure configure, Long accountId, String accessToken, String userId, String startDate, String endDate, Integer page) {
+        log.info("开始自定义创意监测链接预警,accountId:{}", accountId);
+        String clickTrackUrl = "";
+        if (!Check.isNull(configure.getClickTrackUrl())) {
+            clickTrackUrl = configure.getClickTrackUrl().trim();
+        }
+        String actionbarClickUrl = "";
+        if (!Check.isNull(configure.getActionbarClickUrl())) {
+            actionbarClickUrl = configure.getActionbarClickUrl().trim();
+        }
+        String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_LIST;
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Content-Type", " application/json");
+        headers.put("Access-Token", accessToken);
+        JSONObject param = new JSONObject();
+        param.put("advertiser_id", accountId);
+        Integer page_size = 500;
+        param.put("page_size", page_size);
+        param.put("page", page);
+        param.put("start_date", startDate);
+        param.put("end_date", endDate);
+        String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
+        JSONObject resultJson = JSONObject.parseObject(result);
+        if (Check.isNull(resultJson)) {
+            log.error("获取广告创意返回结果为空,advertiserId:{}", accountId);
+            return;
+        }
+        Integer code = resultJson.getInteger("code");
+        String message = resultJson.getString("message");
+        if (null == code || code != 0) {
+            log.error("获取广告创意返回结果异常,advertiserId:{},message:{}", accountId, message);
+            return;
+        }
+        JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
+        if (null == details || details.size() <= 0) {
+            return;
+        }
+        Boolean doGet = true;
+        if (details.size() < page_size) {
+            doGet = false;
+        }
+        Map<Long, JSONObject> unitMap = new HashMap<>();
+        for (int i = 0; i < details.size(); i++) {
+            JSONObject creativeJson = details.getJSONObject(i);
+            Integer status = creativeJson.getInteger("status");
+            if (status == 52 || status == 41 || status == 19) { // 只检查创意状态为投放中、审核中
+                JSONObject unitJson = new JSONObject();
+                Boolean trueOrFalse = false;
+                String click_track_url = creativeJson.getString("click_track_url");
+                if (!Check.isNull(click_track_url)) {
+                    if (!Check.isNull(clickTrackUrl)) {
+                        if (!click_track_url.equals(clickTrackUrl)) {
+                            trueOrFalse = true;
+                            unitJson.put("click_track_url", click_track_url);
+                        }
+                    }
+                }
+                String actionbar_click_url = creativeJson.getString("actionbar_click_url");
+                if (!Check.isNull(actionbar_click_url)) {
+                    if (!Check.isNull(actionbarClickUrl)) {
+                        if (!actionbar_click_url.equals(actionbarClickUrl)) {
+                            trueOrFalse = true;
+                            unitJson.put("actionbar_click_url", actionbar_click_url);
+                        }
+                    }
+                }
+                if (trueOrFalse) {
+                    Long unit_id = creativeJson.getLong("unit_id");
+                    Integer count = monitorLogsMapper.getCount(accountId, unit_id);
+                    if (count <= 0 || count == null) {
+                        unitMap.put(unit_id, unitJson);
+                    }
+                }
+            }
+        }
+        if (!Check.isNullMap(unitMap)) {
+            doOperation(accountId, accessToken, unitMap, userId);
+        }
+        if (doGet) {
+            monitorCreative(configure, accountId, accessToken, userId, startDate, endDate, page + 1);
+        }
+    }
+
+    @Override
+    public void monitorProgramCreative(TrackMonitorConfigure configure, Long accountId, String accessToken, String userId, String startDate, String endDate, Integer page) {
+        log.info("开始程序化创意监测链接预警,accountId:{}", accountId);
+        String clickTrackUrl = "";
+        if (!Check.isNull(configure.getClickTrackUrl())) {
+            clickTrackUrl = configure.getClickTrackUrl().trim();
+        }
+        String actionbarClickUrl = "";
+        if (!Check.isNull(configure.getActionbarClickUrl())) {
+            actionbarClickUrl = configure.getActionbarClickUrl().trim();
+        }
+        String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.PROGRAM_LIST;
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Content-Type", " application/json");
+        headers.put("Access-Token", accessToken);
+        JSONObject param = new JSONObject();
+        param.put("advertiser_id", accountId);
+        Integer page_size = 500;
+        param.put("page_size", page_size);
+        param.put("page", page);
+        param.put("start_date", startDate);
+        param.put("end_date", endDate);
+        String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
+        JSONObject resultJson = JSONObject.parseObject(result);
+        if (Check.isNull(resultJson)) {
+            log.error("获取广告创意返回结果为空,advertiserId:{}", accountId);
+            return;
+        }
+        Integer code = resultJson.getInteger("code");
+        String message = resultJson.getString("message");
+        if (null == code || code != 0) {
+            log.error("获取广告创意返回结果异常,advertiserId:{},message:{}", accountId, message);
+            return;
+        }
+        JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
+        if (null == details || details.size() <= 0) {
+            return;
+        }
+        Boolean doGet = true;
+        if (details.size() < page_size) {
+            doGet = false;
+        }
+        Map<Long, JSONObject> unitMap = new HashMap<>();
+        for (int i = 0; i < details.size(); i++) {
+            JSONObject creativeJson = details.getJSONObject(i);
+
+            Integer status = creativeJson.getInteger("view_status");
+            if (status == 52 || status == 41 || status == 19 || status == 62) { // 只检查创意状态为投放中、审核中、待送审
+                JSONObject unitJson = new JSONObject();
+                Boolean trueOrFalse = false;
+                String click_track_url = creativeJson.getString("click_url");
+                if (!Check.isNull(click_track_url)) {
+                    if (!Check.isNull(clickTrackUrl)) {
+                        if (!click_track_url.equals(clickTrackUrl)) {
+                            trueOrFalse = true;
+                            unitJson.put("click_track_url", click_track_url);
+                        }
+                    }
+                }
+                String actionbar_click_url = creativeJson.getString("actionbar_click_url");
+                if (!Check.isNull(actionbar_click_url)) {
+                    if (!Check.isNull(actionbarClickUrl)) {
+                        if (!actionbar_click_url.equals(actionbarClickUrl)) {
+                            trueOrFalse = true;
+                            unitJson.put("actionbar_click_url", actionbar_click_url);
+                        }
+                    }
+                }
+                if (trueOrFalse) {
+                    Long unit_id = creativeJson.getLong("unit_id");
+                    Integer count = monitorLogsMapper.getCount(accountId, unit_id);
+                    if (count <= 0 || count == null) {
+                        unitMap.put(unit_id, unitJson);
+                    }
+                }
+            }
+        }
+        if (!Check.isNullMap(unitMap)) {
+            doOperation(accountId, accessToken, unitMap, userId);
+        }
+        if (doGet) {
+            monitorCreative(configure, accountId, accessToken, userId, startDate, endDate, page + 1);
+        }
+    }
+
+    private void doOperation(Long accountId, String accessToken, Map<Long, JSONObject> unitMap, String userId) {
+        List<TrackMonitorLogs> trackMonitorLogs = new ArrayList<>();
+        for (Map.Entry<Long, JSONObject> entry : unitMap.entrySet()) {
+            Long unitId = entry.getKey();
+            JSONObject info = entry.getValue();
+            String trackMessage = messageTemplate.getTrackMessage(accountId, unitId);
+            sendMessageService.sendMessage(userId, trackMessage);
+            Map<String, Object> map = monitorUpdateUnitStatus(accessToken, accountId, unitId, 2, "e9ca23d68d884d4ebb19d07889727dae");
+            if (Check.isNullMap(map)) {
+                continue;
+            }
+            Integer code = (Integer) map.get("code");
+            if (code == 0) {
+                TrackMonitorLogs logs = new TrackMonitorLogs();
+                logs.setAccountId(accountId);
+                logs.setUnitId(unitId);
+                String click_track_url = info.getString("click_track_url");
+                if (!Check.isNull(click_track_url)) {
+                    logs.setClickTrackUrl(click_track_url);
+                }
+                String actionbar_click_url = info.getString("actionbar_click_url");
+                if (!Check.isNull(actionbar_click_url)) {
+                    logs.setActionbarClickUrl(actionbar_click_url);
+                }
+                trackMonitorLogs.add(logs);
+            }
+        }
+        monitorLogsMapper.replaceBatch(trackMonitorLogs);
+    }
+
+
+    private Map<String, Object> monitorUpdateUnitStatus(String token, Long advertiserId, Long unitId, int putStatus, String loginId) {
+        Map<String, Object> returnMap = new HashMap<>();
+        try {
+            String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.UPDATE_UNIT_STATUS;
+            Map<String, String> header = new HashMap<>();
+            header.put("Access-Token", token);
+            header.put("Content-Type", "application/json");
+            JSONObject params = new JSONObject();
+            params.put("advertiser_id", advertiserId);
+            params.put("unit_id", unitId);
+            params.put("put_status", putStatus);
+            String result = HttpUtils.httpPostRequest(url, params, header);
+            JSONObject resultJson = JSONObject.parseObject(result);
+            if (!Check.isNull(resultJson)) {
+                Integer code = resultJson.getInteger("code");
+                if (code == 0) {
+                    returnMap.put("code", 0);
+                    returnMap.put("success", true);
+                    returnMap.put("message", "修改成功");
+                    log.info("监测链接预警修改组状态成功,accountId:{}。unitId:{}", advertiserId, unitId);
+                } else {
+                    log.error("监测链接预警修改广告组状态失败,advertiserId:{},unitId:{},返回信息:{}", advertiserId, unitId, resultJson);
+                    returnMap.put("code", -1);
+                    returnMap.put("success", false);
+                    returnMap.put("message", resultJson.getString("message"));
+                }
+            } else {
+                log.error("监测链接预警修改广告组状态返回结果为空,advertiserId:{},unitId:{}", advertiserId, unitId);
+                returnMap.put("code", -1);
+                returnMap.put("success", false);
+                returnMap.put("message", "修改广告组预算返回结果为空");
+            }
+        } catch (Exception e) {
+            log.error("监测链接预警修改广告组状态异常,advertiserId:{},unitId:{}", advertiserId, unitId);
+            e.printStackTrace();
+            returnMap.put("code", -1);
+            returnMap.put("success", false);
+            returnMap.put("message", "修改广告组状态异常");
+        }
+
+        return returnMap;
+    }
+
+}

+ 12 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountDailyMapper.xml

@@ -510,6 +510,12 @@
         ) t7 on t2.project_id = t7.project_id
         where t1.stat_date &gt;= #{startTime}
         AND t1.stat_date &lt;= #{endTime}
+        and
+        t3.responsible_id in
+        <foreach item="id" index="index" collection="userIds"
+                 open="(" separator="," close=")">
+            #{id}
+        </foreach>
         GROUP BY t3.id
         HAVING SUM(charge)>0
         <if test="sortCode != '' and sortCode != null ">
@@ -528,6 +534,12 @@
                           INNER JOIN ctop_project t3 ON t2.project_id = t3.id
                  where t1.stat_date &gt;= #{startTime}
                    AND t1.stat_date &lt;= #{endTime}
+                    and
+                t3.responsible_id in
+                <foreach item="id" index="index" collection="userIds"
+                         open="(" separator="," close=")">
+                    #{id}
+                </foreach>
                  GROUP BY t3.id
                  HAVING SUM(charge) > 0
              ) t

+ 14 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountHourlyMapper.xml

@@ -587,7 +587,14 @@
         AND stat_hour &lt;= #{hours}
         GROUP BY i1.account_id
         ) t6 ON t2.account_id = t6.account_id
-        where stat_date = #{startTime}
+        where
+        stat_date = #{startTime}
+        and
+        t3.responsible_id in
+        <foreach item="id" index="index" collection="userIds"
+                 open="(" separator="," close=")">
+            #{id}
+        </foreach>
         GROUP BY t3.id
         HAVING SUM(charge)>0
         <if test="sortCode != '' and sortCode != null ">
@@ -606,6 +613,12 @@
         LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
         INNER JOIN ctop_project t3 ON t2.project_id = t3.id
         where stat_date = #{startTime}
+        and
+        t3.responsible_id in
+        <foreach item="id" index="index" collection="userIds"
+                 open="(" separator="," close=")">
+            #{id}
+        </foreach>
         GROUP BY t3.id
         HAVING SUM(charge)>0
         )t

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

@@ -577,8 +577,10 @@ public class EtlKuaishouReportAccountHourlyServiceImpl extends ServiceImpl<EtlKu
         }
         //参数处理
         configParameter(request);
+        List<String> userIds = getUserIdList(userId);
+        userIds.add(userId);
         //获取人群集
-        request.put("userIds", getUserIdList(userId));
+        request.put("userIds", userIds);
         List<JSONObject> list = null;
         int total = 0;
         //单日数据

+ 27 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectController.java

@@ -57,6 +57,31 @@ public class ProjectController {
     @Autowired
     private IUserAllocationService userAllocationService;
 
+
+    @ApiOperation(value = "项目-分页列表查询", notes = "项目-分页列表查询")
+    @GetMapping(value = "/getProjectList")
+    public Result<IPage<Project>> getProjectList(Project project,
+                                                 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                 HttpServletRequest req) {
+        Result<IPage<Project>> result = new Result<>();
+        String projectName = project.getProjectName();
+        project.setProjectName(null);
+        QueryWrapper<Project> queryWrapper = QueryGenerator.initQueryWrapper(project, req.getParameterMap());
+        if (!Check.isNull(projectName)) {
+            queryWrapper.like("project_name", projectName);
+        }
+        Page<Project> page = new Page<>(pageNo, pageSize);
+        IPage<Project> pageList = projectService.page(page, queryWrapper);
+        List<Project> records = pageList.getRecords();
+        records = transferAccountService.getTransferInfoListByList(records);
+        pageList.setRecords(records);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
     /**
      * @param advertiserId
      * @param mediaId
@@ -236,8 +261,8 @@ public class ProjectController {
         }
 
         //媒体类型 1、3 头条   2、4 快手
-        if (!Check.isNull(project.getMediaId())){
-            queryWrapper.in("media_id",Arrays.asList(project.getMediaId().split(",")));
+        if (!Check.isNull(project.getMediaId())) {
+            queryWrapper.in("media_id", Arrays.asList(project.getMediaId().split(",")));
         }
 
         queryWrapper.orderByDesc("create_time");

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

@@ -338,6 +338,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) {

+ 6 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java

@@ -1,7 +1,5 @@
 package org.jeecg.modules.ctop.controller;
 
-import cn.com.ctop.alarm.modules.entity.RuleAccountTemplate;
-import cn.com.ctop.alarm.modules.service.IRuleAccountTemplateService;
 import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.Project;
@@ -13,7 +11,6 @@ import cn.com.ctop.common.module.service.ISysRoleExtService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.StringUtils;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouAdvertiserBaseInfoService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import com.alibaba.fastjson.JSONArray;
@@ -98,13 +95,17 @@ public class UserAllocationController {
 
 
     @GetMapping(value = "/getUserIdListByProductId")
-    public Result<List<JSONObject>> getUserIdListByProductId(Long productId) {
+    public Result<List<JSONObject>> getUserIdListByProductId(Long productId, String userId) {
         Result<List<JSONObject>> result = new Result<>();
         try {
             if (Check.isNull(productId)) {
                 throw new Exception("请选择产品id");
             }
-            List<JSONObject> userIdList = userAllocationService.getUserIdListByProductId(productId);
+            String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+            if (roleCode.equals("admin")) {
+                userId = null;
+            }
+            List<JSONObject> userIdList = userAllocationService.getUserIdListByProductId(productId, userId);
             result.setSuccess(true);
             result.setResult(userIdList);
         } catch (Exception e) {

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

@@ -0,0 +1,937 @@
+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`),0) as showMaterial \",\n" +
+            "    \"comment\": \"展示数\"\n" +
+            "  },\n" +
+            "  \"cpm\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.cost) / sum(t1.`show`) IS NULL THEN 0 ELSE ROUND((sum(t1.cost) / sum(t1.`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.`show`) != 0 THEN concat(CAST(round( sum(t1.click) /sum(t1.`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_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),3) 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 ROUND(sum(photo_click)/sum(`show`),4)  else 0 END AS clickRate \",\n" +
+            "    \"comment\": \"封面点击率\"\n" +
+            "  },\n" +
+            "  \"bClickRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(aclick) != 0 THEN ROUND(sum(bclick)/sum(aclick),4) 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, 3 ) 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)), 3) 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)), 3) 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 round(sum(charge)/sum(download_started),3) end AS downloadStartCost \",\n" +
+            "    \"comment\": \"安卓开始下载单价\"\n" +
+            "  },\n" +
+            "  \"downloadStartRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN round(sum(download_started)/sum(bclick),4) 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  round(sum(charge)/sum(download_completed),3) end AS downloadFinishCost \",\n" +
+            "    \"comment\": \"安卓下载完成单价\"\n" +
+            "  },\n" +
+            "  \"downloadFinishRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(download_started) != 0 then  round(sum(download_completed)/sum(download_started),4) 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 round(sum(charge)/sum(activation),3) 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 round(sum(charge)/sum(event_pay_first_day),3) 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 round(sum(event_pay_purchase_amount_first_day)/sum(charge)*100,2) 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 round(sum(charge)/sum(event_pay),3) end AS eventPayCost \",\n" +
+            "    \"comment\": \"付费次数成本\"\n" +
+            "  },\n" +
+            "  \"ROI\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(event_pay_purchase_amount)/sum(charge) IS NULL THEN 0 ELSE round(sum(event_pay_purchase_amount)/sum(charge)*100,2) 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 round(sum(event_register)/sum(activation),4) 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 round(sum(event_credit_grant_app)/sum(event_jin_jian_app),4) 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  round(sum(form_count)/sum(activation),4) 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  round(sum(event_next_day_stay)/sum(activation),4) 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  round(sum(event_credit_grant_landing_page)/sum(event_jin_jian_landing_page),2) ELSE 0 end as eventCreditGrantLandingPageRate \",\n" +
+            "    \"comment\": \"落地页授信率\"\n" +
+            "  },\n" +
+            "  \"submit\": {\n" +
+            "    \"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 round(sum(submit)/sum(bclick),4) else 0 end as submitRate \",\n" +
+            "    \"comment\": \"按钮点击率\"\n" +
+            "  },\n" +
+            "  \"play3sRate\": {\n" +
+            "    \"filed\": \"(CASE WHEN  sum(aclick) != 0 THEN round(sum(play_3s_ratio*aclick)/sum(aclick),4) ELSE 0 END )AS play3sRate \",\n" +
+            "    \"comment\": \"3s播放率\"\n" +
+            "  },\n" +
+            "  \"activeRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(download_completed) != 0 THEN round(sum(activation)/sum(download_completed),4) 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 ROUND(sum(photo_click) / sum(`show`),4) else 0 END AS clickRate \",\n" +
+            "    \"comment\": \"封面点击率\"\n" +
+            "  },\n" +
+            "  \"bClickRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(aclick) != 0 THEN ROUND(sum(bclick) / sum(aclick),4) 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,3) 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), 3) 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), 3) 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 round(sum(charge)/sum(download_started),3) end AS downloadStartCost \",\n" +
+            "    \"comment\": \"安卓开始下载单价\"\n" +
+            "  },\n" +
+            "  \"downloadStartRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(bclick) != 0 THEN round(sum(download_started) / sum(bclick),4) 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  round(sum(charge)/sum(download_completed),3) end AS downloadFinishCost \",\n" +
+            "    \"comment\": \"安卓下载完成单价\"\n" +
+            "  },\n" +
+            "  \"downloadFinishRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(download_started) != 0 then round(sum(download_completed)/sum(download_started),4) 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 round(sum(charge)/sum(activation),3) 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),3) as firstDayPayAmount  \",\n" +
+            "    \"comment\": \"首日付费金额\"\n" +
+            "  },\n" +
+            "  \"firstDayPayCost\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(charge)/sum(event_pay_first_day) IS NULL THEN 0 ELSE round(sum(charge)/sum(event_pay_first_day),3) 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 round(sum(charge)/sum(event_pay),3) 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 round(sum(event_register)/sum(activation),4) 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 round(sum(event_credit_grant_app)/sum(event_jin_jian_app),4) 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 round(sum(form_count)/sum(activation),4) 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 round(sum(event_next_day_stay)/sum(activation),4) 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 round(sum(event_credit_grant_landing_page)/sum(event_jin_jian_landing_page),4) ELSE 0 end as eventCreditGrantLandingPageRate \",\n" +
+            "    \"comment\": \"落地页授信率\"\n" +
+            "  },\n" +
+            "  \"submit\": {\n" +
+            "    \"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 round(sum(submit)/sum(bclick),4) else 0 end as submitRate \",\n" +
+            "    \"comment\": \"按钮点击率\"\n" +
+            "  },\n" +
+            "  \"activeRate\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(download_completed) != 0 THEN round(sum(activation)/sum(download_completed),4) else 0 end as activeRate \",\n" +
+            "    \"comment\": \"下载完成激活率\"\n" +
+            "  },\n" +
+            "  \"play3sCount\": {\n" +
+            "    \"filed\": \"sum(play_3s_ratio*aclick) as play3sCount\",\n" +
+            "    \"comment\": \"3s播放数\"\n" +
+            "  },\n" +
+            "  \"play3sRate\": {\n" +
+            "    \"filed\": \"CASE WHEN sum(aclick) != 0 THEN ROUND(sum(play_3s_count)/sum(aclick),4 ) ELSE 0 END AS play3sRate\",\n" +
+            "    \"comment\": \"3s播放率\"\n" +
+            "  }\n" +
+            "}";
+    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 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;
+}

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

@@ -0,0 +1,77 @@
+package cn.com.ctop.common.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+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;
+
+/**
+ * <p>
+ * 角色表
+ * </p>
+ *
+ * @Author scott
+ * @since 2018-12-19
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class SysRole implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+
+    /**
+     * 角色名称
+     */
+    @Excel(name="角色名",width=15)
+    private String roleName;
+
+    /**
+     * 角色编码
+     */
+    @Excel(name="角色编码",width=15)
+    private String roleCode;
+
+    /**
+          * 描述
+     */
+    @Excel(name="描述",width=60)
+    private String description;
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /**
+     * 更新人
+     */
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+}

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

@@ -0,0 +1,164 @@
+package cn.com.ctop.common.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+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.jeecg.common.aspect.annotation.Dict;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 用户分配
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-08-08
+ */
+@Data
+@TableName("ctop_user_allocation")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_user_allocation对象", description = "用户分配")
+public class UserAllocation implements Serializable {
+
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键ID")
+    private Long id;
+    /**
+     * 登陆人id
+     */
+    @Excel(name = "登陆人id", width = 15)
+    @ApiModelProperty(value = "登陆人id")
+    private String userId;
+
+
+    @Excel(name = "登陆人名称", width = 15)
+    @ApiModelProperty(value = "登陆人名称")
+    private String userName;
+
+    /**
+     * 账户id --授权
+     */
+    @Excel(name = "账户id --授权", width = 15)
+    @ApiModelProperty(value = "账户id --授权")
+    private Long accountId;
+    /**
+     * 广告主ID
+     */
+    @Excel(name = "广告主ID", width = 15)
+    @ApiModelProperty(value = "广告主ID")
+    @Dict(dicCode = "id", dictTable = "ctop_advertiser", dicText = "name")
+    private String advertiserId;
+
+    private String systemType;
+
+    /**
+     * 项目id
+     */
+    @Dict(dicCode = "id", dictTable = "ctop_project", dicText = "project_name")
+    private Long projectId;
+
+    /**
+     * 输入账号  --登陆
+     */
+    @Excel(name = "输入账号  --登陆", width = 15)
+    @ApiModelProperty(value = "输入账号  --登陆")
+    private String accountName;
+
+    /**
+     * 预警 金额
+     */
+    private BigDecimal warningAmount;
+
+    /**
+     * 预警 比例
+     */
+    private BigDecimal warningProportion;
+
+    /**
+     * 创建时间
+     */
+    @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 = 15)
+    @ApiModelProperty(value = "授权名称")
+    private String authName;
+
+    /**
+     * 授权开始时间
+     */
+    @Excel(name = "授权开始时间", width = 15)
+    @ApiModelProperty(value = "授权开始时间")
+    private String authBeginTime;
+
+
+    /**
+     * 0 启动
+     * 1 禁用
+     */
+    private Integer accountStatus;
+
+    /**
+     * 检测链接预警
+     * 0 启动
+     * 1 禁用
+     */
+    private Integer monitoringLink;
+
+    /**
+     * 检测链接预警
+     * 0 启动
+     * 1 禁用
+     */
+    private Integer landingPage;
+
+    /**
+     * 是否开启删评论
+     * 0 启动
+     * 1 禁用
+     */
+    private Integer deleteComment;
+    /**
+     * 自动投放,0关闭,1开启
+     */
+    private Integer autoDelivery;
+    /**
+     * 物料类型 0-不同步,1应用包,(2人群包,3定向包)
+     */
+    private String materialType;
+
+    /**
+     * 修改时间
+     */
+    @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 头条 2快手
+     */
+    @Excel(name = "平台类型 1 头条 2快手", width = 15)
+    @ApiModelProperty(value = "平台类型 1 头条 2快手")
+    private String mediaId;
+}

+ 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);
+}

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

@@ -0,0 +1,38 @@
+package cn.com.ctop.common.mapper;
+
+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;
+
+/**
+ * <p>
+ * 角色表 Mapper 接口
+ * </p>
+ *
+ * @Author scott
+ * @since 2018-12-19
+ */
+public interface SysRoleMapper extends BaseMapper<SysRole> {
+    String getRoleIdByRoleCode(@Param("roleCode") String roleCode);
+
+    String getRoleCodeByUserId(@Param("userId") String userId);
+    /**
+     * @Author scott
+     * @Date 2019/12/13 16:12
+     * @Description: 删除角色与用户关系
+     */
+    @Delete("delete from sys_user_role where role_id = #{roleId}")
+    void deleteRoleUserRelation(@Param("roleId") String roleId);
+
+
+    /**
+     * @Author scott
+     * @Date 2019/12/13 16:12
+     * @Description: 删除角色与权限关系
+     */
+    @Delete("delete from sys_role_permission where role_id = #{roleId}")
+    void deleteRolePermissionRelation(@Param("roleId") String roleId);
+
+    SysRole queryRoleByUserId(@Param("userId") String userId);
+}

+ 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();
+
+}

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

@@ -0,0 +1,22 @@
+package cn.com.ctop.common.mapper;
+
+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;
+
+/**
+ * @Description: 用户分配
+ * @Author: jeecg-boot
+ * @Date: 2019-08-08
+ * @Version: V1.0
+ */
+public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
+    IPage<UserAllocation> queryListWithPermission(Page<UserAllocation> page, String sql);
+
+    List<JSONObject> getAccountListByProjectList(@Param(value = "list")List list, @Param(value = "designUserId")String designUserId);
+}

+ 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 `jeecg-boot`.ctop_project where 1=1
+        and media_id in
+        <foreach collection="mediaList" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        <if test="userId!=null">
+            and responsible_id = #{userId}
+        </if>
+    </select>
+</mapper>

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

@@ -0,0 +1,301 @@
+<?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 `jeecg-boot`.ctop_project_member
+        where user_id = #{userId}
+    </select>
+
+    <select id="selectProductsByUserId" resultType="java.lang.Long">
+        select  DISTINCT(product_id) from `jeecg-boot`.ctop_project where product_id is not NULL  and id in
+         (select
+              DISTINCT(project_id)
+          from `jeecg-boot`.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 `jeecg-boot`.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
+        `jeecg-boot`.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
+        `jeecg-boot`.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
+        `jeecg-boot`.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
+        `jeecg-boot`.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
+        `jeecg-boot`.ctop_user_allocation a
+        left join hcst_system.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
+            `jeecg-boot`.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
+            `jeecg-boot`.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
+        `jeecg-boot`.ctop_advertiser
+        WHERE
+        id = t1.advertiser_id
+        ) AS 'advertiserName',
+        t1.media_id as 'mediaId'
+        FROM
+        `jeecg-boot`.ctop_project t1
+        WHERE
+        t1.id IN (
+        SELECT
+        project_id
+        FROM
+        `jeecg-boot`.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
+        `jeecg-boot`.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 `jeecg-boot`.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
+            `jeecg-boot`.ctop_project_member member
+            left join `jeecg-boot`.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
+        `jeecg-boot`.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
+        `jeecg-boot`.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',
+        t3.product_name  as 'productName',
+        t2.advertiser_id as 'advertiserId',
+        t4.`name`        as 'advertiserName'
+        from `jeecg-boot`.ctop_project_member t1
+        left join `jeecg-boot`.ctop_project t2 on t1.project_id = t2.id
+        left join `jeecg-boot`.ctop_product t3 on t3.id = t2.product_id
+        left join `jeecg-boot`.ctop_advertiser t4 on t2.advertiser_id = t4.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,
+        t2.project_name,
+        t2.product_id,
+        t3.product_name,
+        t2.advertiser_id,
+        t4.`name`
+        order by t2.id desc
+    </select>
+    <select id="getProjectIdsByProductId" resultType="java.lang.Long">
+        SELECT
+        t1.id
+        FROM
+        `jeecg-boot`.ctop_project t1
+        LEFT JOIN `jeecg-boot`.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 `jeecg-boot`.ctop_project_member cpm
+                 left join `jeecg-boot`.ctop_project cp on cpm.project_id = cp.id
+                 left join `jeecg-boot`.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
+        `jeecg-boot`.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>

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

@@ -0,0 +1,29 @@
+<?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.SysRoleMapper">
+
+    <!-- 根据roleCode获取roleId -->
+    <select id="getRoleIdByRoleCode" resultType="java.lang.String">
+        select id
+        from `jeecg-boot`.sys_role
+        where role_code = #{roleCode}
+    </select>
+
+    <!-- 根据userId获取角色code -->
+    <select id="getRoleCodeByUserId" resultType="java.lang.String">
+        select c.role_code
+        from `jeecg-boot`.sys_user a
+                 left join `jeecg-boot`.sys_user_role b on a.id = b.user_id
+                 left join `jeecg-boot`.sys_role c on b.role_id = c.id
+        where a.id = #{userId}
+    </select>
+
+
+    <select id="queryRoleByUserId" resultType="cn.com.ctop.common.entity.SysRole">
+        SELECT t2.role_name,t2.role_code
+        FROM `jeecg-boot`.sys_user_role t1
+                 LEFT JOIN sys_role t2 ON t1.role_id = t2.id
+        WHERE t1.user_id = #{userId} LIMIT 1
+    </select>
+
+</mapper>

+ 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 `jeecg-boot`.sys_user where del_flag = 0 and status = 1
+    </select>
+</mapper>

+ 26 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/common/mapper/xml/UserAllocationMapper.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.common.mapper.UserAllocationMapper">
+
+    <select id="queryListWithPermission" resultType="cn.com.ctop.common.entity.UserAllocation">
+        select * from `jeecg-boot`.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 `jeecg-boot`.sys_user where id = t1.user_id ) as 'userName',
+        t1.auth_name as 'authName',
+        t1.account_status as 'accountStatus'
+        from `jeecg-boot`.ctop_user_allocation t1
+        where t1.project_id in
+        <foreach collection="list" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        <if test="designUserId!=null">
+            and t1.user_id = #{designUserId}
+        </if>
+        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);
+}

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

@@ -0,0 +1,21 @@
+package cn.com.ctop.common.service;
+
+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
+ * @Date: 2019-08-08
+ * @Version: V1.0
+ */
+public interface IUserAllocationService extends IService<UserAllocation> {
+    IPage<UserAllocation> queryListWithPermission(Integer pageSize, Integer pageNo);
+
+    Map<Long, List<JSONObject>> getAccountListByProjectList(List<JSONObject> projectList,String designUserId);
+}

+ 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,null);
+        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,String designUserId) {
+        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,designUserId);
+        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;
+    }
+
+}

+ 0 - 2
jeecg-boot-report/src/main/java/cn/com/ctop/report/JeecgBootReportApplication.java

@@ -10,9 +10,7 @@ import org.springframework.context.annotation.ComponentScan;
 @SpringBootApplication(exclude = {ShiroAnnotationProcessorAutoConfiguration.class, ShiroAutoConfiguration.class, ShiroBeanAutoConfiguration.class})
 @ComponentScan(basePackages = {"org.jeecg", "cn.com.ctop"})
 public class JeecgBootReportApplication {
-
     public static void main(String[] args) {
         SpringApplication.run(JeecgBootReportApplication.class, args);
     }
-
 }

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

@@ -0,0 +1,121 @@
+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.jeecg.common.util.DateUtils;
+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.text.ParseException;
+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("data",dataList);
+        return resultMap;
+    }
+
+    /**
+     * 查询账户报表数据
+     */
+    @PostMapping("/kuaishou/list")
+    public Result<List<JSONObject>> getListReport(@RequestBody JSONObject requestBody) throws ParseException {
+        Result<List<JSONObject>> result = new Result<>();
+        if (requestBody.isEmpty()) {
+            log.error("request body is empty");
+            result.setSuccess(false);
+        }
+        BigDecimal discount = requestBody.getBigDecimal("disscount");
+        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");
+        Integer hour = requestBody.getInteger("hour");
+        if(null == hour){
+            hour = DateUtils.getNowHour();
+        }
+        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("disscount");
+        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.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.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.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 getUserId = params.getString("userId");
+        String type = params.getString("type");
+        if (null == getUserId || "".equals(getUserId.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 userId = getUserId;
+        String roleCode = sysRoleMapper.getRoleCodeByUserId(userId);
+        //角色为 管理员 || 销售 || 媒介 查询全部
+        if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
+            userId = null;
+        }
+        String operatorId = null;
+        if ("operator".equals(roleCode) || roleCode.contains("operationAssistant")) {
+            operatorId = getUserId;
+        }
+        //查询项目信息以及广告主
+        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,operatorId);
+            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", Long.parseLong(startDate.replace("-","")));
+            requestMap.put("endDate", Long.parseLong(endDate.replace("-","")));
+
+            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.getInteger("channelType"))) {
+                requestMap.put("channelType", requestBody.getInteger("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("/kuaishou/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;
+    }
+}

+ 33 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/AccountAttributionInfo.java

@@ -0,0 +1,33 @@
+package cn.com.ctop.report.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+@Data
+@TableName("ctop_account_attribution_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class AccountAttributionInfo {
+    @TableId
+    private String id;
+    private Long accountId;
+    private Long projectId;
+    private Long productId;
+    private String advertiserId;
+    private String companyId;
+    private String projectName;
+    private String advertiserName;
+    private String companyName;
+    private String saleId;
+    private String userId;
+    private String orgCode;
+    @TableField(exist = false)
+    private String userName;
+    @TableField(exist = false)
+    private String authName;
+}

+ 504 - 0
jeecg-boot-report/src/main/java/cn/com/ctop/report/entity/KuaishouAccountReportDailyDw.java

@@ -0,0 +1,504 @@
+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_daily_dw")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class KuaishouAccountReportDailyDw {
+    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 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;
+}

+ 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;
+}

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

@@ -0,0 +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") Long statDate, @Param("accountIds") JSONArray accountIds);
+
+    //根据小时区间查询今日汇总数据
+    JSONObject queryTodaySumByHour(@Param("statDate") Long statDate, @Param("hour") int hour, @Param("accountIds") JSONArray accountIds);
+
+    //根据开始、结束时间 查询汇总数据
+    JSONObject querySumByStartEndDate(@Param("endDate") Long endDate, @Param("startDate") Long startDate, @Param("accountIds") JSONArray accountIds);
+
+    //今日明细数据
+    List<JSONObject> queryTodayDetailReportBy(@Param("filed") String filed, @Param("statDate") Long statDate, @Param("accountIds") JSONArray accountIds);
+
+    //按月分组查询明细数据
+    List<JSONObject> queryDetailGroupMonthByDate(@Param("endDate") Long endDate, @Param("startDate") Long startDate, @Param("accountIds") JSONArray accountIds);
+
+    //根据开始、结束时间 查询明细数据
+    List<JSONObject> queryDetailByStartEndDate(@Param("endDate") Long endDate, @Param("startDate") Long 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")Long endDate, @Param(value = "startDate")Long startDate, @Param(value = "accountIds")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")Long 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<JSONObject> 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);
+}

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

@@ -0,0 +1,190 @@
+<?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.AccountAttributionInfoMapper">
+
+    <insert id="reloadData">
+        replace into `jeecg-boot`.ctop_account_attribution_info(id, account_id, project_id, product_id, advertiser_id, company_id,
+                                          account_name, project_name, advertiser_name, company_name, sale_id, user_id,
+                                          org_code)
+        select cua.account_id,
+               cua.account_id,
+               cp.id,
+               product.id,
+               ca.id,
+               uc.company_id,
+               cua.auth_name,
+               cp.project_name,
+               ca.name,
+               uc.company_name,
+               cp.sale_id,
+               su.id,
+               su.org_code
+        from `jeecg-boot`.ctop_user_allocation cua
+                 left join `jeecg-boot`.ctop_project cp on cua.project_id = cp.id
+                 left join `jeecg-boot`.ctop_advertiser ca on ca.id = cua.advertiser_id
+                 left join `jeecg-boot`.sys_user su on su.id = cua.user_id
+                 left join `jeecg-boot`.user_company uc on uc.user_id = cua.user_id
+                 left join `jeecg-boot`.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.*,
+               cua.auth_name,
+               cua.user_name
+        from `jeecg-boot`.ctop_user_allocation cua
+        left join `jeecg-boot`.ctop_account_attribution_info caai on caai.account_id = cua.account_id
+        where cua.media_id in
+        <foreach collection="mediaList" 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>
+    </select>
+    <select id="selectDesignAccuntsByParams" resultType="cn.com.ctop.report.entity.AccountAttributionInfo">
+        select caai.*
+        from `jeecg-boot`.ctop_user_allocation cua
+                 left join `jeecg-boot`.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="mediaList" 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(`show`) photoShow,
+            sum(photo_click) photoClick,
+            sum(aClick) as aClick,
+            max(`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(`show`) photoShow,
+            sum(photo_click) photoClick,
+            sum(aClick) as aClick
+            FROM
+            kuaishou_account_report_hourly_dw
+            WHERE
+            stat_date = #{statDate}
+            AND `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(`show`) photoShow,
+            sum(photo_click) photoClick,
+            sum(aClick) as aClick,
+            `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
+            `hour`
+            ORDER BY
+            `hour` ASC
+        </select>
+
+
+        <select id="querySumByStartEndDate" resultType="com.alibaba.fastjson.JSONObject">
+            SELECT
+            ROUND(sum(charge),3) cost,
+            sum(`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(`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(`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,
+        account_name as authName,
+        ${filedAll}
+        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>
+        <if test="hasGroupBy == 1">
+            group by ${groupBy}
+            order by ${target} ${order}
+        </if>
+    </select>
+</mapper>

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

@@ -0,0 +1,23 @@
+<?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 t1.stat_date = #{startDate}
+        and t1.`hour` &lt;= #{hour}
+        AND t1.account_id in
+        <foreach item="item" index="index" collection="accountIds"
+                 open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        <if test="hasGroupBy == 1">
+            group by t1.account_id
+        </if>
+        order by ${target} ${order}
+    </select>
+</mapper>

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

@@ -0,0 +1,128 @@
+<?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 kuaishou_material_video_report_daily_dw 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>
+        <if test="leaderId !=null and leaderId != ''">
+            AND t1.leader_id = #{leaderId}
+        </if>
+        <if test="channelType != null">
+            AND t1.channel_type = #{channelType}
+        </if>
+        <if test="clipId !=null and clipId != ''">
+            AND t1.clip_id = #{clipId}
+        </if>
+        <if test="planId !=null and planId != ''">
+            AND t1.plan_id = #{planId}
+        </if>
+        <if test="shotId !=null and shotId != ''">
+            AND t1.shot_id = #{shotId}
+        </if>
+        <if test="companyId !=null and companyId != ''">
+            AND t1.company_id = #{companyId}
+        </if>
+        GROUP BY t1.signature
+        ) t2
+    </select>
+    <select id="getKuaiShouVideoReportByMap" resultType="com.alibaba.fastjson.JSONObject" parameterType="map">
+        SELECT
+        t1.*
+        FROM
+        (select
+        IFNULL( clip_name, '-' ) AS clip,
+        IFNULL( plan_name, '-' ) AS plan,
+        IFNULL( shot_name, '-' ) AS shot,
+        IFNULL( leader_name, '-' ) AS designLeader,
+        IFNULL( video_name, '-' ) AS materialName,
+        IFNULL( cover_url, '-' ) AS coverUrl,
+        IFNULL( photo_url, '-' ) AS url,
+        IFNULL( channel_name, '-' ) AS channel,
+        IFNULL( stat_date, '-' ) AS createTime,
+                ${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>

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

@@ -0,0 +1,28 @@
+package cn.com.ctop.report.service;
+
+import cn.com.ctop.report.entity.AccountAttributionInfo;
+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);
+}

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

@@ -0,0 +1,348 @@
+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){
+            if(null!=attributionInfo&&null!=attributionInfo.getProjectId()&&attributionInfo.getProjectId()!=0){
+                projectIdMaps.putIfAbsent(attributionInfo.getProjectId(),attributionInfo.getProjectId());
+            }
+        }
+        JSONArray projectInfos = new JSONArray();
+        if(projectIdMaps.isEmpty()){
+            return projectInfos;
+        }
+        for (Long key : projectIdMaps.keySet()) {
+            List<AccountAttributionInfo>accountInfos = getAccountInfoListByProjectId(key,accountAttributionInfos);
+            JSONObject projectInfo = new JSONObject();
+            if(!accountInfos.isEmpty()){
+                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;
+    }
+
+    private List<AccountAttributionInfo> getAccountInfoListByProjectId(Long projectId, List<AccountAttributionInfo> accountAttributionInfos) {
+        List<AccountAttributionInfo>result = new ArrayList<>();
+        for(AccountAttributionInfo attributionInfo:accountAttributionInfos){
+            if(null!=attributionInfo&&null!=attributionInfo.getProjectId()&&attributionInfo.getProjectId().equals(projectId)){
+                result.add(attributionInfo);
+            }
+        }
+        return result;
+    }
+
+    @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;
+        Long startDateNum = Long.parseLong(startDate.replace("-",""));
+        Long anotherStartDateNum = Long.parseLong(DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1).replace("-",""));
+
+        Long endDateNum = Long.parseLong(endDate.replace("-",""));
+        Long anotherEndDateNum = Long.parseLong(DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, endDate, -1).replace("-",""));
+        if (startDateNum.equals(endDateNum)) {
+            after = accountAttributionInfoMapper.queryTodaySumReportBy(startDateNum, accounts);
+            if (after == null) {
+                return result;
+            }
+            before = accountAttributionInfoMapper.queryTodaySumByHour(anotherStartDateNum, after.getInteger("maxHour"), accounts);
+            if (before == null) {
+                before = after;
+            }
+        } else {
+            after = accountAttributionInfoMapper.querySumByStartEndDate(endDateNum, startDateNum, 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());
+        Long startDateNum = Long.parseLong(startDate.replace("-",""));
+        Long anotherStartDateNum = Long.parseLong(DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1).replace("-",""));
+
+        Long endDateNum = Long.parseLong(endDate.replace("-",""));
+        Long anotherEndDateNum = Long.parseLong(DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, endDate, -1).replace("-",""));
+        if (startDateNum.equals(endDateNum)) {
+            List<JSONObject> after = accountAttributionInfoMapper.queryTodayDetailReportBy(filedAll, startDateNum, accounts);
+            List<JSONObject> before = accountAttributionInfoMapper.queryTodayDetailReportBy(filedAll, anotherStartDateNum, 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(endDateNum, startDateNum, accounts);
+            } else {
+                after = accountAttributionInfoMapper.queryDetailByStartEndDate(endDateNum, startDateNum, 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;
+    }
+}

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

@@ -0,0 +1,84 @@
+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());
+        Long startDateNum = Long.parseLong(startDate.replace("-",""));
+        Long anotherStartDateNum = Long.parseLong(DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1).replace("-",""));
+
+        Long endDateNum = Long.parseLong(endDate.replace("-",""));
+        Long anotherEndDateNum = Long.parseLong(DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, endDate, -1).replace("-",""));
+
+        if (startDateNum.equals(endDateNum)) {
+            String groupBy = "account_id";
+            if (startDate.equals(DateUtils.date2Str())) {
+                result = kuaishouAccountReportHourlyDwMapper.getReportByParams(filedAll, startDateNum, hour, accounts, target, order,1,groupBy);
+                JSONObject afterSum = kuaishouAccountReportHourlyDwMapper.getReportByParams(filedAll, startDateNum, hour, accounts,target,order,0,groupBy).get(0);
+                JSONObject beforeSum = kuaishouAccountReportHourlyDwMapper.getReportByParams(filedAll,anotherStartDateNum , hour, accounts,target,order,0,groupBy).get(0);
+                result.add(afterSum);
+                result.add(beforeSum);
+                result.add(countTotal(afterSum, beforeSum));
+            } else {
+                result = kuaishouAccountReportDailyDwMapper.getReportByParams(filedAll, endDateNum, startDateNum, accounts, target, order,1,groupBy);
+                JSONObject afterSum = kuaishouAccountReportDailyDwMapper.getReportByParams(filedAll, endDateNum, startDateNum, accounts,target,order,0,groupBy).get(0);
+                JSONObject beforeSum = kuaishouAccountReportDailyDwMapper.getReportByParams(filedAll, anotherEndDateNum, anotherStartDateNum, 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, endDateNum, startDateNum, accounts, target, order,1,groupBy);
+            List<JSONObject> totalList = kuaishouAccountReportDailyDwMapper.getReportByParams(filedAll, endDateNum, startDateNum, 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);
+    }
+}

+ 4 - 11
jeecg-boot-report/src/main/resources/application-dev.yml

@@ -5,7 +5,6 @@ server:
     include-exception: true
     include-stacktrace: ALWAYS
     include-message: ALWAYS
-
   compression:
     enabled: true
     min-response-size: 1024
@@ -20,7 +19,7 @@ spring:
     nacos:
       discovery:
         server-addr: 127.0.0.1:8848
-        service: jeecg-cloud-finance
+        service: jeecg-cloud-report
   servlet:
      multipart:
         max-file-size: 10MB
@@ -106,16 +105,10 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-          username: hcst
-          password: hcst@2020
+          url: jdbc:mysql://139.186.27.96:3390/application?characterEncoding=UTF-8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          username: data
+          password: hcst@2021
           driver-class-name: com.mysql.jdbc.Driver
-          # 多数据源配置
-          #multi-datasource1:
-          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-          #username: root
-          #password: root
-          #driver-class-name: com.mysql.cj.jdbc.Driver
   #redis 配置
   redis:
     database: 0

+ 2 - 3
jeecg-boot-report/src/main/resources/application-prod.yml

@@ -5,7 +5,6 @@ server:
     include-exception: true
     include-stacktrace: ALWAYS
     include-message: ALWAYS
-
   compression:
     enabled: true
     min-response-size: 1024
@@ -20,7 +19,7 @@ spring:
     nacos:
       discovery:
         server-addr: 172.30.0.7:8848
-        service: jeecg-cloud-finance
+        service: jeecg-cloud-report
   servlet:
      multipart:
         max-file-size: 10MB
@@ -106,7 +105,7 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://139.186.27.96:3390/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          url: jdbc:mysql://139.186.27.96:3390/application?characterEncoding=UTF-8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
           username: data
           password: hcst@2021
           driver-class-name: com.mysql.jdbc.Driver

+ 2 - 2
jeecg-boot-report/src/main/resources/application-test.yml

@@ -15,8 +15,8 @@ spring:
   cloud:
     nacos:
       discovery:
-        server-addr: 139.186.134.115:8848
-        service: jeecg-cloud-finance
+        server-addr: 172.30.0.14:8848
+        service: jeecg-cloud-report
   servlet:
     multipart:
       max-file-size: -1

+ 0 - 0
jeecg-boot-report/src/main/resources/application.yml


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác