zhouzeyu@c-top.com.cn 3 سال پیش
والد
کامیت
b9108682dc

+ 1 - 1
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/MaterialReportOverViewV3Mapper.java

@@ -15,7 +15,7 @@ public interface MaterialReportOverViewV3Mapper {
 
     Set<String> recursiveQuerySubordinateByLeader(@Param("leaderId") String leaderId);
 
-    List<JSONObject> getDesignTeamList(@Param("mediaId") int mediaId);
+    List<JSONObject> getDesignTeamList(@Param("mediaId") int mediaId,@Param("companyId") String companyId);
 
     Set<String> recursiveQuerySubordinateByLeaders(@Param("leaderIds") Set<String> leaderIds);
 

+ 7 - 12
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/MaterialReportOverViewV3Mapper.xml

@@ -10,15 +10,9 @@
           and del_flag = 0
     </select>
 
-    <select id="getDesignTeamList" parameterType="int" resultType="com.alibaba.fastjson.JSONObject">
-        select id,depart_name as departName,leader_id as leaderId,leader_name as leaderName from sys_depart
-        <if test='mediaId==1'>
-            where parent_id ='26c10ecb5e0d416bb01f8ff983f4588c'
-        </if>
-        <if test='mediaId==2'>
-            where parent_id ='4e939124a5f541c88838e49d2a3ea72b'
-        </if>
-
+    <select id="getDesignTeamList"  resultType="com.alibaba.fastjson.JSONObject">
+        select id,depart_name as departName,leader_id as leaderId,leader_name as leaderName from  application.sys_depart_personal
+        where company_id=#{companyId}
     </select>
 
     <select id="recursiveQuerySubordinateByLeaders" resultType="java.lang.String">
@@ -619,8 +613,9 @@
         <if test="type == 3">t1.plan_name as userName, "编导" as roleName</if>
         from
         application.kuaishou_material_video_report_daily_dw t1
+
         <where>
-            t1.stat_date  between #{startDate} and  #{endDate}
+            t1.stat_date  between #{startDate} and  #{endDate} and t1.company_id=#{companyId}
         </where>
         <if test="type == 1">AND t1.shot_id is not null and t1.shot_id != '' AND t1.shot_name is not null and t1.shot_name != ''  GROUP BY t1.shot_id</if>
         <if test="type == 2">AND t1.clip_id is not null and t1.clip_id != '' AND t1.clip_name is not null and t1.clip_name != '' GROUP BY t1.clip_id</if>
@@ -646,7 +641,7 @@
         application.app_bytedance_material_info t
         LEFT JOIN application.bytedance_material_video_report_daily_dw t1 on t.material_id=t1.signature
         <where>
-            t1.stat_datetime BETWEEN #{startDate} and #{endDate} and t.company_id=#{companyId}
+            t1.stat_datetime BETWEEN #{startDate} and #{endDate} and t.company_id=#{companyId} and t1.company_id=#{companyId}
         </where>
         <if test="type == 1">AND t1.shot_id is not null and t1.shot_id != '' AND t1.shot_name is not null and t1.shot_name != ''  GROUP BY t1.shot_id</if>
         <if test="type == 2">AND t1.clip_id is not null and t1.clip_id != '' AND t1.clip_name is not null and t1.clip_name != '' GROUP BY t1.clip_id</if>
@@ -1542,7 +1537,7 @@
 
     <!-- 快手创新视频消耗-->
     <select id="getKuaishouDesignTeaminnovativeVideoCost" resultType="java.math.BigDecimal">
-        SELECT  SUM(t1.charge)
+        SELECT  ifnull(SUM(t1.charge),0)
         from  application.app_kuaishou_material_info  t
 		LEFT JOIN  application.kuaishou_material_video_report_daily_dw t1 on t.material_id=t1.signature
         where t.media_time between #{startDate} and #{endDate} and  t.material_innovate=2 and t.leader_id=#{leaderId} and t.company_id=#{companyId}

+ 3 - 2
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/MaterialReportOverViewV2ServiceImpl.java

@@ -62,8 +62,9 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
      */
     @Override
     public List<JSONObject> getDesignTeamList(String userId, int mediaId) {
-
-        List<JSONObject> designTeamList = materialReportOverViewV3Mapper.getDesignTeamList(mediaId);
+        //根据userID查询公司id
+        String companyId = materialReportOverViewV3Mapper.getCompanyId(userId);
+        List<JSONObject> designTeamList = materialReportOverViewV3Mapper.getDesignTeamList(mediaId,companyId);
         if (designTeamList != null && !designTeamList.isEmpty()) {
             //判断是否默认选中
             for (JSONObject jsonObject : designTeamList) {