|
|
@@ -20,7 +20,6 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
@@ -30,13 +29,12 @@ import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
|
|
|
import vip.xiaonuo.common.annotation.CommonLog;
|
|
|
import vip.xiaonuo.common.pojo.CommonResult;
|
|
|
import vip.xiaonuo.common.pojo.CommonValidList;
|
|
|
-import vip.xiaonuo.disk.domain.CourseStudentProgress;
|
|
|
-import vip.xiaonuo.disk.param.courseclasshourfilerelate.CourseRelateIdParam;
|
|
|
+import vip.xiaonuo.disk.domain.CourseStudentBurialpoint;
|
|
|
import vip.xiaonuo.disk.param.coursestudentprogress.CourseStudentProgressAddParam;
|
|
|
import vip.xiaonuo.disk.param.coursestudentprogress.CourseStudentProgressEditParam;
|
|
|
import vip.xiaonuo.disk.param.coursestudentprogress.CourseStudentProgressIdParam;
|
|
|
import vip.xiaonuo.disk.param.coursestudentprogress.CourseStudentProgressPageParam;
|
|
|
-import vip.xiaonuo.disk.service.CourseStudentProgressService;
|
|
|
+import vip.xiaonuo.disk.service.CourseStudentBurialpointService;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
@@ -48,32 +46,32 @@ import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
- * 课程学生-学习进度表控制器
|
|
|
+ * 课程学生-学习埋点表控制器
|
|
|
*
|
|
|
* @author honorfire
|
|
|
* @date 2025/07/30 14:57
|
|
|
*/
|
|
|
-@Api(tags = "课程学生-学习进度表控制器")
|
|
|
+@Api(tags = "课程学生-学习埋点表控制器")
|
|
|
@ApiSupport(author = "SNOWY_TEAM", order = 1)
|
|
|
@RestController
|
|
|
@Validated
|
|
|
-public class CourseStudentProgressController {
|
|
|
+public class CourseStudentBurialpointController {
|
|
|
|
|
|
@Resource
|
|
|
- private CourseStudentProgressService courseStudentProgressService;
|
|
|
+ private CourseStudentBurialpointService courseStudentBurialpointService;
|
|
|
|
|
|
/**
|
|
|
- * 获取课程学生-学习进度表分页
|
|
|
+ * 获取课程学生-学习埋点表分页
|
|
|
*
|
|
|
* @author honorfire
|
|
|
* @date 2025/07/30 14:57
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
- @ApiOperation("获取课程学生-学习进度表分页")
|
|
|
- @SaCheckPermission("/disk/coursestudentprogress/page")
|
|
|
- @GetMapping("/disk/coursestudentprogress/page")
|
|
|
- public CommonResult<Page<CourseStudentProgress>> page(CourseStudentProgressPageParam courseStudentProgressPageParam) {
|
|
|
- return CommonResult.data(courseStudentProgressService.page(courseStudentProgressPageParam));
|
|
|
+ @ApiOperation("获取课程学生-学习埋点表分页")
|
|
|
+ @SaCheckPermission("/disk/coursestudentburialpoint/page")
|
|
|
+ @GetMapping("/disk/coursestudentburialpoint/page")
|
|
|
+ public CommonResult<Page<CourseStudentBurialpoint>> page(CourseStudentProgressPageParam courseStudentProgressPageParam) {
|
|
|
+ return CommonResult.data(courseStudentBurialpointService.page(courseStudentProgressPageParam));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -85,24 +83,25 @@ public class CourseStudentProgressController {
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
@ApiOperation("课程学生学习进度表-添加")
|
|
|
@CommonLog("课程学生学习进度表-添加")
|
|
|
- @PostMapping("/disk/coursestudentprogress/add")
|
|
|
+ @PostMapping("/disk/coursestudentburialpoint/add")
|
|
|
public CommonResult<String> add(@RequestBody @Valid CourseStudentProgressAddParam courseStudentProgressAddParam) {
|
|
|
Map param=new HashMap();
|
|
|
- CourseStudentProgress courseStudentProgress=BeanUtil.toBean(courseStudentProgressAddParam, CourseStudentProgress.class);
|
|
|
+ CourseStudentBurialpoint courseStudentBurialpoint =BeanUtil.toBean(courseStudentProgressAddParam, CourseStudentBurialpoint.class);
|
|
|
String userId =StpLoginUserUtil.getLoginUser().getId();
|
|
|
- courseStudentProgress.setUserId(userId);
|
|
|
+ courseStudentBurialpoint.setUserId(userId);
|
|
|
//进度不能覆盖,查询该学生该课程上一次的学习进度,如果本次进度不大于最高的进度,就只存最高的进度
|
|
|
param.put("userId", userId);
|
|
|
- param.put("hourId", courseStudentProgress.getHourId());
|
|
|
- List<CourseStudentProgress> alreadyList=courseStudentProgressService.wrapperList(param);
|
|
|
- List<String> alreadyProgressList=CollStreamUtil.toList(alreadyList, CourseStudentProgress::getProgress);
|
|
|
+ param.put("hourId", courseStudentBurialpoint.getHourId());
|
|
|
+ List<CourseStudentBurialpoint> alreadyList= courseStudentBurialpointService.wrapperList(param);
|
|
|
+ List<String> alreadyProgressList=CollStreamUtil.toList(alreadyList, CourseStudentBurialpoint::getProgress);
|
|
|
//将String转为Long
|
|
|
List<Long> alreadyProgressLongList=alreadyProgressList.stream().map(Long::parseLong).collect(Collectors.toList());
|
|
|
//取出最大的进度
|
|
|
Long maxProgress=alreadyProgressLongList.stream().max(Long::compareTo).orElse(0L);
|
|
|
- if(Long.valueOf(courseStudentProgressAddParam.getProgress()).longValue()<maxProgress.longValue())courseStudentProgress.setProgress(String.valueOf(maxProgress));
|
|
|
+ if(Long.valueOf(courseStudentProgressAddParam.getProgress()).longValue()<maxProgress.longValue())
|
|
|
+ courseStudentBurialpoint.setProgress(String.valueOf(maxProgress));
|
|
|
|
|
|
- courseStudentProgressService.addOne(courseStudentProgress);
|
|
|
+ courseStudentBurialpointService.addOne(courseStudentBurialpoint);
|
|
|
return CommonResult.ok();
|
|
|
}
|
|
|
|
|
|
@@ -114,68 +113,68 @@ public class CourseStudentProgressController {
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
@ApiOperation("课程学生学习进度-查询最近一次进度")
|
|
|
- @GetMapping("/disk/coursestudentprogress/theLastDetail")
|
|
|
- public CommonResult<CourseStudentProgress> theLastDetail(@Valid CourseStudentProgressPageParam courseStudentProgressPageParam, HttpServletRequest req) {
|
|
|
+ @GetMapping("/disk/coursestudentburialpoint/theLastDetail")
|
|
|
+ public CommonResult<CourseStudentBurialpoint> theLastDetail(@Valid CourseStudentProgressPageParam courseStudentProgressPageParam, HttpServletRequest req) {
|
|
|
Map param=new HashMap();
|
|
|
param.put("userId", StpLoginUserUtil.getLoginUser().getId());
|
|
|
param.put("hourId", req.getParameter("hourId"));
|
|
|
//是否查询最近一次进度,0否1是
|
|
|
param.put("isLast", "1");
|
|
|
- List<CourseStudentProgress> alreadyList=courseStudentProgressService.wrapperList(param);
|
|
|
- CourseStudentProgress courseStudentProgress=null;
|
|
|
+ List<CourseStudentBurialpoint> alreadyList= courseStudentBurialpointService.wrapperList(param);
|
|
|
+ CourseStudentBurialpoint courseStudentBurialpoint =null;
|
|
|
if(alreadyList.size()>0)
|
|
|
{
|
|
|
- courseStudentProgress=alreadyList.get(0);
|
|
|
+ courseStudentBurialpoint =alreadyList.get(0);
|
|
|
}
|
|
|
- return CommonResult.data(courseStudentProgress);
|
|
|
+ return CommonResult.data(courseStudentBurialpoint);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 编辑课程学生-学习进度表
|
|
|
+ * 编辑课程学生-学习埋点表
|
|
|
*
|
|
|
* @author honorfire
|
|
|
* @date 2025/07/30 14:57
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 3)
|
|
|
- @ApiOperation("编辑课程学生-学习进度表")
|
|
|
- @CommonLog("编辑课程学生-学习进度表")
|
|
|
- @PostMapping("/disk/coursestudentprogress/edit")
|
|
|
+ @ApiOperation("编辑课程学生-学习埋点表")
|
|
|
+ @CommonLog("编辑课程学生-学习埋点表")
|
|
|
+ @PostMapping("/disk/coursestudentburialpoint/edit")
|
|
|
public CommonResult<String> edit(@RequestBody @Valid CourseStudentProgressEditParam courseStudentProgressEditParam) {
|
|
|
- CourseStudentProgress courseStudentProgress=BeanUtil.toBean(courseStudentProgressEditParam, CourseStudentProgress.class);
|
|
|
- courseStudentProgressService.editOne(courseStudentProgress);
|
|
|
+ CourseStudentBurialpoint courseStudentBurialpoint =BeanUtil.toBean(courseStudentProgressEditParam, CourseStudentBurialpoint.class);
|
|
|
+ courseStudentBurialpointService.editOne(courseStudentBurialpoint);
|
|
|
return CommonResult.ok();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 删除课程学生-学习进度表
|
|
|
+ * 删除课程学生-学习埋点表
|
|
|
*
|
|
|
* @author honorfire
|
|
|
* @date 2025/07/30 14:57
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 4)
|
|
|
- @ApiOperation("删除课程学生-学习进度表")
|
|
|
- @CommonLog("删除课程学生-学习进度表")
|
|
|
- @SaCheckPermission("/disk/coursestudentprogress/delete")
|
|
|
- @PostMapping("/disk/coursestudentprogress/delete")
|
|
|
+ @ApiOperation("删除课程学生-学习埋点表")
|
|
|
+ @CommonLog("删除课程学生-学习埋点表")
|
|
|
+ @SaCheckPermission("/disk/coursestudentburialpoint/delete")
|
|
|
+ @PostMapping("/disk/coursestudentburialpoint/delete")
|
|
|
public CommonResult<String> delete(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
|
|
|
CommonValidList<CourseStudentProgressIdParam> courseStudentProgressIdParamList) {
|
|
|
- courseStudentProgressService.delete(courseStudentProgressIdParamList);
|
|
|
+ courseStudentBurialpointService.delete(courseStudentProgressIdParamList);
|
|
|
return CommonResult.ok();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取课程学生-学习进度表详情
|
|
|
+ * 获取课程学生-学习埋点表详情
|
|
|
*
|
|
|
* @author honorfire
|
|
|
* @date 2025/07/30 14:57
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
- @ApiOperation("获取课程学生-学习进度表详情")
|
|
|
- @SaCheckPermission("/disk/coursestudentprogress/detail")
|
|
|
- @GetMapping("/disk/coursestudentprogress/detail")
|
|
|
- public CommonResult<CourseStudentProgress> detail(@Valid CourseStudentProgressIdParam courseStudentProgressIdParam) {
|
|
|
- return CommonResult.data(courseStudentProgressService.detail(courseStudentProgressIdParam));
|
|
|
+ @ApiOperation("获取课程学生-学习埋点表详情")
|
|
|
+ @SaCheckPermission("/disk/coursestudentburialpoint/detail")
|
|
|
+ @GetMapping("/disk/coursestudentburialpoint/detail")
|
|
|
+ public CommonResult<CourseStudentBurialpoint> detail(@Valid CourseStudentProgressIdParam courseStudentProgressIdParam) {
|
|
|
+ return CommonResult.data(courseStudentBurialpointService.detail(courseStudentProgressIdParam));
|
|
|
}
|
|
|
|
|
|
}
|