|
@@ -167,7 +167,7 @@ public class DistributePopularizeController {
|
|
|
@NoSubmit
|
|
@NoSubmit
|
|
|
@PostMapping("/post/applyMoney")
|
|
@PostMapping("/post/applyMoney")
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
- public Result<Integer> applyMoney(@RequestBody ApplyMoneyReq applyMoneyReq) throws Exception {
|
|
|
|
|
|
|
+ public Result<String> applyMoney(@RequestBody ApplyMoneyReq applyMoneyReq) throws Exception {
|
|
|
Long userId = StpUserUtil.getLoginIdAsLong();
|
|
Long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
User user = userMapper.selectById(userId);
|
|
User user = userMapper.selectById(userId);
|
|
|
if (user == null) {
|
|
if (user == null) {
|
|
@@ -217,15 +217,16 @@ public class DistributePopularizeController {
|
|
|
distributeMoneyApply.setVerifyStatus(DistributeMoneyApply.Status.fail);
|
|
distributeMoneyApply.setVerifyStatus(DistributeMoneyApply.Status.fail);
|
|
|
distributeMoneyApply.setReason(alipayResponse.getSubMsg());
|
|
distributeMoneyApply.setReason(alipayResponse.getSubMsg());
|
|
|
while (true) {
|
|
while (true) {
|
|
|
- BigDecimal originalPoints = user.getPoints();
|
|
|
|
|
- Integer success = userMapper.updatePoints(user.getId(), originalPoints, distributeMoneyApply.getPoints());
|
|
|
|
|
|
|
+ User db = userMapper.selectById(userId);
|
|
|
|
|
+ Integer success = userMapper.updatePoints(user.getId(), db.getPoints(), distributeMoneyApply.getPoints());
|
|
|
if (success == 1) {
|
|
if (success == 1) {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(alipayResponse.getSubMsg());
|
|
|
}
|
|
}
|
|
|
distributeMoneyApplyMapper.insert(distributeMoneyApply);
|
|
distributeMoneyApplyMapper.insert(distributeMoneyApply);
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(distributeMoneyApply.getMoney().intValue());
|
|
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(distributeMoneyApply.getMoney().toString());
|
|
|
}
|
|
}
|
|
|
throw BusinessRuntimeException.getInstance("系统异常,请重新提交提现申请");
|
|
throw BusinessRuntimeException.getInstance("系统异常,请重新提交提现申请");
|
|
|
}
|
|
}
|