Bladeren bron

Merge remote-tracking branch 'origin/master'

yumeng 11 maanden geleden
bovenliggende
commit
1708366ab9
14 gewijzigde bestanden met toevoegingen van 337 en 118 verwijderingen
  1. 1 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/KuaiShouOcpxActionTypeConfig.java
  2. 2 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/KuaiShouOcpxActionTypeConfigMapper.java
  3. 7 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/KuaiShouOcpxActionTypeConfigMapper.xml
  4. 5 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/IKuaiShouOcpxActionTypeConfigService.java
  5. 5 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/KuaiShouOcpxActionTypeConfigServiceImpl.java
  6. 20 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/controller/FinancePaymentApplicationController.java
  7. 44 7
      jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/controller/FinancePaymentRechargeApplicationController.java
  8. 11 11
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml
  9. 2 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/material/controller/FirstDeliveryValidController.java
  10. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/FirstDeliveryValidServiceImpl.java
  11. 192 87
      jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceAccountReportMapper.xml
  12. 4 0
      jeecg-boot-module-system/src/main/java/org/jeecg/common/constant/AccountReportConstants.java
  13. 28 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AdvertiserController.java
  14. 15 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaiShouOcpxActionTypeConfigController.java

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

@@ -40,6 +40,7 @@ public class KuaiShouOcpxActionTypeConfig {
     @Excel(name = "优化目标", width = 15)
     @ApiModelProperty(value = "优化目标")
     private Integer ocpxActionType;
+    private Integer level;
     /**
      * 优化名称
      */

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

@@ -20,4 +20,6 @@ public interface KuaiShouOcpxActionTypeConfigMapper extends BaseMapper<KuaiShouO
     List<JSONObject> bytedanceList(@Param("level") Integer level);
 
     List<JSONObject> getKuaiShouOcpxTypeList();
+
+    List<JSONObject> getKSdeepList();
 }

+ 7 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/KuaiShouOcpxActionTypeConfigMapper.xml

@@ -13,9 +13,13 @@
     </select>
 
     <select id="getKuaiShouOcpxTypeList" resultType="com.alibaba.fastjson.JSONObject">
-        select
-            ocpx_action_type as 'ocpxActionType',
-            ocpx_action_name as 'ocpxActionName'
+        select ocpx_action_type as 'ocpxActionType', ocpx_action_name as 'ocpxActionName'
         from ctop_kuaishou_ocpx_action_type_config
     </select>
+
+    <select id="getKSdeepList" resultType="com.alibaba.fastjson.JSONObject">
+        select ocpx_action_type as 'deepCode', ocpx_action_name as 'deepName'
+        from ctop_kuaishou_ocpx_action_type_config
+        where `level` = 2
+    </select>
 </mapper>

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

@@ -1,9 +1,12 @@
 package cn.com.ctop.common.module.service;
 
 import cn.com.ctop.common.module.entity.KuaiShouOcpxActionTypeConfig;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.common.api.vo.Result;
 
+import java.util.List;
+
 /**
  * @Description: 转化目标字典表
  * @Author: jeecg-boot
@@ -13,4 +16,6 @@ import org.jeecg.common.api.vo.Result;
 public interface IKuaiShouOcpxActionTypeConfigService extends IService<KuaiShouOcpxActionTypeConfig> {
 
     Result<Object> bytedanceList();
+
+    List<JSONObject> getKSdeepList();
 }

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

@@ -29,4 +29,9 @@ public class KuaiShouOcpxActionTypeConfigServiceImpl extends ServiceImpl<KuaiSho
         data.put("deepConversionType", deepConversionType);
         return Result.ok(data);
     }
+
+    @Override
+    public List<JSONObject> getKSdeepList() {
+        return baseMapper.getKSdeepList();
+    }
 }

+ 20 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/controller/FinancePaymentApplicationController.java

@@ -54,13 +54,30 @@ public class FinancePaymentApplicationController {
         String roleCode = sysRoleService.getRoleCodeByUserId(application.getUserId());
 
         if ("saleAssistant".equals(roleCode)) {
-            if ("4f6454dbad954a8094013bf4c6d74796".equals(application.getUserId())
-                    || "f33798b117a3486a9fae7ba0dab2e0be".equals(application.getUserId())
+            if ("4f6454dbad954a8094013bf4c6d74796".equals(application.getUserId())) {
+                List<String> userIds = new ArrayList<>();
+                userIds.add("4f6454dbad954a8094013bf4c6d74796");//曹媛 销售助理
+                userIds.add("42e137a90ca94cbfa89b21b306cb2e78");//侯加鑫
+                userIds.add("959842590bfc4ad38e0aced255177ced");//王维新
+                userIds.add("f0190eaabfb4488caa22e123e94dadc8");//高洪哲
+                userIds.add("f33798b117a3486a9fae7ba0dab2e0be");//赵欣 销售助理
+                userIds.add("515b962ad5544991b17e744df2b87bab");//支春雨 销售助理
+                userIds.add("5c6abd3bc1d64a1aa365157f7edd3ecd");//关蕊 销售助理
+                userIds.add("02afeb64079043e6b9d6c9581dcef164");//李小治
+                userIds.add("ec8f6954b6ae49e7a356d173dd6568d1");//王莹
+                userIds.add("96058e7c29f14e4380dfbdddde21175b");//杜鑫艳 销售助理
+                userIds.add("163a4cc9a72c425e873d36d08e75f2cd");//陈心瑞 销售助理
+                userIds.add("fe4965692844468798e4fc265e3cdfc8");//崔泽
+                userIds.add("9a99a2e906b64f5082f87c3a60a20b2e");//王明雨
+                userIds.add("e2d55e2888e849ed911bc89b72fc8211");//支一淼 销售助理
+                userIds.add("102f7edf378b42d2a730d28d11a8cc1e");//张鹤玲  销售助理
+                queryWrapper.in("applicanter_id", userIds);
+            } else if ("f33798b117a3486a9fae7ba0dab2e0be".equals(application.getUserId())
                     || "515b962ad5544991b17e744df2b87bab".equals(application.getUserId())
                     || "5c6abd3bc1d64a1aa365157f7edd3ecd".equals(application.getUserId())
                     || "96058e7c29f14e4380dfbdddde21175b".equals(application.getUserId())
             ) {
-                /*销售助理 曹媛组 4f6454dbad954a8094013bf4c6d74796:侯加鑫、王维新、高洪哲             */
+                /*销售助理 关蕊组 5c6abd3bc1d64a1aa365157f7edd3ecd:侯加鑫、王维新、高洪哲             */
                 List<String> userIds = new ArrayList<>();
                 userIds.add("4f6454dbad954a8094013bf4c6d74796");//曹媛 销售助理
                 userIds.add("42e137a90ca94cbfa89b21b306cb2e78");//侯加鑫

+ 44 - 7
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/controller/FinancePaymentRechargeApplicationController.java

@@ -56,14 +56,32 @@ public class FinancePaymentRechargeApplicationController {
             //查询用户角色
             String roleCode = sysRoleService.getRoleCodeByUserId(recharge.getUserId());
             if ("saleAssistant".equals(roleCode)) {
-                if ("4f6454dbad954a8094013bf4c6d74796".equals(recharge.getUserId())
-                        || "f33798b117a3486a9fae7ba0dab2e0be".equals(recharge.getUserId())
+                //曹媛 可以看所有人的
+                if ("4f6454dbad954a8094013bf4c6d74796".equals(recharge.getUserId())) {
+                    List<String> userIds = new ArrayList<>();
+                    userIds.add("4f6454dbad954a8094013bf4c6d74796");//曹媛 销售助理
+                    userIds.add("42e137a90ca94cbfa89b21b306cb2e78");//侯加鑫
+                    userIds.add("959842590bfc4ad38e0aced255177ced");//王维新
+                    userIds.add("f0190eaabfb4488caa22e123e94dadc8");//高洪哲
+                    userIds.add("f33798b117a3486a9fae7ba0dab2e0be");//赵欣 销售助理
+                    userIds.add("515b962ad5544991b17e744df2b87bab");//支春雨 销售助理
+                    userIds.add("5c6abd3bc1d64a1aa365157f7edd3ecd");//关蕊 销售助理
+                    userIds.add("02afeb64079043e6b9d6c9581dcef164");//李小治
+                    userIds.add("ec8f6954b6ae49e7a356d173dd6568d1");//王莹
+                    userIds.add("96058e7c29f14e4380dfbdddde21175b");//杜鑫艳 销售助理
+                    userIds.add("163a4cc9a72c425e873d36d08e75f2cd");//陈心瑞 销售助理
+                    userIds.add("fe4965692844468798e4fc265e3cdfc8");//崔泽
+                    userIds.add("9a99a2e906b64f5082f87c3a60a20b2e");//王明雨
+                    userIds.add("e2d55e2888e849ed911bc89b72fc8211");//支一淼 销售助理
+                    userIds.add("102f7edf378b42d2a730d28d11a8cc1e");//张鹤玲  销售助理
+                    recharge.setUserIds(userIds);
+                } else if ("f33798b117a3486a9fae7ba0dab2e0be".equals(recharge.getUserId())
                         || "515b962ad5544991b17e744df2b87bab".equals(recharge.getUserId())
                         || "5c6abd3bc1d64a1aa365157f7edd3ecd".equals(recharge.getUserId())
                         || "96058e7c29f14e4380dfbdddde21175b".equals(recharge.getUserId())
 
                 ) {
-                    /*销售助理 曹媛组 4f6454dbad954a8094013bf4c6d74796:侯加鑫、王维新、高洪哲             */
+                    /*销售助理 关蕊组 5c6abd3bc1d64a1aa365157f7edd3ecd:侯加鑫、王维新、高洪哲             */
                     List<String> userIds = new ArrayList<>();
                     userIds.add("4f6454dbad954a8094013bf4c6d74796");//曹媛 销售助理
                     userIds.add("42e137a90ca94cbfa89b21b306cb2e78");//侯加鑫
@@ -259,13 +277,32 @@ public class FinancePaymentRechargeApplicationController {
             //查询用户角色
             String roleCode = sysRoleService.getRoleCodeByUserId(recharge.getUserId());
             if ("saleAssistant".equals(roleCode)) {
-                if ("4f6454dbad954a8094013bf4c6d74796".equals(recharge.getUserId())
-                        || "f33798b117a3486a9fae7ba0dab2e0be".equals(recharge.getUserId())
+                //曹媛 可以看所有人的
+                if ("4f6454dbad954a8094013bf4c6d74796".equals(recharge.getUserId())) {
+                    List<String> userIds = new ArrayList<>();
+                    userIds.add("4f6454dbad954a8094013bf4c6d74796");//曹媛 销售助理
+                    userIds.add("42e137a90ca94cbfa89b21b306cb2e78");//侯加鑫
+                    userIds.add("959842590bfc4ad38e0aced255177ced");//王维新
+                    userIds.add("f0190eaabfb4488caa22e123e94dadc8");//高洪哲
+                    userIds.add("f33798b117a3486a9fae7ba0dab2e0be");//赵欣 销售助理
+                    userIds.add("515b962ad5544991b17e744df2b87bab");//支春雨 销售助理
+                    userIds.add("5c6abd3bc1d64a1aa365157f7edd3ecd");//关蕊 销售助理
+                    userIds.add("02afeb64079043e6b9d6c9581dcef164");//李小治
+                    userIds.add("ec8f6954b6ae49e7a356d173dd6568d1");//王莹
+                    userIds.add("96058e7c29f14e4380dfbdddde21175b");//杜鑫艳 销售助理
+                    userIds.add("163a4cc9a72c425e873d36d08e75f2cd");//陈心瑞 销售助理
+                    userIds.add("fe4965692844468798e4fc265e3cdfc8");//崔泽
+                    userIds.add("9a99a2e906b64f5082f87c3a60a20b2e");//王明雨
+                    userIds.add("e2d55e2888e849ed911bc89b72fc8211");//支一淼 销售助理
+                    userIds.add("102f7edf378b42d2a730d28d11a8cc1e");//张鹤玲  销售助理
+                    recharge.setUserIds(userIds);
+                } else if ("f33798b117a3486a9fae7ba0dab2e0be".equals(recharge.getUserId())
                         || "515b962ad5544991b17e744df2b87bab".equals(recharge.getUserId())
                         || "5c6abd3bc1d64a1aa365157f7edd3ecd".equals(recharge.getUserId())
                         || "96058e7c29f14e4380dfbdddde21175b".equals(recharge.getUserId())
+
                 ) {
-                    /*销售助理 曹媛 4f6454dbad954a8094013bf4c6d74796:侯加鑫、王维新、高洪哲             */
+                    /*销售助理 关蕊组 5c6abd3bc1d64a1aa365157f7edd3ecd:侯加鑫、王维新、高洪哲             */
                     List<String> userIds = new ArrayList<>();
                     userIds.add("4f6454dbad954a8094013bf4c6d74796");//曹媛 销售助理
                     userIds.add("42e137a90ca94cbfa89b21b306cb2e78");//侯加鑫
@@ -282,7 +319,7 @@ public class FinancePaymentRechargeApplicationController {
                         || "e2d55e2888e849ed911bc89b72fc8211".equals(recharge.getUserId())
                         || "102f7edf378b42d2a730d28d11a8cc1e".equals(recharge.getUserId())
                 ) {
-                    /*销售助理 陈心瑞:崔泽、王明雨                 */
+                    /*销售助理 陈心瑞:崔泽、王明雨                 */
                     List<String> userIds = new ArrayList<>();
                     userIds.add("163a4cc9a72c425e873d36d08e75f2cd");//陈心瑞 销售助理
                     userIds.add("fe4965692844468798e4fc265e3cdfc8");//崔泽

+ 11 - 11
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml

@@ -933,7 +933,7 @@
         )
         ) as 'designResponsibleName',
         ifnull(round(sum(a.charge),3),0) as 'charge',
-        ifnull(sum(a.photo_show),0) as 'photoShow',
+        ifnull(sum(a.show),0) as 'photoShow',
         ifnull(sum(a.photo_click),0) as 'photoClick',
         ifnull(sum(a.aclick),0) as 'aclick',
         ifnull(sum(a.bclick),0) as 'bclick',
@@ -942,13 +942,13 @@
         ifnull(sum(a.event_register),0) as 'eventRegister',
         ifnull(sum(event_next_day_stay),0) as 'eventNextDayStay',
         ROUND(IFNULL(sum(a.charge)/sum(a.activation),0),2) as 'activationCost',
-        case when (sum(a.photo_show) is not null and sum(a.photo_show)!=0) then
-        concat(round(ifnull(sum(a.photo_click),0)/sum(a.photo_show) * 100 ,2),'%') else 0 end as 'photoClickRate',
+        case when (sum(a.show) is not null and sum(a.show)!=0) then
+        concat(round(ifnull(sum(a.photo_click),0)/sum(a.show) * 100 ,2),'%') else 0 end as 'photoClickRate',
         case when (sum(a.aclick) is not null and sum(a.aclick)!=0) then
         concat(round(ifnull(sum(a.bclick),0)/sum(a.aclick) * 100 ,2),'%') else 0 end as 'bclickRate',
         (case
-        when (sum(a.photo_show) is not null and sum(a.photo_show) != 0)
-        then round((ifnull(sum(a.charge),0) / sum(a.photo_show)) * 1000,2)
+        when (sum(a.show) is not null and sum(a.show) != 0)
+        then round((ifnull(sum(a.charge),0) / sum(a.show)) * 1000,2)
         else 0
         end
         ) as 'impression1kCost',
@@ -964,9 +964,9 @@
         ELSE 0
         end
         ) as 'actionCost',
-        ifnull(sum(a.photo_share),0) as 'photoShare',
-        ifnull(sum(a.photo_comment),0) as 'photoComment',
-        ifnull(sum(a.photo_like),0) as 'photoLike',
+        ifnull(sum(a.share),0) as 'photoShare',
+        ifnull(sum(a.comment),0) as 'photoComment',
+        ifnull(sum(a.like),0) as 'photoLike',
         ifnull(sum(a.follow),0) as 'follow',
         ifnull(sum(a.report),0) as 'report',
         ifnull(sum(a.cancel_follow),0) as 'cancelFollow',
@@ -981,13 +981,13 @@
         end
         ) as 'eventNextDayStayCost'
         from
-        ctop_kuaishou_report_daily_account a
+        application.kuaishou_account_report_daily_dw a
         left join ctop_user_allocation b
         on a.account_id = b.account_id
         where
-        a.stat_date &gt;= #{startDate}
+        a.stat_date &gt;= date_format(#{startDate}, '%Y%m%d')
         and
-        a.stat_date &lt;= #{endDate}
+        a.stat_date &lt;= date_format(#{endDate}, '%Y%m%d')
         and
         b.project_id in
         <foreach collection="projectList" item="item" separator=","

+ 2 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/material/controller/FirstDeliveryValidController.java

@@ -101,7 +101,8 @@ public class FirstDeliveryValidController {
             userIds.add("1b3deb8258e84df994f1371a51cfc14a");
             text.append("上传首投有效素材失败通知:").append("<br/>")
                     .append("您好,您上传的EXCEL文件录入失败").append("<br/>")
-                    .append("请联系管理员!");
+                    .append("请联系管理员!").append("<br/>")
+                    .append("上传页面:统计报表->头条-有效素材->导入明细");
             for (String userId : userIds) {
                 sendMessageService.sendMessage(userId, text.toString());
             }

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/FirstDeliveryValidServiceImpl.java

@@ -232,7 +232,7 @@ public class FirstDeliveryValidServiceImpl implements FirstDeliveryValidService
                 //每行数据对象,按照顺序从0到(lastCellNum-1)记录
                 JSONObject cellEntity = new JSONObject();
                 for (int j = 0; j < lastCellNum; j++) {
-                    cellEntity.put(String.valueOf(j), eeu.getCellValue2(row.getCell(j)));
+                    cellEntity.put(String.valueOf(j), eeu.getCellValue2(row.getCell(j)).replace("\"",""));
                 }
                 list.add(cellEntity);
             }

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

@@ -13,11 +13,11 @@
         application.bytedance_advertiser_report_hourly_dw
         WHERE stat_datetime = DATE_FORMAT(#{statDate},'%Y%m%d')
         <if test="accountIds !=null">
-        AND account_id in
-        <foreach item="item" index="index" collection="accountIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
+            AND account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
     </select>
 
@@ -40,11 +40,11 @@
         WHERE t1.stat_datetime = DATE_FORMAT(#{statDate}, '%Y%m%d' )
         and t1.`hour` &lt;= #{hour}
         <if test="accountIds !=null">
-        AND t1.account_id IN
-        <foreach item="item" index="index" collection="accountIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
+            AND t1.account_id IN
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
         group by t1.account_id
         order by ${target} ${order}
@@ -62,11 +62,11 @@
         stat_datetime = DATE_FORMAT(#{statDate},'%Y%m%d')
         and `hour` &lt;= #{hour}
         <if test="accountIds !=null">
-        AND account_id in
-        <foreach item="item" index="index" collection="accountIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
+            AND account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
     </select>
 
@@ -79,11 +79,11 @@
         t1.stat_datetime = DATE_FORMAT(#{statDate},'%Y%m%d')
         and t1.`hour` &lt;= #{hour}
         <if test="accountIds !=null">
-        AND t1.account_id in
-        <foreach item="item" index="index" collection="accountIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
+            AND t1.account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
     </select>
 
@@ -99,11 +99,11 @@
         WHERE
         stat_datetime = DATE_FORMAT(#{statDate},'%Y%m%d')
         <if test="accountIds !=null">
-        AND account_id in
-        <foreach item="item" index="index" collection="accountIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
+            AND account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
         GROUP BY
         `hour`
@@ -114,15 +114,15 @@
     <select id="queryAllSumByStartEndDate" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         ${filed}
-        FROM application.bytedance_advertiser_report_hourly_dw  t1
+        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(#{startDate},'%Y%m%d')
         <if test="accountIds !=null">
-        AND t1.account_id in
-        <foreach item="item" index="index" collection="accountIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
+            AND t1.account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
     </select>
 
@@ -136,11 +136,11 @@
         WHERE stat_datetime &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
         AND stat_datetime &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
         <if test="accountIds !=null">
-          AND account_id in
-        <foreach item="item" index="index" collection="accountIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
+            AND account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
     </select>
 
@@ -150,16 +150,16 @@
         t1.account_id as accountId,
         t1.account_name as authName,
         ${filed}
-        FROM application.bytedance_advertiser_report_hourly_dw  t1
+        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(#{startDate},'%Y%m%d')
         <if test="accountIds !=null">
-          AND t1.account_id in
-        <foreach item="item" index="index" collection="accountIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
+            AND t1.account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
         group by t1.account_id
         order by ${target} ${order}
@@ -172,16 +172,16 @@
         t1.account_name as authName,
         ${filed}
         FROM
-        FROM application.bytedance_advertiser_report_hourly_dw  t1
+        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(#{startDate},'%Y%m%d')
         <if test="accountIds !=null">
-        AND t1.account_id in
-        <foreach item="item" index="index" collection="accountIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
+            AND t1.account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
         group by t1.stat_datetime
         order by ${target} ${order}
@@ -199,11 +199,11 @@
         WHERE stat_datetime &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
         AND stat_datetime &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
         <if test="accountIds !=null">
-        AND account_id in
-        <foreach item="item" index="index" collection="accountIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
+            AND account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
         group by stat_datetime
         order by stat_datetime
@@ -220,11 +220,11 @@
         WHERE t1.stat_datetime &lt;= DATE_FORMAT(#{endDate},'%Y%m%d')
         AND t1.stat_datetime &gt;= DATE_FORMAT(#{startDate},'%Y%m%d')
         <if test="accountIds !=null">
-        AND t1.account_id in
-        <foreach item="item" index="index" collection="accountIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
+            AND t1.account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
         group by DATE_FORMAT(t1.stat_datetime, '%Y-%m')
         order by t1.stat_datetime
@@ -266,64 +266,174 @@
         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,
+        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,
+        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,
+        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,
+        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,
+        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,
+        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,
+        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,
+        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,
+		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,
+        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,
+        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
+    </sql>
+    <sql id="selectSql1">
+        ifnull
+        (sum(a.show),0)                          as showMaterial,
+        ifnull(sum(a.click),0)                             as clickMaterial,
+        ifnull(sum(a.convert),0)                       as convertMaterial,
+        ifnull(sum(a.cost),0)                              as cost,
+        ifnull(sum(a.active),0)                            as active,
+        ifnull(sum(a.download_finish),0)                   as downloadFinish,
+        ifnull(sum(a.download_start),0)                    as downloadStart,
+		ifnull(sum(a.click_install),0)                     as clickInstall,
+		ifnull(sum(a.install_finish),0)                    as installFinish,
+		ifnull(sum(a.register),0)                          as register,
+        ifnull(sum(a.pay_count),0)                         as payCount,
+		ifnull(sum(a.form),0)                              as form,
+		ifnull(sum(a.total_play),0)                        as totalPlay,
+        ifnull(sum(a.valid_play),0)                        as validPlay,
+        ifnull(sum(a.wifi_play),0)                         as wifiPlay,
+        ifnull(sum(a.play_25_feed_break),0)                 as play25FeedBreak,
+        ifnull(sum(a.play_50_feed_break),0)                 as play50FeedBreak,
+        ifnull(sum(a.play_75_feed_break),0)                 as play75FeedBreak,
+        ifnull(sum(a.play_100_feed_break),0)                as play100FeedBreak,
+		ifnull(sum(a.share),0)                             as shareMaterial,
+		ifnull(sum(a.like),0)                          as likeMaterial,
+		case
+        when sum(a.total_play) != 0 and sum(a.total_play) is not null and sum(a.play_25_feed_break) is not null
+        then round(sum(a.play_25_feed_break) / sum(a.total_play),2)
+        else 0
+        end
+        as play25FeedBreakRate,
+		case
+        when sum(a.click) != 0 and sum(a.click) is not null and sum(a.convert) is not null
+        then round(sum(a.convert) / sum(a.click),2)
+        else 0
+        end
+        as convertRate,
+        case
+        when sum(a.convert) != 0 and sum(a.convert) is not null and sum(a.cost) is not null
+        then round(sum(a.cost)/sum(a.convert),2)
+        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,
+        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,
+		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,
+        case
+        when sum(a.show) != 0 and sum(a.show) is not null and sum(a.click) is not null
+        then round(sum(a.click) / sum(a.show),2)
+        else 0
+        end
+        as ctr,
+        case
+        when sum(a.show) != 0 and sum(a.cost) is not null and sum(a.show) is not null
+        then round(sum(a.cost) / sum(a.show) * 1000,2)
+        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,
+        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,
+        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,
+        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
+        end
+        as activeRegisterCost
     </sql>
 
     <select id="getBytedanceAccountInfoByProjectId"
@@ -385,10 +495,9 @@
 
         select
         concat(#{startDate},'~',#{endDate}) as statDate,
-        a.advertiser_id as 'accountId',
-        c.advertiser_id as 'advertiserId',
-        (select name from ctop_advertiser where id = c.advertiser_id) as 'advertiserName',
-
+        a.account_id as 'accountId',
+        a.advertiser_id as 'advertiserId',
+        a.advertiser_name as 'advertiserName',
         (
         select realname from sys_user where id = (
         select responsible_id from ctop_project where id = b.project_id
@@ -399,24 +508,20 @@
         select design_responsible_id from ctop_project where id = b.project_id
         )
         ) as 'designResponsibleName',
-        b.auth_name as 'authName',
-        b.project_id as 'projectId',
+        a.account_name as 'authName',
+        a.project_id as 'projectId',
         (
-        select realname from sys_user where id = (
-        select sale_id from ctop_project where id = b.project_id
-        )
+        select realname from sys_user where id = a.sale_id
         ) as 'saleName',
-        (select project_name from ctop_project where id = b.project_id) as 'projectName',
+        a.project_name as 'projectName',
         c.media_id as 'mediaId',
-        <include refid="selectSql"></include>
+        <include refid="selectSql1"></include>
         from
-        ctop_bytedance_report_advertiser_daily a
-        left join ctop_user_allocation b on a.advertiser_id = b.account_id
+        application.bytedance_advertiser_report_daily_dw a
+        left join ctop_user_allocation b on a.account_id = b.account_id
         left join ctop_project c on b.project_id = c.id
-        where
-        date_format(a.stat_datetime, '%Y-%m-%d') &gt;= #{startDate}
-        and
-        date_format(a.stat_datetime, '%Y-%m-%d') &lt;= #{endDate}
+        where a.stat_datetime &gt;= date_format(#{startDate}, '%Y%m%d')
+        and a.stat_datetime &lt;= date_format(#{endDate}, '%Y%m%d')
         and
         b.project_id in
         <foreach collection="projectList" item="item" separator=","

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

@@ -561,6 +561,10 @@ public class AccountReportConstants {
             "    \"filed\": \"CASE WHEN sum(t1.charge) / sum(t1.key_action) IS NULL THEN 0 ELSE round(sum(t1.charge)/sum(t1.key_action),3) end as keyActionCost \",\n" +
             "    \"comment\": \"关键行为成本\"\n" +
             "  },\n" +
+            "  \"keyActionRatio\": {\n" +
+            "    \"filed\": \"CASE WHEN  sum(t1.key_action) != 0 THEN concat(CAST(round(sum(t1.key_action) / sum(t1.activation)*100,2) AS CHAR) ,'%') else '0.00%' end as keyActionRatio \",\n" +
+            "    \"comment\": \"关键行为率\"\n" +
+            "  },\n" +
             "  \"eventAppInvoked\": {\n" +
             "    \"filed\": \"IFNULL(sum(t1.event_app_invoked),0) as eventAppInvoked \",\n" +
             "    \"comment\": \"唤醒应用数\"\n" +

+ 28 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AdvertiserController.java

@@ -10,7 +10,11 @@ import cn.com.ctop.common.module.mapper.UserCompanyMapper;
 import cn.com.ctop.common.module.service.IProductService;
 import cn.com.ctop.common.module.service.ISysRoleExtService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
-import cn.com.ctop.common.module.utils.*;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.ctop.common.module.utils.StringUtils;
 import cn.com.ctop.common.module.vo.SheetInfoVo;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouInfoDTO;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO;
@@ -32,11 +36,24 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
 import org.jeecg.modules.ctop.service.IAdvertiserService;
-import org.jeecg.modules.excelutil.entity.*;
+import org.jeecg.modules.excelutil.entity.EffecfReportAccountEntity;
+import org.jeecg.modules.excelutil.entity.EffecfReportCreativeEntity;
+import org.jeecg.modules.excelutil.entity.EffecfReportGroupEntity;
+import org.jeecg.modules.excelutil.entity.EffecfReportPlanEntity;
+import org.jeecg.modules.excelutil.entity.EffecfReportProjectEntity;
+import org.jeecg.modules.excelutil.entity.KuaishouXxlEntity;
 import org.jeecg.modules.system.service.ISysRoleService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
@@ -44,7 +61,12 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.text.ParseException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 广告主信息表
@@ -169,6 +191,7 @@ public class AdvertiserController {
         try {
             String userId = advertiser.getUserId();
             String name = advertiser.getName().trim();
+            advertiser.setName(name);
             QueryWrapper<UserCompany> userCompanyQueryWrapper = new QueryWrapper<>();
             userCompanyQueryWrapper.eq("user_id", userId);
             userCompanyQueryWrapper.orderByDesc("create_time");
@@ -212,6 +235,7 @@ public class AdvertiserController {
         if (advertiserEntity == null) {
             result.error500("未找到对应实体");
         } else {
+            advertiser.setName(advertiser.getName().trim());
             boolean ok = advertiserService.updateById(advertiser);
             if (ok) {
                 result.success("修改成功!");

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

@@ -16,7 +16,15 @@ 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.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
@@ -62,12 +70,18 @@ public class KuaiShouOcpxActionTypeConfigController {
                                                                     HttpServletRequest req) {
         Result<List<KuaiShouOcpxActionTypeConfig>> result = new Result<>();
         QueryWrapper<KuaiShouOcpxActionTypeConfig> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouOcpxActionTypeConfig, req.getParameterMap());
+        queryWrapper.eq("level", 1);
         List<KuaiShouOcpxActionTypeConfig> pageList = kuaiShouOcpxActionTypeConfigService.list(queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
         return result;
     }
 
+    @GetMapping(value = "/deepList")
+    public Result<Object> deepList() {
+        return Result.successMsg("success", kuaiShouOcpxActionTypeConfigService.getKSdeepList());
+    }
+
     @ApiOperation(value = "转化目标字典表-分页列表查询", notes = "转化目标字典表-分页列表查询")
     @GetMapping(value = "/bytedanceList")
     public Result<Object> bytedanceList() {