zoujiajian 3 rokov pred
rodič
commit
3e5690b284

+ 5 - 4
netflix-web/src/main/java/com/cyksj/web/controller/user/DistributePopularizeController.java

@@ -167,7 +167,7 @@ public class DistributePopularizeController {
 	@NoSubmit
 	@PostMapping("/post/applyMoney")
 	@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();
 		User user = userMapper.selectById(userId);
 		if (user == null) {
@@ -217,15 +217,16 @@ public class DistributePopularizeController {
 				distributeMoneyApply.setVerifyStatus(DistributeMoneyApply.Status.fail);
 				distributeMoneyApply.setReason(alipayResponse.getSubMsg());
 				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) {
 						break;
 					}
 				}
+				return GatewayResponse.SUCCESS.newBuilder().toResult(alipayResponse.getSubMsg());
 			}
 			distributeMoneyApplyMapper.insert(distributeMoneyApply);
-			return GatewayResponse.SUCCESS.newBuilder().toResult(distributeMoneyApply.getMoney().intValue());
+			return GatewayResponse.SUCCESS.newBuilder().toResult(distributeMoneyApply.getMoney().toString());
 		}
 		throw BusinessRuntimeException.getInstance("系统异常,请重新提交提现申请");
 	}