|
@@ -1558,28 +1558,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
throw new Exception("缴费周期更新失败,当前乐团有未缴费的学员");
|
|
|
}
|
|
|
//修改学员下次缴费日期
|
|
|
- //获取当前月份
|
|
|
- int currentMonth = Integer.parseInt(DateUtil.getMonth(date));
|
|
|
- int nextMonth = currentMonth;
|
|
|
- for (int i = 0;i < months.size();i++){
|
|
|
- if(i == months.size()-1 && months.get(i) <= currentMonth){
|
|
|
- nextMonth = months.get(0);
|
|
|
- break;
|
|
|
- }else if(months.get(i) > currentMonth){
|
|
|
- nextMonth = months.get(i);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- // 修改学员付费周期
|
|
|
- Date nextPaymentDate = null;
|
|
|
- if(nextMonth > currentMonth){
|
|
|
- nextPaymentDate = DateUtil.addMonths(date, nextMonth - currentMonth);
|
|
|
- }else if(nextMonth < currentMonth) {
|
|
|
- nextPaymentDate = DateUtil.addMonths(date, 12 - currentMonth + nextMonth);
|
|
|
- }else {
|
|
|
- nextPaymentDate = DateUtil.addMonths(date, 12);
|
|
|
- }
|
|
|
- musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId,nextPaymentDate);
|
|
|
+ musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId,musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId));
|
|
|
//批量插入
|
|
|
musicGroupPaymentCalenderDao.batchAdd(months,musicGroupId);
|
|
|
}
|