fix: 【FCJDFDXTXS-70】导出时课程评分四舍五入

This commit is contained in:
liu.zixi
2025-12-11 19:16:21 +08:00
parent 3ba06fd16e
commit cbebcc6da8

View File

@@ -245,7 +245,8 @@ public class CoursePageServiceImpl implements ICoursePageService {
// 课程时长:秒转分 // 课程时长:秒转分
map.put("courseDuration", coursePageVo.getCourseDuration() / 60); map.put("courseDuration", coursePageVo.getCourseDuration() / 60);
map.put("studys", coursePageVo.getStudys()); map.put("studys", coursePageVo.getStudys());
map.put("score", coursePageVo.getScore()); // 课程评分显示1位小数四舍五入
map.put("score", coursePageVo.getScore() == null ? "0.0" : String.format("%.1f", coursePageVo.getScore()));
map.put("status", CourseStatusEnum.getByCode(coursePageVo.getStatus()).getLabel()); map.put("status", CourseStatusEnum.getByCode(coursePageVo.getStatus()).getLabel());
map.put("published", coursePageVo.getPublished() == null || !coursePageVo.getPublished() ? "未发布" : "已发布"); map.put("published", coursePageVo.getPublished() == null || !coursePageVo.getPublished() ? "未发布" : "已发布");
map.put("enabled", coursePageVo.getEnabled() == null || !coursePageVo.getEnabled() ? "停用" : "启用"); map.put("enabled", coursePageVo.getEnabled() == null || !coursePageVo.getEnabled() ? "停用" : "启用");