课程学习记录

master
wenyu441069198 4 months ago
parent 7de8f3f56c
commit 38d4960e88
  1. 2
      src/main/java/com/teaching/backend/model/entity/records/CourseLearningRecord.java
  2. 4
      src/main/java/com/teaching/backend/service/impl/records/CourseLearningRecordServiceImpl.java

@ -51,7 +51,7 @@ public class CourseLearningRecord implements Serializable {
@ApiModelProperty(value = "最近学习时间")
@TableField("time")
private LocalDateTime time;
private LocalDateTime times;
}

@ -45,7 +45,7 @@ public class CourseLearningRecordServiceImpl extends ServiceImpl<CourseLearningR
String courseId = courseLearningRecord.getCourseId();
String userId = courseLearningRecord.getUserId();
//1.生成学习时间
courseLearningRecord.setTime(LocalDateTime.now());
courseLearningRecord.setTimes(LocalDateTime.now());
//2.设置人数
//2.1查人数
Long count = courseLearningNumberService.query()
@ -90,7 +90,7 @@ public class CourseLearningRecordServiceImpl extends ServiceImpl<CourseLearningR
records.forEach(courseLearningRecord -> {
CourseLearningRecordsVo courseLearningRecordsVo = new CourseLearningRecordsVo();
BeanUtil.copyProperties(courseLearningRecord,courseLearningRecordsVo);
Date date = Date.from(courseLearningRecord.getTime().atZone(ZoneId.systemDefault()).toInstant());
Date date = Date.from(courseLearningRecord.getTimes().atZone(ZoneId.systemDefault()).toInstant());
courseLearningRecordsVo.setTime(sdf.format(date));
//填充课程名称
courseLearningRecordsVo.setCourseName(coursesService.getById(courseLearningRecord.getCourseId()).getName());

Loading…
Cancel
Save