From 4c09a559c4a1c40309b34d7a3ea7910306ebc601 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 17 Sep 2024 16:30:20 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=91=E5=95=86=E5=9F=8E=EF=BC=9A=E7=89=A9=E6=B5=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E3=80=81=E5=BE=AE=E4=BF=A1=E9=80=9A=E7=9F=A5=E7=9A=84?= =?UTF-8?q?=E7=BC=93=E5=AD=98=EF=BC=8C=E5=9B=A0=E4=B8=BA=20@Cacheable=20?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BD=BF=E7=94=A8=20condition=20=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=97=A0=E6=B3=95=E7=BC=93=E5=AD=98=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trade/service/order/TradeOrderQueryServiceImpl.java | 4 ++-- .../module/system/service/social/SocialClientServiceImpl.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderQueryServiceImpl.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderQueryServiceImpl.java index 68c549891..7f4b0e034 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderQueryServiceImpl.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderQueryServiceImpl.java @@ -23,10 +23,10 @@ import cn.iocoder.yudao.module.trade.framework.delivery.core.client.ExpressClien import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackQueryReqDTO; import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.ExpressTrackRespDTO; import cn.iocoder.yudao.module.trade.service.delivery.DeliveryExpressService; +import jakarta.annotation.Resource; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; import java.util.*; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; @@ -215,7 +215,7 @@ public class TradeOrderQueryServiceImpl implements TradeOrderQueryService { * @return 物流轨迹 */ @Cacheable(cacheNames = RedisKeyConstants.EXPRESS_TRACK, key = "#code + '-' + #logisticsNo + '-' + #receiverMobile", - condition = "#result != null && #result.length() > 0") + unless = "#result == null") public List getExpressTrackList(String code, String logisticsNo, String receiverMobile) { return expressClientFactory.getDefaultExpressClient().getExpressTrackList(new ExpressTrackQueryReqDTO() .setExpressCode(code).setLogisticsNo(logisticsNo).setPhone(receiverMobile)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java index ba86165c3..7095193ef 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java @@ -280,7 +280,8 @@ public class SocialClientServiceImpl implements SocialClientService { } @Override - @Cacheable(cacheNames = RedisKeyConstants.WXA_SUBSCRIBE_TEMPLATE, key = "#userType", condition = "#result != null") + @Cacheable(cacheNames = RedisKeyConstants.WXA_SUBSCRIBE_TEMPLATE, key = "#userType", + unless = "#result == null") public List getSubscribeTemplateList(Integer userType) { WxMaService service = getWxMaService(userType); try {