瀏覽代碼

Merge branch 'test' into V2.0.1

zhaoxian 3 年之前
父節點
當前提交
6f364656b9

+ 12 - 9
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/entity/KuaishouUnitReportHourlyPojo.java

@@ -78,16 +78,17 @@ public class KuaishouUnitReportHourlyPojo {
     @Excel(name = "封面点击率", width = 15)
     @ApiModelProperty(value = "封面点击率")
     private java.math.BigDecimal photoClickRatio;
-    private java.math.BigDecimal clickRate;
+    private String clickRate;
     /** 3s播放率 */
     @Excel(name = "3s播放率", width = 15)
     @ApiModelProperty(value = "3s播放率")
     private java.math.BigDecimal play3sRatio;
+    private String play3sRate;
     /** 行为率 */
     @Excel(name = "行为率", width = 15)
     @ApiModelProperty(value = "行为率")
     private java.math.BigDecimal actionRatio;
-    private java.math.BigDecimal bClickRate;
+    private String bClickRate;
     /** 平均千次曝光花费(元) */
     @Excel(name = "平均千次曝光花费(元)", width = 15)
     @ApiModelProperty(value = "平均千次曝光花费(元)")
@@ -173,6 +174,7 @@ public class KuaishouUnitReportHourlyPojo {
     @Excel(name = "应用下载数据-付费次数", width = 15)
     @ApiModelProperty(value = "应用下载数据-付费次数")
     private Long eventPay;
+    private java.math.BigDecimal eventPayCost;
     /** 应用下载数据-付费金额 */
     @Excel(name = "应用下载数据-付费金额", width = 15)
     @ApiModelProperty(value = "应用下载数据-付费金额")
@@ -196,7 +198,7 @@ public class KuaishouUnitReportHourlyPojo {
     @Excel(name = "应用下载数据-注册率", width = 15)
     @ApiModelProperty(value = "应用下载数据-注册率")
     private java.math.BigDecimal eventRegisterRatio;
-    private java.math.BigDecimal activeRegisterRate;
+    private String activeRegisterRate;
     /** 应用下载数据-完件数 */
     @Excel(name = "应用下载数据-完件数", width = 15)
     @ApiModelProperty(value = "应用下载数据-完件数")
@@ -217,6 +219,7 @@ public class KuaishouUnitReportHourlyPojo {
     @Excel(name = "应用下载数据-授信率", width = 15)
     @ApiModelProperty(value = "应用下载数据-授信率")
     private java.math.BigDecimal eventCreditGrantAppRatio;
+    private String eventCreditGrantAppRate;
     /** 应用下载数据-付款成功数 */
     @Excel(name = "应用下载数据-付款成功数", width = 15)
     @ApiModelProperty(value = "应用下载数据-付款成功数")
@@ -243,7 +246,7 @@ public class KuaishouUnitReportHourlyPojo {
     @Excel(name = "应用下载数据-次留率(仅支持分日查询)", width = 15)
     @ApiModelProperty(value = "应用下载数据-次留率(仅支持分日查询)")
     private java.math.BigDecimal eventNextDayStayRatio;
-    private java.math.BigDecimal nextDayOpenRate;
+    private String nextDayOpenRate;
     /** 落地页数据-表单提交数 */
     @Excel(name = "落地页数据-表单提交数", width = 15)
     @ApiModelProperty(value = "落地页数据-表单提交数")
@@ -257,7 +260,7 @@ public class KuaishouUnitReportHourlyPojo {
     @Excel(name = "落地页数据-表单提交点击率", width = 15)
     @ApiModelProperty(value = "落地页数据-表单提交点击率")
     private java.math.BigDecimal formActionRatio;
-    private java.math.BigDecimal formCountRate;
+    private String formCountRate;
     /** 落地页数据-落地页完件数 */
     @Excel(name = "落地页数据-落地页完件数", width = 15)
     @ApiModelProperty(value = "落地页数据-落地页完件数")
@@ -278,7 +281,7 @@ public class KuaishouUnitReportHourlyPojo {
     @Excel(name = "落地页数据-落地页授信率", width = 15)
     @ApiModelProperty(value = "落地页数据-落地页授信率")
     private java.math.BigDecimal eventCreditGrantLandingPageRatio;
-    private java.math.BigDecimal eventCreditGrantLandingPageRate;
+    private String eventCreditGrantLandingPageRate;
     /** 落地页数据-有效线索数 */
     @Excel(name = "落地页数据-有效线索数", width = 15)
     @ApiModelProperty(value = "落地页数据-有效线索数")
@@ -322,7 +325,7 @@ public class KuaishouUnitReportHourlyPojo {
     /** 唤醒应用率 */
     @Excel(name = "唤醒应用率", width = 15)
     @ApiModelProperty(value = "唤醒应用率")
-    private java.math.BigDecimal eventAppInvokedRatio;
+    private String eventAppInvokedRatio;
     /** 落地页授信率 */
     @Excel(name = "落地页授信率", width = 15)
     @ApiModelProperty(value = "落地页授信率")
@@ -346,7 +349,7 @@ public class KuaishouUnitReportHourlyPojo {
     /** 新增付费人数率 */
     @Excel(name = "新增付费人数率", width = 15)
     @ApiModelProperty(value = "新增付费人数率")
-    private java.math.BigDecimal eventNewUserPayRatio;
+    private String eventNewUserPayRatio;
     /** 平均千次素材曝光花费(元) */
     @Excel(name = "平均千次素材曝光花费(元)", width = 15)
     @ApiModelProperty(value = "平均千次素材曝光花费(元)")
@@ -388,7 +391,7 @@ public class KuaishouUnitReportHourlyPojo {
     @Excel(name = "按钮点击率", width = 15)
     @ApiModelProperty(value = "按钮点击率")
     private java.math.BigDecimal eventButtonClickRatio;
-    private java.math.BigDecimal submitRate;
+    private String submitRate;
     /** 订单支付率 */
     @Excel(name = "订单支付率", width = 15)
     @ApiModelProperty(value = "订单支付率")

+ 1 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/MaterialStareMapper.java

@@ -27,6 +27,7 @@ public interface MaterialStareMapper {
 
     // 头条 同公司所有下级运营人员 有消耗的
     Set<String> getBytedanceAllOperators(@Param("companyId")String companyId,@Param("startDate")Long start, @Param("endDate")Long endDate,@Param("userIds")Set<String> userIds);
+    Set<String> getAllOperatorsByLearderId(@Param("learderId")String learderId);
     //快手-在投项目数量
     String getKuaiShouOperatorProjectNum(@Param("startDate") Long start, @Param("endDate") Long endDate, @Param("userIds") Set<String> userIds);
     //头条-在投项目数量

+ 128 - 84
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/KuaishouOperationRecordMapper.xml

@@ -6,52 +6,74 @@
 <!-- 查询快手组 时报 消耗前10 -->
     <select id="getKuaishouUnitReportHourly" resultType="org.jeecg.ctop.material.entity.KuaishouUnitReportHourlyPojo">
         SELECT
-            unit_id AS unitId,
-            unit_name as unitName,
-            aclick as aclick,
-            bclick as bclick,
-            charge as cost,
-            `show` as photoShow,
-            photo_click_ratio as clickRate,
-            action_ratio as bClickRate,
-            impression_1k_cost as cpm,
-            photo_click_cost as cpc,
-            action_cost as cpb,
-            download_started as downloadStart,
-            download_completed as downloadFinish,
-            activation as active,
-            event_pay_first_day as firstDayPay,
-            event_pay_purchase_amount_first_day as firstDayPayAmount,
-            event_pay_first_day_roi as firstDayPayROI,
-            event_pay_roi as ROI,
-            event_register as register,
-            event_register_cost as activeRegisterCost,
-            event_register_ratio as activeRegisterRate,
-            event_next_day_stay as nextDayOpen,
-            event_next_day_stay_cost as nextDayOpenCost,
-            event_next_day_stay_ratio as nextDayOpenRate,
-            event_credit_grant_landing_page_ratio as eventCreditGrantLandingPageRate,
-            play_3s_ratio as play3sRate,
-            form_cost as formCountCost,
-            form_action_ratio as formCountRate,
-            event_button_click_cost as submitCost,
-            event_button_click_ratio as submitRate,
-            charge as cost,
-            `show` as photoShow,
-            CONCAT(ROUND(download_started / bclick * 100,2) ,'%') as downloadStartRate,
-            ROUND(download_started / bclick * 100,2) as downloadStartCost,
-            CONCAT(ROUND(download_completed / download_started * 100,2) ,'%') as downloadFinishRate,
-            ROUND(charge / download_completed * 100,2) as downloadFinishCost,
-            ROUND(charge / activation * 100,2) as activeCost,
-            CONCAT(ROUND(activation / download_completed * 100,2) ,'%') as activeRate,
-            ROUND(charge / event_pay_first_day * 100,2) as firstDayPayCost
+            unit_id,
+            unit_name,
+            sum( aclick ) AS aClick,
+            sum( bclick ) AS bClick,
+            sum( charge ) AS cost,
+            sum( `show` ) AS photoShow,
+            sum( photo_click ) AS photoClick ,
+            CONCAT( ROUND( sum( photo_click ) / sum( `show` ) * 100, 2 ), '%' ) AS clickRate,
+            CONCAT( ROUND( sum( bclick ) / sum( aclick ) * 100, 2 ), '%' ) AS bClickRate,
+            ROUND( sum( charge ) / sum( `show` ) * 1000, 2 ) AS cpm,
+            ROUND( sum( charge ) / sum( photo_click ) * 1000, 2 ) AS cpc,
+            ROUND( sum( charge ) / sum( bclick ) * 1000, 2 ) AS cpb,
+            sum( download_started ) AS downloadStart,
+            CONCAT( ROUND( sum( download_started ) / sum( bclick ) * 100, 2 ), '%' ) AS downloadStartRate,
+            ROUND( sum( charge ) / sum( download_started ) * 100, 2 ) AS downloadStartCost,
+
+            CONCAT(ROUND( sum( event_pay_first_day ) / sum( activation ) * 100, 2 ), '%' ) AS eventNewUserPayRatio,
+            sum( download_completed ) AS downloadFinish,
+            CONCAT( ROUND( sum( download_completed ) / sum( download_started ) * 100, 2 ), '%' ) AS downloadFinishRate,
+
+            ROUND( sum( charge ) / sum( download_completed ) * 100, 2 ) AS downloadFinishCost,
+            sum( activation ) AS active,
+            ROUND( sum( charge ) / sum( activation ) * 100, 2 ) AS activeCost,
+            CONCAT( ROUND( sum( activation ) / sum( download_completed ) * 100, 2 ), '%' ) AS activeRate,
+            sum( event_pay_first_day ) AS firstDayPay,
+            sum( event_pay_purchase_amount_first_day ) AS firstDayPayAmount,
+            ROUND( sum( charge ) / sum( event_pay_first_day ) * 100, 2 ) AS firstDayPayCost,
+            ROUND( sum( event_pay_purchase_amount_first_day ) / sum( charge ) * 100, 2 ) AS firstDayPayROI,
+            sum( event_pay ) AS eventPay,
+            sum( event_pay_purchase_amount ) AS eventPayPurchaseAmount,
+            ROUND( sum( charge ) / sum( event_pay ) * 100, 2 ) AS eventPayCost,
+            ROUND( sum( event_pay_purchase_amount ) / sum( charge ) * 100, 2 ) AS ROI,
+            sum( event_register ) AS register,
+            ROUND( sum( charge ) / sum( event_register ) * 100, 2 ) AS activeRegisterCost,
+            CONCAT( ROUND( sum( event_register ) / sum( activation ) * 100, 2 ), '%' ) AS activeRegisterRate,
+            sum( event_next_day_stay ) AS nextDayOpen,
+            ROUND( sum( charge ) / sum( event_next_day_stay ) * 100, 2 ) AS nextDayOpenCost,
+            CONCAT(ROUND( sum( charge ) / sum( form_count ) * 100, 2 ), '%' ) AS nextDayOpenRate,
+            sum( event_jin_jian_app ) AS eventJinJianApp,
+            ROUND( sum( charge ) / sum( event_jin_jian_app ) * 100, 2 ) AS eventJinJianAppCost,
+            sum( event_credit_grant_app ) AS eventCreditGrantApp,
+            ROUND( sum( charge ) / sum( event_credit_grant_app ) * 100, 2 ) AS eventCreditGrantAppCost,
+            CONCAT( ROUND( sum( event_credit_grant_app ) / sum( event_jin_jian_app ) * 100, 2 ), '%' ) AS eventCreditGrantAppRate,
+            ROUND( sum( charge ) / sum( aclick ) * 100, 2 )  AS play3sRate,
+            sum( key_action ) AS keyAction,
+            ROUND( sum( charge ) / sum( aclick ) * 100, 2 ) AS keyActionCost,
+            sum( event_app_invoked ) AS eventAppInvoked,
+            ROUND( sum( charge ) / sum( bclick ) * 100, 2 ) AS eventAppInvokedCost,
+            CONCAT( ROUND( sum( event_app_invoked ) / sum( bclick ) * 100, 2 ), '%' ) AS eventAppInvokedRatio,
+            sum( form_count ) AS formCount,
+            CONCAT( ROUND( sum( form_cost ) / sum( bclick ) * 100, 2 ), '%' ) AS formCountRate,
+            ROUND( sum( charge ) / sum( event_jin_jian_app ) * 100, 2 ) AS formCountCost,
+            sum( event_jin_jian_landing_page ) AS eventJinJianLandingPage,
+            ROUND( sum( charge ) / sum( event_jin_jian_landing_page ) * 100, 2 ) AS eventJinJianLandingPageCost,
+            sum( event_credit_grant_landing_page ) AS eventCreditGrantLandingPage,
+            ROUND( sum( charge ) / sum( event_credit_grant_landing_page_ratio ) * 100, 2 ) AS eventCreditGrantLandingPageCost,
+            CONCAT( ROUND( sum( event_credit_grant_landing_page ) / sum( event_jin_jian_landing_page ) * 100, 2 ), '%' ) AS eventCreditGrantLandingPageRate,
+            sum( event_button_click ) AS submit,
+            ROUND( sum( charge ) / sum( event_button_click ) * 100, 2 ) AS submitCost,
+            CONCAT( ROUND( sum( event_button_click ) / sum( bclick ) * 100, 2 ), '%' ) AS submitRate
         FROM
-            media_api.`kuaishou_unit_report_hourly`
+            application.kuaishou_unit_report_hourly_dw
         WHERE
          stat_date >= #{startTime}
         AND stat_date &lt;= #{endTime}
-        AND advertiser_id = #{advertiserId}
-        ORDER BY charge DESC
+        AND account_id = #{advertiserId}
+        GROUP BY unit_id
+        ORDER BY sum( charge ) DESC
         LIMIT 10
     </select>
 
@@ -60,52 +82,74 @@
     <!-- 查询快手组 日报 消耗前10  -->
     <select id="getKuaishouUnitReportDaily" resultType="org.jeecg.ctop.material.entity.KuaishouUnitReportHourlyPojo">
         SELECT
-            unit_id AS unitId,
-            unit_name as unitName,
-            aclick as aclick,
-            bclick as bclick,
-            charge as cost,
-            `show` as photoShow,
-            photo_click_ratio as clickRate,
-            action_ratio as bClickRate,
-            impression_1k_cost as cpm,
-            photo_click_cost as cpc,
-            action_cost as cpb,
-            download_started as downloadStart,
-            download_completed as downloadFinish,
-            activation as active,
-            event_pay_first_day as firstDayPay,
-            event_pay_purchase_amount_first_day as firstDayPayAmount,
-            event_pay_first_day_roi as firstDayPayROI,
-            event_pay_roi as ROI,
-            event_register as register,
-            event_register_cost as activeRegisterCost,
-            event_register_ratio as activeRegisterRate,
-            event_next_day_stay as nextDayOpen,
-            event_next_day_stay_cost as nextDayOpenCost,
-            event_next_day_stay_ratio as nextDayOpenRate,
-            event_credit_grant_landing_page_ratio as eventCreditGrantLandingPageRate,
-            play_3s_ratio as play3sRate,
-            form_cost as formCountCost,
-            form_action_ratio as formCountRate,
-            event_button_click_cost as submitCost,
-            event_button_click_ratio as submitRate,
-            charge as cost,
-            `show` as photoShow,
-            CONCAT(ROUND(download_started / bclick * 100,2) ,'%') as downloadStartRate,
-            ROUND(download_started / bclick * 100,2) as downloadStartCost,
-            CONCAT(ROUND(download_completed / download_started * 100,2) ,'%') as downloadFinishRate,
-            ROUND(charge / download_completed * 100,2) as downloadFinishCost,
-            ROUND(charge / activation * 100,2) as activeCost,
-            CONCAT(ROUND(activation / download_completed * 100,2) ,'%') as activeRate,
-            ROUND(charge / event_pay_first_day * 100,2) as firstDayPayCost
+            unit_id,
+            unit_name,
+            sum( aclick ) AS aClick,
+            sum( bclick ) AS bClick,
+            sum( charge ) AS cost,
+            sum( `show` ) AS photoShow,
+            sum( photo_click ) AS photoClick ,
+            CONCAT( ROUND( sum( photo_click ) / sum( `show` ) * 100, 2 ), '%' ) AS clickRate,
+            CONCAT( ROUND( sum( bclick ) / sum( aclick ) * 100, 2 ), '%' ) AS bClickRate,
+            ROUND( sum( charge ) / sum( `show` ) * 1000, 2 ) AS cpm,
+            ROUND( sum( charge ) / sum( photo_click ) * 1000, 2 ) AS cpc,
+            ROUND( sum( charge ) / sum( bclick ) * 1000, 2 ) AS cpb,
+            sum( download_started ) AS downloadStart,
+            CONCAT( ROUND( sum( download_started ) / sum( bclick ) * 100, 2 ), '%' ) AS downloadStartRate,
+            ROUND( sum( charge ) / sum( download_started ) * 100, 2 ) AS downloadStartCost,
+
+            CONCAT(ROUND( sum( event_pay_first_day ) / sum( activation ) * 100, 2 ), '%' ) AS eventNewUserPayRatio,
+            sum( download_completed ) AS downloadFinish,
+            CONCAT( ROUND( sum( download_completed ) / sum( download_started ) * 100, 2 ), '%' ) AS downloadFinishRate,
+
+            ROUND( sum( charge ) / sum( download_completed ) * 100, 2 ) AS downloadFinishCost,
+            sum( activation ) AS active,
+            ROUND( sum( charge ) / sum( activation ) * 100, 2 ) AS activeCost,
+            CONCAT( ROUND( sum( activation ) / sum( download_completed ) * 100, 2 ), '%' ) AS activeRate,
+            sum( event_pay_first_day ) AS firstDayPay,
+            sum( event_pay_purchase_amount_first_day ) AS firstDayPayAmount,
+            ROUND( sum( charge ) / sum( event_pay_first_day ) * 100, 2 ) AS firstDayPayCost,
+            ROUND( sum( event_pay_purchase_amount_first_day ) / sum( charge ) * 100, 2 ) AS firstDayPayROI,
+            sum( event_pay ) AS eventPay,
+            sum( event_pay_purchase_amount ) AS eventPayPurchaseAmount,
+            ROUND( sum( charge ) / sum( event_pay ) * 100, 2 ) AS eventPayCost,
+            ROUND( sum( event_pay_purchase_amount ) / sum( charge ) * 100, 2 ) AS ROI,
+            sum( event_register ) AS register,
+            ROUND( sum( charge ) / sum( event_register ) * 100, 2 ) AS activeRegisterCost,
+            CONCAT( ROUND( sum( event_register ) / sum( activation ) * 100, 2 ), '%' ) AS activeRegisterRate,
+            sum( event_next_day_stay ) AS nextDayOpen,
+            ROUND( sum( charge ) / sum( event_next_day_stay ) * 100, 2 ) AS nextDayOpenCost,
+            CONCAT(ROUND( sum( charge ) / sum( form_count ) * 100, 2 ), '%' ) AS nextDayOpenRate,
+            sum( event_jin_jian_app ) AS eventJinJianApp,
+            ROUND( sum( charge ) / sum( event_jin_jian_app ) * 100, 2 ) AS eventJinJianAppCost,
+            sum( event_credit_grant_app ) AS eventCreditGrantApp,
+            ROUND( sum( charge ) / sum( event_credit_grant_app ) * 100, 2 ) AS eventCreditGrantAppCost,
+            CONCAT( ROUND( sum( event_credit_grant_app ) / sum( event_jin_jian_app ) * 100, 2 ), '%' ) AS eventCreditGrantAppRate,
+            ROUND( sum( charge ) / sum( aclick ) * 100, 2 )  AS play3sRate,
+            sum( key_action ) AS keyAction,
+            ROUND( sum( charge ) / sum( aclick ) * 100, 2 ) AS keyActionCost,
+            sum( event_app_invoked ) AS eventAppInvoked,
+            ROUND( sum( charge ) / sum( bclick ) * 100, 2 ) AS eventAppInvokedCost,
+            CONCAT( ROUND( sum( event_app_invoked ) / sum( bclick ) * 100, 2 ), '%' ) AS eventAppInvokedRatio,
+            sum( form_count ) AS formCount,
+            CONCAT( ROUND( sum( form_cost ) / sum( bclick ) * 100, 2 ), '%' ) AS formCountRate,
+            ROUND( sum( charge ) / sum( event_jin_jian_app ) * 100, 2 ) AS formCountCost,
+            sum( event_jin_jian_landing_page ) AS eventJinJianLandingPage,
+            ROUND( sum( charge ) / sum( event_jin_jian_landing_page ) * 100, 2 ) AS eventJinJianLandingPageCost,
+            sum( event_credit_grant_landing_page ) AS eventCreditGrantLandingPage,
+            ROUND( sum( charge ) / sum( event_credit_grant_landing_page_ratio ) * 100, 2 ) AS eventCreditGrantLandingPageCost,
+            CONCAT( ROUND( sum( event_credit_grant_landing_page ) / sum( event_jin_jian_landing_page ) * 100, 2 ), '%' ) AS eventCreditGrantLandingPageRate,
+            sum( event_button_click ) AS submit,
+            ROUND( sum( charge ) / sum( event_button_click ) * 100, 2 ) AS submitCost,
+            CONCAT( ROUND( sum( event_button_click ) / sum( bclick ) * 100, 2 ), '%' ) AS submitRate
         FROM
-            media_api.`kuaishou_unit_report_daily`
+            application.kuaishou_unit_report_daily_dw
         WHERE
             stat_date &gt;= #{startTime}
           AND stat_date &lt;= #{endTime}
-          AND advertiser_id = #{advertiserId}
-        ORDER BY charge DESC
+          AND account_id = #{advertiserId}
+        GROUP BY unit_id
+        ORDER BY sum( charge ) DESC
             LIMIT 10
     </select>
 

+ 14 - 22
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/MaterialStareMapper.xml

@@ -465,10 +465,8 @@
         (SELECT u.realname from `jeecg-boot`.sys_user u where u.id = d.user_id) as userName
         FROM
         application.kuaishou_account_report_daily_dw d
-        LEFT JOIN `jeecg-boot`.ctop_user_allocation u on d.account_id = u.account_id
         WHERE
         d.charge > 0
-        and u.account_status = 0
         <if test="startDate != null and startDate != '' ">
             and d.stat_date &gt;= #{startDate}
         </if>
@@ -503,10 +501,8 @@
         (SELECT u.realname from `jeecg-boot`.sys_user u where u.id = d.user_id) as userName
         FROM
         application.kuaishou_account_report_daily_dw d
-        LEFT JOIN `jeecg-boot`.ctop_user_allocation u on d.account_id = u.account_id
         WHERE
         d.charge > 0
-        and u.account_status = 0
         <if test="startDate != null and startDate != '' ">
             and d.stat_date &gt;= #{startDate}
         </if>
@@ -530,10 +526,8 @@
         (SELECT u.realname from `jeecg-boot`.sys_user u where u.id = d.user_id) as userName
         FROM
         application.bytedance_advertiser_report_hourly_dw d
-        LEFT JOIN `jeecg-boot`.ctop_user_allocation u on d.account_id = u.account_id
         WHERE
         d.cost > 0
-        and u.account_status = 0
         <if test="startDate != null and startDate != '' ">
             and d.stat_datetime &gt;= #{startDate}
         </if>
@@ -563,10 +557,8 @@
         (SELECT u.realname from `jeecg-boot`.sys_user u where u.id = d.user_id) as userName
         FROM
         application.bytedance_advertiser_report_daily_dw d
-        LEFT JOIN `jeecg-boot`.ctop_user_allocation u on d.account_id = u.account_id
         WHERE
         d.cost > 0
-        and u.account_status = 0
         <if test="startDate != null and startDate != '' ">
             and d.stat_datetime &gt;= #{startDate}
         </if>
@@ -595,10 +587,8 @@
         (SELECT u.realname from `jeecg-boot`.sys_user u where u.id = d.user_id) as userName
         FROM
         application.kuaishou_account_report_hourly_dw d
-        LEFT JOIN `jeecg-boot`.ctop_user_allocation u on d.account_id = u.account_id
         WHERE
         d.charge > 0
-        and u.account_status = 0
         <if test="startDate != null and startDate != '' ">
             and d.stat_date &gt;= #{startDate}
         </if>
@@ -625,10 +615,8 @@
         (SELECT u.realname from `jeecg-boot`.sys_user u where u.id = d.user_id) as userName
         FROM
         application.bytedance_advertiser_report_hourly_dw d
-        LEFT JOIN `jeecg-boot`.ctop_user_allocation u on d.account_id = u.account_id
         WHERE
         d.cost > 0
-        and u.account_status = 0
         <if test="startDate != null and startDate != '' ">
             and d.stat_datetime &gt;= #{startDate}
         </if>
@@ -677,10 +665,8 @@
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.form_count ), 2 ),0) AS formCountPrice
         FROM
         application.kuaishou_account_report_daily_dw d
-        LEFT JOIN `jeecg-boot`.ctop_user_allocation u on d.account_id = u.account_id
         WHERE
         d.charge > 0
-        and u.account_status = 0
         <if test="startDate != null and startDate != '' ">
             and d.stat_date &gt;= #{startDate}
         </if>
@@ -712,10 +698,8 @@
         ( SELECT realname FROM `jeecg-boot`.sys_user u WHERE u.id = d.user_id ) AS userName
         FROM
         application.bytedance_advertiser_report_hourly_dw d
-        LEFT JOIN `jeecg-boot`.ctop_user_allocation u on d.account_id = u.account_id
         WHERE
         d.cost > 0
-        and u.account_status = 0
         <if test="startDate != null and startDate != '' ">
             and d.stat_datetime &gt;= #{startDate}
         </if>
@@ -742,10 +726,8 @@
         SUM( d.charge ) AS totalCost
         FROM
         application.kuaishou_account_report_hourly_dw d
-        LEFT JOIN `jeecg-boot`.ctop_user_allocation u ON d.account_id = u.account_id
         WHERE
         d.charge > 0
-        AND u.account_status = 0
         <if test="startDate != null and startDate != '' ">
             and d.stat_date &gt;= #{startDate}
         </if>
@@ -777,10 +759,8 @@
         SUM( d.cost ) AS totalCost
         FROM
         application.bytedance_advertiser_report_hourly_dw d
-        LEFT JOIN `jeecg-boot`.ctop_user_allocation u ON d.account_id = u.account_id
         WHERE
         d.cost > 0
-        AND u.account_status = 0
         <if test="startDate != null and startDate != '' ">
             and d.stat_datetime &gt;= #{startDate}
         </if>
@@ -846,10 +826,8 @@
         IFNULL(SUM(d.photo_click),0) as photoClick
         FROM
         application.kuaishou_account_report_daily_dw d
-        LEFT JOIN `jeecg-boot`.ctop_user_allocation u on d.account_id = u.account_id
         WHERE
         d.charge > 0
-        and u.account_status = 0
         <if test="startDate != null and startDate != '' ">
             and d.stat_date &gt;= #{startDate}
         </if>
@@ -1876,4 +1854,18 @@
           AND t4.media_id = #{mediaId}
     </select>
 
+
+    <!-- 所有下级运营人员 -->
+    <select id="getAllOperatorsByLearderId" resultType="java.lang.String">
+        SELECT
+            user_id
+        FROM
+            application.`app_user_manage`
+        WHERE
+            manage_id = #{learderId}
+          AND type = 1
+    </select>
+
+
+
 </mapper>

+ 14 - 5
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/MaterialStareServiceImpl.java

@@ -1515,7 +1515,11 @@ public class MaterialStareServiceImpl implements MaterialStareService {
            List<KuaiShouOperateGroupVo> operationList = ListPageUtil.page(operationManagerList, pageSize, pageNum);
             for (KuaiShouOperateGroupVo groupVo : operationList) {
                 //下级员工
-                Set<String> operatorUserIds = getAffiliateId(groupVo.getUserId());
+                //Set<String> operatorUserIds = getAffiliateId(groupVo.getUserId());
+                //运营经理下的下级员工
+                Set<String> operatorUserIds = materialStareMapper.getAllOperatorsByLearderId(groupVo.getUserId());
+
+
                 //有消耗的账户
                 if (mediaType.equals("1")){
                     operatorUserIds = materialStareMapper.getBytedanceAllOperators(null,DateUtils.getDateInteger(startTime).longValue(),DateUtils.getDateInteger(endTime).longValue(),operatorUserIds);
@@ -1530,7 +1534,7 @@ public class MaterialStareServiceImpl implements MaterialStareService {
                 }
 
                 //运营数量
-                int operationNum = Check.isNull(operatorUserIds) ? 0 : operatorUserIds.size();
+                int operationNum = Check.isNull(getAffiliateId(groupVo.getUserId())) ? 0 : getAffiliateId(groupVo.getUserId()).size();
                 groupVo.setOperationNum(operationNum);
 
                 //查询账户数据
@@ -1672,7 +1676,12 @@ public class MaterialStareServiceImpl implements MaterialStareService {
 
             for (KuaiShouOperateGroupVo groupVo : operationManagerList) {
                 //下级员工
-                Set<String> operatorUserIds = getAffiliateId(groupVo.getUserId());
+                //Set<String> operatorUserIds = getAffiliateId(groupVo.getUserId());
+
+                //运营经理下的下级员工
+                Set<String> operatorUserIds = materialStareMapper.getAllOperatorsByLearderId(groupVo.getUserId());
+
+
                 //有消耗的账户
                 if (mediaType.equals("1")){
                     operatorUserIds = materialStareMapper.getBytedanceAllOperators(null,DateUtils.getDateInteger(startTime).longValue(),DateUtils.getDateInteger(endTime).longValue(),operatorUserIds);
@@ -1686,7 +1695,7 @@ public class MaterialStareServiceImpl implements MaterialStareService {
                 }
 
                 //运营数量
-                int operationNum = Check.isNull(operatorUserIds) ? 0 : operatorUserIds.size();
+                int operationNum = Check.isNull(getAffiliateId(groupVo.getUserId())) ? 0 : getAffiliateId(groupVo.getUserId()).size();
                 groupVo.setOperationNum(operationNum);
 
                 //查询账户数据
@@ -1701,7 +1710,7 @@ public class MaterialStareServiceImpl implements MaterialStareService {
                         listOperate = materialStareMapper.getBytedanceOperateInfo(startDate,entDate,operatorUserIds);
                     }
                 }else {
-                    listOperate= materialStareMapper.getBytedanceOperateInfoHourly(startDate,entDate,operatorUserIds);
+                    listOperate= materialStareMapper.getKuaiShouOperateInfo(startDate,entDate,operatorUserIds);
                 }
 
                 //总花费

+ 8 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/utils/FeidNotNullUtils.java

@@ -100,6 +100,14 @@ public class FeidNotNullUtils {
         for (int j = 0; j < dateList.size(); j++) {
             Object obj = dateList.get(j);
             Map unitMap = Check.parseObj2Map(obj);
+            /**
+             * 之所以加了这三行代码 是因为 obj 中的 这三个参数 转成unitMap 后 key变成了 AClick/BClick/ROI 所以导致在根据自定义列中的fieldName获取值的时候 获取不到
+             * 别问为啥不修改下字段的命名规则 或者 前端同事修改下自定义列的字段 因为 我的同事是个老厨师了
+             */
+            unitMap.put("aClick",unitMap.get("AClick"));
+            unitMap.put("bClick",unitMap.get("BClick"));
+            unitMap.put("roi",unitMap.get("ROI"));
+
             Map<String,Object> map = new HashMap<>();
             for (int k =0;k < array.size();k++) {
                 JSONObject json = (JSONObject)array.get(k);