pans 6 месяцев назад
Родитель
Сommit
f394a1bf64

+ 15 - 13
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CourseStudentBurialpointController.java

@@ -90,19 +90,21 @@ public class CourseStudentBurialpointController {
         String userId =StpLoginUserUtil.getLoginUser().getId();
         courseStudentBurialpoint.setUserId(userId);
         //进度不能覆盖,查询该学生该课程上一次的学习进度,如果本次进度不大于最高的进度,就只存最高的进度
-        param.put("userId", userId);
-        param.put("hourId", courseStudentBurialpoint.getHourId());
-        param.put("funcType", courseStudentBurialpoint.getFuncType());
-        param.put("type", courseStudentBurialpoint.getType());
-        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())
-            courseStudentBurialpoint.setProgress(String.valueOf(maxProgress));
-
+        if("1".equals(courseStudentBurialpoint.getType())){
+            param.put("userId", userId);
+            param.put("hourId", courseStudentBurialpoint.getHourId());
+            param.put("funcType", courseStudentBurialpoint.getFuncType());
+            param.put("type", courseStudentBurialpoint.getType());
+            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()){
+                courseStudentBurialpoint.setProgress(String.valueOf(maxProgress));
+            }
+        }
         courseStudentBurialpointService.addOne(courseStudentBurialpoint);
         return CommonResult.ok();
     }

+ 0 - 1
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/param/coursestudentprogress/CourseStudentProgressAddParam.java

@@ -36,7 +36,6 @@ public class CourseStudentProgressAddParam {
 
     /** 当前学习进度 */
     @ApiModelProperty(value = "当前学习进度", position = 4)
-    @NotBlank(message = "当前学习进度不能为空")
     private String progress;