From 3f915a7ac849dd1bbee9906598c1c4d05097005b Mon Sep 17 00:00:00 2001 From: yang <2119157836@qq.com> Date: Fri, 7 Mar 2025 15:31:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor(pay):=20=E6=8F=90=E7=8E=B0=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/pay/AliPay/AliPayController.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/pay/AliPay/AliPayController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/pay/AliPay/AliPayController.java index a42688c..ad4a147 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/pay/AliPay/AliPayController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/pay/AliPay/AliPayController.java @@ -17,6 +17,8 @@ import com.mcwl.pay.domain.OrderTradeDto; import com.mcwl.pay.domain.vo.PayVo; import com.mcwl.pay.service.AliPayService; import com.mcwl.pay.service.OrderTradeService; +import com.mcwl.system.domain.SysUserPayAccount; +import com.mcwl.system.service.ISysUserPayAccountService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.ibatis.annotations.Param; @@ -57,6 +59,9 @@ public class AliPayController extends BaseController { @Autowired private OrderTradeService orderTradeService; + @Autowired + private ISysUserPayAccountService sysUserPayAccountService; + @Autowired private AliPayService aliPayService; @@ -175,6 +180,17 @@ public class AliPayController extends BaseController { @NotNull(message = "提现金额不能为空") @Pattern(regexp = "^(0|(?!0\\d)[1-9]\\d*)(\\.\\d{2})?$", message = "金额格式错误(必须保留两位小数)") String amount) throws Exception { + + SysUserPayAccount sysUserPayAccount = sysUserPayAccountService.lambdaQuery() + .eq(SysUserPayAccount::getUserId, SecurityUtils.getUserId()) + .eq(SysUserPayAccount::getType, 0) + .one(); + + if (Objects.isNull(sysUserPayAccount)) { + return R.fail("请先绑定支付宝"); + } + + if (Double.parseDouble(amount) < 0.1) { return R.fail("提现金额最小为0.1"); }