|
@@ -1883,7 +1883,11 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
|
|
|
//计算课时
|
|
|
List<CourseScheduleStudentPayment> studentPaymentList = paymentDao.selectList(Wrappers.<CourseScheduleStudentPayment>lambdaQuery().eq(CourseScheduleStudentPayment::getCourseId, courseId));
|
|
|
- int time = studentPaymentList.size() * schedule.getSingleCourseTime();
|
|
|
+
|
|
|
+ String formula = sysConfigService.findConfigValue(SysConfigConstant.PIANO_ROOM_TIME_FORMULA);
|
|
|
+ Integer n = (Integer) WrapperUtil.strToFormula(formula, "n", String.valueOf(studentPaymentList.size() + 1));//人数计算 公式n*(n-1) n包含老师
|
|
|
+ Integer time = schedule.getSingleCourseTime() * n;//消耗时长 课程数*单课时长*人数
|
|
|
+
|
|
|
PianoRoomTime pianoRoomTime = pianoRoomTimeDao.selectOne(Wrappers.<PianoRoomTime>lambdaQuery().eq(PianoRoomTime::getTeacherId, teacherId));
|
|
|
if (pianoRoomTime == null) {
|
|
|
throw new BizException("未查到剩余时长");
|