浏览代码

盯盘2.0功能 ,修改预算,余额数据获取方式

zhaoxian 4 年之前
父节点
当前提交
36185980c7

+ 8 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountDailyMapper.xml

@@ -319,11 +319,13 @@
         AND i2.user_id = #{userId}
         GROUP BY i1.account_id
         ) t4 ON t2.account_id = t4.account_id
-        LEFT JOIN ctop_kuaishou_account_balance_budget t6 ON t6.account_id = t2.account_id
+        LEFT JOIN (
+        select account_id,balance,day_budget from ctop_kuaishou_account_balance_budget
+        where state =1
+        ) t6 ON t6.account_id = t2.account_id
         where stat_date >= #{startTime}
         AND stat_date <= #{endTime}
         AND t2.user_id = #{userId}
-        AND t6.state = 1
         GROUP BY t2.account_id
         <if test="sortCode != '' and sortCode != null ">
             ORDER BY ${sortCode}
@@ -389,10 +391,12 @@
             </foreach>
         </if>
         ) t5 ON t2.user_id = t5.id
-        LEFT JOIN ctop_kuaishou_account_balance_budget t6 ON t6.account_id = t2.account_id
+        LEFT JOIN (
+        select account_id,balance,day_budget from ctop_kuaishou_account_balance_budget
+        where state =1
+        ) t6 ON t6.account_id = t2.account_id
         where stat_date &gt;= #{startTime}
         AND stat_date &lt;= #{endTime}
-        AND t6.state = 1
         and t2.account_status = 0
         <if test="userIds != null">
             AND t2.user_id IN

+ 8 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountHourlyMapper.xml

@@ -268,10 +268,12 @@
         AND i2.user_id = #{userId}
         GROUP BY i1.account_id
         ) t4 ON t2.account_id = t4.account_id
-        LEFT JOIN ctop_kuaishou_account_balance_budget t6 ON t6.account_id = t2.account_id
+        LEFT JOIN (
+        select account_id,balance,day_budget from ctop_kuaishou_account_balance_budget
+        where state =1
+        ) t6 ON t6.account_id = t2.account_id
         where stat_date = #{startTime}
         AND t2.user_id = #{userId}
-        AND t6.state = 1
         GROUP BY t2.account_id
         <if test="sortCode != '' and sortCode != null ">
             ORDER BY ${sortCode}
@@ -364,9 +366,11 @@
             </foreach>
         </if>
         ) t5 ON t2.user_id = t5.id
-        LEFT JOIN ctop_kuaishou_account_balance_budget t6 ON t6.account_id = t2.account_id
+        LEFT JOIN (
+        select account_id,balance,day_budget from ctop_kuaishou_account_balance_budget
+        where state =1
+        ) t6 ON t6.account_id = t2.account_id
         where stat_date = #{startTime}
-        AND t6.state = 1
         and t2.account_status = 0
         <if test="userIds != null">
             AND t2.user_id IN

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportHourlyAccountMapper.xml

@@ -185,13 +185,13 @@
         IFNULL(t5.lweekCharge,0) 'lweekCharge',
         IFNULL(ROUND((t4.weekCharge-t5.lweekCharge)/t5.lweekCharge*100,2),0) 'weekGrew',
         IFNULL((SELECT count(1) FROM ctop_user_allocation where user_id = #{userId} AND account_status = 0),0) 'accouuntCount'
-        FROM ctop_etl_kuaishou_report_account_hourly t1
+        FROM ctop_kuaishou_report_hourly_account t1
         LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
         LEFT JOIN(
         SELECT SUM(charge) 'zcharge' FROM ctop_kuaishou_report_hourly_account i1
         LEFT JOIN ctop_user_allocation i2 ON i1.account_id = i2.account_id
         WHERE i2.user_id = #{userId}
-        AND i1.stat_date = #{today}
+        AND i1.stat_date = DATE_SUB(#{today},INTERVAL 1 DAY)
         AND i1.stat_hour  &lt;= DATE_FORMAT(now(), '%H')
         ) t3 ON 1=1
         LEFT JOIN(

+ 0 - 8
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/EtlKuaishouReportAccountHourlyServiceImpl.java

@@ -309,14 +309,6 @@ public class EtlKuaishouReportAccountHourlyServiceImpl extends ServiceImpl<EtlKu
      */
     @Override
     public Result<Object> queryPersonalAchievements(String userId) {
-        SysRole role = roleMapper.queryRoleByUserId(userId);
-        //TODO
-//        if (roleName.contains("总监") || roleName.contains("经理")) {
-//
-//        }
-//        if (roleName.contains("管理员")) {
-//
-//        }
         Map<String, Object> paramsMap = new HashMap<>();
         //本周一
         String monday = DateUtils.getdateFromWeek(1);