| 
														
															@@ -2,8 +2,12 @@ package com.fs.qw.service.impl; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; 
														 | 
														
														 | 
														
															 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 
														 | 
														
														 | 
														
															 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.fs.common.constant.HttpStatus; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.fs.common.core.page.TableDataInfo; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.common.utils.DateUtils; 
														 | 
														
														 | 
														
															 import com.fs.common.utils.DateUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.common.utils.DictUtils; 
														 | 
														
														 | 
														
															 import com.fs.common.utils.DictUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.fs.company.cache.ICompanyCacheService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.fs.company.domain.Company; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.company.domain.CompanyUser; 
														 | 
														
														 | 
														
															 import com.fs.company.domain.CompanyUser; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.company.mapper.CompanyUserMapper; 
														 | 
														
														 | 
														
															 import com.fs.company.mapper.CompanyUserMapper; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.course.domain.FsUserCourse; 
														 | 
														
														 | 
														
															 import com.fs.course.domain.FsUserCourse; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -18,11 +22,13 @@ import com.fs.qw.service.IQwWatchLogService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.qw.vo.QwWatchLogAllStatisticsListVO; 
														 | 
														
														 | 
														
															 import com.fs.qw.vo.QwWatchLogAllStatisticsListVO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.qw.vo.QwWatchLogStatisticsListVO; 
														 | 
														
														 | 
														
															 import com.fs.qw.vo.QwWatchLogStatisticsListVO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.fs.store.service.cache.IFsUserCourseCacheService; 
														 | 
														
														 | 
														
															 import com.fs.store.service.cache.IFsUserCourseCacheService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.github.pagehelper.PageInfo; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.hc.openapi.tool.util.StringUtils; 
														 | 
														
														 | 
														
															 import com.hc.openapi.tool.util.StringUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.beans.factory.annotation.Autowired; 
														 | 
														
														 | 
														
															 import org.springframework.beans.factory.annotation.Autowired; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.stereotype.Service; 
														 | 
														
														 | 
														
															 import org.springframework.stereotype.Service; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.*; 
														 | 
														
														 | 
														
															 import java.util.*; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import java.util.stream.Collectors; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 /** 
														 | 
														
														 | 
														
															 /** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  * 企微看课Service业务层处理 
														 | 
														
														 | 
														
															  * 企微看课Service业务层处理 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -44,6 +50,9 @@ public class QwWatchLogServiceImpl extends ServiceImpl<QwWatchLogMapper, QwWatch 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Autowired 
														 | 
														
														 | 
														
															     @Autowired 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     private IFsUserCourseVideoCacheService fsUserCourseVideoCacheService; 
														 | 
														
														 | 
														
															     private IFsUserCourseVideoCacheService fsUserCourseVideoCacheService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Autowired 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private ICompanyCacheService companyCacheService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     /** 
														 | 
														
														 | 
														
															     /** 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * 查询企微看课 
														 | 
														
														 | 
														
															      * 查询企微看课 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * 
														 | 
														
														 | 
														
															      * 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -143,43 +152,68 @@ public class QwWatchLogServiceImpl extends ServiceImpl<QwWatchLogMapper, QwWatch 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return vos; 
														 | 
														
														 | 
														
															         return vos; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Override 
														 | 
														
														 | 
														
															     @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    public List<QwWatchLogStatisticsListVO> selectQwWatchLogStatisticsListVONew(QwWatchLogStatisticsListParam param) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public TableDataInfo selectQwWatchLogStatisticsListVONew(QwWatchLogStatisticsListParam param) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         // 获取当前公司下的所有销售 
														 | 
														
														 | 
														
															         // 获取当前公司下的所有销售 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<CompanyUser> companyUsers = companyUserMapper.selectCompanyUserByCompanyId(param.getCompanyId()); 
														 | 
														
														 | 
														
															         List<CompanyUser> companyUsers = companyUserMapper.selectCompanyUserByCompanyId(param.getCompanyId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Long> userIds = companyUsers.stream() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .map(CompanyUser::getUserId) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .filter(Objects::nonNull) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .collect(Collectors.toList()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<QwWatchLogStatisticsListVO> list = new ArrayList<>(); 
														 | 
														
														 | 
														
															         List<QwWatchLogStatisticsListVO> list = new ArrayList<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        for (CompanyUser companyUser : companyUsers) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            // 统计销售下面的所有记录 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            List<QwWatchLogStatisticsListVO> vos = qwWatchLogMapper.selectQwWatchLogByCompanyUserId(companyUser.getCompanyId(),companyUser.getUserId() 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    , param.getSTime(),param.getETime(),param.getProject(),param.getCourseId(),param.getVideoId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            for (QwWatchLogStatisticsListVO item : vos) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                item.setCompanyUserName(String.format("%s_%d",companyUser.getUserName(),companyUser.getUserId())); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                item.setCreateTime(companyUser.getCreateTime()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                if(ObjectUtils.isNotNull(item.getProject())){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    String sysCourseProject = DictUtils.getDictLabel("sys_course_project", String.valueOf(item.getProject())); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    if(StringUtils.isNotBlank(sysCourseProject)){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        item.setProjectName(sysCourseProject); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        // 统计销售下面的所有记录 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<QwWatchLogStatisticsListVO> vos = qwWatchLogMapper 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .selectQwWatchLogByCompanyUserId(userIds 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                , param.getSTime(),param.getETime(),param.getProject(),param.getCourseId(),param.getVideoId(),param.getPageNum(),param.getPageSize()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        for (QwWatchLogStatisticsListVO item : vos) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            Company company = companyCacheService.selectCompanyById(item.getCompanyId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if(ObjectUtils.isNotNull(company)){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                item.setCompanyUserName(company.getCompanyName()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                item.setCreateTime(company.getCreateTime()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if(ObjectUtils.isNotNull(item.getProject())){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                String sysCourseProject = DictUtils.getDictLabel("sys_course_project", String.valueOf(item.getProject())); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if(StringUtils.isNotBlank(sysCourseProject)){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    item.setProjectName(sysCourseProject); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                // 课程名 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                if(ObjectUtils.isNotNull(item.getCourseId())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    FsUserCourse course = fsUserCourseCacheService.selectFsUserCourseByCourseId(item.getCourseId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    if(ObjectUtils.isNotNull(course)){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        item.setCourseName(course.getCourseName()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            // 课程名 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if(ObjectUtils.isNotNull(item.getCourseId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                FsUserCourse course = fsUserCourseCacheService.selectFsUserCourseByCourseId(item.getCourseId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if(ObjectUtils.isNotNull(course)){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    item.setCourseName(course.getCourseName()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                // 小节名 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                if(ObjectUtils.isNotNull(item.getVideoId())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    FsUserCourseVideo fsUserCourseVideo = fsUserCourseVideoCacheService.selectFsUserCourseVideoByVideoId(item.getVideoId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    if(ObjectUtils.isNotNull(fsUserCourseVideo)){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        item.setVideoName(fsUserCourseVideo.getTitle()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            // 小节名 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if(ObjectUtils.isNotNull(item.getVideoId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                FsUserCourseVideo fsUserCourseVideo = fsUserCourseVideoCacheService.selectFsUserCourseVideoByVideoId(item.getVideoId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if(ObjectUtils.isNotNull(fsUserCourseVideo)){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    item.setVideoName(fsUserCourseVideo.getTitle()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                list.add(item); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            list.add(item); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        return list; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        // 获取总记录数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Long total = qwWatchLogMapper 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .selectQwWatchLogByCompanyUserIdCount(userIds 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        , param.getSTime(), param.getETime(), param.getProject(), param.getCourseId(), param.getVideoId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        TableDataInfo rspData = new TableDataInfo(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        rspData.setCode(HttpStatus.SUCCESS); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        rspData.setMsg("查询成功"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        rspData.setRows(list); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        rspData.setTotal(total); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return rspData; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Override 
														 | 
														
														 | 
														
															     @Override 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -250,6 +284,12 @@ public class QwWatchLogServiceImpl extends ServiceImpl<QwWatchLogMapper, QwWatch 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return list; 
														 | 
														
														 | 
														
															         return list; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Override 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public Long selectQwWatchLogStatisticsListVONewCount(QwWatchLogStatisticsListParam param) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return companyUserMapper.selectQwWatchLogStatisticsListVONewCount(param); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public List<Date> getDatesBetween(Date sTime, Date eTime) { 
														 | 
														
														 | 
														
															     public List<Date> getDatesBetween(Date sTime, Date eTime) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<Date> dates = new ArrayList<>(); 
														 | 
														
														 | 
														
															         List<Date> dates = new ArrayList<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Calendar calendar = Calendar.getInstance(); 
														 | 
														
														 | 
														
															         Calendar calendar = Calendar.getInstance(); 
														 |