|
@@ -682,8 +682,9 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
|
|
|
List<CourseScheduleStudentPaymentDto> notStartCourses = statusCoursesMap.get(CourseStatusEnum.OVER);
|
|
|
notStartCourses.sort(Comparator.comparing(CourseScheduleStudentPaymentDto::getCourseStartTime));
|
|
|
for (CourseScheduleStudentPaymentDto notStartCourse : notStartCourses) {
|
|
|
- BigDecimal deductAmount = studentRegistrationService.updateUserSurplusCourseFee(notStartCourse.getUserId(), notStartCourse.getMusicGroupId(), notStartCourse.getExpectPrice().negate(), StringUtils.join("课程结束,扣除课程费用:", notStartCourse.getCourseScheduleId()), null);
|
|
|
- notStartCourse.setActualPrice(deductAmount.abs());
|
|
|
+ BigDecimal actualPrice = Objects.isNull(notStartCourse.getActualPrice())?BigDecimal.ZERO:notStartCourse.getActualPrice();
|
|
|
+ BigDecimal deductAmount = studentRegistrationService.updateUserSurplusCourseFee(notStartCourse.getUserId(), notStartCourse.getMusicGroupId(), (notStartCourse.getExpectPrice().subtract(actualPrice)).negate(), StringUtils.join("课程结束,扣除课程费用:", notStartCourse.getCourseScheduleId()), null);
|
|
|
+ notStartCourse.setActualPrice(actualPrice.add(deductAmount.abs()));
|
|
|
needUpdates.add(notStartCourse);
|
|
|
}
|
|
|
}
|
|
@@ -691,4 +692,8 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
|
|
|
courseScheduleStudentPaymentDao.batchUpdate(needUpdates);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ System.out.println(new BigDecimal(12).subtract(BigDecimal.ZERO));
|
|
|
+ }
|
|
|
}
|