Selaa lähdekoodia

fix 提现超过额度

zoujiajian 3 vuotta sitten
vanhempi
sitoutus
03880e3f2e

+ 0 - 7
netflix-dao/src/main/java/com/cyksj/model/request/ApplyMoneyReq.java

@@ -4,8 +4,6 @@ import com.cyksj.model.entity.DistributeMoneyApply;
 import lombok.Getter;
 import lombok.Setter;
 
-import java.math.BigDecimal;
-
 /*
  *项目名: netflix
  *文件名: ApplyMoneyReq
@@ -20,9 +18,4 @@ public class ApplyMoneyReq {
 	private DistributeMoneyApply.Type type;
 
 	private String realName;
-
-	/**
-	 * 提取的money
-	 */
-	private BigDecimal money;
 }

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

@@ -173,7 +173,6 @@ public class DistributePopularizeController {
 		if (user == null) {
 			throw BusinessRuntimeException.getInstance("请先授权登录");
 		}
-		BigDecimal applyMoney = applyMoneyReq.getMoney();
 		if (ObjectUtil.hasEmpty(applyMoneyReq.getAccount(), applyMoneyReq.getRealName())) {
 			throw BusinessRuntimeException.getInstance("必填项不能为空");
 		}
@@ -191,12 +190,11 @@ 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());
-		if (applyMoney.compareTo(money) > 0) {
-			throw BusinessRuntimeException.getInstance("超过可提现金额");
-		}
-		if (applyMoney.compareTo(BigDecimal.valueOf(4 * 100 * 100)) > 0) {
-			throw BusinessRuntimeException.getInstance("每日可提现金额不超过400");
+		BigDecimal fourHundred = BigDecimal.valueOf(4 * 100 * 100);
+		if (money.compareTo(fourHundred) > 0) {
+			money = fourHundred;
 		}
 		if (update == 1) {
 			TransferAccountsReq req = new TransferAccountsReq();