优化搜索关键字不能为空格。优化管理端商品上下架时没有清空goods缓存问题

This commit is contained in:
paulGao 2022-04-26 11:37:48 +08:00
parent b2a8578f43
commit 27112e35b3
2 changed files with 4 additions and 1 deletions

View File

@ -363,6 +363,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
queryWrapper.in(Goods::getId, goodsIds);
List<Goods> goodsList = this.list(queryWrapper);
for (Goods goods : goodsList) {
if (GoodsStatusEnum.DOWN.equals(goodsStatusEnum)) {
cache.remove(CachePrefix.GOODS.getPrefix() + goods.getId());
}
goodsSkuService.updateGoodsSkuStatus(goods);
}
if (GoodsStatusEnum.DOWN.equals(goodsStatusEnum)) {

View File

@ -88,7 +88,7 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService {
if (!exists) {
esGoodsIndexService.init();
}
if (CharSequenceUtil.isNotEmpty(searchDTO.getKeyword())) {
if (CharSequenceUtil.isNotBlank(searchDTO.getKeyword())) {
cache.incrementScore(CachePrefix.HOT_WORD.getPrefix(), searchDTO.getKeyword());
}
NativeSearchQueryBuilder searchQueryBuilder = createSearchQueryBuilder(searchDTO, pageVo);