Commit 71ec06393a531d149b38f551747caa5deab104de
1 parent
57d782bc
merge 冲突修改
Showing
2 changed files
with
17 additions
and
7 deletions
yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/ErrorCodeConstants.java
| @@ -42,14 +42,14 @@ public interface ErrorCodeConstants { | @@ -42,14 +42,14 @@ public interface ErrorCodeConstants { | ||
| 42 | ErrorCode REFUND_NOT_FOUND = new ErrorCode(1_007_006_004, "支付退款单不存在"); | 42 | ErrorCode REFUND_NOT_FOUND = new ErrorCode(1_007_006_004, "支付退款单不存在"); |
| 43 | ErrorCode REFUND_STATUS_IS_NOT_WAITING = new ErrorCode(1_007_006_005, "支付退款单不处于待退款"); | 43 | ErrorCode REFUND_STATUS_IS_NOT_WAITING = new ErrorCode(1_007_006_005, "支付退款单不处于待退款"); |
| 44 | 44 | ||
| 45 | - // ========== 钱包模块 1007007000 ========== | 45 | + // ========== 钱包模块 1-007-007-000 ========== |
| 46 | ErrorCode WALLET_NOT_FOUND = new ErrorCode(1007007000, "用户钱包不存在"); | 46 | ErrorCode WALLET_NOT_FOUND = new ErrorCode(1007007000, "用户钱包不存在"); |
| 47 | ErrorCode WALLET_BALANCE_NOT_ENOUGH = new ErrorCode(1007007001, "钱包余额不足"); | 47 | ErrorCode WALLET_BALANCE_NOT_ENOUGH = new ErrorCode(1007007001, "钱包余额不足"); |
| 48 | ErrorCode WALLET_TRANSACTION_NOT_FOUND = new ErrorCode(1007007002, "未找到对应的钱包交易"); | 48 | ErrorCode WALLET_TRANSACTION_NOT_FOUND = new ErrorCode(1007007002, "未找到对应的钱包交易"); |
| 49 | ErrorCode WALLET_REFUND_EXIST = new ErrorCode(1007007003, "已经存在钱包退款"); | 49 | ErrorCode WALLET_REFUND_EXIST = new ErrorCode(1007007003, "已经存在钱包退款"); |
| 50 | ErrorCode WALLET_FREEZE_PRICE_NOT_ENOUGH = new ErrorCode(1007007004, "钱包冻结余额不足"); | 50 | ErrorCode WALLET_FREEZE_PRICE_NOT_ENOUGH = new ErrorCode(1007007004, "钱包冻结余额不足"); |
| 51 | 51 | ||
| 52 | - // ========== 钱包模块 1-007-007-000 ========== | 52 | + // ========== 钱包充值模块 1-007-008-000 ========== |
| 53 | ErrorCode WALLET_RECHARGE_NOT_FOUND = new ErrorCode(1007008000, "钱包充值记录不存在"); | 53 | ErrorCode WALLET_RECHARGE_NOT_FOUND = new ErrorCode(1007008000, "钱包充值记录不存在"); |
| 54 | ErrorCode WALLET_RECHARGE_UPDATE_PAID_STATUS_NOT_UNPAID = new ErrorCode(1007008001, "钱包充值更新支付状态失败,钱包充值记录不是【未支付】状态"); | 54 | ErrorCode WALLET_RECHARGE_UPDATE_PAID_STATUS_NOT_UNPAID = new ErrorCode(1007008001, "钱包充值更新支付状态失败,钱包充值记录不是【未支付】状态"); |
| 55 | ErrorCode WALLET_RECHARGE_UPDATE_PAID_PAY_ORDER_ID_ERROR = new ErrorCode(1007008002, "钱包充值更新支付状态失败,支付单编号不匹配"); | 55 | ErrorCode WALLET_RECHARGE_UPDATE_PAID_PAY_ORDER_ID_ERROR = new ErrorCode(1007008002, "钱包充值更新支付状态失败,支付单编号不匹配"); |
| @@ -62,6 +62,18 @@ public interface ErrorCodeConstants { | @@ -62,6 +62,18 @@ public interface ErrorCodeConstants { | ||
| 62 | ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUND_NOT_FOUND = new ErrorCode(1007008009, "钱包退款更新失败,退款订单不存在"); | 62 | ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUND_NOT_FOUND = new ErrorCode(1007008009, "钱包退款更新失败,退款订单不存在"); |
| 63 | ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUND_PRICE_NOT_MATCH = new ErrorCode(1007008010, "钱包退款更新失败,退款单金额不匹配"); | 63 | ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUND_PRICE_NOT_MATCH = new ErrorCode(1007008010, "钱包退款更新失败,退款单金额不匹配"); |
| 64 | 64 | ||
| 65 | + // ========== 转账模块 1-007-009-000 ========== | ||
| 66 | + ErrorCode PAY_TRANSFER_SUBMIT_CHANNEL_ERROR = new ErrorCode(1007009000, "发起转账报错,错误码:{},错误提示:{}"); | ||
| 67 | + ErrorCode PAY_TRANSFER_ALIPAY_LOGIN_ID_IS_EMPTY = new ErrorCode(1007009001, "支付宝登录 ID 不能为空"); | ||
| 68 | + ErrorCode PAY_TRANSFER_ALIPAY_ACCOUNT_NAME_IS_EMPTY = new ErrorCode(1007009002, "支付宝账号名称不能为空"); | ||
| 69 | + ErrorCode PAY_TRANSFER_NOT_FOUND = new ErrorCode(1007009003, "转账交易单不存在"); | ||
| 70 | + ErrorCode PAY_TRANSFER_STATUS_IS_SUCCESS = new ErrorCode(1007009004, "转账单已成功转账"); | ||
| 71 | + ErrorCode PAY_TRANSFER_STATUS_IS_NOT_WAITING = new ErrorCode(1007009005, "转账单不处于待转账"); | ||
| 72 | + ErrorCode PAY_TRANSFER_STATUS_IS_NOT_PENDING = new ErrorCode(1007009006, "转账单不处于待转账或转账中"); | ||
| 73 | + ErrorCode PAY_TRANSFER_EXTENSION_NOT_FOUND = new ErrorCode(1007009007, "转账交易拓展单不存在"); | ||
| 74 | + ErrorCode PAY_TRANSFER_TYPE_AND_CHANNEL_NOT_MATCH = new ErrorCode(1007009008, "转账类型和转账渠道不匹配"); | ||
| 75 | + ErrorCode PAY_TRANSFER_EXTENSION_STATUS_IS_NOT_PENDING = new ErrorCode(1007009009, "转账拓展单不处于待转账或转账中"); | ||
| 76 | + | ||
| 65 | // ========== 示例订单 1-007-900-000 ========== | 77 | // ========== 示例订单 1-007-900-000 ========== |
| 66 | ErrorCode DEMO_ORDER_NOT_FOUND = new ErrorCode(1007900000, "示例订单不存在"); | 78 | ErrorCode DEMO_ORDER_NOT_FOUND = new ErrorCode(1007900000, "示例订单不存在"); |
| 67 | ErrorCode DEMO_ORDER_UPDATE_PAID_STATUS_NOT_UNPAID = new ErrorCode(1007900001, "示例订单更新支付状态失败,订单不是【未支付】状态"); | 79 | ErrorCode DEMO_ORDER_UPDATE_PAID_STATUS_NOT_UNPAID = new ErrorCode(1007900001, "示例订单更新支付状态失败,订单不是【未支付】状态"); |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/transfer/PayTransferServiceImpl.java
| @@ -5,7 +5,6 @@ import cn.hutool.core.util.StrUtil; | @@ -5,7 +5,6 @@ import cn.hutool.core.util.StrUtil; | ||
| 5 | import cn.hutool.extra.spring.SpringUtil; | 5 | import cn.hutool.extra.spring.SpringUtil; |
| 6 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | 6 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 7 | import cn.iocoder.yudao.framework.pay.core.client.PayClient; | 7 | import cn.iocoder.yudao.framework.pay.core.client.PayClient; |
| 8 | -import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory; | ||
| 9 | import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO; | 8 | import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferRespDTO; |
| 10 | import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO; | 9 | import cn.iocoder.yudao.framework.pay.core.client.dto.transfer.PayTransferUnifiedReqDTO; |
| 11 | import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; | 10 | import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; |
| @@ -41,6 +40,7 @@ import static cn.iocoder.yudao.module.pay.enums.transfer.PayTransferStatusEnum.* | @@ -41,6 +40,7 @@ import static cn.iocoder.yudao.module.pay.enums.transfer.PayTransferStatusEnum.* | ||
| 41 | @Service | 40 | @Service |
| 42 | @Slf4j | 41 | @Slf4j |
| 43 | public class PayTransferServiceImpl implements PayTransferService { | 42 | public class PayTransferServiceImpl implements PayTransferService { |
| 43 | + | ||
| 44 | private static final String TRANSFER_NO_PREFIX = "T"; | 44 | private static final String TRANSFER_NO_PREFIX = "T"; |
| 45 | 45 | ||
| 46 | @Resource | 46 | @Resource |
| @@ -52,8 +52,6 @@ public class PayTransferServiceImpl implements PayTransferService { | @@ -52,8 +52,6 @@ public class PayTransferServiceImpl implements PayTransferService { | ||
| 52 | @Resource | 52 | @Resource |
| 53 | private PayChannelService channelService; | 53 | private PayChannelService channelService; |
| 54 | @Resource | 54 | @Resource |
| 55 | - private PayClientFactory payClientFactory; | ||
| 56 | - @Resource | ||
| 57 | private PayNoRedisDAO noRedisDAO; | 55 | private PayNoRedisDAO noRedisDAO; |
| 58 | 56 | ||
| 59 | @Override | 57 | @Override |
| @@ -64,7 +62,7 @@ public class PayTransferServiceImpl implements PayTransferService { | @@ -64,7 +62,7 @@ public class PayTransferServiceImpl implements PayTransferService { | ||
| 64 | validateChannelCodeAndTypeMatch(reqVO.getChannelCode(), transfer.getType()); | 62 | validateChannelCodeAndTypeMatch(reqVO.getChannelCode(), transfer.getType()); |
| 65 | // 1.3 校验支付渠道是否有效 | 63 | // 1.3 校验支付渠道是否有效 |
| 66 | PayChannelDO channel = validateChannelCanSubmit(transfer.getAppId(), reqVO.getChannelCode()); | 64 | PayChannelDO channel = validateChannelCanSubmit(transfer.getAppId(), reqVO.getChannelCode()); |
| 67 | - PayClient client = payClientFactory.getPayClient(channel.getId()); | 65 | + PayClient client = channelService.getPayClient(channel.getId()); |
| 68 | 66 | ||
| 69 | // 2 新增转账拓展单 | 67 | // 2 新增转账拓展单 |
| 70 | String no = noRedisDAO.generate(TRANSFER_NO_PREFIX); | 68 | String no = noRedisDAO.generate(TRANSFER_NO_PREFIX); |
| @@ -232,7 +230,7 @@ public class PayTransferServiceImpl implements PayTransferService { | @@ -232,7 +230,7 @@ public class PayTransferServiceImpl implements PayTransferService { | ||
| 232 | appService.validPayApp(appId); | 230 | appService.validPayApp(appId); |
| 233 | // 校验支付渠道是否有效 | 231 | // 校验支付渠道是否有效 |
| 234 | PayChannelDO channel = channelService.validPayChannel(appId, channelCode); | 232 | PayChannelDO channel = channelService.validPayChannel(appId, channelCode); |
| 235 | - PayClient client = payClientFactory.getPayClient(channel.getId()); | 233 | + PayClient client = channelService.getPayClient(channel.getId()); |
| 236 | if (client == null) { | 234 | if (client == null) { |
| 237 | log.error("[validateChannelCanSubmit][渠道编号({}) 找不到对应的支付客户端]", channel.getId()); | 235 | log.error("[validateChannelCanSubmit][渠道编号({}) 找不到对应的支付客户端]", channel.getId()); |
| 238 | throw exception(CHANNEL_NOT_FOUND); | 236 | throw exception(CHANNEL_NOT_FOUND); |