Merge branch '250331-bugfix-shl' into test

# Conflicts:
#	servers/boe-server-all/src/main/java/com/xboe/module/course/entity/CourseTeacher.java
#	servers/boe-server-all/src/main/java/com/xboe/school/study/api/StudyCourseApi.java
This commit is contained in:
joshen
2025-04-01 10:25:53 +08:00
2 changed files with 15 additions and 9 deletions

View File

@@ -56,12 +56,5 @@ public class CourseTeacher extends IdBaseEntity {
/**讲师类型 1 内部讲师 2外部讲师*/ /**讲师类型 1 内部讲师 2外部讲师*/
@Transient @Transient
private Integer teacherType; private Integer teacherType;
/**供应商*/
// @Transient
// private String supplier;
//
// /**讲师类型 1 内部讲师 2外部讲师*/
// @Transient
// private Integer teacherType;
} }

View File

@@ -219,11 +219,11 @@ public class StudyCourseApi extends ApiBaseController{
redisTemplate.opsForValue().set(teacherVo.get(0).getTeacherId(), teacherVo.get(0).getStatus()); redisTemplate.opsForValue().set(teacherVo.get(0).getTeacherId(), teacherVo.get(0).getStatus());
//设置过期时间为1天 //设置过期时间为1天
redisTemplate.expire(teacherVo.get(0).getTeacherId(), 24 * 60 * 60, TimeUnit.SECONDS); redisTemplate.expire(teacherVo.get(0).getTeacherId(), 24 * 60 * 60, TimeUnit.SECONDS);
if (Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1") && t.getTeacherType() == 1 ){ if (Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1") && ( t==null || t.getTeacherType() == 1)){
ct.setTeacherName("BOE教师"); ct.setTeacherName("BOE教师");
} }
} }
if (Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1") && t.getTeacherType() == 1 ){ if (Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1") && ( t==null || t.getTeacherType() == 1)){
ct.setTeacherName("BOE教师"); ct.setTeacherName("BOE教师");
} }
} }
@@ -275,6 +275,19 @@ public class StudyCourseApi extends ApiBaseController{
continue; continue;
} }
// 查询redis上面的key并解析value获取到lastStudyTime
String lastActive = redisTemplate.opsForValue().get("studyContentId:" + item.getId() + ":last_active");
if (StringUtil.isNotBlank(lastActive)) {
String[] parts = lastActive.split("&");
if (parts.length == 2) {
int lastStudyTimeRedis = Integer.parseInt(parts[0]);
log.info("study-video-time-redis获取---lastStudyTimeRedis = " + lastStudyTimeRedis);
if(lastStudyTimeRedis>0){
item.setLastStudyTime(lastStudyTimeRedis);
}
}
}
BigDecimal lastStudyTime = new BigDecimal(item.getLastStudyTime()); BigDecimal lastStudyTime = new BigDecimal(item.getLastStudyTime());
BigDecimal duration = new BigDecimal(content.getDuration()); BigDecimal duration = new BigDecimal(content.getDuration());
BigDecimal progress = lastStudyTime.divide(duration, 10, RoundingMode.HALF_UP); BigDecimal progress = lastStudyTime.divide(duration, 10, RoundingMode.HALF_UP);