fix(trainingCourseRecord): 确保学习时长单调不下降,避免前端误传导致统计异常
This commit is contained in:
@@ -186,6 +186,12 @@ public class HotTrainingCourseRecordServiceImpl implements IHotTrainingCourseRec
|
|||||||
update.setProgressRate(before.getProgressRate());
|
update.setProgressRate(before.getProgressRate());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (before != null && before.getLearnDurationMin() != null && update.getLearnDurationMin() != null) {
|
||||||
|
// 确保学习时长(秒)单调不下降,避免前端误传0导致统计为0
|
||||||
|
if (update.getLearnDurationMin() < before.getLearnDurationMin()) {
|
||||||
|
update.setLearnDurationMin(before.getLearnDurationMin());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
initHourPackageUsageFieldsForUpdate(update, before);
|
initHourPackageUsageFieldsForUpdate(update, before);
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
|
|||||||
Reference in New Issue
Block a user