Quellcode durchsuchen

Merge branch 'V2.0.1' into test

zhaoxian vor 3 Jahren
Ursprung
Commit
5aba43e9c3

+ 6 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsVideoReportCtrl.java

@@ -81,6 +81,7 @@ public class KsVideoReportCtrl {
                 throw new Exception("请输入查询结束时间");
             }
             String filedAll = JsonResourceUtil.joinAllFiled(AccountReportConstants.getKuaishouVideoReportMap());
+            filedAll = filedAll.replace("t1.photo_show", "`show`");
             if (Check.isNull(filedAll)) {
                 throw new Exception("初始化查询 字段返回为空");
             }
@@ -119,7 +120,11 @@ public class KsVideoReportCtrl {
                 requestMap.put("leaderId", requestBody.getString("leaderId"));
             }
             if (!Check.isNull(requestBody.getString("target"))) {
-                requestMap.put("target", requestBody.getString("target"));
+                if("photo_show".equals(requestBody.getString("target"))){
+                    requestMap.put("target",  "`show`");
+                }else{
+                 requestMap.put("target", requestBody.getString("target"));
+                }
             }
             if (!Check.isNull(requestBody.getString("order"))) {
                 requestMap.put("order", requestBody.getString("order"));

+ 63 - 72
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KsVideoReportMapper.xml

@@ -2,22 +2,23 @@
 <!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.report.mapper.KsVideoReportMapper">
 
-    <select id="getKuaiShouVideoReportByMap" resultType="com.alibaba.fastjson.JSONObject" parameterType="map">
+    <select id="getKuaiShouVideoReportByMap"  resultType="com.alibaba.fastjson.JSONObject" parameterType="map">
         SELECT
-        t1.*,
-        IFNULL(t2.clip_name,'-') as clip,
-        IFNULL(t2.plan_name,'-') as plan,
-        IFNULL(t2.shot_name,'-') as shot,
-        IFNULL(t2.design_team_leader_name,'-') as designLeader,
-        IFNULL(t2.video_name,'-') as materialName,
-        IFNULL(t2.cover_url,'-') as coverUrl,
-        IFNULL(t2.url,'-') as url ,
-        IFNULL(t2.channel_name,'-') AS channel,
-        IFNULL(t2.state_date,'-') as createTime
+        IFNULL(t1.clip_name,'-') as clip,
+        IFNULL(t1.plan_name,'-') as plan,
+        IFNULL(t1.shot_name,'-') as shot,
+        IFNULL(t1.leader_name,'-') as designLeader,
+        IFNULL(t1.video_name,'-') as materialName,
+        IFNULL(t1.cover_url,'-') as coverUrl,
+        IFNULL(t1.photo_url,'-') as url ,
+        IFNULL(t1.channel_name,'-') AS channel,
+        DATE_FORMAT(stat_date,'%Y-%m-%d') as createTime,
+        key_action as 'keyAction',
+        key_action_cost as 'keyActionCost',
+        ${filed}
         FROM
-        (select ${filed}
-        from ctop_etl_kuaishou_account_material_report_daily t1
-        where 1 = 1
+        application.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"
@@ -26,85 +27,75 @@
             </foreach>
         </if>
         <if test="startDate !=null and startDate != ''">
-            AND t1.stat_date &gt;= #{startDate}
+            AND t1.stat_date &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
         </if>
         <if test="endDate !=null and endDate != ''">
-            AND t1.stat_date &lt;= #{endDate}
+            AND t1.stat_date &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
         </if>
-        GROUP BY t1.signature
-        ) t1
-        LEFT JOIN ctop_etl_kuaishou_video_info t2
-        ON t1.signature = t2.video_code
-        WHERE
-        1 = 1
         <if test="leaderId !=null and leaderId != ''">
-            AND t2.design_team_leader_id = #{leaderId}
+            AND t1.leader_id = #{leaderId}
         </if>
         <if test="channelType != null">
-            AND t2.channel_type = #{channelType}
+            AND t1.channel_type = #{channelType}
         </if>
         <if test="clipId !=null and clipId != ''">
-            AND t2.clip_id = #{clipId}
+            AND t1.clip_id = #{clipId}
         </if>
         <if test="planId !=null and planId != ''">
-            AND t2.plan_id = #{planId}
+            AND t1.plan_id = #{planId}
         </if>
         <if test="shotId !=null and shotId != ''">
-            AND t2.shot_id = #{shotId}
+            AND t1.shot_id = #{shotId}
         </if>
         <if test="companyId !=null and companyId != ''">
-            AND t2.company_id = #{companyId}
+            AND t1.company_id = #{companyId}
         </if>
+        group by signature
         ORDER BY ${target} ${order}
     </select>
 
 
     <select id="getTotalByMap" resultType="java.lang.Long">
-        SELECT
-        count(1)
+        SELECT IFNULL(sum(1),0)
+        FROM (
+            SELECT
+        signature
         FROM
-        (select
-        t1.signature
-        from ctop_etl_kuaishou_account_material_report_daily t1
-        where 1 = 1
-        <if test="accountIds !=null and accountIds != ''">
-            and t1.account_id in
-            <foreach item="item" index="index" collection="accountIds"
-                     open="(" separator="," close=")">
-                #{item}
-            </foreach>
-        </if>
-        <if test="startDate !=null and startDate != ''">
-            AND t1.stat_date &gt;= #{startDate}
-        </if>
-        <if test="endDate !=null and endDate != ''">
-            AND t1.stat_date &lt;= #{endDate}
-        </if>
-        GROUP BY t1.signature
-        ) t1
-        LEFT JOIN ctop_etl_kuaishou_video_info t2
-        ON t1.signature = t2.video_code
-        WHERE
-        1 = 1
-        <if test="leaderId !=null and leaderId != ''">
-            AND t2.design_team_leader_id = #{leaderId}
-        </if>
-        <if test="channelType != null">
-            AND t2.channel_type = #{channelType}
-        </if>
-        <if test="clipId !=null and clipId != ''">
-            AND t2.clip_id = #{clipId}
-        </if>
-        <if test="planId !=null and planId != ''">
-            AND t2.plan_id = #{planId}
-        </if>
-        <if test="shotId !=null and shotId != ''">
-            AND t2.shot_id = #{shotId}
-        </if>
-        <if test="companyId !=null and companyId != ''">
-            AND t2.company_id = #{companyId}
-        </if>
-
+        application.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;= DATE_FORMAT(#{startDate},'%Y%m%d')
+            </if>
+            <if test="endDate !=null and endDate != ''">
+                AND t1.stat_date &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
+            </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 signature
+        ) t
     </select>
 
 

+ 85 - 77
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaiShouAccountReportMapper.xml

@@ -5,14 +5,13 @@
     <select id="queryTodaySumReportBy" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         ROUND(sum(charge),2) cost,
-        sum(photo_show) photoShow,
+        sum(`show`) photoShow,
         sum(photo_click) photoClick,
         sum(aClick) as aClick,
-        max(stat_hour) maxHour
-        FROM
-        ctop_kuaishou_report_hourly_account
+        max(`hour`) maxHour
+        FROM application.kuaishou_account_report_hourly_dw
         WHERE
-        stat_date = #{statDate}
+        stat_date = DATE_FORMAT(#{statDate},'%Y%m%d')
         AND account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
@@ -22,13 +21,15 @@
 
     <select id="queryTodaySumByHourGroupAccount" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
-        t2.account_id as accountId,
-        t2.auth_name as authName,
+        t1.account_id as accountId,
+        t1.account_name as authName,
+        key_action as 'keyAction',
+        key_action_cost as 'keyActionCost',
         ${filed}
-        FROM ctop_kuaishou_report_hourly_account t1
-        left join ctop_user_allocation t2 on t1.account_id=t2.account_id
-        WHERE t1.stat_date = #{statDate}
-        and t1.stat_hour &lt;= #{hour}
+        FROM
+        application.kuaishou_account_report_hourly_dw t1
+        WHERE t1.stat_date = DATE_FORMAT(#{statDate},'%Y%m%d')
+        and t1.`hour` &lt;= #{hour}
         AND t1.account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
@@ -40,15 +41,14 @@
 
     <select id="queryTodaySumByHour" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
-          ROUND(sum(charge),2) cost,
-          sum(photo_show) photoShow,
-          sum(photo_click) photoClick,
-          sum(aClick) as aClick
-        FROM
-          ctop_kuaishou_report_hourly_account
+        ROUND(sum(charge),2) cost,
+        sum(photo_show) photoShow,
+        sum(photo_click) photoClick,
+        sum(aClick) as aClick
+        FROM application.kuaishou_account_report_hourly_dw
         WHERE
-          stat_date = #{statDate}
-        AND stat_hour &lt;= #{hour}
+        stat_date = DATE_FORMAT(#{statDate},'%Y%m%d')
+        AND `hour` &lt;= #{hour}
         AND account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
@@ -58,13 +58,15 @@
 
     <select id="querySumByHour" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
+        key_action as 'keyAction',
+        key_action_cost as 'keyActionCost',
         ${filed}
         FROM
-        ctop_kuaishou_report_hourly_account t1
+        application.kuaishou_account_report_hourly_dw t1
         WHERE
-        t1.stat_date = #{statDate}
-        and t1.stat_hour &lt;= #{hour}
-        AND t1.account_id in
+        stat_date = DATE_FORMAT(#{statDate},'%Y%m%d')
+        and `hour` &lt;= #{hour}
+        AND account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
@@ -73,32 +75,33 @@
 
     <select id="queryTodayDetailReportBy" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
-          ROUND(sum(charge),2) cost,
-          sum(photo_show) photoShow,
-          sum(photo_click) photoClick,
-          sum(aClick) as aClick,
-          stat_hour as statHour
-        FROM
-          ctop_kuaishou_report_hourly_account
+        ROUND(sum(charge),2) cost,
+        sum(`show`) photoShow,
+        sum(photo_click) photoClick,
+        sum(aClick) as aClick,
+        `hour` as statHour
+        FROM application.kuaishou_account_report_hourly_dw
         WHERE
-          stat_date = #{statDate}
+        stat_date = DATE_FORMAT(#{statDate},'%Y%m%d')
         AND account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
         </foreach>
         GROUP BY
-        stat_hour
+        `hour`
         ORDER BY
-        stat_hour ASC
+        `hour` ASC
     </select>
 
     <select id="queryAllSumByStartEndDate" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
+        key_action as 'keyAction',
+        key_action_cost as 'keyActionCost',
         ${filed}
-        FROM ctop_kuaishou_report_daily_account t1
-        WHERE t1.stat_date &lt;= #{endDate}
-        AND t1.stat_date &gt;= #{startDate}
+        FROM application.kuaishou_account_report_daily_dw t1
+        WHERE  t1.stat_date &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
+        AND t1.stat_date &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
         AND t1.account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
@@ -108,13 +111,14 @@
 
     <select id="querySumByStartEndDate" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
-          ROUND(sum(charge),2) cost,
-          sum(photo_show) photoShow,
-          sum(photo_click) photoClick,
-          sum(aClick) as aClick
-        FROM ctop_kuaishou_report_daily_account t1
-        WHERE t1.stat_date &lt;= #{endDate}
-        AND t1.stat_date &gt;= #{startDate}
+        ROUND(sum(charge),2) cost,
+        sum(`show`) photoShow,
+        sum(photo_click) photoClick,
+        sum(aClick) as aClick
+        FROM
+        application.kuaishou_account_report_daily_dw
+        WHERE stat_date &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
+        AND stat_date &gt;= DATE_FORMAT( #{startDate},'%Y%m%d')
         AND account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
@@ -124,16 +128,17 @@
 
     <select id="querySumByDateGroupAccount" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
-        t1.stat_date as statDate,
-        t2.account_id as accountId,
-        t2.auth_name as authName,
+        DATE_FORMAT(t1.stat_date,'%Y-%m-%d') as statDate,
+        t1.account_id as accountId,
+        t1.account_name as authName,
+        key_action as 'keyAction',
+        key_action_cost as 'keyActionCost',
         ${filed}
         FROM
-        ctop_kuaishou_report_daily_account t1
-        left join ctop_user_allocation t2 on t1.account_id=t2.account_id
+        application.kuaishou_account_report_daily_dw  t1
         WHERE
-        t1.stat_date &lt;= #{endDate}
-        AND t1.stat_date &gt;= #{startDate}
+        t1.stat_date &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
+        AND t1.stat_date &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
         AND t1.account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
@@ -145,16 +150,17 @@
 
     <select id="querySumByDateGroupAccountAndDate" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
-        t1.stat_date as statDate,
-        t2.account_id as accountId,
-        t2.auth_name as authName,
+        key_action as 'keyAction',
+        key_action_cost as 'keyActionCost',
+        DATE_FORMAT(t1.stat_date,'%Y-%m-%d') as statDate,
+        t1.account_id as accountId,
+        t1.account_name as authName,
         ${filed}
         FROM
-        ctop_kuaishou_report_daily_account t1
-        left join ctop_user_allocation t2 on t1.account_id=t2.account_id
+        application.kuaishou_account_report_daily_dw  t1
         WHERE
-        t1.stat_date &lt;= #{endDate}
-        AND t1.stat_date &gt;= #{startDate}
+        t1.stat_date &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
+        AND t1.stat_date &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
         AND t1.account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
@@ -166,41 +172,43 @@
 
     <select id="queryDetailByStartEndDate" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
-          ROUND(sum(charge),2) cost,
-          sum(photo_show) photoShow,
-          sum(photo_click) photoClick,
-          sum(aClick) as aClick,
-          stat_date as statDate
+        ROUND(sum(charge),2) cost,
+        sum(`show`) photoShow,
+        sum(photo_click) photoClick,
+        sum(aClick) as aClick,
+        DATE_FORMAT(stat_date,'%Y-%m-%d') as statDate
         FROM
-          ctop_kuaishou_report_daily_account
-        WHERE stat_date &lt;= #{endDate}
-        AND stat_date &gt;= #{startDate}
+        application.kuaishou_account_report_daily_dw
+        WHERE stat_date &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
+        AND stat_date &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
         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
+        order by stat_date
     </select>
 
     <select id="queryDetailGroupMonthByDate" resultType="com.alibaba.fastjson.JSONObject">
+
         SELECT
-          ROUND(sum(charge),2) cost,
-          sum(photo_show) photoShow,
-          sum(photo_click) photoClick,
-          sum(aClick) as aClick,
-          DATE_FORMAT(t1.stat_date, '%Y-%m') statDate
-        FROM ctop_kuaishou_report_daily_account t1
-        WHERE t1.stat_date &lt;= #{endDate}
-        AND t1.stat_date &gt;= #{startDate}
-        AND t1.account_id in
+        ROUND(sum(charge),2) cost,
+        sum(`show`) photoShow,
+        sum(photo_click) photoClick,
+        sum(aClick) as aClick,
+        DATE_FORMAT(stat_date, '%Y-%m') statDate
+        FROM
+        application.kuaishou_account_report_daily_dw
+        WHERE stat_date &lt;=  DATE_FORMAT(#{endDate},'%Y%m%d')
+        AND stat_date &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
+        AND 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
+        group by DATE_FORMAT(stat_date, '%Y-%m')
+        order by stat_date
     </select>
 
     <select id="queryDetailGroupDayByMonth" resultType="com.alibaba.fastjson.JSONObject">

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

@@ -39,7 +39,8 @@ public class KsVideoReportServiceImpl implements IKsVideoReportService {
     public PageInfo<JSONObject> getKuaiShouVideoPageReportByMap(Map<String, Object> requestMap, int pageSize, int pageNo) {
         Long total = ksVideoReportMapper.getTotalByMap(requestMap);
         PageHelper.startPage(pageNo, pageSize, false);
-        PageInfo pageInfo = new PageInfo(ksVideoReportMapper.getKuaiShouVideoReportByMap(requestMap));
+        List<JSONObject> list = ksVideoReportMapper.getKuaiShouVideoReportByMap(requestMap);
+        PageInfo pageInfo = new PageInfo(list);
         pageInfo.setTotal(total);
         return pageInfo;
 

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

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.report.service.impl;
 
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaiShouAccountReportMapper;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouAccountReportService;
@@ -92,7 +93,11 @@ public class KuaiShouAccountReportServiceImpl implements IKuaiShouAccountReportS
     @Override
     public List<JSONObject> getListDataBy(String mediaId, BigDecimal discount, JSONArray accounts, String startDate, String endDate, int hour, String target, String order) {
         List<JSONObject> result;
+        if (!Check.isNull(target) && "photo_show".equals(target)) {
+            target = "`show`";
+        }
         String filedAll = JsonResourceUtil.joinAllFiled(AccountReportConstants.getDicMapKs());
+        filedAll = filedAll.replace("t1.photo_show", "`show`");
         if (startDate.equals(endDate)) {
             if (startDate.equals(DateUtils.date2Str())) {
                 result = kuaiShouAccountReportMapper.queryTodaySumByHourGroupAccount(filedAll, startDate, hour, accounts, target, order);

+ 25 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/controller/BytedanceVideoReportCtrl.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.toutiao.modules.report.controller;
 
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.ExportExcelUtils;
 import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceVideoReportService;
@@ -54,6 +55,30 @@ public class BytedanceVideoReportCtrl {
             int pageSize = requestBody.getInteger("pageSize");
             int pageNo = requestBody.getInteger("pageNo");
             String filedAll = JsonResourceUtil.joinAllFiled(AccountReportConstants.getDicMapByVideo());
+            filedAll = filedAll.replace("like_material", "`like`").
+                    replace("material_show", "`show`").
+                    replace("convert_material", "`convert`").
+                    replace("play50_feed_break", "play_50_feed_break").
+                    replace("play100_feed_break", "play_100_feed_break").
+                    replace("play25_feed_break", "play_25_feed_break").
+                    replace("play75_feed_break", "play_75_feed_break").
+                    replace("share_material", "share");
+            if (!Check.isNull(target) && "material_show".equals(target)) {
+                target = "`show`";
+            } else if ("convert_material".equals(target)) {
+                target = "`convert`";
+            } else if ("play50_feed_break".equals(target)) {
+                target = "play_50_feed_break";
+            } else if ("play100_feed_break".equals(target)) {
+                target = "play_100_feed_break";
+            } else if ("play25_feed_break".equals(target)) {
+                target = "play_25_feed_break";
+            } else if ("play75_feed_break".equals(target)) {
+                target = "play_75_feed_break";
+            } else if ("share_material".equals(target)) {
+                target = "share";
+            }
+
             try {
                 if (accountIds.isEmpty()) {
                     accountIds = null;

+ 121 - 127
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceAccountReportMapper.xml

@@ -5,15 +5,14 @@
     <select id="queryTodaySumReportBy" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         ROUND(sum(cost),2) cost,
-        sum(show_num) showNum,
+        sum(`show`) showNum,
         sum(click) click,
-        sum(convert_num) as convertNum,
-        max(stat_hour) maxHour
+        sum(`convert`) as convertNum,
+        max(`hour`) maxHour
         FROM
-        ctop_bytedance_report_advertiser_hourly
-        WHERE
-        stat_datetime = #{statDate}
-        AND advertiser_id in
+        application.bytedance_advertiser_report_hourly_dw
+        WHERE stat_datetime = DATE_FORMAT(#{statDate},'%Y%m%d')
+        AND account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
@@ -21,48 +20,44 @@
     </select>
 
     <select id="queryTodayReportByAccount" resultType="com.alibaba.fastjson.JSONObject">
-        SELECT
-        ROUND(sum(cost),2) cost,
-        sum(show_num) showNum,
-        sum(click) click,
-        sum(convert_num) as convertNum
-        FROM
-        ctop_bytedance_report_advertiser_daily
-        WHERE
-        stat_datetime = #{statDate} '00:00:00'
-        AND advertiser_id= #{accountId}
+        SELECT ROUND(sum(cost), 2) cost,
+               sum(show_num)       showNum,
+               sum(click)          click,
+               sum(convert_num) as convertNum
+        FROM ctop_bytedance_report_advertiser_daily
+        WHERE stat_datetime = #{statDate} '00:00:00'
+        AND account_id= #{accountId}
     </select>
 
     <select id="queryTodaySumByHourGroupAccount" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
-        t2.account_id as accountId,
-        t2.auth_name as authName,
+        t1.account_id as accountId,
+        t1.account_name as authName,
         ${filed}
-        FROM ctop_bytedance_report_advertiser_hourly t1
-        left join ctop_user_allocation t2 on t1.advertiser_id=t2.account_id
-        WHERE t1.stat_datetime = #{statDate}
-        and t1.stat_hour &lt;= #{hour}
-        AND t1.advertiser_id in
+        FROM application.bytedance_advertiser_report_hourly_dw t1
+        WHERE t1.stat_datetime = DATE_FORMAT(#{statDate}, '%Y%m%d' )
+        and t1.`hour` &lt;= #{hour}
+        AND t1.account_id IN
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
         </foreach>
-        group by t1.advertiser_id
+        group by t1.account_id
         order by ${target} ${order}
     </select>
 
     <select id="queryTodaySumByHour" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         ROUND(sum(cost),2) cost,
-        sum(show_num) showNum,
+        sum(`show`) showNum,
         sum(click) click,
-        sum(convert_num) as convertNum
+        sum(`convert`) as convertNum
         FROM
-        ctop_bytedance_report_advertiser_hourly
+        application.bytedance_advertiser_report_hourly_dw
         WHERE
-        stat_datetime = #{statDate}
-        and stat_hour &lt;= #{hour}
-        AND advertiser_id in
+        stat_datetime = DATE_FORMAT(#{statDate},'%Y%m%d')
+        and `hour` &lt;= #{hour}
+        AND account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
@@ -73,11 +68,11 @@
         SELECT
         ${filed}
         FROM
-        ctop_bytedance_report_advertiser_hourly t1
+        application.bytedance_advertiser_report_hourly_dw t1
         WHERE
-        t1.stat_datetime = #{statDate}
-        and t1.stat_hour &lt;= #{hour}
-        AND t1.advertiser_id in
+        t1.stat_datetime = DATE_FORMAT(#{statDate},'%Y%m%d')
+        and t1.`hour` &lt;= #{hour}
+        AND t1.account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
@@ -87,32 +82,32 @@
     <select id="queryTodayDetailReportBy" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         ROUND(sum(cost),2) cost,
-        sum(show_num) showNum,
+        sum(`show`) showNum,byteDance/dailyPage
         sum(click) click,
-        sum(convert_num) as convertNum,
-        stat_hour as statHour
+        sum(`convert`) as convertNum,
+        `hour` as statHour
         FROM
-        ctop_bytedance_report_advertiser_hourly
+        application.bytedance_advertiser_report_hourly_dw
         WHERE
-        stat_datetime = #{statDate}
-        AND advertiser_id in
+        stat_datetime = DATE_FORMAT(#{statDate},'%Y%m%d')
+        AND account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
         </foreach>
         GROUP BY
-        stat_hour
+        `hour`
         ORDER BY
-        stat_hour ASC
+        `hour` ASC
     </select>
 
     <select id="queryAllSumByStartEndDate" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         ${filed}
-        FROM ctop_bytedance_report_advertiser_daily t1
-        WHERE t1.stat_datetime &lt;= #{endDate} '00:00:00'
-        AND t1.stat_datetime &gt;= #{startDate}
-        AND t1.advertiser_id in
+        FROM application.bytedance_advertiser_report_hourly_dw  t1
+        WHERE t1.stat_datetime &lt;=DATE_FORMAT(#{endDate},'%Y%m%d')
+        AND t1.stat_datetime &gt;= DATE_FORMAT(#{statDate},'%Y%m%d')
+        AND t1.account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
@@ -121,13 +116,14 @@
 
     <select id="querySumByStartEndDate" resultType="com.alibaba.fastjson.JSONObject">
         SELECT ROUND(sum(cost), 2) cost,
-        sum(show_num) showNum,
+        sum(`show`) showNum,
         sum(click) click,
-        sum(convert_num) as convertNum
-        FROM ctop_bytedance_report_advertiser_daily t1
-        WHERE t1.stat_datetime &lt;= #{endDate} '00:00:00'
-        AND t1.stat_datetime &gt;= #{startDate}
-        AND advertiser_id in
+        sum(`convert`) as convertNum
+        FROM
+        application.bytedance_advertiser_report_hourly_dw
+        WHERE stat_datetime &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
+        AND stat_datetime &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
+        AND account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
@@ -137,37 +133,35 @@
     <select id="querySumByDateGroupAccount" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         DATE_FORMAT(t1.stat_datetime,'%Y-%m-%d') as statDate,
-        t2.account_id as accountId,
-        t2.auth_name as authName,
+        t1.account_id as accountId,
+        t1.account_name as authName,
         ${filed}
         FROM
-        ctop_bytedance_report_advertiser_daily t1
-        left join ctop_user_allocation t2 on t1.advertiser_id=t2.account_id
+        FROM application.bytedance_advertiser_report_hourly_dw  t1
         WHERE
-        t1.stat_datetime &lt;= #{endDate} '00:00:00'
-        AND t1.stat_datetime &gt;= #{startDate}
-        AND t1.advertiser_id in
+        t1.stat_datetime &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
+        AND t1.stat_datetime &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
+        AND t1.account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
         </foreach>
-        group by t1.advertiser_id
+        group by t1.account_id
         order by ${target} ${order}
     </select>
 
     <select id="querySumByDateGroupAccountAndDate" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         DATE_FORMAT(t1.stat_datetime,'%Y-%m-%d') as statDate,
-        t2.account_id as accountId,
-        t2.auth_name as authName,
+        t1.account_id as accountId,
+        t1.account_name as authName,
         ${filed}
         FROM
-        ctop_bytedance_report_advertiser_daily t1
-        left join ctop_user_allocation t2 on t1.advertiser_id=t2.account_id
+        FROM application.bytedance_advertiser_report_hourly_dw  t1
         WHERE
-        t1.stat_datetime &lt;= #{endDate} '00:00:00'
-        AND t1.stat_datetime &gt;= #{startDate}
-        AND t1.advertiser_id in
+        t1.stat_datetime &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
+        AND t1.stat_datetime &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
+        AND t1.account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
@@ -179,45 +173,44 @@
     <select id="queryDetailByStartEndDate" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         ROUND(sum(cost),2) cost,
-        sum(show_num) showNum,
+        sum(`show`) showNum,
         sum(click) click,
-        sum(convert_num) convertNum,
+        sum(`convert`) convertNum,
         DATE_FORMAT(stat_datetime, '%Y-%m-%d') statDate
         FROM
-        ctop_bytedance_report_advertiser_daily
-        WHERE stat_datetime &lt;= #{endDate} '00:00:00'
-        AND stat_datetime &gt;= #{startDate}
-        AND advertiser_id in
+        application.bytedance_advertiser_report_daily_dw
+        WHERE stat_datetime &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
+        AND stat_datetime &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
+        AND account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
         </foreach>
         group by stat_datetime
-        order by stat_datetime asc
+        order by stat_datetime
     </select>
 
     <select id="queryDetailGroupMonthByDate" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         ROUND(sum(cost),2) cost,
-        sum(show_num) showNum,
+        sum(`show`) showNum,
         sum(click) click,
-        sum(convert_num) convertNum,
+        sum(`convert`) convertNum,
         DATE_FORMAT(t1.stat_datetime, '%Y-%m') statDate
-        FROM ctop_bytedance_report_advertiser_daily t1
-        WHERE t1.stat_datetime &lt;= #{endDate} '00:00:00'
-        AND t1.stat_datetime &gt;= #{startDate}
-        AND t1.advertiser_id in
+        FROM application.bytedance_advertiser_report_daily_dw t1
+        WHERE t1.stat_datetime &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
+        AND t1.stat_datetime &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
+        AND t1.account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
         </foreach>
         group by DATE_FORMAT(t1.stat_datetime, '%Y-%m')
-        order by t1.stat_datetime asc
+        order by t1.stat_datetime
     </select>
 
     <select id="queryDetailGroupDayByMonth" resultType="com.alibaba.fastjson.JSONObject">
-        SELECT
-               DATE_FORMAT(stat_datetime, '%Y-%m-%d')                      statDate,
+        SELECT DATE_FORMAT(stat_datetime, '%Y-%m-%d') statDate,
                SUBSTR(DATE_FORMAT(stat_datetime, '%Y-%m-%d') FROM 9 FOR 2) day
         FROM ctop_bytedance_report_advertiser_daily
         WHERE stat_datetime like '${month}%'
@@ -226,7 +219,8 @@
     </select>
 
     <sql id="selectSql">
-        ifnull(sum(a.show_num),0)                          as showMaterial,
+        ifnull
+        (sum(a.show_num),0)                          as showMaterial,
         ifnull(sum(a.click),0)                             as clickMaterial,
         ifnull(sum(a.convert_num),0)                       as convertMaterial,
         ifnull(sum(a.cost),0)                              as cost,
@@ -250,53 +244,65 @@
 		case
         when sum(a.total_play) != 0 and sum(a.total_play) is not null and sum(a.play25_feed_break) is not null
         then round(sum(a.play25_feed_break) / sum(a.total_play),2)
-        else 0 end                               as play25FeedBreakRate,
+        else 0
+        end                               as play25FeedBreakRate,
 		case
         when sum(a.click) != 0 and sum(a.click) is not null and sum(a.convert_num) is not null
         then round(sum(a.convert_num) / sum(a.click),2)
-        else 0 end                               as convertRate,
+        else 0
+        end                               as convertRate,
         case
         when sum(a.convert_num) != 0 and sum(a.convert_num) is not null and sum(a.cost) is not null
         then round(sum(a.cost)/sum(a.convert_num),2)
-        else 0 end as convertCost,
+        else 0
+        end as convertCost,
 		ifnull(sum(a.follow),0)                            as follow,
         ifnull(sum(a.next_day_open),0)                     as nextDayOpen,
         case
         when sum(a.active) != 0 and sum(a.next_day_open) is not null and sum(a.active) is not null
         then round(sum(a.next_day_open) / sum(a.active),2)
-        else 0 end                               as nextDayOpenRate,
+        else 0
+        end                               as nextDayOpenRate,
         case
         when sum(a.next_day_open) != 0 and sum(a.next_day_open) is not null and sum(a.cost) is not null
         then round(sum(a.cost) / sum(a.next_day_open),2)
-        else 0 end                               as nextDayOpenCost,
+        else 0
+        end                               as nextDayOpenCost,
 		case
         when sum(a.click) != 0 and sum(a.click) is not null and sum(a.cost) is not null
         then round(sum(a.cost) / sum(a.click),2)
-        else 0 end                               as cpc,
+        else 0
+        end                               as cpc,
         case
         when sum(a.show_num) != 0 and sum(a.show_num) is not null and sum(a.click) is not null
         then round(sum(a.click) / sum(a.show_num),2)
-        else 0 end                               as ctr,
+        else 0
+        end                               as ctr,
         case
         when sum(a.show_num) != 0 and sum(a.cost) is not null and sum(a.show_num) is not null
         then round(sum(a.cost) / sum(a.show_num) * 1000,2)
-        else 0 end                               as cpm,
+        else 0
+        end                               as cpm,
 		case
         when sum(a.active) != 0 and sum(a.cost) is not null and sum(a.active) is not null
         then round(sum(a.cost) / sum(a.active),2)
-        else 0 end                               as activeCost,
+        else 0
+        end                               as activeCost,
 		case
         when sum(a.click) != 0 and sum(a.active) is not null and sum(a.click) is not null
         then round(sum(a.active) / sum(a.click),2)
-        else 0 end                               as activeRate,
+        else 0
+        end                               as activeRate,
         case
         when sum(a.active) != 0 and sum(a.register) is not null and sum(a.active) is not null
         then round(sum(a.register) / sum(a.active),2)
-        else 0 end                               as activeRegisterRate,
+        else 0
+        end                               as activeRegisterRate,
         case
         when sum(a.register) != 0 and sum(a.cost) is not null and sum(a.register) is not null
         then round(sum(a.cost) / sum(a.register),2)
-        else 0 end                               as activeRegisterCost
+        else 0
+        end                               as activeRegisterCost
     </sql>
 
     <select id="getBytedanceAccountInfoByProjectId"
@@ -400,11 +406,9 @@
     </select>
 
     <select id="getRoleCodeByUserId" resultType="string">
-        select
-        role_code
-        from
-        sys_user_role a
-        left join sys_role b on a.role_id = b.id
+        select role_code
+        from sys_user_role a
+                 left join sys_role b on a.role_id = b.id
         where a.user_id = #{userId}
     </select>
 
@@ -460,40 +464,30 @@
     </select>
 
     <select id="getUserProjectAccountIds" resultType="long">
-        select
-        a.account_id
-        from
-        (select project_id,account_id,media_id,create_time from ctop_user_allocation  group by account_id) a
-        left join ctop_project_member b on a.project_id=b.project_id
-        where
-        a.user_id = #{userId}
-        and a.media_id in (1,3)
-        order by a.create_time desc
-        limit 50
+        select a.account_id
+        from (select project_id, account_id, media_id, create_time from ctop_user_allocation group by account_id) a
+                 left join ctop_project_member b on a.project_id = b.project_id
+        where a.user_id = #{userId}
+          and a.media_id in (1, 3)
+        order by a.create_time desc limit 50
     </select>
 
 
     <select id="getSaleProjectAccountIds" resultType="long">
-        select
-        a.account_id
-        from
-        (select project_id,account_id,media_id,create_time from ctop_user_allocation  group by account_id) a
-        left join ctop_project b on a.project_id=b.id
-        where
-        b.sale_id = #{userId}
-        and b.media_id in (1,3)
+        select a.account_id
+        from (select project_id, account_id, media_id, create_time from ctop_user_allocation group by account_id) a
+                 left join ctop_project b on a.project_id = b.id
+        where b.sale_id = #{userId}
+          and b.media_id in (1, 3)
         order by a.create_time desc
 
     </select>
 
     <select id="getUserProjectAccountIdsByAdmin" resultType="long">
-        select
-        a.account_id
-        from
-        ctop_user_allocation a
-        left join ctop_project b on a.project_id = b.id
-        where
-        b.media_id in (1,3)
+        select a.account_id
+        from ctop_user_allocation a
+                 left join ctop_project b on a.project_id = b.id
+        where b.media_id in (1, 3)
 
     </select>
     <select id="getBytedanceProjectInfoEntity"

+ 13 - 15
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceVideoReportMapper.xml

@@ -4,27 +4,25 @@
 
     <select id="queryVideoReportBy" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
-        t1.md5 signature,
-        (case when t1.toutiao_url != ''  then t1.toutiao_url
-            when t1.url !='' then t1.url
-            else ''  end ) AS url,
+        t1.signature,
+        t1.video_url AS url,
         t1.cover_url AS converUrl,
         t1.clip_name AS clip,
         t1.shot_name AS shot,
         t1.plan_name AS plan,
-        t1.team_leader as leader,
-        t1.material_name AS materialName,
+        t1.leader_name AS leader,
+        t1.video_name AS materialName,
         t1.project_name AS projectName,
-        t1.material_create_time AS createTime,
-        sum(t1.material_show) as showMaterial,
-        t1.team_leader as 'teamLeader',
-        concat(CAST(round(sum(t1.in_app_pay) / sum(t1.convert_material)*100,2) AS CHAR) ,'%') as 'firstPurchase',
+        DATE_FORMAT(stat_datetime,'%Y-%m-%d') AS createTime,
+        sum( t1.SHOW ) AS showMaterial,
+        t1.leader_name AS 'teamLeader',
+        concat( CAST( round( sum( t1.in_app_pay ) / sum( t1.CONVERT )* 100, 2 ) AS CHAR ), '%' ) AS 'firstPurchase',
         ${filed}
         FROM
-        etl_report_bytedance_video t1
+        application.bytedance_material_video_report_daily_dw t1
         WHERE
-        t1.stat_datetime >= #{startDate}
-        AND t1.stat_datetime &lt;= #{endDate}
+        t1.stat_datetime >= DATE_FORMAT(#{startDate}, '%Y%m%d' )
+        AND t1.stat_datetime &lt;= DATE_FORMAT(#{endDate}, '%Y%m%d' )
         <if test="accountIds != null">
             AND t1.account_id in
             <foreach item="item" index="index" collection="accountIds"
@@ -42,9 +40,9 @@
             AND (t1.plan_name LIKE '%${plan}%')
         </if>
         <if test="leader!= null and leader!='' ">
-            AND t1.team_leader LIKE '%${leader}%'
+            AND t1.leader_name LIKE '%${leader}%'
         </if>
-        GROUP BY t1.md5
+        GROUP BY t1.signature
         ORDER BY ${target} ${order}
     </select>
 

+ 29 - 7
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceAccountReportServiceImpl.java

@@ -102,17 +102,39 @@ public class BytedanceAccountReportServiceImpl implements IBytedanceAccountRepor
     public List<JSONObject> getListDataBy(String mediaId, BigDecimal discount, JSONArray accounts, String startDate, String endDate, int hour, String target, String order) {
         List<JSONObject> result;
         String filedAll = JsonResourceUtil.joinAllFiled(AccountReportConstants.getDictMapBy());
+        filedAll = filedAll.replace("like_num", "`like`").
+                replace("show_num", "`show`").
+                replace("convert_num", "`convert`").
+                replace("play50_feed_break", "play_50_feed_break").
+                replace("play100_feed_break", "play_100_feed_break").
+                replace("play25_feed_break", "play_25_feed_break").
+                replace("play75_feed_break", "play_75_feed_break");
+        if (!Check.isNull(target) && "like_num".equals(target)) {
+            target = "`like`";
+        } else if ("show_num".equals(target)) {
+            target = "`show`";
+        } else if ("convert_num".equals(target)) {
+            target = "`convert`";
+        } else if ("play50_feed_break".equals(target)) {
+            target = "play_50_feed_break";
+        } else if ("play100_feed_break".equals(target)) {
+            target = "play_100_feed_break";
+        } else if ("play25_feed_break".equals(target)) {
+            target = "play_25_feed_break";
+        } else if ("play75_feed_break".equals(target)) {
+            target = "play_75_feed_break";
+        }
         if (startDate.equals(endDate)) {
             //由于时报数据不准,修改逻辑除当日数据外全部请求日报数据
-            if(startDate.equals(DateUtils.date2Str())){
+            if (startDate.equals(DateUtils.date2Str())) {
                 result = bytedanceAccountReportMapper.queryTodaySumByHourGroupAccount(filedAll, startDate, hour, accounts, target, order);
                 JSONObject afterSum = bytedanceAccountReportMapper.querySumByHour(filedAll, startDate, hour, accounts);
                 JSONObject beforeSum = bytedanceAccountReportMapper.querySumByHour(filedAll, DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1), hour, accounts);
                 result.add(afterSum);
                 result.add(beforeSum);
                 result.add(countTotal(afterSum, beforeSum));
-            }else {
-                result= bytedanceAccountReportMapper.querySumByDateGroupAccount(filedAll, endDate, startDate, accounts, target, order);
+            } else {
+                result = bytedanceAccountReportMapper.querySumByDateGroupAccount(filedAll, endDate, startDate, accounts, target, order);
                 JSONObject afterSum = bytedanceAccountReportMapper.queryAllSumByStartEndDate(filedAll, endDate, startDate, accounts);
                 JSONObject beforeSum = bytedanceAccountReportMapper.queryAllSumByStartEndDate(filedAll, DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, endDate, -1), DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1), accounts);
                 result.add(afterSum);
@@ -135,10 +157,10 @@ public class BytedanceAccountReportServiceImpl implements IBytedanceAccountRepor
         List<JSONObject> result;
         if (startDate.equals(endDate)) {
             //由于时报数据不准,修改逻辑除当日数据外全部请求日报数据
-            if(startDate.equals(DateUtils.date2Str())){
+            if (startDate.equals(DateUtils.date2Str())) {
                 result = bytedanceAccountReportMapper.queryTodaySumByHourGroupAccount(filed, startDate, hour, accounts, target, order);
-            }else {
-                result= bytedanceAccountReportMapper.querySumByDateGroupAccount(filed, startDate, endDate, accounts, target, order);
+            } else {
+                result = bytedanceAccountReportMapper.querySumByDateGroupAccount(filed, startDate, endDate, accounts, target, order);
             }
         } else {
             result = bytedanceAccountReportMapper.querySumByDateGroupAccount(filed, endDate, startDate, accounts, target, order);
@@ -205,7 +227,7 @@ public class BytedanceAccountReportServiceImpl implements IBytedanceAccountRepor
             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 ? zero : after.getBigDecimal(k), before.getBigDecimal(k) == null ? zero : before.getBigDecimal(k))).multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP)+"%");
+                jsonObject.put(k, (LinkUtils.countLink(after.getBigDecimal(k) == null ? zero : after.getBigDecimal(k), before.getBigDecimal(k) == null ? zero : before.getBigDecimal(k))).multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%");
             }
         });
         return jsonObject;

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

@@ -82,6 +82,7 @@ public class AiKuaishouAdvertiserStrategyController {
         List<String> userIds = new ArrayList<>();
         if ("CompanyManager".equals(roleCode)) {
             userIds = sysRoleService.getCompanyUsers(roleCode, userId);
+            aiKuaishouAdvertiserStrategy.setUserIds(userIds);
         } else if ("bytedanceDirector".equals(roleCode)) {
             userIds = sysRoleService.getCompanyUsers(roleCode, userId);
             aiKuaishouAdvertiserStrategy.setUserIds(userIds);