|
@@ -45,6 +45,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
|
|
private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
|
|
|
|
+ @Autowired
|
|
private MusicGroupPaymentEntitiesDao musicGroupPaymentEntitiesDao;
|
|
private MusicGroupPaymentEntitiesDao musicGroupPaymentEntitiesDao;
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupSubjectGoodsGroupDao musicGroupSubjectGoodsGroupDao;
|
|
private MusicGroupSubjectGoodsGroupDao musicGroupSubjectGoodsGroupDao;
|
|
@@ -240,27 +242,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
musicGroup.setUpdateTime(new Date());
|
|
musicGroup.setUpdateTime(new Date());
|
|
musicGroupDao.update(musicGroup);
|
|
musicGroupDao.update(musicGroup);
|
|
|
|
|
|
- // 查询下次缴费时间
|
|
|
|
- List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
|
|
|
|
- if (musicGroupPaymentCalenderList != null && musicGroupPaymentCalenderList.size() > 0) {
|
|
|
|
-
|
|
|
|
- Collections.sort(musicGroupPaymentCalenderList);
|
|
|
|
-
|
|
|
|
- Calendar cale = Calendar.getInstance();
|
|
|
|
- int month = cale.get(Calendar.MONTH) + 1;
|
|
|
|
-
|
|
|
|
- MusicGroupPaymentCalender calender = null;
|
|
|
|
-
|
|
|
|
- for (MusicGroupPaymentCalender cal : musicGroupPaymentCalenderList) {
|
|
|
|
- if (cal.getPaymentMonth() >= month) {
|
|
|
|
- calender = cal;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 重新设置下次缴费时间
|
|
|
|
- musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId, calender.getStartPaymentDate());
|
|
|
|
- }
|
|
|
|
|
|
+ // 重新设置下次缴费时间
|
|
|
|
+ musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId, musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId));
|
|
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -411,7 +394,29 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
public boolean renewForCallback(StudentPaymentOrder studentPaymentOrder) {
|
|
public boolean renewForCallback(StudentPaymentOrder studentPaymentOrder) {
|
|
|
|
|
|
- return false;
|
|
|
|
|
|
+ studentPaymentOrderDao.update(studentPaymentOrder);
|
|
|
|
+
|
|
|
|
+ Integer userId = studentPaymentOrder.getUserId();
|
|
|
|
+ String musicGroupId = studentPaymentOrder.getMusicGroupId();
|
|
|
|
+
|
|
|
|
+ //更新下次续费时间
|
|
|
|
+ MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
|
|
|
|
+
|
|
|
|
+ if(musicGroupStudentFee == null){
|
|
|
|
+ throw new BizException("系统数据异常,找不到学员预缴费信息");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Date date = new Date();
|
|
|
|
+
|
|
|
|
+ musicGroupStudentFee.setUpdateTime(date);
|
|
|
|
+ musicGroupStudentFee.setLatestPaidTime(date);
|
|
|
|
+ musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
|
+ musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
|
|
|
|
+ musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId));
|
|
|
|
+
|
|
|
|
+ musicGroupStudentFeeDao.update(musicGroupStudentFee);
|
|
|
|
+
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|