Browse Source

Merge branch 'video-dev' into test

hcst_sunzhen 5 years ago
parent
commit
d7309b15b3

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

@@ -15,6 +15,7 @@ import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanDailyReportService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanHourlyReportService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
@@ -59,6 +60,8 @@ public class TestController {
     private IMaterialTagService tagService;
     @Autowired
     private IMaterialImageInfoService iMaterialImageInfoService;
+    @Autowired
+    private IBytedanceReportService bytedanceReportService;
 
     @GetMapping(value = "/t")
     public String test() {
@@ -654,4 +657,27 @@ public class TestController {
     }
 
 
+    @GetMapping(value = "/BytedanceDailyAsyncJob")
+    public void BytedanceDailyAsyncJob() {
+        String startDate = "2020-06-01";
+        Date getDate = DateUtils.addDay(new Date(), -1);
+        String endDate = DateUtils.formatDate(getDate);
+        endDate = "2020-06-02";
+        log.info("头条广告计划异步任务开始执行,跑的是" + startDate + "~" + endDate + "的数据");
+
+        List<CtopOauthToken> tokens = tokenService.getToutiaoTokenByCreateTime(endDate);
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("头条获取异步报表数据任务执行失败:未获取到可用的token");
+            return;
+        }
+
+        //1.创意 2.广告主 3.广告组 4.广告计划
+        for (CtopOauthToken token : tokens) {
+            bytedanceReportService.bytedanceAsyncTaskCreate(startDate, endDate, token, 1);
+            bytedanceReportService.bytedanceAsyncTaskCreate(startDate, endDate, token, 2);
+            bytedanceReportService.bytedanceAsyncTaskCreate(startDate, endDate, token, 3);
+            bytedanceReportService.bytedanceAsyncTaskCreate(startDate, endDate, token, 4);
+        }
+    }
+
 }

+ 51 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyAsyncJob.java

@@ -0,0 +1,51 @@
+package org.jeecg.modules.ctop.job;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.util.DateUtils;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 头条数据异步报表  获取前一天绑定的账户,跑从2020-01-01到前一天的数据;目的是防止新绑定账户数据缺失;
+ *
+ * @author sunzhen
+ */
+@Slf4j
+public class BytedanceDailyAsyncJob implements Job {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IBytedanceReportService bytedanceReportService;
+
+    @Override
+    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+        String startDate = "2020-01-01";
+        Date getDate = DateUtils.addDay(new Date(), -1);
+        String endDate = DateUtils.formatDate(getDate);
+
+        log.info("头条数据异步报表  获取前一天绑定的账户,跑从2020-01-01到前一天的数据,时间为:" + startDate + "~" + endDate + "的数据");
+
+        List<CtopOauthToken> tokens = tokenService.getToutiaoTokenByCreateTime(endDate);
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("头条获取异步报表数据任务执行失败:未获取到可用的token");
+            return;
+        }
+
+        //1.创意 2.广告主 3.广告组 4.广告计划
+        for (CtopOauthToken token : tokens) {
+            bytedanceReportService.bytedanceAsyncTaskCreate(startDate, endDate, token, 1);
+            bytedanceReportService.bytedanceAsyncTaskCreate(startDate, endDate, token, 2);
+            bytedanceReportService.bytedanceAsyncTaskCreate(startDate, endDate, token, 3);
+            bytedanceReportService.bytedanceAsyncTaskCreate(startDate, endDate, token, 4);
+        }
+
+    }
+}

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyAccountReportNextDayStayJob.java

@@ -34,7 +34,7 @@ public class KuaishouDailyAccountReportNextDayStayJob implements Job {
         Thread thread = new Thread() {
             @Override
             public void run() {
-                Date getDate = new Date();
+                Date getDate = DateUtils.addDay(new Date(), -1);
                 //1:查询当日数据
                 List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
                 if (null == tokens || tokens.size() <= 0) {

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/CtopOauthTokenMapper.java

@@ -39,4 +39,6 @@ public interface CtopOauthTokenMapper extends BaseMapper<CtopOauthToken> {
     List<CtopOauthToken> selectToutiaoToken();
 
     CtopOauthToken getAccessTokenByAccountIdAndMediaId(@Param("mediaId")Integer mediaId, @Param("accountId")Long accountId);
+
+    List<CtopOauthToken> getToutiaoTokenByCreateTime(@Param("createTime")String createTime);
 }

+ 13 - 1
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/CtopOauthTokenMapper.xml

@@ -93,7 +93,7 @@
         left join ctop_user_allocation t2
         on t1.account_id = t2.account_id
         where t2.account_status = 0
-        and t1.media_id = 1
+        and t1.media_id in (1,3)
         group by account_id
     </select>
 
@@ -106,4 +106,16 @@
         and account_id = #{accountId}
     </select>
 
+    <!-- 根据mediaType 和 账户绑定助手时间createTime 获取accountId -->
+    <select id="getToutiaoTokenByCreateTime" resultType="cn.com.ctop.common.module.entity.CtopOauthToken">
+            select t1.*
+        from ctop_oauth_token t1
+        left join ctop_user_allocation t2
+        on t1.account_id = t2.account_id
+        where t2.account_status = 0
+        and t1.media_id in (1,3)
+        and date_format(t2.create_time, '%Y-%m-%d') = #{createTime}
+        group by account_id
+    </select>
+
 </mapper>

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/ICtopOauthTokenService.java

@@ -29,4 +29,6 @@ public interface ICtopOauthTokenService extends IService<CtopOauthToken> {
     List<CtopOauthToken> selectToutiaoToken();
 
     CtopOauthToken getAccessTokenByAccountIdAndMediaId(Integer mediaId, Long accountId);
+
+    List<CtopOauthToken> getToutiaoTokenByCreateTime(String createTime);
 }

+ 7 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java

@@ -197,4 +197,11 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
     public CtopOauthToken getAccessTokenByAccountIdAndMediaId(Integer mediaId, Long accountId) {
         return cTopOauthTokenMapper.getAccessTokenByAccountIdAndMediaId(mediaId, accountId);
     }
+
+    @Override
+    public List<CtopOauthToken> getToutiaoTokenByCreateTime(String createTime) {
+        return cTopOauthTokenMapper.getToutiaoTokenByCreateTime(createTime);
+    }
+
+
 }

+ 7 - 7
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/controller/ByteDanceVideoReportDailyController.java

@@ -335,10 +335,10 @@ public class ByteDanceVideoReportDailyController {
 						// continue;
 					 //}
 					 //
-					 //if( column.equals("projectName")){
-						// ByteDanceVideoReportDaily.add(sum.getProjectName() );  //
-						// continue;
-					 //}
+					 if( column.equals("projectName")){
+						 ByteDanceVideoReportDaily.add(sum.getProjectName() );  //
+						 continue;
+					 }
 
 					 //if( column.equals("advertiserId")){
 						// ByteDanceVideoReportDaily.add(sum.getAdvertiserId() );  //
@@ -812,9 +812,9 @@ public class ByteDanceVideoReportDailyController {
 				// listHeaders.add("projectId");
 			 //}
 
-			 //if( column.equals("projectName")){
-				// listHeaders.add("项目");
-			 //}
+			 if( column.equals("projectName")){
+				 listHeaders.add("项目名称");
+			 }
 
 			 //if( column.equals("advertiserId")){
 				// listHeaders.add("客户id");

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/ByteDanceVideoReportDailyMapper.java

@@ -70,7 +70,7 @@ public interface ByteDanceVideoReportDailyMapper extends BaseMapper<ByteDanceVid
 
     List<Long> getAccountIdByprojectIds(@Param("projectIds")List<Long> projectIds);
 
-    List<Long> getAccountIdsByOperatorIdAndMediaId(@Param("mediaId")Integer mediaId, @Param("userId")String userId);
+    List<Long> getAccountIdsByOperatorIdAndMediaId(@Param("userId")String userId);
 
     List<Long> getAccountIds(@Param("companyId")String companyId, @Param("signature")String signature);
 }

+ 13 - 10
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/ByteDanceVideoReportDailyMapper.xml

@@ -338,12 +338,13 @@
         where
         stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
-        and a.company_id = #{companyId}
+        <!-- and a.company_id = #{companyId} -->
+        <if test="accountIds != null">
         and a.account_id in
             <foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
                 #{item}
             </foreach>
-
+        </if>
         and f.material_id = #{signature}
         group by stat_datetime
         order by stat_datetime desc
@@ -368,13 +369,15 @@
         where
         stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
-        and a.company_id = #{companyId}
+        <!-- and a.company_id = #{companyId} -->
+
         <if test="accountIds != null">
             and a.account_id in
             <foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
+
         and f.material_id = #{signature}
         group by stat_datetime
         order by stat_datetime desc
@@ -428,7 +431,7 @@
         ctop_user_allocation
         where
         user_id = #{userId}
-        and media_id = #{mediaId}
+        and media_id in (1,3)
     </select>
 
     <sql id="videoInfoSql">
@@ -694,7 +697,7 @@
         left join (select material_id,clip_id,shot_id,plan_id,plane_id from ctop_material_ascription group by material_id) f on a.signature = f.material_id
         where stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
-        and a.company_id = #{companyId}
+        <!-- and a.company_id = #{companyId}  -->
         and f.material_id is not null
         and f.shot_id = #{userId}
         <if test="accountIds != null">
@@ -744,7 +747,7 @@
         left join (select material_id,clip_id,shot_id,plan_id,plane_id from ctop_material_ascription group by material_id) f on a.signature = f.material_id
         where stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
-        and a.company_id = #{companyId}
+        <!-- and a.company_id = #{companyId} -->
         and f.material_id is not null
         <if test="accountIds != null">
             and a.account_id in
@@ -770,7 +773,7 @@
         left join (select material_id,clip_id,shot_id,plan_id,plane_id from ctop_material_ascription group by material_id) f on a.signature = f.material_id
         where stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
-        and a.company_id = #{companyId}
+
         and f.material_id is not null
         and f.plane_id = #{userId}
         <if test="accountIds != null">
@@ -796,7 +799,7 @@
         left join (select material_id,clip_id,shot_id,plan_id,plane_id from ctop_material_ascription group by material_id) f on a.signature = f.material_id
         where stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
-        and a.company_id = #{companyId}
+        <!-- and a.company_id = #{companyId}  -->
         and f.material_id is not null
         and f.plan_id = #{userId}
         <if test="accountIds != null">
@@ -822,7 +825,7 @@
         left join (select material_id,clip_id,shot_id,plan_id,plane_id from ctop_material_ascription group by material_id) f on a.signature = f.material_id
         where stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
-        and a.company_id = #{companyId}
+        <!-- and a.company_id = #{companyId}  -->
         and f.material_id is not null
         and f.clip_id = #{userId}
         <if test="accountIds != null">
@@ -848,7 +851,7 @@
         ctop_bytedance_video_report_daily
         where
         signature = #{signature}
-        and company_id = #{companyId}
+        <!-- and company_id = #{companyId}  -->
     </select>
 
 </mapper>

+ 36 - 24
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ByteDanceVideoReportDailyServiceImpl.java

@@ -105,7 +105,7 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
                 PageHelper.startPage(pageNo,pageSize,sort);
                 mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
             }else{
-                List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
+                List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(userId);
                 PageHelper.startPage(pageNo,pageSize,sort);
                 mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
             }
@@ -115,7 +115,7 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
         }else if(roleCode.equals("plan")){
             PageHelper.startPage(pageNo,pageSize,sort);
             mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
-        }else if(roleCode.equals("plane")){
+        }else if(roleCode.equals("plane")  || roleCode.equals("planeLeader")){
             PageHelper.startPage(pageNo,pageSize,sort);
             mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
         }else if(roleCode.equals("clip")){
@@ -174,7 +174,7 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
                 PageHelper.startPage(pageNo,pageSize,sort);
                 mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
             }else{
-                List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
+                List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(userId);
                 PageHelper.startPage(pageNo,pageSize,sort);
                 mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
             }
@@ -184,7 +184,7 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
         }else if(roleCode.equals("plan")){
                 PageHelper.startPage(pageNo,pageSize,sort);
                 mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
-        }else if(roleCode.equals("plane")){
+        }else if(roleCode.equals("plane")  || roleCode.equals("planeLeader")){
                 PageHelper.startPage(pageNo,pageSize,sort);
                 mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
         }else if(roleCode.equals("clip")){
@@ -242,7 +242,7 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
                 PageHelper.startPage(pageNo,pageSize,sort);
                 mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
             }else{
-                List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
+                List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(userId);
                 PageHelper.startPage(pageNo,pageSize,sort);
                 mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
             }
@@ -252,7 +252,7 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
         }else if(roleCode.equals("plan")){
             PageHelper.startPage(pageNo,pageSize,sort);
             mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
-        }else if(roleCode.equals("plane")){
+        }else if(roleCode.equals("plane")  || roleCode.equals("planeLeader")){
             PageHelper.startPage(pageNo,pageSize,sort);
             mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
         }else if(roleCode.equals("clip")){
@@ -288,31 +288,49 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
         String userId = sysUser.getId();
         String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
         String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
+
+        //排序
+        if(StringUtils.isBlank(sort)){
+            sort = "cost-";
+        }
+        sort = sort.replace("-", " desc,").replace("+", " asc,");  //sort=id-name+age+
+        sort = sort.substring(0, sort.length() - 1);
+        //
+
         List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
 
         List<Long> accountIdsList = null;
         if(accountIds != null && accountIds.length != 0){
             accountIdsList = Arrays.asList(accountIds);
         }
+
         //admin能看所有视频
         if(roleCode.equals(CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN)){
+            PageHelper.orderBy(sort);
             mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
         }else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
             if (accountIdsList != null && !accountIdsList.isEmpty()){
+                PageHelper.orderBy(sort);
                 mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
             }else{
-                List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
+                List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(userId);
+                PageHelper.orderBy(sort);
                 mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
             }
         }else if(roleCode.equals("shot")){
+            PageHelper.orderBy(sort);
             mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
         }else if(roleCode.equals("plan")){
+            PageHelper.orderBy(sort);
             mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
-        }else if(roleCode.equals("plane")){
+        }else if(roleCode.equals("plane")  || roleCode.equals("planeLeader")){
+            PageHelper.orderBy(sort);
             mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
         }else if(roleCode.equals("clip")){
+            PageHelper.orderBy(sort);
             mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
         }else if(roleCode.equals("designTeamLeader")){
+            PageHelper.orderBy(sort);
             mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
         }
         return mList;
@@ -346,7 +364,7 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
                 PageHelper.startPage(pageNo,pageSize,sort);
                 mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
             }else{
-                List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
+                List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(userId);
                 PageHelper.startPage(pageNo,pageSize,sort);
                 mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
             }
@@ -356,7 +374,7 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
         }else if(roleCode.equals("plan")){
             PageHelper.startPage(pageNo,pageSize,sort);
             mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
-        }else if(roleCode.equals("plane")){
+        }else if(roleCode.equals("plane")  || roleCode.equals("planeLeader")){
             PageHelper.startPage(pageNo,pageSize,sort);
             mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
         }else if(roleCode.equals("clip")){
@@ -406,21 +424,11 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
             if (accountIdsList != null && !accountIdsList.isEmpty()){
                 mList = byteDanceVideoReportDailyMapper.videoInfoListDetailOperator(companyId, startDate,endDate,signature, accountIdsList);
             }else{
-                accountIdsList= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
+                accountIdsList= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(userId);
                 mList = byteDanceVideoReportDailyMapper.videoInfoListDetailOperator(companyId, startDate,endDate,signature, accountIdsList);
             }
-        }else if(roleCode.equals("shot")){
-            accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
-            mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
-        }else if(roleCode.equals("plan")){
-            accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
-            mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
-        }else if(roleCode.equals("plane")){
-            accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
-            mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
-        }else if(roleCode.equals("clip")){
-            accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
-            mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
+        }else if(roleCode.equals("shot") || roleCode.equals("plan") || roleCode.equals("plane")  || roleCode.equals("planeLeader") || roleCode.equals("clip") || roleCode.equals("designTeamLeader")){
+            mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate, endDate, signature, accountIdsList);
         }else if(roleCode.equals("designTeamLeader")){
             accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
             mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
@@ -468,7 +476,11 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
         String userId = sysUser.getId();
         String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
 
-        if(roleCode.equals(CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN)  || roleCode.equals("designTeamLeader") ){
+        //拥有头条视频报表权限的是 管理员-可看所有公司视频  设计组长-可看所在公司所有视频  设计-可以自己所在项目的所有视频
+        if(roleCode.equals(CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN)
+                || roleCode.equals("designTeamLeader") || roleCode.equals("plan") ||
+                roleCode.equals("plane") || roleCode.equals("clip") || roleCode.equals("shot") || roleCode.equals("planeLeader")
+        ){
             return 1;
         }else{
             return 0;