|
@@ -6,9 +6,11 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
|
+import com.fs.common.utils.DictUtils;
|
|
|
import com.fs.company.cache.ICompanyUserCacheService;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
import com.fs.course.config.CourseConfig;
|
|
@@ -22,6 +24,7 @@ import com.fs.course.mapper.FsUserCourseMapper;
|
|
|
import com.fs.course.mapper.FsUserCourseVideoMapper;
|
|
|
import com.fs.course.param.*;
|
|
|
import com.fs.course.service.IFsCourseWatchLogService;
|
|
|
+import com.fs.course.service.cache.IFsUserCourseVideoCacheService;
|
|
|
import com.fs.course.vo.*;
|
|
|
import com.fs.his.config.FsSysConfig;
|
|
|
import com.fs.his.utils.ConfigUtil;
|
|
@@ -39,7 +42,10 @@ import com.fs.sop.domain.QwSopLogs;
|
|
|
import com.fs.sop.mapper.SopUserLogsMapper;
|
|
|
import com.fs.store.domain.FsUser;
|
|
|
import com.fs.store.service.IFsUserService;
|
|
|
+import com.fs.store.service.cache.IFsUserCacheService;
|
|
|
+import com.fs.store.service.cache.IFsUserCourseCacheService;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
+import com.hc.openapi.tool.util.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -53,10 +59,7 @@ import java.time.LocalDateTime;
|
|
|
import java.time.ZoneId;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Collection;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 短链课程看课记录Service业务层处理
|
|
@@ -96,6 +99,15 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
|
|
|
@Autowired
|
|
|
private IFsUserService fsUserService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IFsUserCourseCacheService fsUserCourseCacheService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsUserCourseVideoCacheService fsUserCourseVideoCacheService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsUserCacheService fsUserCacheService;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 查询短链课程看课记录
|
|
@@ -283,6 +295,49 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
|
|
|
return fsCourseWatchLogMapper.selectFsCourseWatchLogStatisticsListVO(param);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<FsCourseWatchLogStatisticsListVO> selectFsCourseWatchLogStatisticsListVONew(FsCourseWatchLogStatisticsListParam param) {
|
|
|
+ List<FsCourseWatchLogStatisticsListVO> list = fsCourseWatchLogMapper.selectFsCourseWatchLogStatisticsListVONew(param);
|
|
|
+ for (FsCourseWatchLogStatisticsListVO item : list) {
|
|
|
+ // 项目名
|
|
|
+ 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.getVideoId())) {
|
|
|
+ FsUserCourseVideo fsUserCourseVideo = fsUserCourseVideoCacheService.selectFsUserCourseVideoByVideoId(item.getVideoId());
|
|
|
+ if(ObjectUtils.isNotNull(fsUserCourseVideo)){
|
|
|
+ item.setVideoName(fsUserCourseVideo.getTitle());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 用户名
|
|
|
+ if(ObjectUtils.isNotNull(item.getUserId())) {
|
|
|
+ FsUser fsUser = fsUserCacheService.selectFsUserById(item.getUserId());
|
|
|
+ if(ObjectUtils.isNotNull(fsUser)){
|
|
|
+ item.setUserName(String.format("%s_%d",fsUser.getNickname(),fsUser.getUserId()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 销售名
|
|
|
+ if(ObjectUtils.isNotNull(item.getCompanyUserId())) {
|
|
|
+ CompanyUser companyUser = companyUserCacheService.selectCompanyUserById(item.getCompanyUserId());
|
|
|
+ if(ObjectUtils.isNotNull(companyUser)){
|
|
|
+ item.setCompanyUserName(String.format("%s_%d", companyUser.getUserName(), companyUser.getUserId()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public void sendSocket(String cmd,String message,String appKey){
|
|
|
MsgBean msgBean=new MsgBean();
|