浏览代码

Merge branch 'V1.1.8'

zhaoxian 4 年之前
父节点
当前提交
a23de05301

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

@@ -2,6 +2,7 @@ package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.utils.QueryGenerator;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
+import java.util.List;
 import java.util.Map;
 
 /**

+ 19 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/UserCompanyController.java

@@ -23,7 +23,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;
@@ -121,6 +129,16 @@ public class UserCompanyController {
         return result;
     }
 
+    @GetMapping(value = "/allCompany")
+    public Result<Object> allCompany() {
+        try {
+            return userCompanyService.allCompany();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
     /**
      * 添加
      *

+ 5 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/UserCompanyMapper.java

@@ -1,7 +1,11 @@
 package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.UserCompany;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.common.api.vo.Result;
+
+import java.util.List;
 
 /**
  * 用户够公司
@@ -12,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface UserCompanyMapper extends BaseMapper<UserCompany> {
 
+    List<JSONObject> allCompany();
 }

+ 7 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserCompanyMapper.xml

@@ -2,4 +2,11 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.common.module.mapper.UserCompanyMapper">
 
+    <select id="allCompany" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT company_id as 'companyId',
+               company_name as 'companyName'
+        FROM user_company
+        GROUP BY company_id
+    </select>
+
 </mapper>

+ 3 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IUserCompanyService.java

@@ -3,6 +3,7 @@ package cn.com.ctop.common.module.service;
 import cn.com.ctop.common.module.entity.SysUser;
 import cn.com.ctop.common.module.entity.UserCompany;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
 
 /**
  * 用户够公司
@@ -18,4 +19,6 @@ public interface IUserCompanyService extends IService<UserCompany> {
     void removeByUserId(String id);
 
     UserCompany getByUserId(String userId);
+
+    Result<Object> allCompany();
 }

+ 11 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserCompanyServiceImpl.java

@@ -9,14 +9,17 @@ import cn.com.ctop.common.module.mapper.SysUserDepartMapper;
 import cn.com.ctop.common.module.mapper.UserCompanyMapper;
 import cn.com.ctop.common.module.service.IUserCompanyService;
 import cn.com.ctop.common.module.utils.Check;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -96,9 +99,15 @@ public class UserCompanyServiceImpl extends ServiceImpl<UserCompanyMapper, UserC
 
     @Override
     public UserCompany getByUserId(String userId) {
-        QueryWrapper<UserCompany>queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("user_id",userId);
+        QueryWrapper<UserCompany> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id", userId);
         queryWrapper.last("limit 1");
         return null;
     }
+
+    @Override
+    public Result<Object> allCompany() {
+        List<JSONObject> data = userCompanyMapper.allCompany();
+        return Result.ok(data);
+    }
 }

+ 2 - 2
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouVideoRelateCreativesJob.java

@@ -42,14 +42,14 @@ public class KuaishouVideoRelateCreativesJob {
     public void execute() throws Exception {
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
         if (null == tokens || tokens.isEmpty()) {
-            XxlJobHelper.log("定时获取人群分析报表数据异常:未获取到可用的token");
+            XxlJobHelper.log("未获取到可用的token");
             XxlJobHelper.handleFail();
             return;
         }
         //查询有效策略的账户ID
         List<Long> accountIds = kuaishouStrategyService.queryActiveAccount();
         if (Check.isNull(accountIds) || accountIds.size() == 0) {
-            XxlJobHelper.log("定时获取人群分析报表数据异常:未获取到有效策略账户信息");
+            XxlJobHelper.log("未获取到有效策略账户信息");
             XxlJobHelper.handleFail();
             return;
         }

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouVideoGetController.java

@@ -99,12 +99,12 @@ public class KuaiShouVideoGetController {
      * @return
      */
     @GetMapping(value = "/labelMaterialList")
-    public Result<Object> labelMaterialList(String realname, String roleCode, String startTime, String endTime, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+    public Result<Object> labelMaterialList(String companyId, String realname, String roleCode, String startTime, String endTime, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
         try {
             if (Check.isNull(startTime) || Check.isNull(endTime)) {
                 return Result.error("请选择查询日期");
             }
-            return kuaiShouReportDailyMaterialService.labelMaterialList(realname, roleCode, startTime, endTime, pageNo, pageSize);
+            return kuaiShouReportDailyMaterialService.labelMaterialList(companyId, realname, roleCode, startTime, endTime, pageNo, pageSize);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 3 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouReportDailyMaterialMapper.java

@@ -39,9 +39,9 @@ public interface KuaiShouReportDailyMaterialMapper extends BaseMapper<KuaiShouRe
 
     List<JSONObject> getVideoInfoByList(@Param("photoIdList") List<Long> photoIdList);
 
-    Long labelMaterialListTotal(@Param("realname") String realname, @Param("roleCode") String roleCode, @Param("startTime") String startTime, @Param("endTime") String endTime);
+    Long labelMaterialListTotal(@Param("companyId") String companyId, @Param("realname") String realname, @Param("roleCode") String roleCode, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
-    List<JSONObject> labelMaterialList(@Param("realname") String realname, @Param("roleCode") String roleCode, @Param("startTime") String startTime, @Param("endTime") String endTime);
+    List<JSONObject> labelMaterialList(@Param("companyId") String companyId, @Param("realname") String realname, @Param("roleCode") String roleCode, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
-    JSONObject labelMaterialAll(@Param("realname") String realname, @Param("roleCode") String roleCode, @Param("startTime") String startTime, @Param("endTime") String endTime);
+    JSONObject labelMaterialAll(@Param("companyId") String companyId, @Param("realname") String realname, @Param("roleCode") String roleCode, @Param("startTime") String startTime, @Param("endTime") String endTime);
 }

+ 93 - 49
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml

@@ -445,15 +445,16 @@
         LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
         INNER JOIN
         (
-        SELECT signature  FROM ctop_kuaishou_video_get
-        WHERE  stat_date &gt;=  #{startTime}
-        AND stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        SELECT signature FROM ctop_kuaishou_video_get
+        WHERE stat_date &gt;= #{startTime}
+        AND stat_date &lt;= concat(#{endTime},' 23:59:59')
         GROUP BY signature
         ) t4 ON t4.signature= t1.`code`
         INNER JOIN(
         SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
         LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
         LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
         WHERE 1=1
         <if test="realname!=null">
             and tt1.realname LIKE CONCAT('%',#{realname},'%')
@@ -464,6 +465,9 @@
         <if test="roleCode==null">
             AND tt3.role_code in ('clip','shot','plan')
         </if>
+        <if test="companyId!=null">
+            AND tt4.company_id = #{companyId}
+        </if>
         ) t3 ON t3.id = t1.user_id
         WHERE t2.parent_id in(60155,60156)
         GROUP BY t1.user_id
@@ -487,19 +491,23 @@
         t3.realname,
         t3.role_name
         FROM ctop_material_tag_info t1
-        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
         INNER JOIN
         (
-        SELECT signature  FROM ctop_kuaishou_video_get
-        WHERE  stat_date &gt;=  #{startTime}
-        AND stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        SELECT signature FROM ctop_kuaishou_video_get
+        WHERE stat_date &gt;= #{startTime}
+        AND stat_date &lt;= concat(#{endTime},' 23:59:59')
         GROUP BY signature
         ) t4 ON t4.signature= t1.`code`
         INNER JOIN(
         SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
         LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
         LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
         WHERE 1=1
+        <if test="companyId!=null">
+            AND tt4.company_id = #{companyId}
+        </if>
         <if test="realname!=null">
             and tt1.realname LIKE CONCAT('%',#{realname},'%')
         </if>
@@ -515,22 +523,26 @@
         ) k
         LEFT JOIN
         (
-            SELECT
+        SELECT
         t1.user_id, SUM(t5.charge) 'zhenren_charge'
         FROM ctop_material_tag_info t1
-        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
         INNER JOIN
         (
-        SELECT signature  FROM ctop_kuaishou_video_get
-        WHERE  stat_date &gt;=  #{startTime}
-        AND stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        SELECT signature FROM ctop_kuaishou_video_get
+        WHERE stat_date &gt;= #{startTime}
+        AND stat_date &lt;= concat(#{endTime},' 23:59:59')
         GROUP BY signature
         ) t4 ON t4.signature= t1.`code`
         INNER JOIN(
         SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
         LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
         LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
         WHERE 1=1
+        <if test="companyId!=null">
+            AND tt4.company_id = #{companyId}
+        </if>
         <if test="realname!=null">
             and tt1.realname LIKE CONCAT('%',#{realname},'%')
         </if>
@@ -541,7 +553,7 @@
             AND tt3.role_code in ('clip','shot','plan')
         </if>
         ) t3 ON t3.id = t1.user_id
-        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON  t1.`code` = t5.signature
+        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
         WHERE t2.parent_id = 60155
         GROUP BY t1.user_id
         ) k1 ON k1.user_id =k.user_id
@@ -550,19 +562,23 @@
         SELECT
         t1.user_id,t4.signature
         FROM ctop_material_tag_info t1
-        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
         INNER JOIN
         (
-        SELECT signature  FROM ctop_kuaishou_video_get
-        WHERE  stat_date &gt;=  #{startTime}
-        AND stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        SELECT signature FROM ctop_kuaishou_video_get
+        WHERE stat_date &gt;= #{startTime}
+        AND stat_date &lt;= concat(#{endTime},' 23:59:59')
         GROUP BY signature
         ) t4 ON t4.signature= t1.`code`
         INNER JOIN(
         SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
         LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
         LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
         WHERE 1=1
+        <if test="companyId!=null">
+            AND tt4.company_id = #{companyId}
+        </if>
         <if test="realname!=null">
             and tt1.realname LIKE CONCAT('%',#{realname},'%')
         </if>
@@ -583,19 +599,23 @@
         SELECT
         t1.user_id, SUM(t5.charge) 'zhizuo_charge'
         FROM ctop_material_tag_info t1
-        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
         INNER JOIN
         (
-        SELECT signature  FROM ctop_kuaishou_video_get
-        WHERE  stat_date &gt;=  #{startTime}
-        AND stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        SELECT signature FROM ctop_kuaishou_video_get
+        WHERE stat_date &gt;= #{startTime}
+        AND stat_date &lt;= concat(#{endTime},' 23:59:59')
         GROUP BY signature
         ) t4 ON t4.signature= t1.`code`
         INNER JOIN(
         SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
         LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
         LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
         WHERE 1=1
+        <if test="companyId!=null">
+            AND tt4.company_id = #{companyId}
+        </if>
         <if test="realname!=null">
             and tt1.realname LIKE CONCAT('%',#{realname},'%')
         </if>
@@ -606,7 +626,7 @@
             AND tt3.role_code in ('clip','shot','plan')
         </if>
         ) t3 ON t3.id = t1.user_id
-        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON  t1.`code` = t5.signature
+        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
         WHERE t2.parent_id = 60156
         GROUP BY t1.user_id
         )k3 ON k3.user_id =k.user_id
@@ -615,19 +635,23 @@
         SELECT
         t1.user_id,t4.signature
         FROM ctop_material_tag_info t1
-        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
         INNER JOIN
         (
-        SELECT signature  FROM ctop_kuaishou_video_get
-        WHERE  stat_date &gt;=  #{startTime}
-        AND stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        SELECT signature FROM ctop_kuaishou_video_get
+        WHERE stat_date &gt;= #{startTime}
+        AND stat_date &lt;= concat(#{endTime},' 23:59:59')
         GROUP BY signature
         ) t4 ON t4.signature= t1.`code`
         INNER JOIN(
         SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
         LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
         LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
         WHERE 1=1
+        <if test="companyId!=null">
+            AND tt4.company_id = #{companyId}
+        </if>
         <if test="realname!=null">
             and tt1.realname LIKE CONCAT('%',#{realname},'%')
         </if>
@@ -638,7 +662,7 @@
             AND tt3.role_code in ('clip','shot','plan')
         </if>
         ) t3 ON t3.id = t1.user_id
-        WHERE  t2.parent_id = 60156
+        WHERE t2.parent_id = 60156
         GROUP BY t1.user_id,t1.`code`
         ) t
         GROUP BY user_id
@@ -669,19 +693,23 @@
         t3.realname,
         t3.role_name
         FROM ctop_material_tag_info t1
-        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
         INNER JOIN
         (
-        SELECT signature  FROM ctop_kuaishou_video_get
-        WHERE  stat_date &gt;=  #{startTime}
-        AND stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        SELECT signature FROM ctop_kuaishou_video_get
+        WHERE stat_date &gt;= #{startTime}
+        AND stat_date &lt;= concat(#{endTime},' 23:59:59')
         GROUP BY signature
         ) t4 ON t4.signature= t1.`code`
         INNER JOIN(
         SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
         LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
         LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
         WHERE 1=1
+        <if test="companyId!=null">
+            AND tt4.company_id = #{companyId}
+        </if>
         <if test="realname!=null">
             and tt1.realname LIKE CONCAT('%',#{realname},'%')
         </if>
@@ -700,12 +728,12 @@
         SELECT
         t1.user_id, SUM(t5.charge) 'zhenren_charge'
         FROM ctop_material_tag_info t1
-        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
         INNER JOIN
         (
-        SELECT signature  FROM ctop_kuaishou_video_get
-        WHERE  stat_date &gt;=  #{startTime}
-        AND stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        SELECT signature FROM ctop_kuaishou_video_get
+        WHERE stat_date &gt;= #{startTime}
+        AND stat_date &lt;= concat(#{endTime},' 23:59:59')
         GROUP BY signature
         ) t4 ON t4.signature= t1.`code`
         INNER JOIN
@@ -713,7 +741,11 @@
         SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
         LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
         LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
         WHERE 1=1
+        <if test="companyId!=null">
+            AND tt4.company_id = #{companyId}
+        </if>
         <if test="realname!=null">
             and tt1.realname LIKE CONCAT('%',#{realname},'%')
         </if>
@@ -724,7 +756,7 @@
             AND tt3.role_code in ('clip','shot','plan')
         </if>
         ) t3 ON t3.id = t1.user_id
-        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON  t1.`code` = t5.signature
+        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
         WHERE t2.parent_id = 60155
         GROUP BY t1.user_id
         )k1 ON k1.user_id =k.user_id
@@ -733,19 +765,23 @@
         SELECT
         t1.user_id,t4.signature
         FROM ctop_material_tag_info t1
-        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
         INNER JOIN
         (
-        SELECT signature  FROM ctop_kuaishou_video_get
-        WHERE  stat_date &gt;=  #{startTime}
-        AND stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        SELECT signature FROM ctop_kuaishou_video_get
+        WHERE stat_date &gt;= #{startTime}
+        AND stat_date &lt;= concat(#{endTime},' 23:59:59')
         GROUP BY signature
         ) t4 ON t4.signature= t1.`code`
         INNER JOIN(
         SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
         LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
         LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
         WHERE 1=1
+        <if test="companyId!=null">
+            AND tt4.company_id = #{companyId}
+        </if>
         <if test="realname!=null">
             and tt1.realname LIKE CONCAT('%',#{realname},'%')
         </if>
@@ -766,19 +802,23 @@
         SELECT
         t1.user_id, SUM(t5.charge) 'zhizuo_charge'
         FROM ctop_material_tag_info t1
-        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
         INNER JOIN
         (
-        SELECT signature  FROM ctop_kuaishou_video_get
-        WHERE  stat_date &gt;=  #{startTime}
-        AND stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        SELECT signature FROM ctop_kuaishou_video_get
+        WHERE stat_date &gt;= #{startTime}
+        AND stat_date &lt;= concat(#{endTime},' 23:59:59')
         GROUP BY signature
         ) t4 ON t4.signature= t1.`code`
         INNER JOIN(
         SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
         LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
         LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
         WHERE 1=1
+        <if test="companyId!=null">
+            AND tt4.company_id = #{companyId}
+        </if>
         <if test="realname!=null">
             and tt1.realname LIKE CONCAT('%',#{realname},'%')
         </if>
@@ -789,7 +829,7 @@
             AND tt3.role_code in ('clip','shot','plan')
         </if>
         ) t3 ON t3.id = t1.user_id
-        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON  t1.`code` = t5.signature
+        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON t1.`code` = t5.signature
         WHERE t2.parent_id = 60156
         GROUP BY t1.user_id
         )k3 ON k3.user_id =k.user_id
@@ -798,19 +838,23 @@
         SELECT
         t1.user_id,t4.signature
         FROM ctop_material_tag_info t1
-        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
         INNER JOIN
         (
-        SELECT signature  FROM ctop_kuaishou_video_get
-        WHERE  stat_date &gt;=  #{startTime}
-        AND stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        SELECT signature FROM ctop_kuaishou_video_get
+        WHERE stat_date &gt;= #{startTime}
+        AND stat_date &lt;= concat(#{endTime},' 23:59:59')
         GROUP BY signature
         ) t4 ON t4.signature= t1.`code`
         INNER JOIN(
         SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
         LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
         LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        LEFT JOIN user_company tt4 ON tt1.id = tt4.user_id
         WHERE 1=1
+        <if test="companyId!=null">
+            AND tt4.company_id = #{companyId}
+        </if>
         <if test="realname!=null">
             and tt1.realname LIKE CONCAT('%',#{realname},'%')
         </if>

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouReportDailyMaterialService.java

@@ -28,5 +28,5 @@ public interface IKuaiShouReportDailyMaterialService extends IService<KuaiShouRe
 
     List<KuaiShouReportDailyMaterial> getVideoInfoByList(List<KuaiShouReportDailyMaterial> addList, List<Long> photoIdList);
 
-    Result<Object> labelMaterialList(String realname, String roleCode, String startTime, String endTime, Integer pageNo, Integer pageSize);
+    Result<Object> labelMaterialList(String companyId,String realname, String roleCode, String startTime, String endTime, Integer pageNo, Integer pageSize);
 }

+ 4 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouReportDailyMaterialServiceImpl.java

@@ -127,15 +127,15 @@ public class KuaiShouReportDailyMaterialServiceImpl extends ServiceImpl<KuaiShou
     }
 
     @Override
-    public Result<Object> labelMaterialList(String realname, String roleCode, String startTime, String endTime, Integer pageNo, Integer pageSize) {
-        Long total = dailyMaterialMapper.labelMaterialListTotal(realname, roleCode, startTime, endTime);
+    public Result<Object> labelMaterialList(String companyId, String realname, String roleCode, String startTime, String endTime, Integer pageNo, Integer pageSize) {
+        Long total = dailyMaterialMapper.labelMaterialListTotal(companyId, realname, roleCode, startTime, endTime);
         PageHelper.startPage(pageNo, pageSize, false);
-        PageInfo pageInfo = new PageInfo(dailyMaterialMapper.labelMaterialList(realname, roleCode, startTime, endTime));
+        PageInfo pageInfo = new PageInfo(dailyMaterialMapper.labelMaterialList(companyId, realname, roleCode, startTime, endTime));
         pageInfo.setTotal(total);
         JSONObject data = new JSONObject();
         data.put("pageInfo", pageInfo);
         if (total > 0) {
-            data.put("total", dailyMaterialMapper.labelMaterialAll(realname, roleCode, startTime, endTime));
+            data.put("total", dailyMaterialMapper.labelMaterialAll(companyId, realname, roleCode, startTime, endTime));
         }
         return Result.ok(data);
     }