|
@@ -259,9 +259,15 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
if (defaultUnitPrice == null) {
|
|
|
throw new BizException("请先设置分部课程类型单价");
|
|
|
}
|
|
|
- if (courseSettings.getCourseCurrentPrice()
|
|
|
- .divide(new BigDecimal(courseSettings.getCourseTotalMinuties()), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN)
|
|
|
- .compareTo(defaultUnitPrice.getUnitPrice()) != 0) {
|
|
|
+ if (courseSettings.getCourseTotalMinuties() != 0) {
|
|
|
+ if (courseSettings
|
|
|
+ .getCourseCurrentPrice()
|
|
|
+ .divide(new BigDecimal(courseSettings.getCourseTotalMinuties()), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN)
|
|
|
+ .compareTo(defaultUnitPrice.getUnitPrice()) != 0) {
|
|
|
+ status = AUDITING;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
status = AUDITING;
|
|
|
break;
|
|
|
}
|
|
@@ -564,9 +570,14 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
if (defaultUnitPrice == null) {
|
|
|
throw new BizException("请先设置分部课程类型单价");
|
|
|
}
|
|
|
- if (courseSettings.getCourseCurrentPrice()
|
|
|
- .divide(new BigDecimal(courseSettings.getCourseTotalMinuties()), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN)
|
|
|
- .compareTo(defaultUnitPrice.getUnitPrice()) != 0) {
|
|
|
+ if (courseSettings.getCourseTotalMinuties() != 0) {
|
|
|
+ if (courseSettings.getCourseCurrentPrice()
|
|
|
+ .divide(new BigDecimal(courseSettings.getCourseTotalMinuties()), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN)
|
|
|
+ .compareTo(defaultUnitPrice.getUnitPrice()) != 0) {
|
|
|
+ status = AUDITING;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
status = AUDITING;
|
|
|
break;
|
|
|
}
|
|
@@ -1210,12 +1221,13 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
if (id == null) {
|
|
|
throw new BizException("参数校验失败");
|
|
|
}
|
|
|
- MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(id);
|
|
|
+ MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.getForLock(id);
|
|
|
if (calender == null) {
|
|
|
throw new BizException("缴费信息不存在");
|
|
|
}
|
|
|
- if (calender.getStatus() != PaymentCalenderStatusEnum.NO || calender.getStatus() != PaymentCalenderStatusEnum.REJECT) {
|
|
|
- throw new BizException("删除失败,只有“拒绝”或“未开启缴费”状态才能删除");
|
|
|
+ if (calender.getStatus() != PaymentCalenderStatusEnum.AUDITING || calender.getStatus() != PaymentCalenderStatusEnum.NO
|
|
|
+ || calender.getStatus() != PaymentCalenderStatusEnum.REJECT) {
|
|
|
+ throw new BizException("删除失败,只有[审核中]、[拒绝]或[未开启缴费]状态才能删除");
|
|
|
}
|
|
|
|
|
|
List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao.queryByCalenderId(id,null);
|
|
@@ -1230,6 +1242,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
musicGroupPaymentCalenderDao.delete(id);
|
|
|
musicGroupPaymentCalenderDetailDao.deleteByCalenderId(id);
|
|
|
+ musicGroupPaymentStudentCourseDetailDao.deleteByMusicGroupPaymentCalenderId(id);
|
|
|
|
|
|
List<Long> calenderIds = new ArrayList<Long>();
|
|
|
calenderIds.add(id);
|