|
@@ -63,7 +63,7 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
|
|
|
|
|
|
@Override
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
- public Boolean renewForCallback(StudentPaymentOrder studentPaymentOrder) {
|
|
|
+ public Boolean renewForCallback(StudentPaymentOrder studentPaymentOrder) throws Exception {
|
|
|
int updateCount = studentPaymentOrderDao.update(studentPaymentOrder);
|
|
|
if (updateCount <= 0) {
|
|
|
throw new BizException("订单更新失败");
|
|
@@ -142,7 +142,12 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
|
|
|
if (info.getMaxNum() != null && info.getPaidNum() > 0) {
|
|
|
//重试避免人数过多频繁冲突
|
|
|
boolean flag = false;
|
|
|
- for (int i = 1; i <= 10; i++) {
|
|
|
+ int max = 100, min = 1;
|
|
|
+ int ran2 = (int) (Math.random() * (max - min) + min);
|
|
|
+ for (int i = 1; i <= 100; i++) {
|
|
|
+ if (i == ran2) {
|
|
|
+ Thread.sleep(ran2);
|
|
|
+ }
|
|
|
info = sporadicChargeInfoDao.get(info.getId());
|
|
|
info.setPaidNum(info.getPaidNum() - 1);
|
|
|
info.setUpdateTime(new Date());
|