|
@@ -4,11 +4,9 @@ import com.fs.app.annotation.Login;
|
|
|
import com.fs.app.config.ImageStorageConfig;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.domain.ResponseResult;
|
|
|
-import com.fs.common.enums.BizResponseEnum;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
import com.fs.company.service.ICompanyUserService;
|
|
|
-import com.fs.company.service.impl.CompanyServiceImpl;
|
|
|
import com.fs.course.domain.FsUserCoursePeriod;
|
|
|
import com.fs.course.param.FsCourseLinkCreateParam;
|
|
|
import com.fs.course.param.FsWatchCourseTimeParam;
|
|
@@ -63,7 +61,7 @@ public class FsUserCourseVideoController extends AppBaseController {
|
|
|
@Autowired
|
|
|
private IFsUserCoursePeriodService fsUserCoursePeriodService;
|
|
|
@Autowired
|
|
|
- private ICompanyUserService companyService;
|
|
|
+ private ICompanyUserService companyUserService;
|
|
|
|
|
|
@Login
|
|
|
@GetMapping("/pageList")
|
|
@@ -114,24 +112,22 @@ public class FsUserCourseVideoController extends AppBaseController {
|
|
|
@RequestParam(required = false) String keyword,
|
|
|
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
|
|
@RequestParam(required = false, defaultValue = "10") Integer pageSize) {
|
|
|
- log.debug("参与记录 keyword: {}, pageNum: {}, pageSize: {}", keyword, pageNum, pageSize);
|
|
|
- String userId = getUserId();
|
|
|
+ log.debug("参与记录 videoId:{}, type:{}, keyword: {}, pageNum: {}, pageSize: {}", videoId, type, keyword, pageNum, pageSize);
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
- //判断是否管理员 管理员查所有
|
|
|
- CompanyUser companyUser = companyService.selectCompanyUserById(Long.valueOf(userId));
|
|
|
- if (companyUser != null) {
|
|
|
- if (companyUser.isAdmin()) {
|
|
|
- params.put("companyId", companyUser.getCompanyId());
|
|
|
- } else {
|
|
|
- params.put("companyUserId", userId);
|
|
|
- }
|
|
|
- } else {
|
|
|
- return ResponseResult.fail(BizResponseEnum.PARAM_ERROR);
|
|
|
- }
|
|
|
params.put("videoId", videoId);
|
|
|
params.put("type", type);
|
|
|
params.put("keyword", keyword);
|
|
|
|
|
|
+ // type 0 答题领奖记录----答题正确并且领取红包的
|
|
|
+ // type 1 完播----这堂课看完的人
|
|
|
+ // type 2 未完播---看课中断
|
|
|
+ // 管理员看整个公司 否则看自己的
|
|
|
+ CompanyUser companyUser = companyUserService.selectCompanyUserByUserId(Long.parseLong(getUserId()));
|
|
|
+ if (companyUser.isAdmin()) {
|
|
|
+ params.put("companyId", companyUser.getCompanyId());
|
|
|
+ } else {
|
|
|
+ params.put("companyUserId", companyUser.getUserId());
|
|
|
+ }
|
|
|
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
List<FsUserCourseParticipationRecordVO> record = fsUserCourseService.getParticipationRecordByMap(params);
|