|
|
@@ -1,7 +1,6 @@
|
|
|
package com.fs.app.controller.course;
|
|
|
|
|
|
|
|
|
-
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.fs.app.annotation.UserOperationLog;
|
|
|
@@ -13,6 +12,7 @@ import com.fs.common.core.domain.ResponseResult;
|
|
|
import com.fs.app.annotation.Login;
|
|
|
import com.fs.common.core.domain.model.LoginUser;
|
|
|
import com.fs.common.utils.SecurityUtils;
|
|
|
+import com.fs.company.service.ICompanyUserService;
|
|
|
import com.fs.course.dto.BatchSendCourseDTO;
|
|
|
import com.fs.course.param.*;
|
|
|
import com.fs.course.param.newfs.FsUserCourseAddCompanyUserParam;
|
|
|
@@ -57,17 +57,19 @@ public class CourseFsUserController extends AppBaseController {
|
|
|
private IFsCourseQuestionBankService questionBankService;
|
|
|
|
|
|
@Autowired
|
|
|
- private IFsSalesUserPeriodRelationService salesUserPeriodRelationService;
|
|
|
+ private IFsSalesUserPeriodRelationService salesUserPeriodRelationService;
|
|
|
@Autowired
|
|
|
private IFsUserService fsUserService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICompanyUserService companyUserService;
|
|
|
|
|
|
|
|
|
@Login
|
|
|
@ApiOperation("判断是否添加客服(是否关联销售)")
|
|
|
@PostMapping("/isAddKf")
|
|
|
public ResponseResult<FsUser> isAddCompanyUser(@Valid @RequestBody FsUserCourseAddCompanyUserParam param) {
|
|
|
- if (ObjectUtil.isEmpty(param.getUserId())){
|
|
|
+ if (ObjectUtil.isEmpty(param.getUserId())) {
|
|
|
Long userId = Long.parseLong(getUserId());
|
|
|
param.setUserId(userId);
|
|
|
}
|
|
|
@@ -82,7 +84,7 @@ public class CourseFsUserController extends AppBaseController {
|
|
|
@PostMapping("/bindPeriodToUser")
|
|
|
public AjaxResult bindPeriodToUser(@RequestBody PeriodStatisticCountParam param) {
|
|
|
try {
|
|
|
- int result = salesUserPeriodRelationService.bindSalesUserPeriod(param.getSalesId(), param.getUserId(), param.getPeriodId(),param.getId());
|
|
|
+ int result = salesUserPeriodRelationService.bindSalesUserPeriod(param.getSalesId(), param.getUserId(), param.getPeriodId(), param.getId());
|
|
|
if (result > 0) {
|
|
|
return AjaxResult.success("绑定成功");
|
|
|
} else {
|
|
|
@@ -100,7 +102,7 @@ public class CourseFsUserController extends AppBaseController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/isSaveKf")
|
|
|
- public R isSaveKf(@RequestBody FsUserCourseVideoAddKfUParam param){
|
|
|
+ public R isSaveKf(@RequestBody FsUserCourseVideoAddKfUParam param) {
|
|
|
Long userId = Long.parseLong(getUserId());
|
|
|
param.setUserId(userId);
|
|
|
return courseVideoService.isSaveKf(param);
|
|
|
@@ -109,10 +111,9 @@ public class CourseFsUserController extends AppBaseController {
|
|
|
|
|
|
@ApiOperation("h5课程简介")
|
|
|
@GetMapping("/getH5CourseByVideoId")
|
|
|
- public R getCourseByVideoId(@RequestParam("videoId") Long videoId)
|
|
|
- {
|
|
|
+ public R getCourseByVideoId(@RequestParam("videoId") Long videoId) {
|
|
|
FsUserCourseVideoH5VO course = courseService.selectFsUserCourseVideoH5VOByVideoId(videoId);
|
|
|
- return R.ok().put("data",course);
|
|
|
+ return R.ok().put("data", course);
|
|
|
}
|
|
|
|
|
|
@Login
|
|
|
@@ -126,16 +127,14 @@ public class CourseFsUserController extends AppBaseController {
|
|
|
|
|
|
@ApiOperation("获取真实链接")
|
|
|
@GetMapping("/getRealLink")
|
|
|
- public R getRealLink(@RequestParam("sortLink")String link)
|
|
|
- {
|
|
|
+ public R getRealLink(@RequestParam("sortLink") String link) {
|
|
|
return courseLinkService.getRealLinkH5(link);
|
|
|
}
|
|
|
|
|
|
@ApiOperation("更新看课时长")
|
|
|
@PostMapping("/updateWatchDuration")
|
|
|
@Login
|
|
|
- public R updateWatchDuration(@RequestBody FsUserCourseVideoUParam param)
|
|
|
- {
|
|
|
+ public R updateWatchDuration(@RequestBody FsUserCourseVideoUParam param) {
|
|
|
param.setUserId(Long.parseLong(getUserId()));
|
|
|
return courseVideoService.updateWatchDurationWx(param);
|
|
|
}
|
|
|
@@ -154,14 +153,14 @@ public class CourseFsUserController extends AppBaseController {
|
|
|
@PostMapping("/courseAnswer")
|
|
|
@UserOperationLog(operationType = FsUserOperationEnum.ANSWER)
|
|
|
@RepeatSubmit
|
|
|
- public R courseAnswer(@RequestBody FsCourseQuestionAnswerUParam param){
|
|
|
- if (ObjectUtil.isEmpty(param.getUserId())){
|
|
|
+ public R courseAnswer(@RequestBody FsCourseQuestionAnswerUParam param) {
|
|
|
+ if (ObjectUtil.isEmpty(param.getUserId())) {
|
|
|
Long userId = Long.parseLong(getUserId());
|
|
|
param.setUserId(userId);
|
|
|
}
|
|
|
- logger.info("zyp \n【答题】:{}",param.getQuestions());
|
|
|
- if (param.getDuration()==null){
|
|
|
- logger.info("zyp \n【未识别到时长】:{}",param.getUserId());
|
|
|
+ logger.info("zyp \n【答题】:{}", param.getQuestions());
|
|
|
+ if (param.getDuration() == null) {
|
|
|
+ logger.info("zyp \n【未识别到时长】:{}", param.getUserId());
|
|
|
}
|
|
|
return questionBankService.courseAnswerByFsUser(param);
|
|
|
}
|
|
|
@@ -170,26 +169,38 @@ public class CourseFsUserController extends AppBaseController {
|
|
|
@PostMapping("/sendReward")
|
|
|
@UserOperationLog(operationType = FsUserOperationEnum.SENDREWARD)
|
|
|
@RepeatSubmit
|
|
|
- public R sendReward(@RequestBody FsCourseSendRewardUParam param)
|
|
|
- {
|
|
|
- if (ObjectUtil.isEmpty(param.getUserId())){
|
|
|
+ public R sendReward(@RequestBody FsCourseSendRewardUParam param) {
|
|
|
+ if (ObjectUtil.isEmpty(param.getUserId())) {
|
|
|
Long userId = Long.parseLong(getUserId());
|
|
|
param.setUserId(userId);
|
|
|
}
|
|
|
- logger.info("zyp \n【发放奖励】2:{}",param);
|
|
|
+ logger.info("zyp \n【发放奖励】2:{}", param);
|
|
|
return courseVideoService.sendRewardByFsUser(param);
|
|
|
}
|
|
|
|
|
|
|
|
|
@PostMapping("/getErrMsg")
|
|
|
public void getErrMsg(@RequestParam("msg") String msg) {
|
|
|
- logger.error("zyp \n【h5看课中途报错】:{}",msg);
|
|
|
+ logger.error("zyp \n【h5看课中途报错】:{}", msg);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据销售获取邀请码
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getInviteCode")
|
|
|
+ @ApiOperation("根据销售获取邀请码")
|
|
|
+ public R getInviteCode(Long salesId) {
|
|
|
+ String inviteCode = companyUserService.getInviteCodeByCompanyUserId(salesId);
|
|
|
+ return R.ok().put("inviteCode", inviteCode);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@PostMapping("/bindSales")
|
|
|
@ApiOperation("销售分享app下载链接给用户")
|
|
|
- public R bindSalesToUser(@RequestBody FsUserBindSalesParamDTO param){
|
|
|
- Boolean r = fsUserService.bindUserToSales(param.getUserId(), param.getSalesId());
|
|
|
+ public R bindSalesToUser(@RequestBody FsUserBindSalesParamDTO param) {
|
|
|
+ Boolean r = fsUserService.bindUserToSales(param.getUserId(), param.getInviteCode());
|
|
|
if (r) {
|
|
|
return R.ok();
|
|
|
}
|