Quellcode durchsuchen

头条视频报表

hcst_sunzhen vor 5 Jahren
Ursprung
Commit
016b4cad9a

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

@@ -34,7 +34,7 @@ public interface ByteDanceVideoReportDailyMapper extends BaseMapper<ByteDanceVid
 
     void updateJsonByUserIdAndType(@Param("json") String json, @Param("userId") String userId, @Param("columnType") Integer columnType);
 
-    List<ByteDanceVideoReportDaily> videoInfoListDetail(@Param("companyId") String companyId, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("signature") String signature);
+    List<ByteDanceVideoReportDaily> videoInfoListDetail(@Param("companyId") String companyId, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("signature") String signature, @Param("role") String role);
 
     List<ByteDanceVideoReportDaily> bytedanceVideoInfoList(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("role") String role, @Param("userId") String userId, @Param("signature") String signature, @Param("companyId") String companyId, @Param("cost") BigDecimal cost);
 

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

@@ -463,10 +463,14 @@
         else 0 end                           as downloadStartRate               --  应用下载广告数据-安卓下载开始率  计算方法:安卓下载开始数/点击数
 
         from ctop_bytedance_video_report_daily a
-        left join ctop_material_ascription f on a.signature = f.material_id
-        where a.company_id = #{companyId}
-        and stat_datetime &gt;= #{startDate}
+        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}
+
+        <if test=" role != 'admin' ">
+           and a.company_id = #{companyId}
+        </if>
+
         and f.material_id is not null
 
         <choose>   <!-- 编导、剪辑、拍摄、平面只能查看自己本职工作制作的视频,设计组长和管理员能查看所有的-->
@@ -571,11 +575,14 @@
                 huanbi as huanbi
 
         from ctop_bytedance_video_report_daily a
-        left join ctop_material_ascription f on a.signature = f.material_id
-        where a.company_id = #{companyId}
-        and f.material_id = #{signature}
-        and stat_datetime &gt;= #{startDate}
+        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}
+        <if test=" role != 'admin' ">
+            and a.company_id = #{companyId}
+        </if>
+        and f.material_id = #{signature}
         order by stat_datetime desc
     </select>
 
@@ -679,10 +686,12 @@
                     a.download_start_rate as downloadStartRate --  应用下载广告数据-安卓下载开始率  计算方法:安卓下载开始数/点击数
         from ctop_bytedance_video_report_daily a
         left join (select id,code,url,material_name from ctop_material_info group by code) e on a.signature = e.code
-        left join ctop_material_ascription f on e.id = f.material_id
-        where a.company_id = #{companyId}
-        and stat_datetime &gt;= #{startDate}
+        left join (select material_id,clip_id,shot_id,plan_id,plane_id from ctop_material_ascription group by material_id) f on e.id = f.material_id
+        where stat_datetime &gt;= #{startDate}
         and stat_datetime &lt;= #{endDate}
+        <if test=" role != 'admin' ">
+            and a.company_id = #{companyId}
+        </if>
         and e.code is not null
         <!--<if test="role == 'plan'">
             and f.plan = #{userId}

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

@@ -159,10 +159,10 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
     public List<ByteDanceVideoReportDaily> videoInfoListDetail(String startDate, String endDate, String signature){
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String userId = sysUser.getId();
-        //String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
+        String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
         String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
 
-        return byteDanceVideoReportDailyMapper.videoInfoListDetail(companyId, startDate, endDate, signature);
+        return byteDanceVideoReportDailyMapper.videoInfoListDetail(companyId, startDate, endDate, signature, roleCode);
     }
 
     public String getColumnJson(Integer columnType){