Bläddra i källkod

fix 分销提现限额

zoujiajian 3 år sedan
förälder
incheckning
42c471084b

+ 3 - 2
netflix-web/src/main/java/com/cyksj/web/controller/user/DistributePopularizeController.java

@@ -228,13 +228,14 @@ public class DistributePopularizeController {
 		}
 		BigDecimal num = user.getPoints().divide(min, RoundingMode.DOWN);
 		BigDecimal points = min.multiply(num);
-		Integer update = userMapper.subPoints(user.getId(), points);
 		//门槛金额是分
 		BigDecimal money = num.multiply(distributePointsExchangeMoney.getMoney());
 		BigDecimal fourHundred = BigDecimal.valueOf(4 * 100 * 100);
 		if (money.compareTo(fourHundred) > 0) {
 			money = fourHundred;
+			points = fourHundred.divide(distributePointsExchangeMoney.getMoney()).multiply(min);
 		}
+		Integer update = userMapper.subPoints(user.getId(), points);
 		if (update == 1) {
 			TransferAccountsReq req = new TransferAccountsReq();
 			req.setMoney(money);
@@ -246,7 +247,7 @@ public class DistributePopularizeController {
 			DistributeMoneyApply distributeMoneyApply = new DistributeMoneyApply();
 			distributeMoneyApply.setUserId(userId);
 			distributeMoneyApply.setPoints(points);
-			distributeMoneyApply.setMoney(num.multiply(distributePointsExchangeMoney.getMoney()));
+			distributeMoneyApply.setMoney(money);
 			distributeMoneyApply.setAccount(applyMoneyReq.getAccount());
 			distributeMoneyApply.setRealName(applyMoneyReq.getRealName());
 			AlipayResponse alipayResponse = orderService.transferAccounts(req);