diff --git a/yudao-module-mall/yudao-module-trade-server/src/main/java/cn/iocoder/yudao/module/trade/framework/delivery/config/ExpressClientConfig.java b/yudao-module-mall/yudao-module-trade-server/src/main/java/cn/iocoder/yudao/module/trade/framework/delivery/config/ExpressClientConfig.java index 2799c3f1c..2f04c7fb6 100644 --- a/yudao-module-mall/yudao-module-trade-server/src/main/java/cn/iocoder/yudao/module/trade/framework/delivery/config/ExpressClientConfig.java +++ b/yudao-module-mall/yudao-module-trade-server/src/main/java/cn/iocoder/yudao/module/trade/framework/delivery/config/ExpressClientConfig.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.trade.framework.delivery.config; import cn.iocoder.yudao.module.trade.framework.delivery.core.client.ExpressClient; import cn.iocoder.yudao.module.trade.framework.delivery.core.client.ExpressClientFactory; import cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl.ExpressClientFactoryImpl; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.client.RestTemplate; @@ -18,6 +19,11 @@ import org.springframework.web.client.RestTemplate; @Configuration(proxyBeanMethods = false) public class ExpressClientConfig { + @Bean + @Qualifier("expressRestTemplate") + public RestTemplate expressRestTemplate() { + return new RestTemplate(); + } @Bean public ExpressClientFactory expressClientFactory(TradeExpressProperties tradeExpressProperties, RestTemplate restTemplate) { diff --git a/yudao-module-mall/yudao-module-trade-server/src/main/java/cn/iocoder/yudao/module/trade/framework/delivery/core/client/impl/ExpressClientFactoryImpl.java b/yudao-module-mall/yudao-module-trade-server/src/main/java/cn/iocoder/yudao/module/trade/framework/delivery/core/client/impl/ExpressClientFactoryImpl.java index 2cd523c2b..8438c5979 100644 --- a/yudao-module-mall/yudao-module-trade-server/src/main/java/cn/iocoder/yudao/module/trade/framework/delivery/core/client/impl/ExpressClientFactoryImpl.java +++ b/yudao-module-mall/yudao-module-trade-server/src/main/java/cn/iocoder/yudao/module/trade/framework/delivery/core/client/impl/ExpressClientFactoryImpl.java @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl.kd100.K import cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl.kdniao.KdNiaoExpressClient; import cn.iocoder.yudao.module.trade.framework.delivery.core.enums.ExpressClientEnum; import lombok.AllArgsConstructor; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.web.client.RestTemplate; import java.util.Map; @@ -24,6 +25,7 @@ public class ExpressClientFactoryImpl implements ExpressClientFactory { private final Map clientMap = new ConcurrentHashMap<>(8); private final TradeExpressProperties tradeExpressProperties; + @Qualifier("expressRestTemplate") private final RestTemplate restTemplate; @Override