|
|
@@ -1,9 +1,11 @@
|
|
|
package com.fs.app.controller;
|
|
|
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fs.common.annotation.RepeatSubmit;
|
|
|
import com.fs.common.core.controller.BaseController;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
+import com.fs.course.config.CourseConfig;
|
|
|
import com.fs.course.domain.FsUserCourse;
|
|
|
import com.fs.course.param.FsCourseLinkCreateParam;
|
|
|
import com.fs.course.param.FsCourseLinkMiniParam;
|
|
|
@@ -17,11 +19,15 @@ import com.fs.course.param.FsCourseListBySidebarParam;
|
|
|
import com.fs.course.vo.FsCourseListBySidebarVO;
|
|
|
import com.fs.course.vo.FsCourseVideoListBySidebarVO;
|
|
|
import com.fs.course.vo.newfs.FsUserCourseVideoPageListVO;
|
|
|
+import com.fs.his.config.FsSysConfig;
|
|
|
+import com.fs.his.utils.ConfigUtil;
|
|
|
import com.fs.qw.domain.QwUser;
|
|
|
import com.fs.qw.service.IQwExternalContactService;
|
|
|
+import com.fs.system.service.ISysConfigService;
|
|
|
import com.fs.voice.utils.StringUtil;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+import com.hc.openapi.tool.util.StringUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -52,6 +58,8 @@ public class ApisFsUserCourseVideoController extends BaseController {
|
|
|
@Autowired
|
|
|
private IFsCourseLinkService courseLinkService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysConfigService configService;
|
|
|
|
|
|
|
|
|
@ApiOperation("课程视频详情")
|
|
|
@@ -72,6 +80,19 @@ public class ApisFsUserCourseVideoController extends BaseController {
|
|
|
}
|
|
|
param.setCompanyId(qwUser.getCompanyId());
|
|
|
|
|
|
+ String json = configService.selectConfigByKey("course.config");
|
|
|
+ if(null == json || StringUtils.isBlank(json)){
|
|
|
+ return R.error("未配置课程信息");
|
|
|
+ }
|
|
|
+ CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
+ //配置仅展示当天的课程
|
|
|
+ if(null != config && config.isSidebarOnlyShowTodayCourse()){
|
|
|
+ PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
|
+ List<FsCourseListBySidebarVO> fsCourseListBySidebar = fsUserCourseService.getFsCourseListBySidebarToday(param);
|
|
|
+ PageInfo<FsCourseListBySidebarVO> result = new PageInfo<>(fsCourseListBySidebar);
|
|
|
+ return R.ok().put("data", result);
|
|
|
+ }
|
|
|
+
|
|
|
PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
|
List<FsCourseListBySidebarVO> fsCourseListBySidebar = fsUserCourseService.getFsCourseListBySidebar(param);
|
|
|
PageInfo<FsCourseListBySidebarVO> result = new PageInfo<>(fsCourseListBySidebar);
|
|
|
@@ -86,6 +107,19 @@ public class ApisFsUserCourseVideoController extends BaseController {
|
|
|
return R.error("课程id不能为空");
|
|
|
}
|
|
|
|
|
|
+ String json = configService.selectConfigByKey("course.config");
|
|
|
+ if(null == json || StringUtils.isBlank(json)){
|
|
|
+ return R.error("未配置课程信息");
|
|
|
+ }
|
|
|
+ CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
+ //配置仅展示当天的课程
|
|
|
+ if(null != config && config.isSidebarOnlyShowTodayCourse()){
|
|
|
+ PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
|
+ List<FsCourseVideoListBySidebarVO> videoListBySidebar = fsUserCourseVideoService.getFsCourseVideoListBySidebarToday(param);
|
|
|
+ PageInfo<FsCourseVideoListBySidebarVO> result = new PageInfo<>(videoListBySidebar);
|
|
|
+ return R.ok().put("data", result);
|
|
|
+ }
|
|
|
+
|
|
|
PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
|
List<FsCourseVideoListBySidebarVO> videoListBySidebar = fsUserCourseVideoService.getFsCourseVideoListBySidebar(param);
|
|
|
PageInfo<FsCourseVideoListBySidebarVO> result = new PageInfo<>(videoListBySidebar);
|