|
|
@@ -218,6 +218,9 @@ public class DistributePopularizeController {
|
|
|
if (ObjectUtil.hasEmpty(applyMoneyReq.getAccount(), applyMoneyReq.getRealName())) {
|
|
|
throw BusinessRuntimeException.getInstance("必填项不能为空");
|
|
|
}
|
|
|
+ if (applyMoneyReq.getAccount().length() > 255 || applyMoneyReq.getRealName().length() > 32) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请输入正确的账户信息");
|
|
|
+ }
|
|
|
Boolean isTakeAll = applyMoneyReq.getIsTakeAll();
|
|
|
BigDecimal userPoints = user.getPoints();
|
|
|
DistributePointsExchangeMoney distributePointsExchangeMoney = distributePointsExchangeMoneyMapper.selectOne(Wrappers.lambdaQuery(DistributePointsExchangeMoney.class).orderByDesc(DistributePointsExchangeMoney::getPoints).last("limit 1"));
|
|
|
@@ -278,7 +281,18 @@ public class DistributePopularizeController {
|
|
|
return GatewayResponse.FAIL.newBuilder().setMsg(alipayResponse.getSubMsg()).toResult();
|
|
|
}
|
|
|
}
|
|
|
- distributeMoneyApplyMapper.insert(distributeMoneyApply);
|
|
|
+ try {
|
|
|
+ distributeMoneyApplyMapper.insert(distributeMoneyApply);
|
|
|
+ } catch (Exception e) {
|
|
|
+ while (true) {
|
|
|
+ User db = userMapper.selectById(userId);
|
|
|
+ Integer success = userMapper.updatePoints(user.getId(), db.getPoints(), distributeMoneyApply.getPoints());
|
|
|
+ if (success == 1) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return GatewayResponse.FAIL.newBuilder().setMsg("网络错误,请重试").toResult();
|
|
|
+ }
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(distributeMoneyApply);
|
|
|
}
|
|
|
throw BusinessRuntimeException.getInstance("系统异常,请重新提交提现申请");
|