Commit 9095394fedc3782ca73975b9456338968bc1e5c4
1 parent
9697aee8
钱包 - 创建钱包充值校验修改
Showing
3 changed files
with
4 additions
and
10 deletions
yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/ErrorCodeConstants.java
| @@ -59,10 +59,9 @@ public interface ErrorCodeConstants { | @@ -59,10 +59,9 @@ public interface ErrorCodeConstants { | ||
| 59 | ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUND_ORDER_ID_ERROR = new ErrorCode(1_007_008_008, "钱包退款更新失败,钱包退款单编号不匹配"); | 59 | ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUND_ORDER_ID_ERROR = new ErrorCode(1_007_008_008, "钱包退款更新失败,钱包退款单编号不匹配"); |
| 60 | ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUND_NOT_FOUND = new ErrorCode(1_007_008_009, "钱包退款更新失败,退款订单不存在"); | 60 | ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUND_NOT_FOUND = new ErrorCode(1_007_008_009, "钱包退款更新失败,退款订单不存在"); |
| 61 | ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUND_PRICE_NOT_MATCH = new ErrorCode(1_007_008_010, "钱包退款更新失败,退款单金额不匹配"); | 61 | ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUND_PRICE_NOT_MATCH = new ErrorCode(1_007_008_010, "钱包退款更新失败,退款单金额不匹配"); |
| 62 | - ErrorCode WALLET_RECHARGE_PACKAGE_AND_PRICE_IS_EMPTY = new ErrorCode(1_007_008_011, "充值金额和充钱套餐不能同时为空"); | ||
| 63 | - ErrorCode WALLET_RECHARGE_PACKAGE_NOT_FOUND = new ErrorCode(1_007_008_012, "钱包充值套餐不存在"); | ||
| 64 | - ErrorCode WALLET_RECHARGE_PACKAGE_IS_DISABLE = new ErrorCode(1_007_008_013, "钱包充值套餐已禁用"); | ||
| 65 | - ErrorCode WALLET_RECHARGE_PACKAGE_NAME_EXISTS = new ErrorCode(1_007_008_014, "钱包充值套餐名称已存在"); | 62 | + ErrorCode WALLET_RECHARGE_PACKAGE_NOT_FOUND = new ErrorCode(1_007_008_011, "钱包充值套餐不存在"); |
| 63 | + ErrorCode WALLET_RECHARGE_PACKAGE_IS_DISABLE = new ErrorCode(1_007_008_012, "钱包充值套餐已禁用"); | ||
| 64 | + ErrorCode WALLET_RECHARGE_PACKAGE_NAME_EXISTS = new ErrorCode(1_007_008_013, "钱包充值套餐名称已存在"); | ||
| 66 | 65 | ||
| 67 | // ========== 转账模块 1-007-009-000 ========== | 66 | // ========== 转账模块 1-007-009-000 ========== |
| 68 | ErrorCode PAY_TRANSFER_SUBMIT_CHANNEL_ERROR = new ErrorCode(1_007_009_000, "发起转账报错,错误码:{},错误提示:{}"); | 67 | ErrorCode PAY_TRANSFER_SUBMIT_CHANNEL_ERROR = new ErrorCode(1_007_009_000, "发起转账报错,错误码:{},错误提示:{}"); |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/wallet/vo/recharge/AppPayWalletRechargeCreateReqVO.java
| @@ -19,7 +19,7 @@ public class AppPayWalletRechargeCreateReqVO { | @@ -19,7 +19,7 @@ public class AppPayWalletRechargeCreateReqVO { | ||
| 19 | private Long packageId; | 19 | private Long packageId; |
| 20 | 20 | ||
| 21 | @AssertTrue(message = "充值金额和充钱套餐不能同时为空") | 21 | @AssertTrue(message = "充值金额和充钱套餐不能同时为空") |
| 22 | - public boolean validatePayPriceAndPackageId() { | 22 | + public boolean isValidPayPriceAndPackageId() { |
| 23 | return Objects.nonNull(payPrice) || Objects.nonNull(packageId); | 23 | return Objects.nonNull(payPrice) || Objects.nonNull(packageId); |
| 24 | } | 24 | } |
| 25 | } | 25 | } |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java
| @@ -64,11 +64,6 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService { | @@ -64,11 +64,6 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService { | ||
| 64 | @Transactional(rollbackFor = Exception.class) | 64 | @Transactional(rollbackFor = Exception.class) |
| 65 | public PayWalletRechargeDO createWalletRecharge(Long userId, Integer userType, String userIp, | 65 | public PayWalletRechargeDO createWalletRecharge(Long userId, Integer userType, String userIp, |
| 66 | AppPayWalletRechargeCreateReqVO reqVO) { | 66 | AppPayWalletRechargeCreateReqVO reqVO) { |
| 67 | - | ||
| 68 | - if (Objects.isNull(reqVO.getPayPrice()) && Objects.isNull(reqVO.getPackageId())) { | ||
| 69 | - // TODO @jason @AssertTrue 貌似没有效果。需要查下原因 | ||
| 70 | - throw exception(WALLET_RECHARGE_PACKAGE_AND_PRICE_IS_EMPTY); | ||
| 71 | - } | ||
| 72 | // 1.1 计算充值金额 | 67 | // 1.1 计算充值金额 |
| 73 | int payPrice; | 68 | int payPrice; |
| 74 | int bonusPrice = 0; | 69 | int bonusPrice = 0; |