浏览代码

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_java into openIm

15376779826 4 周之前
父节点
当前提交
7a43c4b8a3

+ 5 - 0
fs-service/src/main/java/com/fs/qw/mapper/QwWatchLogMapper.java

@@ -77,6 +77,7 @@ public interface QwWatchLogMapper extends BaseMapper<QwWatchLog>{
             "    COUNT(CASE WHEN qec.`level` = 2 THEN 1 END) AS B,\n" +
             "    COUNT(CASE WHEN qec.`level` = 3 THEN 1 END) AS C,\n" +
             "    COUNT(CASE WHEN qec.`level` = 4 THEN 1 END) AS D,\n" +
+            "    COUNT(CASE WHEN qec.`level` = 5 THEN 1 END) AS E,\n" +
             "    COUNT(CASE WHEN qec.fs_user_id IS NOT NULL THEN 1 END) AS sign,\n" +
             "    COUNT(CASE WHEN qec.`status` =3 THEN 1 END) AS los,\n" +
             "    COUNT(CASE WHEN qec.`status` IN (4, 5,6) THEN 1 END) AS del\n" +
@@ -84,11 +85,15 @@ public interface QwWatchLogMapper extends BaseMapper<QwWatchLog>{
             "    qw_external_contact qec\n" +
             "JOIN\n" +
             "    qw_user qu ON qec.qw_user_id = qu.id \n" +
+            "left join company_user cu on qec.company_user_id = cu.user_id "+
             "WHERE\n" +
             "    DATE(qec.create_time) &gt;= DATE(#{sTime}) and  DATE(qec.create_time) &lt;= DATE(#{eTime}) and qec.company_id =#{companyId} " +
             "<if test ='nickName !=null and nickName!=\"\"'>\n" +
             "   and qu.qw_user_name like concat( #{nickName}, '%')\n" +
             "</if>" +
+            "<if test ='deptId !=null and deptId!=\"\"'>\n" +
+            "   and cu.dept_id = #{deptId}\n" +
+            "</if>" +
             "<if test ='ids !=null and ids!=\"\"'>\n" +
             "   and qec.qw_user_id in (${ids})\n" +
             "</if>" +

+ 1 - 0
fs-service/src/main/java/com/fs/qw/param/QwWatchLogStatisticsListParam.java

@@ -33,6 +33,7 @@ public class QwWatchLogStatisticsListParam {
     private Long project;
     private Long courseId;
     private Long videoId;
+    private Long deptId;
 
     private Long pageNum;
     private Long pageSize;

+ 9 - 0
fs-service/src/main/java/com/fs/qw/service/impl/QwWatchLogServiceImpl.java

@@ -10,7 +10,9 @@ import com.fs.common.utils.DictUtils;
 import com.fs.company.cache.ICompanyCacheService;
 import com.fs.company.cache.ICompanyUserCacheService;
 import com.fs.company.domain.Company;
+import com.fs.company.domain.CompanyDept;
 import com.fs.company.domain.CompanyUser;
+import com.fs.company.mapper.CompanyDeptMapper;
 import com.fs.company.mapper.CompanyUserMapper;
 import com.fs.course.domain.FsUserCourse;
 import com.fs.course.domain.FsUserCourseVideo;
@@ -51,6 +53,9 @@ public class QwWatchLogServiceImpl extends ServiceImpl<QwWatchLogMapper, QwWatch
     @Autowired
     private CompanyUserMapper companyUserMapper;
 
+    @Autowired
+    private CompanyDeptMapper companyDeptMapper;
+
     @Autowired
     private IFsUserCourseCacheService fsUserCourseCacheService;
 
@@ -141,6 +146,10 @@ public class QwWatchLogServiceImpl extends ServiceImpl<QwWatchLogMapper, QwWatch
 
     @Override
     public TableDataInfo selectQwWatchLogStatisticsListVO(QwWatchLogStatisticsListParam param) {
+        CompanyDept companyDept = companyDeptMapper.selectCompanyDeptById(param.getDeptId());
+        if (ObjectUtils.isNotEmpty(companyDept)&&companyDept.getParentId()==0L){
+            param.setDeptId(null);
+        }
         TableDataInfo rspData = new TableDataInfo();
         rspData.setCode(HttpStatus.SUCCESS);
         rspData.setMsg("查询成功");

+ 2 - 0
fs-service/src/main/java/com/fs/qw/vo/QwWatchLogStatisticsListVO.java

@@ -43,6 +43,8 @@ public class QwWatchLogStatisticsListVO {
     private Long b;
     private Long c;
     private Long d;
+    private Long e;
+    private Long black;
     private Long los;//流失数
     private Long del;//删除数
 }

+ 4 - 0
fs-service/src/main/resources/mapper/course/FsUserCourseVideoMapper.xml

@@ -36,6 +36,7 @@
         <result property="viewEndTime"    column="view_end_time"    />
         <result property="lastJoinTime"    column="last_join_time"    />
         <result property="projectId"    column="project_id"    />
+        <result property="isFirst"    column="is_first"    />
     </resultMap>
 
     <sql id="selectFsUserCourseVideoVo">
@@ -105,6 +106,7 @@
             <if test="listingStartTime != null">listing_start_time,</if>
             <if test="listingEndTime != null">listing_end_time,</if>
             <if test="userId != null">user_id,</if>
+            <if test="isFirst != null">is_first,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fileId != null">#{fileId},</if>
@@ -142,6 +144,7 @@
             <if test="listingEndTime != null">#{listingEndTime},</if>
             <if test="projectId != null">#{projectId},</if>
             <if test="userId != null">#{userId},</if>
+            <if test="isFirst != null">#{isFirst},</if>
         </trim>
     </insert>
     <insert id="insertBatchFsUserCourseVideo" parameterType="FsUserCourseVideo" useGeneratedKeys="true" keyProperty="videoId">
@@ -228,6 +231,7 @@
             <if test="listingStartTime != null">listing_start_time = #{listingStartTime},</if>
             <if test="listingEndTime != null">listing_end_time = #{listingEndTime},</if>
             <if test="projectId != null">project_id = #{projectId},</if>
+            <if test="isFirst != null">is_first = #{isFirst},</if>
         </trim>
         where video_id = #{videoId}
     </update>