浏览代码

视频报表汇总报表增加项目名称字段、下载权限增加设计师

hcst_sunzhen 5 年之前
父节点
当前提交
0e88045f2a

+ 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);
 }

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

@@ -339,11 +339,12 @@
         stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
         <!-- 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
@@ -430,7 +431,7 @@
         ctop_user_allocation
         where
         user_id = #{userId}
-        and media_id = #{mediaId}
+        and media_id in (1,3)
     </select>
 
     <sql id="videoInfoSql">

+ 8 - 19
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);
             }
@@ -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);
             }
@@ -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);
             }
@@ -313,7 +313,7 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
                 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);
             }
@@ -364,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);
             }
@@ -424,22 +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")  || roleCode.equals("planeLeader")){
-            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);