|
@@ -16,13 +16,11 @@ import com.fs.company.cache.ICompanyUserCacheService;
|
|
|
import com.fs.company.domain.Company;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
import com.fs.course.config.CourseConfig;
|
|
|
-import com.fs.course.domain.FsCourseFinishTemp;
|
|
|
-import com.fs.course.domain.FsCourseWatchLog;
|
|
|
-import com.fs.course.domain.FsUserCourse;
|
|
|
-import com.fs.course.domain.FsUserCourseVideo;
|
|
|
+import com.fs.course.domain.*;
|
|
|
import com.fs.course.mapper.*;
|
|
|
import com.fs.course.param.*;
|
|
|
import com.fs.course.service.IFsCourseWatchLogService;
|
|
|
+import com.fs.course.service.IFsUserCoursePeriodService;
|
|
|
import com.fs.course.service.cache.IFsUserCourseVideoCacheService;
|
|
|
import com.fs.course.vo.*;
|
|
|
import com.fs.his.config.FsSysConfig;
|
|
@@ -127,6 +125,9 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
|
|
|
@Autowired
|
|
|
private HyWatchLogMapper hyWatchLogMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IFsUserCoursePeriodService userCoursePeriodService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询短链课程看课记录
|
|
|
*
|
|
@@ -616,7 +617,26 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
|
|
|
|
|
|
@Override
|
|
|
public List<FsCourseWatchLogListVO> selectFsCourseWatchLogListVO(FsCourseWatchLogListParam param) {
|
|
|
- return fsCourseWatchLogMapper.selectFsCourseWatchLogListVO(param);
|
|
|
+ List<FsCourseWatchLogListVO> fsCourseWatchLogListVOS = fsCourseWatchLogMapper.selectFsCourseWatchLogListVO(param);
|
|
|
+ List<FsUserCoursePeriod> fsUserCoursePeriods = userCoursePeriodService.selectFsUserCoursePeriodList(new FsUserCoursePeriod());
|
|
|
+
|
|
|
+ // 将 fsUserCoursePeriods 转换为 Map,便于快速查找
|
|
|
+ Map<Long, String> periodIdToNameMap = fsUserCoursePeriods.stream()
|
|
|
+ .collect(Collectors.toMap(
|
|
|
+ FsUserCoursePeriod::getPeriodId,
|
|
|
+ FsUserCoursePeriod::getPeriodName,
|
|
|
+ (existing, replacement) -> existing // 如果有重复key,保留现有的
|
|
|
+ ));
|
|
|
+
|
|
|
+ // 遍历并赋值
|
|
|
+ fsCourseWatchLogListVOS.forEach(vo -> {
|
|
|
+ String periodName = periodIdToNameMap.get(vo.getPeriodId());
|
|
|
+ if (periodName != null) {
|
|
|
+ vo.setPeriodIdName(periodName);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return fsCourseWatchLogListVOS;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -1096,7 +1116,24 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
|
|
|
public List<FsCourseWatchLogListVO> selectFsCourseWatchLogListVOexport(FsCourseWatchLogListParam param) {
|
|
|
|
|
|
List<FsCourseWatchLogListVO> list = fsCourseWatchLogMapper.selectFsCourseWatchLogListVOexport(param);
|
|
|
+
|
|
|
+ //查询所有营期
|
|
|
+ List<FsUserCoursePeriod> fsUserCoursePeriods = userCoursePeriodService.selectFsUserCoursePeriodList(new FsUserCoursePeriod());
|
|
|
+
|
|
|
for (FsCourseWatchLogListVO item : list) {
|
|
|
+ //营期名称
|
|
|
+ if (ObjectUtils.isNotNull(item.getPeriodId())) {
|
|
|
+ // 获取匹配的periodName
|
|
|
+ String periodName = fsUserCoursePeriods.stream()
|
|
|
+ .filter(period -> item.getPeriodId().equals(period.getPeriodId()))
|
|
|
+ .map(FsUserCoursePeriod::getPeriodName)
|
|
|
+ .findFirst()
|
|
|
+ .orElse("无营期名称");
|
|
|
+ item.setPeriodIdName(periodName);
|
|
|
+ }else {
|
|
|
+ item.setPeriodIdName("自动发课无营期名称");
|
|
|
+ }
|
|
|
+
|
|
|
// 项目
|
|
|
if(ObjectUtils.isNotNull(item.getProject())) {
|
|
|
String sysCourseProject = DictUtils.getDictLabel("sys_course_project", String.valueOf(item.getProject()));
|