mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-12 20:36:50 +08:00
feat:修改学习记录导出中学习时长字段格式为两位小数
This commit is contained in:
@@ -451,8 +451,8 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
map.put("学习开始时间", studyCourse1.getStartTime());
|
map.put("学习开始时间", studyCourse1.getStartTime());
|
||||||
// 结束时间为空的,说明还没学习结束(有值)
|
// 结束时间为空的,说明还没学习结束(有值)
|
||||||
map.put("学习结束时间", studyCourse1.getFinishTime());
|
map.put("学习结束时间", studyCourse1.getFinishTime());
|
||||||
// 学习时长:学习总时间是秒,现在要求的学习时间是分钟,向上取整,1秒算1分钟,60秒算1分钟,61秒算2分钟
|
// 学习时长(保留两位小数):
|
||||||
map.put("学习时长(分)", studyCourse1.getTotalDuration() == null ? null : (int) Math.ceil(studyCourse1.getTotalDuration() / 60.0));
|
map.put("学习时长(分)", studyCourse1.getTotalDuration() == null ? null : String.format("%.2f", studyCourse1.getTotalDuration() / 60.0));
|
||||||
// 学习状态需要转换
|
// 学习状态需要转换
|
||||||
String statusText = "";
|
String statusText = "";
|
||||||
if (studyCourse1.getStatus() != null) {
|
if (studyCourse1.getStatus() != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user