Forráskód Böngészése

Merge branch 'master' into V2.0.1

zhaoxian 3 éve
szülő
commit
cebd298201

+ 2 - 2
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/BytedanceAccountReportDailyDwMapper.xml

@@ -401,8 +401,8 @@
         ) t3 ON t.user_id = t3.user_id
         LEFT JOIN (
         SELECT user_id,
-        SUM(new_ad_num) as 'newUnitNum',
-        SUM(new_campaign_num) as 'newCampaignNum'
+        IFNULL(SUM(new_ad_num),0) + IFNULL(SUM(trust_unit_num),0) as 'newUnitNum',
+        IFNULL(SUM(new_campaign_num),0) as 'newCampaignNum'
         FROM application.app_bytedance_account_base_info_d
         WHERE stat_date >= #{startDate}
         AND stat_date <= #{endDate}

+ 2 - 2
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/KuaishouAccountReportDailyDwMapper.xml

@@ -456,8 +456,8 @@
         LEFT JOIN (
         SELECT
         user_id,
-        SUM(new_campaign_num) as 'newCampaignNum',
-        SUM(new_unit_num) as 'newUnitNum'
+        IFNULL(SUM(new_campaign_num),0) as 'newCampaignNum',
+        IFNULL(SUM(new_unit_num),0) + ifnull(SUM(trust_unit_num),0) as 'newUnitNum'
         FROM application.app_kuaishou_account_base_info_d
         WHERE stat_date >= #{startDate}
         AND stat_date <= #{endDate}

+ 0 - 56
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/achievements/mapper/xml/DesignerMapper.xml

@@ -155,8 +155,6 @@
         WHERE clip_id = #{userId}
           AND d.stat_date >= #{startTime}
           AND d.stat_date <= #{endTime}
-          AND d.first_cost_day >= #{startTime}
-          AND d.first_cost_day <= #{endTime}
         UNION ALL
         SELECT QUARTER(d.first_cost_day)                           quaterTime,
                DATE_FORMAT(d.first_cost_day, '%Y')                 yearTime,
@@ -169,8 +167,6 @@
         WHERE shot_id = #{userId}
           AND d.stat_date >= #{startTime}
           AND d.stat_date <= #{endTime}
-          AND d.first_cost_day >= #{startTime}
-          AND d.first_cost_day <= #{endTime}
         UNION ALL
         SELECT QUARTER(d.first_cost_day)                           quaterTime,
                DATE_FORMAT(d.first_cost_day, '%Y')                 yearTime,
@@ -183,8 +179,6 @@
         WHERE plan_id = #{userId}
           AND d.stat_date >= #{startTime}
           AND d.stat_date <= #{endTime}
-          AND d.first_cost_day >= #{startTime}
-          AND d.first_cost_day <= #{endTime}
     </select>
 
 
@@ -201,8 +195,6 @@
         WHERE clip_id = #{userId}
           AND d.stat_date &gt;= #{startTime}
           AND d.stat_date &lt;= #{endTime}
-          AND d.first_cost_day &gt;= #{startTime}
-          AND d.first_cost_day &lt;= #{endTime}
         UNION ALL
         SELECT QUARTER(d.first_cost_day)                             quaterTime,
                DATE_FORMAT(d.first_cost_day, '%Y')                   yearTime,
@@ -215,8 +207,6 @@
         WHERE shot_id = #{userId}
           AND d.stat_date &gt;= #{startTime}
           AND d.stat_date &lt;= #{endTime}
-          AND d.first_cost_day &gt;= #{startTime}
-          AND d.first_cost_day &lt;= #{endTime}
         UNION ALL
         SELECT QUARTER(d.first_cost_day)                             quaterTime,
                DATE_FORMAT(d.first_cost_day, '%Y')                   yearTime,
@@ -229,8 +219,6 @@
         WHERE plan_id = #{userId}
           AND d.stat_date &gt;= #{startTime}
           AND d.stat_date &lt;= #{endTime}
-          AND d.first_cost_day &gt;= #{startTime}
-          AND d.first_cost_day &lt;= #{endTime}
     </select>
 
     <!-- 查询设计 本季度 头条季度消耗汇总-->
@@ -250,8 +238,6 @@
             )
           AND stat_date &gt;= #{startTime}
           AND stat_date &lt;= #{endTime}
-          AND d.first_cost_day &gt;= #{startTime}
-          AND d.first_cost_day &lt;= #{endTime}
     </select>
     <!-- 查询设计 本季度 快手季度消耗汇总-->
     <select id="getDesignerKuaishouQuaterCost" resultType="com.alibaba.fastjson.JSONObject">
@@ -270,8 +256,6 @@
             )
           AND stat_date &gt;= #{startTime}
           AND stat_date &lt;= #{endTime}
-          AND d.first_cost_day &gt;= #{startTime}
-          AND d.first_cost_day &lt;= #{endTime}
     </select>
 
     <!-- 管理消耗-->
@@ -283,16 +267,12 @@
                  WHERE leader_id = #{userId}
                    AND stat_date &gt;= #{startTime}
                    AND stat_date &lt;= #{endTime}
-                   AND first_cost_day &gt;= #{startTime}
-                   AND first_cost_day &lt;= #{endTime}
                  UNION
                  SELECT IFNULL(SUM(charge), 0) cost, leader_id, 'kuaishou' as type, 2 as sort
                  FROM application.kuaishou_material_cost_daily
                  WHERE leader_id = #{userId}
                    AND stat_date &gt;= #{startTime}
                    AND stat_date &lt;= #{endTime}
-                   AND first_cost_day &gt;= #{startTime}
-                   AND first_cost_day &lt;= #{endTime}
              ) t
         ORDER BY t.sort
     </select>
@@ -394,8 +374,6 @@
                  WHERE clip_id = #{userId}
                    AND d.stat_date &gt;= #{month1.startTime}
                    AND d.stat_date &lt;= #{month1.endTime}
-                   AND d.first_cost_day &gt;= #{month1.startTime}
-                   AND d.first_cost_day &lt;= #{month1.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month1.startTime}, '%m')              monthTime,
                         IFNULL(ROUND(SUM(d.cost), 2), 0)                 AS cost,
@@ -406,8 +384,6 @@
                  WHERE shot_id = #{userId}
                    AND d.stat_date &gt;= #{month1.startTime}
                    AND d.stat_date &lt;= #{month1.endTime}
-                   AND d.first_cost_day &gt;= #{month1.startTime}
-                   AND d.first_cost_day &lt;= #{month1.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month1.startTime}, '%m')              monthTime,
                         IFNULL(ROUND(SUM(d.cost), 2), 0)                 AS cost,
@@ -418,8 +394,6 @@
                  WHERE plan_id = #{userId}
                    AND d.stat_date &gt;= #{month1.startTime}
                    AND d.stat_date &lt;= #{month1.endTime}
-                   AND d.first_cost_day &gt;= #{month1.startTime}
-                   AND d.first_cost_day &lt;= #{month1.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month2.startTime}, '%m')              monthTime,
                         IFNULL(ROUND(SUM(d.cost), 2), 0)                 AS cost,
@@ -430,8 +404,6 @@
                  WHERE clip_id = #{userId}
                    AND d.stat_date &gt;= #{month2.startTime}
                    AND d.stat_date &lt;= #{month2.endTime}
-                   AND d.first_cost_day &gt;= #{month2.startTime}
-                   AND d.first_cost_day &lt;= #{month2.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month2.startTime}, '%m')              monthTime,
                         IFNULL(ROUND(SUM(d.cost), 2), 0)                 AS cost,
@@ -442,8 +414,6 @@
                  WHERE shot_id = #{userId}
                    AND d.stat_date &gt;= #{month2.startTime}
                    AND d.stat_date &lt;= #{month2.endTime}
-                   AND d.first_cost_day &gt;= #{month2.startTime}
-                   AND d.first_cost_day &lt;= #{month2.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month2.startTime}, '%m')              monthTime,
                         IFNULL(ROUND(SUM(d.cost), 2), 0)                 AS cost,
@@ -454,8 +424,6 @@
                  WHERE plan_id = #{userId}
                    AND d.stat_date &gt;= #{month2.startTime}
                    AND d.stat_date &lt;= #{month2.endTime}
-                   AND d.first_cost_day &gt;= #{month2.startTime}
-                   AND d.first_cost_day &lt;= #{month2.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month3.startTime}, '%m')              monthTime,
                         IFNULL(ROUND(SUM(d.cost), 2), 0)                 AS cost,
@@ -466,8 +434,6 @@
                  WHERE clip_id = #{userId}
                    AND d.stat_date &gt;= #{month3.startTime}
                    AND d.stat_date &lt;= #{month3.endTime}
-                   AND d.first_cost_day &gt;= #{month3.startTime}
-                   AND d.first_cost_day &lt;= #{month3.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month3.startTime}, '%m')              monthTime,
                         IFNULL(ROUND(SUM(d.cost), 2), 0)                 AS cost,
@@ -478,8 +444,6 @@
                  WHERE shot_id = #{userId}
                    AND d.stat_date &gt;= #{month3.startTime}
                    AND d.stat_date &lt;= #{month3.endTime}
-                   AND d.first_cost_day &gt;= #{month3.startTime}
-                   AND d.first_cost_day &lt;= #{month3.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month3.startTime}, '%m')              monthTime,
                         IFNULL(ROUND(SUM(d.cost), 2), 0)                 AS cost,
@@ -490,8 +454,6 @@
                  WHERE plan_id = #{userId}
                    AND d.stat_date &gt;= #{month3.startTime}
                    AND d.stat_date &lt;= #{month3.endTime}
-                   AND d.first_cost_day &gt;= #{month3.startTime}
-                   AND d.first_cost_day &lt;= #{month3.endTime}
              ) t
         order by monthTime, type
     </select>
@@ -510,8 +472,6 @@
                  WHERE clip_id = #{userId}
                    AND d.stat_date &gt;= #{month1.startTime}
                    AND d.stat_date &lt;= #{month1.endTime}
-                   AND d.first_cost_day &gt;= #{month1.startTime}
-                   AND d.first_cost_day &lt;= #{month1.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month1.startTime}, '%m')                monthTime,
                         IFNULL(ROUND(SUM(d.charge), 2), 0)                 AS cost,
@@ -522,8 +482,6 @@
                  WHERE shot_id = #{userId}
                    AND d.stat_date &gt;= #{month1.startTime}
                    AND d.stat_date &lt;= #{month1.endTime}
-                   AND d.first_cost_day &gt;= #{month1.startTime}
-                   AND d.first_cost_day &lt;= #{month1.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month1.startTime}, '%m')                monthTime,
                         IFNULL(ROUND(SUM(d.charge), 2), 0)                 AS cost,
@@ -534,8 +492,6 @@
                  WHERE plan_id = #{userId}
                    AND d.stat_date &gt;= #{month1.startTime}
                    AND d.stat_date &lt;= #{month1.endTime}
-                   AND d.first_cost_day &gt;= #{month1.startTime}
-                   AND d.first_cost_day &lt;= #{month1.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month2.startTime}, '%m')                monthTime,
                         IFNULL(ROUND(SUM(d.charge), 2), 0)                 AS cost,
@@ -546,8 +502,6 @@
                  WHERE clip_id = #{userId}
                    AND d.stat_date &gt;= #{month2.startTime}
                    AND d.stat_date &lt;= #{month2.endTime}
-                   AND d.first_cost_day &gt;= #{month2.startTime}
-                   AND d.first_cost_day &lt;= #{month2.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month2.startTime}, '%m')                monthTime,
                         IFNULL(ROUND(SUM(d.charge), 2), 0)                 AS cost,
@@ -558,8 +512,6 @@
                  WHERE shot_id = #{userId}
                    AND d.stat_date &gt;= #{month2.startTime}
                    AND d.stat_date &lt;= #{month2.endTime}
-                   AND d.first_cost_day &gt;= #{month2.startTime}
-                   AND d.first_cost_day &lt;= #{month2.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month2.startTime}, '%m')                monthTime,
                         IFNULL(ROUND(SUM(d.charge), 2), 0)                 AS cost,
@@ -570,8 +522,6 @@
                  WHERE plan_id = #{userId}
                    AND d.stat_date &gt;= #{month2.startTime}
                    AND d.stat_date &lt;= #{month2.endTime}
-                   AND d.first_cost_day &gt;= #{month2.startTime}
-                   AND d.first_cost_day &lt;= #{month2.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month3.startTime}, '%m')                monthTime,
                         IFNULL(ROUND(SUM(d.charge), 2), 0)                 AS cost,
@@ -582,8 +532,6 @@
                  WHERE clip_id = #{userId}
                    AND d.stat_date &gt;= #{month3.startTime}
                    AND d.stat_date &lt;= #{month3.endTime}
-                   AND d.first_cost_day &gt;= #{month3.startTime}
-                   AND d.first_cost_day &lt;= #{month3.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month3.startTime}, '%m')                monthTime,
                         IFNULL(ROUND(SUM(d.charge), 2), 0)                 AS cost,
@@ -594,8 +542,6 @@
                  WHERE shot_id = #{userId}
                    AND d.stat_date &gt;= #{month3.startTime}
                    AND d.stat_date &lt;= #{month3.endTime}
-                   AND d.first_cost_day &gt;= #{month3.startTime}
-                   AND d.first_cost_day &lt;= #{month3.endTime}
                  UNION
                  SELECT DATE_FORMAT(#{month3.startTime}, '%m')                monthTime,
                         IFNULL(ROUND(SUM(d.charge), 2), 0)                 AS cost,
@@ -606,8 +552,6 @@
                  WHERE plan_id = #{userId}
                    AND d.stat_date &gt;= #{month3.startTime}
                    AND d.stat_date &lt;= #{month3.endTime}
-                   AND d.first_cost_day &gt;= #{month3.startTime}
-                   AND d.first_cost_day &lt;= #{month3.endTime}
              ) t
         order by monthTime, type
     </select>

+ 4 - 7
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouOperationReportController.java

@@ -216,13 +216,10 @@ public class KuaishouOperationReportController {
         roleCode.add("operationAssistant");
         //运营专员
         roleCode.add("operator");
-        if ("1".equals(mediaId)) {
-            //快手运营经理
-            roleCode.add("touTiaoOperationManager");
-        } else {
-            //快手运营经理
-            roleCode.add("kuaishouOperationManager");
-        }
+        //快手运营经理
+        roleCode.add("touTiaoOperationManager");
+        //快手运营经理
+        roleCode.add("kuaishouOperationManager");
         return Result.OK(compensationService.getAllOperatorList(roleCode, mediaId));
     }