Commit e26814be3152e264f89d9c2ce7814b0221d0ac9e
Merge remote-tracking branch 'yudao/feature/mall_product' into feature/mall_product
Showing
23 changed files
with
130 additions
and
124 deletions
.image/common/mall-feature.png
0 → 100644
32.1 KB
.image/common/mall-preview.png
0 → 100644
255 KB
.image/common/ruoyi-vue-pro-architecture.png
0 → 100644
192 KB
.image/common/ruoyi-vue-pro-biz.png
0 → 100644
79.9 KB
.image/common/yudao-cloud-architecture.png
0 → 100644
493 KB
README.md
| @@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
| 23 | > | 23 | > |
| 24 | > 😜 给项目点点 Star 吧,这对我们真的很重要! | 24 | > 😜 给项目点点 Star 吧,这对我们真的很重要! |
| 25 | 25 | ||
| 26 | - | 26 | + |
| 27 | 27 | ||
| 28 | * 管理后台的电脑端:Vue3 提供 [element-plus](https://gitee.com/yudaocode/yudao-ui-admin-vue3)、[vben(ant-design-vue)](https://gitee.com/yudaocode/yudao-ui-admin-vben) 两个版本,Vue2 提供 [element-ui](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/master/yudao-ui-admin) 版本 | 28 | * 管理后台的电脑端:Vue3 提供 [element-plus](https://gitee.com/yudaocode/yudao-ui-admin-vue3)、[vben(ant-design-vue)](https://gitee.com/yudaocode/yudao-ui-admin-vben) 两个版本,Vue2 提供 [element-ui](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/master/yudao-ui-admin) 版本 |
| 29 | * 管理后台的移动端:采用 [uni-app](https://github.com/dcloudio/uni-app) 方案,一份代码多终端适配,同时支持 APP、小程序、H5! | 29 | * 管理后台的移动端:采用 [uni-app](https://github.com/dcloudio/uni-app) 方案,一份代码多终端适配,同时支持 APP、小程序、H5! |
| @@ -102,7 +102,7 @@ | @@ -102,7 +102,7 @@ | ||
| 102 | 102 | ||
| 103 | 系统内置多种多种业务功能,可以用于快速你的业务系统: | 103 | 系统内置多种多种业务功能,可以用于快速你的业务系统: |
| 104 | 104 | ||
| 105 | - | 105 | + |
| 106 | 106 | ||
| 107 | * 系统功能 | 107 | * 系统功能 |
| 108 | * 基础设施 | 108 | * 基础设施 |
| @@ -214,17 +214,19 @@ | @@ -214,17 +214,19 @@ | ||
| 214 | 214 | ||
| 215 | ### 商城系统 | 215 | ### 商城系统 |
| 216 | 216 | ||
| 217 | -建设中... | 217 | + |
| 218 | 218 | ||
| 219 | - | ||
| 220 | - | ||
| 221 | - | ||
| 222 | - | ||
| 223 | - | 219 | + |
| 224 | 220 | ||
| 225 | ### 会员中心 | 221 | ### 会员中心 |
| 226 | 222 | ||
| 227 | -和「商城系统」一起开发 | 223 | +| | 功能 | 描述 | |
| 224 | +|-----|------|----------------------------------| | ||
| 225 | +| 🚀 | 会员管理 | 会员是 C 端的消费者,该功能用于会员的搜索与管理 | | ||
| 226 | +| 🚀 | 会员标签 | 对会员的标签进行创建、查询、修改、删除等操作 | | ||
| 227 | +| 🚀 | 会员等级 | 对会员的等级、成长值进行管理,可用于订单折扣等会员权益 | | ||
| 228 | +| 🚀 | 会员分组 | 对会员进行分组,用于用户画像、内容推送等运营手段 | | ||
| 229 | +| 🚀 | 积分签到 | 回馈给签到、消费等行为的积分,会员可订单抵现、积分兑换等途径消耗 | | ||
| 228 | 230 | ||
| 229 | ## 🐨 技术栈 | 231 | ## 🐨 技术栈 |
| 230 | 232 |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/PayClientFactory.java
| 1 | package cn.iocoder.yudao.framework.pay.core.client; | 1 | package cn.iocoder.yudao.framework.pay.core.client; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.framework.pay.core.client.impl.AbstractPayClient; | 3 | +import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | * 支付客户端的工厂接口 | 6 | * 支付客户端的工厂接口 |
| @@ -21,8 +21,18 @@ public interface PayClientFactory { | @@ -21,8 +21,18 @@ public interface PayClientFactory { | ||
| 21 | * 创建支付客户端 | 21 | * 创建支付客户端 |
| 22 | * | 22 | * |
| 23 | * @param channelId 渠道编号 | 23 | * @param channelId 渠道编号 |
| 24 | - * @param client 支付客户端 | ||
| 25 | - * @param <Config> 支付配置 | 24 | + * @param channelCode 渠道编码 |
| 25 | + * @param config 支付配置 | ||
| 26 | */ | 26 | */ |
| 27 | - <Config extends PayClientConfig> void addOrUpdatePayClient(Long channelId, AbstractPayClient<Config> client); | 27 | + <Config extends PayClientConfig> void createOrUpdatePayClient(Long channelId, String channelCode, |
| 28 | + Config config); | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 注册支付客户端 Class,用于模块中实现的 PayClient | ||
| 32 | + * | ||
| 33 | + * @param channel 支付渠道的编码的枚举 | ||
| 34 | + * @param payClientClass 支付客户端 class | ||
| 35 | + */ | ||
| 36 | + void registerPayClientClass(PayChannelEnum channel, Class<?> payClientClass); | ||
| 37 | + | ||
| 28 | } | 38 | } |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/AbstractPayClient.java
| @@ -9,7 +9,6 @@ import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDT | @@ -9,7 +9,6 @@ import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDT | ||
| 9 | import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundRespDTO; | 9 | import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundRespDTO; |
| 10 | import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundUnifiedReqDTO; | 10 | import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundUnifiedReqDTO; |
| 11 | import cn.iocoder.yudao.framework.pay.core.client.exception.PayException; | 11 | import cn.iocoder.yudao.framework.pay.core.client.exception.PayException; |
| 12 | -import lombok.Getter; | ||
| 13 | import lombok.extern.slf4j.Slf4j; | 12 | import lombok.extern.slf4j.Slf4j; |
| 14 | 13 | ||
| 15 | import java.util.Map; | 14 | import java.util.Map; |
| @@ -36,7 +35,6 @@ public abstract class AbstractPayClient<Config extends PayClientConfig> implemen | @@ -36,7 +35,6 @@ public abstract class AbstractPayClient<Config extends PayClientConfig> implemen | ||
| 36 | /** | 35 | /** |
| 37 | * 支付配置 | 36 | * 支付配置 |
| 38 | */ | 37 | */ |
| 39 | - @Getter | ||
| 40 | protected Config config; | 38 | protected Config config; |
| 41 | 39 | ||
| 42 | public AbstractPayClient(Long channelId, String channelCode, Config config) { | 40 | public AbstractPayClient(Long channelId, String channelCode, Config config) { |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/PayClientFactoryImpl.java
| 1 | package cn.iocoder.yudao.framework.pay.core.client.impl; | 1 | package cn.iocoder.yudao.framework.pay.core.client.impl; |
| 2 | 2 | ||
| 3 | +import cn.hutool.core.lang.Assert; | ||
| 4 | +import cn.hutool.core.util.ReflectUtil; | ||
| 3 | import cn.iocoder.yudao.framework.pay.core.client.PayClient; | 5 | import cn.iocoder.yudao.framework.pay.core.client.PayClient; |
| 4 | import cn.iocoder.yudao.framework.pay.core.client.PayClientConfig; | 6 | import cn.iocoder.yudao.framework.pay.core.client.PayClientConfig; |
| 5 | import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory; | 7 | import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory; |
| 8 | +import cn.iocoder.yudao.framework.pay.core.client.impl.alipay.*; | ||
| 9 | +import cn.iocoder.yudao.framework.pay.core.client.impl.mock.MockPayClient; | ||
| 10 | +import cn.iocoder.yudao.framework.pay.core.client.impl.weixin.*; | ||
| 11 | +import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; | ||
| 6 | import lombok.extern.slf4j.Slf4j; | 12 | import lombok.extern.slf4j.Slf4j; |
| 7 | 13 | ||
| 14 | +import java.util.Map; | ||
| 8 | import java.util.concurrent.ConcurrentHashMap; | 15 | import java.util.concurrent.ConcurrentHashMap; |
| 9 | import java.util.concurrent.ConcurrentMap; | 16 | import java.util.concurrent.ConcurrentMap; |
| 10 | 17 | ||
| 18 | +import static cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum.*; | ||
| 19 | + | ||
| 11 | /** | 20 | /** |
| 12 | * 支付客户端的工厂实现类 | 21 | * 支付客户端的工厂实现类 |
| 13 | * | 22 | * |
| @@ -18,10 +27,38 @@ public class PayClientFactoryImpl implements PayClientFactory { | @@ -18,10 +27,38 @@ public class PayClientFactoryImpl implements PayClientFactory { | ||
| 18 | 27 | ||
| 19 | /** | 28 | /** |
| 20 | * 支付客户端 Map | 29 | * 支付客户端 Map |
| 30 | + * | ||
| 21 | * key:渠道编号 | 31 | * key:渠道编号 |
| 22 | */ | 32 | */ |
| 23 | private final ConcurrentMap<Long, AbstractPayClient<?>> clients = new ConcurrentHashMap<>(); | 33 | private final ConcurrentMap<Long, AbstractPayClient<?>> clients = new ConcurrentHashMap<>(); |
| 24 | 34 | ||
| 35 | + /** | ||
| 36 | + * 支付客户端 Class Map | ||
| 37 | + */ | ||
| 38 | + private final Map<PayChannelEnum, Class<?>> clientClass = new ConcurrentHashMap<>(); | ||
| 39 | + | ||
| 40 | + public PayClientFactoryImpl() { | ||
| 41 | + // 微信支付客户端 | ||
| 42 | + clientClass.put(WX_PUB, WxPubPayClient.class); | ||
| 43 | + clientClass.put(WX_LITE, WxLitePayClient.class); | ||
| 44 | + clientClass.put(WX_APP, WxAppPayClient.class); | ||
| 45 | + clientClass.put(WX_BAR, WxBarPayClient.class); | ||
| 46 | + clientClass.put(WX_NATIVE, WxNativePayClient.class); | ||
| 47 | + // 支付包支付客户端 | ||
| 48 | + clientClass.put(ALIPAY_WAP, AlipayWapPayClient.class); | ||
| 49 | + clientClass.put(ALIPAY_QR, AlipayQrPayClient.class); | ||
| 50 | + clientClass.put(ALIPAY_APP, AlipayAppPayClient.class); | ||
| 51 | + clientClass.put(ALIPAY_PC, AlipayPcPayClient.class); | ||
| 52 | + clientClass.put(ALIPAY_BAR, AlipayBarPayClient.class); | ||
| 53 | + // Mock 支付客户端 | ||
| 54 | + clientClass.put(MOCK, MockPayClient.class); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + @Override | ||
| 58 | + public void registerPayClientClass(PayChannelEnum channel, Class<?> payClientClass) { | ||
| 59 | + clientClass.put(channel, payClientClass); | ||
| 60 | + } | ||
| 61 | + | ||
| 25 | @Override | 62 | @Override |
| 26 | public PayClient getPayClient(Long channelId) { | 63 | public PayClient getPayClient(Long channelId) { |
| 27 | AbstractPayClient<?> client = clients.get(channelId); | 64 | AbstractPayClient<?> client = clients.get(channelId); |
| @@ -33,12 +70,26 @@ public class PayClientFactoryImpl implements PayClientFactory { | @@ -33,12 +70,26 @@ public class PayClientFactoryImpl implements PayClientFactory { | ||
| 33 | 70 | ||
| 34 | @Override | 71 | @Override |
| 35 | @SuppressWarnings("unchecked") | 72 | @SuppressWarnings("unchecked") |
| 36 | - public <Config extends PayClientConfig> void addOrUpdatePayClient(Long channelId, AbstractPayClient<Config> client) { | ||
| 37 | - AbstractPayClient<Config> prePayClient = (AbstractPayClient<Config>) clients.putIfAbsent(channelId, client); | ||
| 38 | - if (prePayClient == null) { | 73 | + public <Config extends PayClientConfig> void createOrUpdatePayClient(Long channelId, String channelCode, |
| 74 | + Config config) { | ||
| 75 | + AbstractPayClient<Config> client = (AbstractPayClient<Config>) clients.get(channelId); | ||
| 76 | + if (client == null) { | ||
| 77 | + client = this.createPayClient(channelId, channelCode, config); | ||
| 39 | client.init(); | 78 | client.init(); |
| 79 | + clients.put(client.getId(), client); | ||
| 40 | } else { | 80 | } else { |
| 41 | - prePayClient.refresh(client.getConfig()); | 81 | + client.refresh(config); |
| 42 | } | 82 | } |
| 43 | } | 83 | } |
| 84 | + | ||
| 85 | + @SuppressWarnings("unchecked") | ||
| 86 | + private <Config extends PayClientConfig> AbstractPayClient<Config> createPayClient(Long channelId, String channelCode, | ||
| 87 | + Config config) { | ||
| 88 | + PayChannelEnum channelEnum = PayChannelEnum.getByCode(channelCode); | ||
| 89 | + Assert.notNull(channelEnum, String.format("支付渠道(%s) 为空", channelCode)); | ||
| 90 | + Class<?> payClientClass = clientClass.get(channelEnum); | ||
| 91 | + Assert.notNull(payClientClass, String.format("支付渠道(%s) Class 为空", channelCode)); | ||
| 92 | + return (AbstractPayClient<Config>) ReflectUtil.newInstance(payClientClass, channelId, config); | ||
| 93 | + } | ||
| 94 | + | ||
| 44 | } | 95 | } |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/test/java/cn/iocoder/yudao/framework/pay/core/client/impl/PayClientFactoryImplIntegrationTest.java
| @@ -9,6 +9,7 @@ import cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayQrPayClient; | @@ -9,6 +9,7 @@ import cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayQrPayClient; | ||
| 9 | import cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayWapPayClient; | 9 | import cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayWapPayClient; |
| 10 | import cn.iocoder.yudao.framework.pay.core.client.impl.weixin.WxPayClientConfig; | 10 | import cn.iocoder.yudao.framework.pay.core.client.impl.weixin.WxPayClientConfig; |
| 11 | import cn.iocoder.yudao.framework.pay.core.client.impl.weixin.WxPubPayClient; | 11 | import cn.iocoder.yudao.framework.pay.core.client.impl.weixin.WxPubPayClient; |
| 12 | +import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; | ||
| 12 | import org.junit.jupiter.api.Disabled; | 13 | import org.junit.jupiter.api.Disabled; |
| 13 | import org.junit.jupiter.api.Test; | 14 | import org.junit.jupiter.api.Test; |
| 14 | 15 | ||
| @@ -40,8 +41,7 @@ public class PayClientFactoryImplIntegrationTest { | @@ -40,8 +41,7 @@ public class PayClientFactoryImplIntegrationTest { | ||
| 40 | config.setMchKey("0alL64UDQdlCwiKZ73ib7ypaIjMns06p"); | 41 | config.setMchKey("0alL64UDQdlCwiKZ73ib7ypaIjMns06p"); |
| 41 | // 创建客户端 | 42 | // 创建客户端 |
| 42 | Long channelId = RandomUtil.randomLong(); | 43 | Long channelId = RandomUtil.randomLong(); |
| 43 | - | ||
| 44 | - payClientFactory.addOrUpdatePayClient(channelId, new WxPubPayClient(channelId, config)); | 44 | + payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.WX_PUB.getCode(), config); |
| 45 | PayClient client = payClientFactory.getPayClient(channelId); | 45 | PayClient client = payClientFactory.getPayClient(channelId); |
| 46 | // 发起支付 | 46 | // 发起支付 |
| 47 | PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO(); | 47 | PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO(); |
| @@ -64,7 +64,7 @@ public class PayClientFactoryImplIntegrationTest { | @@ -64,7 +64,7 @@ public class PayClientFactoryImplIntegrationTest { | ||
| 64 | config.setApiV3Key("joerVi8y5DJ3o4ttA0o1uH47Xz1u2Ase"); | 64 | config.setApiV3Key("joerVi8y5DJ3o4ttA0o1uH47Xz1u2Ase"); |
| 65 | // 创建客户端 | 65 | // 创建客户端 |
| 66 | Long channelId = RandomUtil.randomLong(); | 66 | Long channelId = RandomUtil.randomLong(); |
| 67 | - payClientFactory.addOrUpdatePayClient(channelId, new WxPubPayClient(channelId, config)); | 67 | + payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.WX_PUB.getCode(), config); |
| 68 | PayClient client = payClientFactory.getPayClient(channelId); | 68 | PayClient client = payClientFactory.getPayClient(channelId); |
| 69 | // 发起支付 | 69 | // 发起支付 |
| 70 | PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO(); | 70 | PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO(); |
| @@ -87,7 +87,7 @@ public class PayClientFactoryImplIntegrationTest { | @@ -87,7 +87,7 @@ public class PayClientFactoryImplIntegrationTest { | ||
| 87 | config.setAlipayPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnq90KnF4dTnlzzmxpujbI05OYqi5WxAS6cL0gnZFv2gK51HExF8v/BaP7P979PhFMgWTqmOOI+Dtno5s+yD09XTY1WkshbLk6i4g2Xlr8fyW9ODnkU88RI2w9UdPhQU4cPPwBNlrsYhKkVK2OxwM3kFqjoBBY0CZoZCsSQ3LDH5WeZqPArlsS6xa2zqJBuuoKjMrdpELl3eXSjP8K54eDJCbeetCZNKWLL3DPahTPB7LZikfYmslb0QUvCgGapD0xkS7eVq70NaL1G57MWABs4tbfWgxike4Daj3EfUrzIVspQxj7w8HEj9WozJPgL88kSJSits0pqD3n5r8HSuseQIDAQAB"); | 87 | config.setAlipayPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnq90KnF4dTnlzzmxpujbI05OYqi5WxAS6cL0gnZFv2gK51HExF8v/BaP7P979PhFMgWTqmOOI+Dtno5s+yD09XTY1WkshbLk6i4g2Xlr8fyW9ODnkU88RI2w9UdPhQU4cPPwBNlrsYhKkVK2OxwM3kFqjoBBY0CZoZCsSQ3LDH5WeZqPArlsS6xa2zqJBuuoKjMrdpELl3eXSjP8K54eDJCbeetCZNKWLL3DPahTPB7LZikfYmslb0QUvCgGapD0xkS7eVq70NaL1G57MWABs4tbfWgxike4Daj3EfUrzIVspQxj7w8HEj9WozJPgL88kSJSits0pqD3n5r8HSuseQIDAQAB"); |
| 88 | // 创建客户端 | 88 | // 创建客户端 |
| 89 | Long channelId = RandomUtil.randomLong(); | 89 | Long channelId = RandomUtil.randomLong(); |
| 90 | - payClientFactory.addOrUpdatePayClient(channelId, new AlipayQrPayClient(channelId, config)); | 90 | + payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.ALIPAY_QR.getCode(), config); |
| 91 | PayClient client = payClientFactory.getPayClient(channelId); | 91 | PayClient client = payClientFactory.getPayClient(channelId); |
| 92 | // 发起支付 | 92 | // 发起支付 |
| 93 | PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO(); | 93 | PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO(); |
| @@ -111,7 +111,7 @@ public class PayClientFactoryImplIntegrationTest { | @@ -111,7 +111,7 @@ public class PayClientFactoryImplIntegrationTest { | ||
| 111 | config.setAlipayPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnq90KnF4dTnlzzmxpujbI05OYqi5WxAS6cL0gnZFv2gK51HExF8v/BaP7P979PhFMgWTqmOOI+Dtno5s+yD09XTY1WkshbLk6i4g2Xlr8fyW9ODnkU88RI2w9UdPhQU4cPPwBNlrsYhKkVK2OxwM3kFqjoBBY0CZoZCsSQ3LDH5WeZqPArlsS6xa2zqJBuuoKjMrdpELl3eXSjP8K54eDJCbeetCZNKWLL3DPahTPB7LZikfYmslb0QUvCgGapD0xkS7eVq70NaL1G57MWABs4tbfWgxike4Daj3EfUrzIVspQxj7w8HEj9WozJPgL88kSJSits0pqD3n5r8HSuseQIDAQAB"); | 111 | config.setAlipayPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnq90KnF4dTnlzzmxpujbI05OYqi5WxAS6cL0gnZFv2gK51HExF8v/BaP7P979PhFMgWTqmOOI+Dtno5s+yD09XTY1WkshbLk6i4g2Xlr8fyW9ODnkU88RI2w9UdPhQU4cPPwBNlrsYhKkVK2OxwM3kFqjoBBY0CZoZCsSQ3LDH5WeZqPArlsS6xa2zqJBuuoKjMrdpELl3eXSjP8K54eDJCbeetCZNKWLL3DPahTPB7LZikfYmslb0QUvCgGapD0xkS7eVq70NaL1G57MWABs4tbfWgxike4Daj3EfUrzIVspQxj7w8HEj9WozJPgL88kSJSits0pqD3n5r8HSuseQIDAQAB"); |
| 112 | // 创建客户端 | 112 | // 创建客户端 |
| 113 | Long channelId = RandomUtil.randomLong(); | 113 | Long channelId = RandomUtil.randomLong(); |
| 114 | - payClientFactory.addOrUpdatePayClient(channelId, new AlipayWapPayClient(channelId, config)); | 114 | + payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.ALIPAY_WAP.getCode(), config); |
| 115 | PayClient client = payClientFactory.getPayClient(channelId); | 115 | PayClient client = payClientFactory.getPayClient(channelId); |
| 116 | // 发起支付 | 116 | // 发起支付 |
| 117 | PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO(); | 117 | PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO(); |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java
| @@ -110,8 +110,9 @@ public class ProductSpuServiceImpl implements ProductSpuService { | @@ -110,8 +110,9 @@ public class ProductSpuServiceImpl implements ProductSpuService { | ||
| 110 | spu.setMarketPrice(getMinValue(skus, ProductSkuCreateOrUpdateReqVO::getMarketPrice)); | 110 | spu.setMarketPrice(getMinValue(skus, ProductSkuCreateOrUpdateReqVO::getMarketPrice)); |
| 111 | // sku 单价最低的商品的成本价格 | 111 | // sku 单价最低的商品的成本价格 |
| 112 | spu.setCostPrice(getMinValue(skus, ProductSkuCreateOrUpdateReqVO::getCostPrice)); | 112 | spu.setCostPrice(getMinValue(skus, ProductSkuCreateOrUpdateReqVO::getCostPrice)); |
| 113 | - // sku 单价最低的商品的条形码 | ||
| 114 | - spu.setBarCode(getMinValue(skus, ProductSkuCreateOrUpdateReqVO::getBarCode)); | 113 | + // sku 单价最低的商品的条形码 TODO 芋艿:条形码字段,是不是可以删除 |
| 114 | + spu.setBarCode(""); | ||
| 115 | +// spu.setBarCode(getMinValue(skus, ProductSkuCreateOrUpdateReqVO::getBarCode)); | ||
| 115 | // skus 库存总数 | 116 | // skus 库存总数 |
| 116 | spu.setStock(getSumValue(skus, ProductSkuCreateOrUpdateReqVO::getStock, Integer::sum)); | 117 | spu.setStock(getSumValue(skus, ProductSkuCreateOrUpdateReqVO::getStock, Integer::sum)); |
| 117 | // 若是 spu 已有状态则不处理 | 118 | // 若是 spu 已有状态则不处理 |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/SeckillConfigController.java
| @@ -81,12 +81,13 @@ public class SeckillConfigController { | @@ -81,12 +81,13 @@ public class SeckillConfigController { | ||
| 81 | @GetMapping("/list-all-simple") | 81 | @GetMapping("/list-all-simple") |
| 82 | @Operation(summary = "获得所有开启状态的秒杀时段精简列表", description = "主要用于前端的下拉选项") | 82 | @Operation(summary = "获得所有开启状态的秒杀时段精简列表", description = "主要用于前端的下拉选项") |
| 83 | public CommonResult<List<SeckillConfigSimpleRespVO>> getListAllSimple() { | 83 | public CommonResult<List<SeckillConfigSimpleRespVO>> getListAllSimple() { |
| 84 | - List<SeckillConfigDO> list = seckillConfigService.getSeckillConfigListByStatus(CommonStatusEnum.ENABLE.getStatus()); | 84 | + List<SeckillConfigDO> list = seckillConfigService.getSeckillConfigListByStatus( |
| 85 | + CommonStatusEnum.ENABLE.getStatus()); | ||
| 85 | return success(SeckillConfigConvert.INSTANCE.convertList1(list)); | 86 | return success(SeckillConfigConvert.INSTANCE.convertList1(list)); |
| 86 | } | 87 | } |
| 87 | 88 | ||
| 88 | @GetMapping("/page") | 89 | @GetMapping("/page") |
| 89 | - @Operation(summary = "获得秒杀活动分页") | 90 | + @Operation(summary = "获得秒杀时间段分页") |
| 90 | @PreAuthorize("@ss.hasPermission('promotion:seckill-config:query')") | 91 | @PreAuthorize("@ss.hasPermission('promotion:seckill-config:query')") |
| 91 | public CommonResult<PageResult<SeckillConfigRespVO>> getSeckillActivityPage(@Valid SeckillConfigPageReqVO pageVO) { | 92 | public CommonResult<PageResult<SeckillConfigRespVO>> getSeckillActivityPage(@Valid SeckillConfigPageReqVO pageVO) { |
| 92 | PageResult<SeckillConfigDO> pageResult = seckillConfigService.getSeckillConfigPage(pageVO); | 93 | PageResult<SeckillConfigDO> pageResult = seckillConfigService.getSeckillConfigPage(pageVO); |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/bargain/AppBargainActivityController.java
| @@ -35,7 +35,7 @@ public class AppBargainActivityController { | @@ -35,7 +35,7 @@ public class AppBargainActivityController { | ||
| 35 | activity1.setId(1L); | 35 | activity1.setId(1L); |
| 36 | activity1.setName("618 大砍价"); | 36 | activity1.setName("618 大砍价"); |
| 37 | activity1.setSpuId(2048L); | 37 | activity1.setSpuId(2048L); |
| 38 | - activity1.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | 38 | + activity1.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| 39 | activity1.setMarketPrice(50); | 39 | activity1.setMarketPrice(50); |
| 40 | activity1.setBargainPrice(100); | 40 | activity1.setBargainPrice(100); |
| 41 | activity1.setStartTime(LocalDateTimeUtils.addTime(Duration.ofDays(-2))); | 41 | activity1.setStartTime(LocalDateTimeUtils.addTime(Duration.ofDays(-2))); |
| @@ -47,7 +47,7 @@ public class AppBargainActivityController { | @@ -47,7 +47,7 @@ public class AppBargainActivityController { | ||
| 47 | activity2.setId(2L); | 47 | activity2.setId(2L); |
| 48 | activity2.setName("双十一砍价"); | 48 | activity2.setName("双十一砍价"); |
| 49 | activity2.setSpuId(4096L); | 49 | activity2.setSpuId(4096L); |
| 50 | - activity2.setPicUrl("https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKXMYJOomfp7cebz3cIeb8sHk3GGSIJtWEgREe3j7J1WoAbTvIOicpcNdFkWAziatBSMod8b5RyS4CQ/132"); | 50 | + activity2.setPicUrl("https://static.iocoder.cn/mall/132.jpeg"); |
| 51 | activity2.setMarketPrice(100); | 51 | activity2.setMarketPrice(100); |
| 52 | activity2.setBargainPrice(200); | 52 | activity2.setBargainPrice(200); |
| 53 | activity2.setStartTime(LocalDateTimeUtils.addTime(Duration.ofDays(-2))); | 53 | activity2.setStartTime(LocalDateTimeUtils.addTime(Duration.ofDays(-2))); |
| @@ -69,7 +69,7 @@ public class AppBargainActivityController { | @@ -69,7 +69,7 @@ public class AppBargainActivityController { | ||
| 69 | activity1.setId(1L); | 69 | activity1.setId(1L); |
| 70 | activity1.setName("618 大砍价"); | 70 | activity1.setName("618 大砍价"); |
| 71 | activity1.setSpuId(2048L); | 71 | activity1.setSpuId(2048L); |
| 72 | - activity1.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | 72 | + activity1.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| 73 | activity1.setMarketPrice(50); | 73 | activity1.setMarketPrice(50); |
| 74 | activity1.setBargainPrice(100); | 74 | activity1.setBargainPrice(100); |
| 75 | activityList.add(activity1); | 75 | activityList.add(activity1); |
| @@ -78,7 +78,7 @@ public class AppBargainActivityController { | @@ -78,7 +78,7 @@ public class AppBargainActivityController { | ||
| 78 | activity2.setId(2L); | 78 | activity2.setId(2L); |
| 79 | activity2.setName("双十一砍价"); | 79 | activity2.setName("双十一砍价"); |
| 80 | activity2.setSpuId(4096L); | 80 | activity2.setSpuId(4096L); |
| 81 | - activity2.setPicUrl("https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKXMYJOomfp7cebz3cIeb8sHk3GGSIJtWEgREe3j7J1WoAbTvIOicpcNdFkWAziatBSMod8b5RyS4CQ/132"); | 81 | + activity2.setPicUrl("https://static.iocoder.cn/mall/132.jpeg"); |
| 82 | activity2.setMarketPrice(100); | 82 | activity2.setMarketPrice(100); |
| 83 | activity2.setBargainPrice(200); | 83 | activity2.setBargainPrice(200); |
| 84 | activityList.add(activity2); | 84 | activityList.add(activity2); |
| @@ -94,7 +94,7 @@ public class AppBargainActivityController { | @@ -94,7 +94,7 @@ public class AppBargainActivityController { | ||
| 94 | activity.setId(2L); | 94 | activity.setId(2L); |
| 95 | activity.setName("618 大砍价"); | 95 | activity.setName("618 大砍价"); |
| 96 | activity.setSpuId(2048L); | 96 | activity.setSpuId(2048L); |
| 97 | - activity.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | 97 | + activity.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| 98 | activity.setMarketPrice(50); | 98 | activity.setMarketPrice(50); |
| 99 | activity.setBargainPrice(100); | 99 | activity.setBargainPrice(100); |
| 100 | activity.setStock(10); | 100 | activity.setStock(10); |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/bargain/AppBargainRecordController.java
| @@ -81,7 +81,7 @@ public class AppBargainRecordController { | @@ -81,7 +81,7 @@ public class AppBargainRecordController { | ||
| 81 | record1.setPrice(200); | 81 | record1.setPrice(200); |
| 82 | record1.setPayPrice(180); | 82 | record1.setPayPrice(180); |
| 83 | record1.setStatus(1); | 83 | record1.setStatus(1); |
| 84 | - record1.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | 84 | + record1.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| 85 | record1.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(2))); | 85 | record1.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(2))); |
| 86 | page.getList().add(record1); | 86 | page.getList().add(record1); |
| 87 | 87 | ||
| @@ -96,7 +96,7 @@ public class AppBargainRecordController { | @@ -96,7 +96,7 @@ public class AppBargainRecordController { | ||
| 96 | record2.setPrice(200); | 96 | record2.setPrice(200); |
| 97 | record2.setPayPrice(280); | 97 | record2.setPayPrice(280); |
| 98 | record2.setStatus(2); | 98 | record2.setStatus(2); |
| 99 | - record2.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | 99 | + record2.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| 100 | record2.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(2))); | 100 | record2.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(2))); |
| 101 | page.getList().add(record2); | 101 | page.getList().add(record2); |
| 102 | 102 | ||
| @@ -111,7 +111,7 @@ public class AppBargainRecordController { | @@ -111,7 +111,7 @@ public class AppBargainRecordController { | ||
| 111 | record3.setPrice(200); | 111 | record3.setPrice(200); |
| 112 | record3.setPayPrice(380); | 112 | record3.setPayPrice(380); |
| 113 | record3.setStatus(2); | 113 | record3.setStatus(2); |
| 114 | - record3.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | 114 | + record3.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| 115 | record3.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(2))); | 115 | record3.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(2))); |
| 116 | record3.setOrderId(100L); | 116 | record3.setOrderId(100L); |
| 117 | page.getList().add(record3); | 117 | page.getList().add(record3); |
| @@ -127,7 +127,7 @@ public class AppBargainRecordController { | @@ -127,7 +127,7 @@ public class AppBargainRecordController { | ||
| 127 | record4.setPrice(200); | 127 | record4.setPrice(200); |
| 128 | record4.setPayPrice(380); | 128 | record4.setPayPrice(380); |
| 129 | record4.setStatus(3); | 129 | record4.setStatus(3); |
| 130 | - record4.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | 130 | + record4.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| 131 | record4.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(2))); | 131 | record4.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(2))); |
| 132 | record4.setOrderId(100L); | 132 | record4.setOrderId(100L); |
| 133 | page.getList().add(record4); | 133 | page.getList().add(record4); |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationActivityController.java
| @@ -38,7 +38,7 @@ public class AppCombinationActivityController { | @@ -38,7 +38,7 @@ public class AppCombinationActivityController { | ||
| 38 | activity1.setName("618 大拼团"); | 38 | activity1.setName("618 大拼团"); |
| 39 | activity1.setUserSize(3); | 39 | activity1.setUserSize(3); |
| 40 | activity1.setSpuId(2048L); | 40 | activity1.setSpuId(2048L); |
| 41 | - activity1.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | 41 | + activity1.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| 42 | activity1.setMarketPrice(50); | 42 | activity1.setMarketPrice(50); |
| 43 | activity1.setCombinationPrice(100); | 43 | activity1.setCombinationPrice(100); |
| 44 | activityList.add(activity1); | 44 | activityList.add(activity1); |
| @@ -48,7 +48,7 @@ public class AppCombinationActivityController { | @@ -48,7 +48,7 @@ public class AppCombinationActivityController { | ||
| 48 | activity2.setName("双十一拼团"); | 48 | activity2.setName("双十一拼团"); |
| 49 | activity2.setUserSize(5); | 49 | activity2.setUserSize(5); |
| 50 | activity2.setSpuId(4096L); | 50 | activity2.setSpuId(4096L); |
| 51 | - activity2.setPicUrl("https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKXMYJOomfp7cebz3cIeb8sHk3GGSIJtWEgREe3j7J1WoAbTvIOicpcNdFkWAziatBSMod8b5RyS4CQ/132"); | 51 | + activity2.setPicUrl("https://static.iocoder.cn/mall/132.jpeg"); |
| 52 | activity2.setMarketPrice(100); | 52 | activity2.setMarketPrice(100); |
| 53 | activity2.setCombinationPrice(200); | 53 | activity2.setCombinationPrice(200); |
| 54 | activityList.add(activity2); | 54 | activityList.add(activity2); |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java
| @@ -41,7 +41,7 @@ public class AppCombinationRecordController { | @@ -41,7 +41,7 @@ public class AppCombinationRecordController { | ||
| 41 | summary.getAvatars().add("https://thirdwx.qlogo.cn/mmopen/vi_32/ouwtwJycbic2JrCoZjETict0klxd1uRuicRneKk00ewMcCClxVcVHQT91Sh9MJGtwibf1fOicD1WpwSP4icJM6eQq1AA/132"); | 41 | summary.getAvatars().add("https://thirdwx.qlogo.cn/mmopen/vi_32/ouwtwJycbic2JrCoZjETict0klxd1uRuicRneKk00ewMcCClxVcVHQT91Sh9MJGtwibf1fOicD1WpwSP4icJM6eQq1AA/132"); |
| 42 | summary.getAvatars().add("https://thirdwx.qlogo.cn/mmopen/vi_32/RpUrhwens58qc99OcGs993xL4M5QPOe05ekqF9Eia440kRicAlicicIdQWicHBmy2bzLgHzHguWEzHHxnIgeictL7bLA/132"); | 42 | summary.getAvatars().add("https://thirdwx.qlogo.cn/mmopen/vi_32/RpUrhwens58qc99OcGs993xL4M5QPOe05ekqF9Eia440kRicAlicicIdQWicHBmy2bzLgHzHguWEzHHxnIgeictL7bLA/132"); |
| 43 | summary.getAvatars().add("https://thirdwx.qlogo.cn/mmopen/vi_32/S4tfqmxc8GZGsKc1K4mnhpvtG16gtMrLnTQfDibhr7jJich9LRI5RQKZDoqEjZM3azMib5nic7F4ZXKMEgYyLO08KA/132"); | 43 | summary.getAvatars().add("https://thirdwx.qlogo.cn/mmopen/vi_32/S4tfqmxc8GZGsKc1K4mnhpvtG16gtMrLnTQfDibhr7jJich9LRI5RQKZDoqEjZM3azMib5nic7F4ZXKMEgYyLO08KA/132"); |
| 44 | - summary.getAvatars().add("https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKXMYJOomfp7cebz3cIeb8sHk3GGSIJtWEgREe3j7J1WoAbTvIOicpcNdFkWAziatBSMod8b5RyS4CQ/132"); | 44 | + summary.getAvatars().add("https://static.iocoder.cn/mall/132.jpeg"); |
| 45 | return success(summary); | 45 | return success(summary); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| @@ -61,7 +61,7 @@ public class AppCombinationRecordController { | @@ -61,7 +61,7 @@ public class AppCombinationRecordController { | ||
| 61 | record.setExpireTime(new Date()); | 61 | record.setExpireTime(new Date()); |
| 62 | record.setUserSize(10); | 62 | record.setUserSize(10); |
| 63 | record.setUserCount(i); | 63 | record.setUserCount(i); |
| 64 | - record.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | 64 | + record.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| 65 | record.setActivityId(1L); | 65 | record.setActivityId(1L); |
| 66 | record.setSpuName("活动:" + i); | 66 | record.setSpuName("活动:" + i); |
| 67 | list.add(record); | 67 | list.add(record); |
| @@ -84,7 +84,7 @@ public class AppCombinationRecordController { | @@ -84,7 +84,7 @@ public class AppCombinationRecordController { | ||
| 84 | headRecord.setUserCount(3); | 84 | headRecord.setUserCount(3); |
| 85 | headRecord.setStatus(1); | 85 | headRecord.setStatus(1); |
| 86 | headRecord.setActivityId(10L); | 86 | headRecord.setActivityId(10L); |
| 87 | - headRecord.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | 87 | + headRecord.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| 88 | headRecord.setCombinationPrice(100); | 88 | headRecord.setCombinationPrice(100); |
| 89 | detail.setHeadRecord(headRecord); | 89 | detail.setHeadRecord(headRecord); |
| 90 | // 团员 | 90 | // 团员 |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillActivityController.java
| @@ -39,7 +39,7 @@ public class AppSeckillActivityController { | @@ -39,7 +39,7 @@ public class AppSeckillActivityController { | ||
| 39 | activity1.setId(1L); | 39 | activity1.setId(1L); |
| 40 | activity1.setName("618 大秒杀"); | 40 | activity1.setName("618 大秒杀"); |
| 41 | activity1.setSpuId(2048L); | 41 | activity1.setSpuId(2048L); |
| 42 | - activity1.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | 42 | + activity1.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| 43 | activity1.setMarketPrice(50); | 43 | activity1.setMarketPrice(50); |
| 44 | activity1.setSeckillPrice(100); | 44 | activity1.setSeckillPrice(100); |
| 45 | activityList.add(activity1); | 45 | activityList.add(activity1); |
| @@ -48,7 +48,7 @@ public class AppSeckillActivityController { | @@ -48,7 +48,7 @@ public class AppSeckillActivityController { | ||
| 48 | activity2.setId(2L); | 48 | activity2.setId(2L); |
| 49 | activity2.setName("双十一大秒杀"); | 49 | activity2.setName("双十一大秒杀"); |
| 50 | activity2.setSpuId(4096L); | 50 | activity2.setSpuId(4096L); |
| 51 | - activity2.setPicUrl("https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKXMYJOomfp7cebz3cIeb8sHk3GGSIJtWEgREe3j7J1WoAbTvIOicpcNdFkWAziatBSMod8b5RyS4CQ/132"); | 51 | + activity2.setPicUrl("https://static.iocoder.cn/mall/132.jpeg"); |
| 52 | activity2.setMarketPrice(100); | 52 | activity2.setMarketPrice(100); |
| 53 | activity2.setSeckillPrice(200); | 53 | activity2.setSeckillPrice(200); |
| 54 | activityList.add(activity2); | 54 | activityList.add(activity2); |
| @@ -65,7 +65,7 @@ public class AppSeckillActivityController { | @@ -65,7 +65,7 @@ public class AppSeckillActivityController { | ||
| 65 | activity1.setId(1L); | 65 | activity1.setId(1L); |
| 66 | activity1.setName("618 大秒杀"); | 66 | activity1.setName("618 大秒杀"); |
| 67 | activity1.setSpuId(2048L); | 67 | activity1.setSpuId(2048L); |
| 68 | - activity1.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | 68 | + activity1.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| 69 | activity1.setMarketPrice(50); | 69 | activity1.setMarketPrice(50); |
| 70 | activity1.setSeckillPrice(100); | 70 | activity1.setSeckillPrice(100); |
| 71 | activity1.setUnitName("个"); | 71 | activity1.setUnitName("个"); |
| @@ -77,7 +77,7 @@ public class AppSeckillActivityController { | @@ -77,7 +77,7 @@ public class AppSeckillActivityController { | ||
| 77 | activity2.setId(2L); | 77 | activity2.setId(2L); |
| 78 | activity2.setName("双十一大秒杀"); | 78 | activity2.setName("双十一大秒杀"); |
| 79 | activity2.setSpuId(4096L); | 79 | activity2.setSpuId(4096L); |
| 80 | - activity2.setPicUrl("https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKXMYJOomfp7cebz3cIeb8sHk3GGSIJtWEgREe3j7J1WoAbTvIOicpcNdFkWAziatBSMod8b5RyS4CQ/132"); | 80 | + activity2.setPicUrl("https://static.iocoder.cn/mall/132.jpeg"); |
| 81 | activity2.setMarketPrice(100); | 81 | activity2.setMarketPrice(100); |
| 82 | activity2.setSeckillPrice(200); | 82 | activity2.setSeckillPrice(200); |
| 83 | activity2.setUnitName("套"); | 83 | activity2.setUnitName("套"); |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillConfigController.java
| @@ -25,8 +25,8 @@ public class AppSeckillConfigController { | @@ -25,8 +25,8 @@ public class AppSeckillConfigController { | ||
| 25 | public CommonResult<List<AppSeckillConfigRespVO>> getSeckillConfigList() { | 25 | public CommonResult<List<AppSeckillConfigRespVO>> getSeckillConfigList() { |
| 26 | return success(Arrays.asList( | 26 | return success(Arrays.asList( |
| 27 | new AppSeckillConfigRespVO().setId(1L).setStartTime("00:00").setEndTime("09:59") | 27 | new AppSeckillConfigRespVO().setId(1L).setStartTime("00:00").setEndTime("09:59") |
| 28 | - .setSliderPicUrls(Arrays.asList("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg", | ||
| 29 | - "https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKXMYJOomfp7cebz3cIeb8sHk3GGSIJtWEgREe3j7J1WoAbTvIOicpcNdFkWAziatBSMod8b5RyS4CQ/132")), | 28 | + .setSliderPicUrls(Arrays.asList("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg", |
| 29 | + "https://static.iocoder.cn/mall/132.jpeg")), | ||
| 30 | new AppSeckillConfigRespVO().setId(2L).setStartTime("10:00").setEndTime("12:59"), | 30 | new AppSeckillConfigRespVO().setId(2L).setStartTime("10:00").setEndTime("12:59"), |
| 31 | new AppSeckillConfigRespVO().setId(2L).setStartTime("13:00").setEndTime("22:59"), | 31 | new AppSeckillConfigRespVO().setId(2L).setStartTime("13:00").setEndTime("22:59"), |
| 32 | new AppSeckillConfigRespVO().setId(2L).setStartTime("23:00").setEndTime("23:59") | 32 | new AppSeckillConfigRespVO().setId(2L).setStartTime("23:00").setEndTime("23:59") |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/seckill/seckillconfig/SeckillConfigMapper.java
| @@ -16,7 +16,7 @@ public interface SeckillConfigMapper extends BaseMapperX<SeckillConfigDO> { | @@ -16,7 +16,7 @@ public interface SeckillConfigMapper extends BaseMapperX<SeckillConfigDO> { | ||
| 16 | return selectPage(reqVO, new LambdaQueryWrapperX<SeckillConfigDO>() | 16 | return selectPage(reqVO, new LambdaQueryWrapperX<SeckillConfigDO>() |
| 17 | .likeIfPresent(SeckillConfigDO::getName, reqVO.getName()) | 17 | .likeIfPresent(SeckillConfigDO::getName, reqVO.getName()) |
| 18 | .eqIfPresent(SeckillConfigDO::getStatus, reqVO.getStatus()) | 18 | .eqIfPresent(SeckillConfigDO::getStatus, reqVO.getStatus()) |
| 19 | - .orderByDesc(SeckillConfigDO::getId)); | 19 | + .orderByAsc(SeckillConfigDO::getStartTime)); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | default List<SeckillConfigDO> selectListByStatus(Integer status) { | 22 | default List<SeckillConfigDO> selectListByStatus(Integer status) { |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java
| @@ -11,7 +11,6 @@ import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; | @@ -11,7 +11,6 @@ import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; | ||
| 11 | import cn.iocoder.yudao.module.member.controller.app.auth.vo.*; | 11 | import cn.iocoder.yudao.module.member.controller.app.auth.vo.*; |
| 12 | import cn.iocoder.yudao.module.member.convert.auth.AuthConvert; | 12 | import cn.iocoder.yudao.module.member.convert.auth.AuthConvert; |
| 13 | import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; | 13 | import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; |
| 14 | -import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper; | ||
| 15 | import cn.iocoder.yudao.module.member.service.user.MemberUserService; | 14 | import cn.iocoder.yudao.module.member.service.user.MemberUserService; |
| 16 | import cn.iocoder.yudao.module.system.api.logger.LoginLogApi; | 15 | import cn.iocoder.yudao.module.system.api.logger.LoginLogApi; |
| 17 | import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; | 16 | import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; |
| @@ -60,9 +59,6 @@ public class MemberAuthServiceImpl implements MemberAuthService { | @@ -60,9 +59,6 @@ public class MemberAuthServiceImpl implements MemberAuthService { | ||
| 60 | @Resource | 59 | @Resource |
| 61 | private WxMaService wxMaService; | 60 | private WxMaService wxMaService; |
| 62 | 61 | ||
| 63 | - @Resource | ||
| 64 | - private MemberUserMapper userMapper; | ||
| 65 | - | ||
| 66 | @Override | 62 | @Override |
| 67 | public AppAuthLoginRespVO login(AppAuthLoginReqVO reqVO) { | 63 | public AppAuthLoginRespVO login(AppAuthLoginReqVO reqVO) { |
| 68 | // 使用手机 + 密码,进行登录。 | 64 | // 使用手机 + 密码,进行登录。 |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java
| @@ -168,9 +168,6 @@ public class MemberUserServiceImpl implements MemberUserService { | @@ -168,9 +168,6 @@ public class MemberUserServiceImpl implements MemberUserService { | ||
| 168 | 168 | ||
| 169 | @Override | 169 | @Override |
| 170 | public boolean isPasswordMatch(String rawPassword, String encodedPassword) { | 170 | public boolean isPasswordMatch(String rawPassword, String encodedPassword) { |
| 171 | - if(true) { | ||
| 172 | - return true; | ||
| 173 | - } | ||
| 174 | return passwordEncoder.matches(rawPassword, encodedPassword); | 171 | return passwordEncoder.matches(rawPassword, encodedPassword); |
| 175 | } | 172 | } |
| 176 | 173 |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/framework/pay/wallet/WalletPayClient.java
| 1 | package cn.iocoder.yudao.module.pay.framework.pay.wallet; | 1 | package cn.iocoder.yudao.module.pay.framework.pay.wallet; |
| 2 | 2 | ||
| 3 | +import cn.hutool.extra.spring.SpringUtil; | ||
| 3 | import cn.iocoder.yudao.framework.common.exception.ServiceException; | 4 | import cn.iocoder.yudao.framework.common.exception.ServiceException; |
| 4 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO; | 5 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO; |
| 5 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO; | 6 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO; |
| @@ -7,6 +8,7 @@ import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundRespDTO; | @@ -7,6 +8,7 @@ import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundRespDTO; | ||
| 7 | import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundUnifiedReqDTO; | 8 | import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundUnifiedReqDTO; |
| 8 | import cn.iocoder.yudao.framework.pay.core.client.impl.AbstractPayClient; | 9 | import cn.iocoder.yudao.framework.pay.core.client.impl.AbstractPayClient; |
| 9 | import cn.iocoder.yudao.framework.pay.core.client.impl.NonePayClientConfig; | 10 | import cn.iocoder.yudao.framework.pay.core.client.impl.NonePayClientConfig; |
| 11 | +import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; | ||
| 10 | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO; | 12 | import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO; |
| 11 | import cn.iocoder.yudao.module.pay.service.wallet.PayWalletService; | 13 | import cn.iocoder.yudao.module.pay.service.wallet.PayWalletService; |
| 12 | import lombok.extern.slf4j.Slf4j; | 14 | import lombok.extern.slf4j.Slf4j; |
| @@ -23,30 +25,26 @@ import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeC | @@ -23,30 +25,26 @@ import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeC | ||
| 23 | @Slf4j | 25 | @Slf4j |
| 24 | public class WalletPayClient extends AbstractPayClient<NonePayClientConfig> { | 26 | public class WalletPayClient extends AbstractPayClient<NonePayClientConfig> { |
| 25 | 27 | ||
| 26 | - private PayWalletService payWalletService; | 28 | + private PayWalletService wallService; |
| 27 | 29 | ||
| 28 | - public WalletPayClient(Long channelId, String channelCode, NonePayClientConfig config) { | ||
| 29 | - super(channelId, channelCode, config); | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - public WalletPayClient(Long channelId, String channelCode, NonePayClientConfig config, | ||
| 33 | - PayWalletService payWalletService) { | ||
| 34 | - this(channelId, channelCode, config); | ||
| 35 | - this.payWalletService = payWalletService; | 30 | + public WalletPayClient(Long channelId, NonePayClientConfig config) { |
| 31 | + super(channelId, PayChannelEnum.WALLET.getCode(), config); | ||
| 36 | } | 32 | } |
| 37 | 33 | ||
| 38 | @Override | 34 | @Override |
| 39 | protected void doInit() { | 35 | protected void doInit() { |
| 40 | - // 钱包支付,无需初始化 | 36 | + if (wallService == null) { |
| 37 | + wallService = SpringUtil.getBean(PayWalletService.class); | ||
| 38 | + } | ||
| 41 | } | 39 | } |
| 42 | 40 | ||
| 43 | @Override | 41 | @Override |
| 44 | protected PayOrderRespDTO doUnifiedOrder(PayOrderUnifiedReqDTO reqDTO) { | 42 | protected PayOrderRespDTO doUnifiedOrder(PayOrderUnifiedReqDTO reqDTO) { |
| 45 | try { | 43 | try { |
| 46 | - PayWalletTransactionDO transaction = payWalletService.pay(reqDTO.getOutTradeNo(), reqDTO.getPrice()); | 44 | + PayWalletTransactionDO transaction = wallService.pay(reqDTO.getOutTradeNo(), reqDTO.getPrice()); |
| 47 | return PayOrderRespDTO.successOf(transaction.getNo(), transaction.getCreator(), | 45 | return PayOrderRespDTO.successOf(transaction.getNo(), transaction.getCreator(), |
| 48 | transaction.getTransactionTime(), | 46 | transaction.getTransactionTime(), |
| 49 | - reqDTO.getOutTradeNo(), "WALLET_PAY_SUCCESS"); // TODO @jason:transaction 作为 traData 好了; | 47 | + reqDTO.getOutTradeNo(), transaction); |
| 50 | } catch (Throwable ex) { | 48 | } catch (Throwable ex) { |
| 51 | log.error("[doUnifiedOrder] 失败", ex); | 49 | log.error("[doUnifiedOrder] 失败", ex); |
| 52 | Integer errorCode = INTERNAL_SERVER_ERROR.getCode(); | 50 | Integer errorCode = INTERNAL_SERVER_ERROR.getCode(); |
| @@ -74,10 +72,10 @@ public class WalletPayClient extends AbstractPayClient<NonePayClientConfig> { | @@ -74,10 +72,10 @@ public class WalletPayClient extends AbstractPayClient<NonePayClientConfig> { | ||
| 74 | @Override | 72 | @Override |
| 75 | protected PayRefundRespDTO doUnifiedRefund(PayRefundUnifiedReqDTO reqDTO) { | 73 | protected PayRefundRespDTO doUnifiedRefund(PayRefundUnifiedReqDTO reqDTO) { |
| 76 | try { | 74 | try { |
| 77 | - PayWalletTransactionDO payWalletTransaction = payWalletService.refund(reqDTO.getOutRefundNo(), | 75 | + PayWalletTransactionDO payWalletTransaction = wallService.refund(reqDTO.getOutRefundNo(), |
| 78 | reqDTO.getRefundPrice(), reqDTO.getReason()); | 76 | reqDTO.getRefundPrice(), reqDTO.getReason()); |
| 79 | return PayRefundRespDTO.successOf(payWalletTransaction.getNo(), payWalletTransaction.getTransactionTime(), | 77 | return PayRefundRespDTO.successOf(payWalletTransaction.getNo(), payWalletTransaction.getTransactionTime(), |
| 80 | - reqDTO.getOutRefundNo(), "WALLET_REFUND_SUCCESS"); | 78 | + reqDTO.getOutRefundNo(), payWalletTransaction); |
| 81 | } catch (Throwable ex) { | 79 | } catch (Throwable ex) { |
| 82 | log.error("[doUnifiedRefund] 失败", ex); | 80 | log.error("[doUnifiedRefund] 失败", ex); |
| 83 | Integer errorCode = INTERNAL_SERVER_ERROR.getCode(); | 81 | Integer errorCode = INTERNAL_SERVER_ERROR.getCode(); |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelServiceImpl.java
| @@ -8,12 +8,6 @@ import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | @@ -8,12 +8,6 @@ import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | ||
| 8 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | 8 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 9 | import cn.iocoder.yudao.framework.pay.core.client.PayClientConfig; | 9 | import cn.iocoder.yudao.framework.pay.core.client.PayClientConfig; |
| 10 | import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory; | 10 | import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory; |
| 11 | -import cn.iocoder.yudao.framework.pay.core.client.impl.AbstractPayClient; | ||
| 12 | -import cn.iocoder.yudao.framework.pay.core.client.impl.NonePayClientConfig; | ||
| 13 | -import cn.iocoder.yudao.framework.pay.core.client.impl.alipay.*; | ||
| 14 | -import cn.iocoder.yudao.framework.pay.core.client.impl.mock.MockPayClient; | ||
| 15 | -import cn.iocoder.yudao.framework.pay.core.client.impl.mock.MockPayClientConfig; | ||
| 16 | -import cn.iocoder.yudao.framework.pay.core.client.impl.weixin.*; | ||
| 17 | import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; | 11 | import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; |
| 18 | import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils; | 12 | import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils; |
| 19 | import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelCreateReqVO; | 13 | import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelCreateReqVO; |
| @@ -22,7 +16,6 @@ import cn.iocoder.yudao.module.pay.convert.channel.PayChannelConvert; | @@ -22,7 +16,6 @@ import cn.iocoder.yudao.module.pay.convert.channel.PayChannelConvert; | ||
| 22 | import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO; | 16 | import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO; |
| 23 | import cn.iocoder.yudao.module.pay.dal.mysql.channel.PayChannelMapper; | 17 | import cn.iocoder.yudao.module.pay.dal.mysql.channel.PayChannelMapper; |
| 24 | import cn.iocoder.yudao.module.pay.framework.pay.wallet.WalletPayClient; | 18 | import cn.iocoder.yudao.module.pay.framework.pay.wallet.WalletPayClient; |
| 25 | -import cn.iocoder.yudao.module.pay.service.wallet.PayWalletService; | ||
| 26 | import lombok.Getter; | 19 | import lombok.Getter; |
| 27 | import lombok.Setter; | 20 | import lombok.Setter; |
| 28 | import lombok.extern.slf4j.Slf4j; | 21 | import lombok.extern.slf4j.Slf4j; |
| @@ -64,14 +57,15 @@ public class PayChannelServiceImpl implements PayChannelService { | @@ -64,14 +57,15 @@ public class PayChannelServiceImpl implements PayChannelService { | ||
| 64 | 57 | ||
| 65 | @Resource | 58 | @Resource |
| 66 | private Validator validator; | 59 | private Validator validator; |
| 67 | - @Resource | ||
| 68 | - private PayWalletService payWalletService; | ||
| 69 | 60 | ||
| 70 | /** | 61 | /** |
| 71 | * 初始化 {@link #payClientFactory} 缓存 | 62 | * 初始化 {@link #payClientFactory} 缓存 |
| 72 | */ | 63 | */ |
| 73 | @PostConstruct | 64 | @PostConstruct |
| 74 | public void initLocalCache() { | 65 | public void initLocalCache() { |
| 66 | + // 注册钱包支付 Class | ||
| 67 | + payClientFactory.registerPayClientClass(PayChannelEnum.WALLET, WalletPayClient.class); | ||
| 68 | + | ||
| 75 | // 注意:忽略自动多租户,因为要全局初始化缓存 | 69 | // 注意:忽略自动多租户,因为要全局初始化缓存 |
| 76 | TenantUtils.executeIgnore(() -> { | 70 | TenantUtils.executeIgnore(() -> { |
| 77 | // 第一步:查询数据 | 71 | // 第一步:查询数据 |
| @@ -85,55 +79,13 @@ public class PayChannelServiceImpl implements PayChannelService { | @@ -85,55 +79,13 @@ public class PayChannelServiceImpl implements PayChannelService { | ||
| 85 | log.error("[支付模块 yudao-module-pay - 表结构未导入][参考 https://doc.iocoder.cn/pay/build/ 开启]"); | 79 | log.error("[支付模块 yudao-module-pay - 表结构未导入][参考 https://doc.iocoder.cn/pay/build/ 开启]"); |
| 86 | } | 80 | } |
| 87 | log.info("[initLocalCache][缓存支付渠道,数量为:{}]", channels.size()); | 81 | log.info("[initLocalCache][缓存支付渠道,数量为:{}]", channels.size()); |
| 88 | - // 第二步:构建缓存:创建或更新支付 Client | ||
| 89 | - channels.forEach(payChannel ->{ | ||
| 90 | - AbstractPayClient<PayClientConfig> payClient = createPayClient(payChannel.getId(), payChannel.getCode(), payChannel.getConfig()); | ||
| 91 | - payClientFactory.addOrUpdatePayClient(payChannel.getId(), payClient); | ||
| 92 | 82 | ||
| 93 | - }); | 83 | + // 第二步:构建缓存:创建或更新支付 Client |
| 84 | + channels.forEach(payChannel -> payClientFactory.createOrUpdatePayClient(payChannel.getId(), | ||
| 85 | + payChannel.getCode(), payChannel.getConfig())); | ||
| 94 | this.channelCache = channels; | 86 | this.channelCache = channels; |
| 95 | }); | 87 | }); |
| 96 | } | 88 | } |
| 97 | - @SuppressWarnings("unchecked") | ||
| 98 | - private <Config extends PayClientConfig> AbstractPayClient<Config> createPayClient( | ||
| 99 | - Long channelId, String channelCode, Config config) { | ||
| 100 | - PayChannelEnum channelEnum = PayChannelEnum.getByCode(channelCode); | ||
| 101 | - Assert.notNull(channelEnum, String.format("支付渠道(%s) 为空", channelEnum)); | ||
| 102 | - // 创建客户端 | ||
| 103 | - switch (channelEnum) { | ||
| 104 | - // 微信支付 | ||
| 105 | - case WX_PUB: | ||
| 106 | - return (AbstractPayClient<Config>) new WxPubPayClient(channelId, (WxPayClientConfig) config); | ||
| 107 | - case WX_LITE: | ||
| 108 | - return (AbstractPayClient<Config>) new WxLitePayClient(channelId, (WxPayClientConfig) config); | ||
| 109 | - case WX_APP: | ||
| 110 | - return (AbstractPayClient<Config>) new WxAppPayClient(channelId, (WxPayClientConfig) config); | ||
| 111 | - case WX_BAR: | ||
| 112 | - return (AbstractPayClient<Config>) new WxBarPayClient(channelId, (WxPayClientConfig) config); | ||
| 113 | - case WX_NATIVE: | ||
| 114 | - return (AbstractPayClient<Config>) new WxNativePayClient(channelId, (WxPayClientConfig) config); | ||
| 115 | - // 支付宝支付 | ||
| 116 | - case ALIPAY_WAP: | ||
| 117 | - return (AbstractPayClient<Config>) new AlipayWapPayClient(channelId, (AlipayPayClientConfig) config); | ||
| 118 | - case ALIPAY_QR: | ||
| 119 | - return (AbstractPayClient<Config>) new AlipayQrPayClient(channelId, (AlipayPayClientConfig) config); | ||
| 120 | - case ALIPAY_APP: | ||
| 121 | - return (AbstractPayClient<Config>) new AlipayAppPayClient(channelId, (AlipayPayClientConfig) config); | ||
| 122 | - case ALIPAY_PC: | ||
| 123 | - return (AbstractPayClient<Config>) new AlipayPcPayClient(channelId, (AlipayPayClientConfig) config); | ||
| 124 | - case ALIPAY_BAR: | ||
| 125 | - return (AbstractPayClient<Config>) new AlipayBarPayClient(channelId, (AlipayPayClientConfig) config); | ||
| 126 | - // 其它支付 | ||
| 127 | - case MOCK: | ||
| 128 | - return (AbstractPayClient<Config>) new MockPayClient(channelId, (MockPayClientConfig) config); | ||
| 129 | - case WALLET: | ||
| 130 | - return (AbstractPayClient<Config>) new WalletPayClient( | ||
| 131 | - channelId, channelCode, (NonePayClientConfig) config, payWalletService); | ||
| 132 | - } | ||
| 133 | - // 创建失败,错误日志 + 抛出异常 | ||
| 134 | - log.error("[createPayClient][配置({}) 找不到合适的客户端实现]", config); | ||
| 135 | - throw new IllegalArgumentException(String.format("配置(%s) 找不到合适的客户端实现", config)); | ||
| 136 | - } | ||
| 137 | 89 | ||
| 138 | /** | 90 | /** |
| 139 | * 通过定时任务轮询,刷新缓存 | 91 | * 通过定时任务轮询,刷新缓存 |