|
@@ -148,6 +148,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
private GoodsService goodsService;
|
|
private GoodsService goodsService;
|
|
@Autowired
|
|
@Autowired
|
|
private ClassGroupStudentMapperService classGroupStudentMapperService;
|
|
private ClassGroupStudentMapperService classGroupStudentMapperService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ImFeignService imFeignService;
|
|
private ImFeignService imFeignService;
|
|
@@ -1658,8 +1660,10 @@ 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) throws IOException {
|
|
public boolean renewForCallback(StudentPaymentOrder studentPaymentOrder) throws IOException {
|
|
|
|
|
|
- studentPaymentOrderService.update(studentPaymentOrder);
|
|
|
|
-
|
|
|
|
|
|
+ int updateNum = studentPaymentOrderService.update(studentPaymentOrder);
|
|
|
|
+ if(updateNum <= 0){
|
|
|
|
+ throw new BizException("订单更新失败");
|
|
|
|
+ }
|
|
Integer userId = studentPaymentOrder.getUserId();
|
|
Integer userId = studentPaymentOrder.getUserId();
|
|
String musicGroupId = studentPaymentOrder.getMusicGroupId();
|
|
String musicGroupId = studentPaymentOrder.getMusicGroupId();
|
|
|
|
|
|
@@ -1683,6 +1687,24 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
// musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, musicGroupStudentFee.getNextPaymentDate(), musicGroupStudentFee));
|
|
// musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, musicGroupStudentFee.getNextPaymentDate(), musicGroupStudentFee));
|
|
musicGroupStudentFeeDao.update(musicGroupStudentFee);
|
|
musicGroupStudentFeeDao.update(musicGroupStudentFee);
|
|
|
|
|
|
|
|
+ MusicGroupPaymentCalenderDetail userLastCalenderDetail = musicGroupPaymentCalenderDetailDao.getUserLastCalenderDetail(musicGroupId, userId);
|
|
|
|
+ if(userLastCalenderDetail == null){
|
|
|
|
+ throw new BizException("学生没有续费中的记录");
|
|
|
|
+ }
|
|
|
|
+ //更新学生的缴费记录状态
|
|
|
|
+ userLastCalenderDetail.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
|
+ userLastCalenderDetail.setActualAmount(userLastCalenderDetail.getExpectAmount());
|
|
|
|
+ userLastCalenderDetail.setPayTime(date);
|
|
|
|
+ userLastCalenderDetail.setUpdateTime(date);
|
|
|
|
+ musicGroupPaymentCalenderDetailDao.update(userLastCalenderDetail);
|
|
|
|
+
|
|
|
|
+ //更新实际缴费人数
|
|
|
|
+ MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderDao.getForLock(userLastCalenderDetail.getMusicGroupPaymentCalenderId());
|
|
|
|
+ Integer actualNum = musicGroupPaymentCalender.getActualNum() == null ? 0:musicGroupPaymentCalender.getActualNum();
|
|
|
|
+ musicGroupPaymentCalender.setActualNum(actualNum);
|
|
|
|
+ musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
|
+ musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
|
|
|
|
+
|
|
//插入交易明细
|
|
//插入交易明细
|
|
SysUserCashAccount cashAccount = sysUserCashAccountService.get(userId);
|
|
SysUserCashAccount cashAccount = sysUserCashAccountService.get(userId);
|
|
BigDecimal amount = studentPaymentOrder.getActualAmount();
|
|
BigDecimal amount = studentPaymentOrder.getActualAmount();
|