|
|
@@ -383,7 +383,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (chargeInfo == null) {
|
|
|
throw new BizException("支付项不存在");
|
|
|
}
|
|
|
- if(chargeInfo.getOpenFlag().equals(1)){
|
|
|
+ if (chargeInfo.getOpenFlag().equals(1)) {
|
|
|
throw new BizException("项目已关闭");
|
|
|
}
|
|
|
BigDecimal amount = chargeInfo.getAmount();
|
|
|
@@ -393,27 +393,29 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (!(amount.compareTo(sporadicPayDto.getAmount()) == 0)) {
|
|
|
throw new BizException("订单金额异常");
|
|
|
}
|
|
|
- //重试避免人数过多频繁冲突
|
|
|
- boolean flag = false;
|
|
|
- for (int i = 1; i <= 10; i++) {
|
|
|
- chargeInfo = sporadicChargeInfoDao.get(sporadicPayDto.getSporadicId());
|
|
|
- if (chargeInfo.getMaxNum() != null && chargeInfo.getMaxNum() <= chargeInfo.getPaidNum()) {
|
|
|
- throw new BizException("活动人数暂时已满,请稍后再试");
|
|
|
+ if (chargeInfo.getMaxNum() != null) {
|
|
|
+ //重试避免人数过多频繁冲突
|
|
|
+ boolean flag = false;
|
|
|
+ for (int i = 1; i <= 10; i++) {
|
|
|
+ chargeInfo = sporadicChargeInfoDao.get(sporadicPayDto.getSporadicId());
|
|
|
+ if (chargeInfo.getMaxNum() != null && chargeInfo.getMaxNum() <= chargeInfo.getPaidNum()) {
|
|
|
+ throw new BizException("活动人数暂时已满,请稍后再试");
|
|
|
+ }
|
|
|
+ chargeInfo.setPaidNum(chargeInfo.getPaidNum() + 1);
|
|
|
+ chargeInfo.setUpdateTime(new Date());
|
|
|
+ int update = sporadicChargeInfoDao.update(chargeInfo);
|
|
|
+ if (update > 0) {
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- chargeInfo.setPaidNum(chargeInfo.getPaidNum() + 1);
|
|
|
- chargeInfo.setUpdateTime(new Date());
|
|
|
- int update = sporadicChargeInfoDao.update(chargeInfo);
|
|
|
- if (update > 0) {
|
|
|
- flag = true;
|
|
|
- break;
|
|
|
+ if (!flag) {
|
|
|
+ throw new BizException("活动火爆,请稍后再试");
|
|
|
}
|
|
|
}
|
|
|
- if (!flag) {
|
|
|
- throw new BizException("活动火爆,请稍后再试");
|
|
|
- }
|
|
|
|
|
|
OrderTypeEnum type = OrderTypeEnum.SPORADIC;
|
|
|
- if(chargeInfo.getChargeType().equals(SporadicChargeTypeEnum.DOUBLE_ELEVEN2020)){
|
|
|
+ if (chargeInfo.getChargeType().equals(SporadicChargeTypeEnum.DOUBLE_ELEVEN2020)) {
|
|
|
type = OrderTypeEnum.DOUBLE_ELEVEN2020;
|
|
|
}
|
|
|
|
|
|
@@ -641,7 +643,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
String channelType = "";
|
|
|
|
|
|
- StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, goodsList, otherGoodsList, courseForms,remitFee,courseRemitFee);
|
|
|
+ StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, goodsList, otherGoodsList, courseForms, remitFee, courseRemitFee);
|
|
|
studentPaymentOrder.setVersion(0);
|
|
|
|
|
|
Date date = new Date();
|
|
|
@@ -848,7 +850,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
String channelType = "";
|
|
|
|
|
|
- StudentPaymentOrder studentPaymentOrder = studentRegistrationService.reAddOrder(userId, amount, orderNo, channelType, courseFee, goodsGroups, goodsList, otherGoodsList, studentRegistration.getMusicGroupId(), ApplyOrder, courseForms,remitFee,courseRemitFee);
|
|
|
+ StudentPaymentOrder studentPaymentOrder = studentRegistrationService.reAddOrder(userId, amount, orderNo, channelType, courseFee, goodsGroups, goodsList, otherGoodsList, studentRegistration.getMusicGroupId(), ApplyOrder, courseForms, remitFee, courseRemitFee);
|
|
|
studentPaymentOrder.setVersion(0);
|
|
|
Date date = new Date();
|
|
|
|
|
|
@@ -1449,7 +1451,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public boolean extensionApplyExpireDate(String musicGroupId, Date expireDate) {
|
|
|
+ public boolean extensionApplyExpireDate(String musicGroupId, Date expireDate) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if (sysUser == null) {
|
|
|
throw new BizException("用户信息获取失败");
|
|
|
@@ -1476,7 +1478,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
+ @Override
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
public boolean applyQuitMusicGroup(String musicGroupId) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
@@ -1538,7 +1540,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (classGroup.getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)) {
|
|
|
classGroupService.delSingle(classGroupId);
|
|
|
} else {
|
|
|
- classGroupStudentMapperService.delClassGroupStudent(userId, classGroupId,true);
|
|
|
+ classGroupStudentMapperService.delClassGroupStudent(userId, classGroupId, true);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1640,7 +1642,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (classGroup.getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)) {
|
|
|
classGroupService.delSingle(classGroupId);
|
|
|
} else {
|
|
|
- classGroupStudentMapperService.delClassGroupStudent(userId, classGroupId,true);
|
|
|
+ classGroupStudentMapperService.delClassGroupStudent(userId, classGroupId, true);
|
|
|
}
|
|
|
}
|
|
|
|