fix: 修改商品后清除商品缓存,修改Store、StoreServiceImpl的注释
This commit is contained in:
parent
5c164f89cc
commit
8f516f7be7
@ -1,12 +1,21 @@
|
||||
package cn.lili.event.impl;
|
||||
|
||||
|
||||
import cn.lili.cache.Cache;
|
||||
import cn.lili.cache.CachePrefix;
|
||||
import cn.lili.event.GoodsCommentCompleteEvent;
|
||||
import cn.lili.event.StoreSettingChangeEvent;
|
||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
||||
import cn.lili.modules.goods.service.GoodsSkuService;
|
||||
import cn.lili.modules.member.entity.dos.MemberEvaluation;
|
||||
import cn.lili.modules.store.entity.dos.Store;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品SKU变化
|
||||
*
|
||||
@ -14,7 +23,7 @@ import org.springframework.stereotype.Service;
|
||||
* @since 2020-07-03 11:20
|
||||
*/
|
||||
@Service
|
||||
public class GoodsSkuExecute implements GoodsCommentCompleteEvent {
|
||||
public class GoodsSkuExecute implements GoodsCommentCompleteEvent, StoreSettingChangeEvent {
|
||||
|
||||
/**
|
||||
* 商品
|
||||
@ -22,9 +31,23 @@ public class GoodsSkuExecute implements GoodsCommentCompleteEvent {
|
||||
@Autowired
|
||||
private GoodsSkuService goodsSkuService;
|
||||
|
||||
@Autowired
|
||||
private Cache cache;
|
||||
|
||||
@Override
|
||||
public void goodsComment(MemberEvaluation memberEvaluation) {
|
||||
goodsSkuService.updateGoodsSkuCommentNum(memberEvaluation.getSkuId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void storeSettingChange(Store store) {
|
||||
//修改数据后,清除商品索引
|
||||
GoodsSearchParams goodsSearchParams = new GoodsSearchParams();
|
||||
goodsSearchParams.setStoreId(store.getId());
|
||||
List<String> goodsSkuKeys = new ArrayList<>();
|
||||
for (GoodsSku goodsSku : goodsSkuService.getGoodsSkuByList(goodsSearchParams)) {
|
||||
goodsSkuKeys.add(CachePrefix.GOODS_SKU.getPrefix()+goodsSku.getId());
|
||||
}
|
||||
cache.multiDel(goodsSkuKeys);
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ public class Store extends BaseEntity {
|
||||
@ApiModelProperty(value = "服务评分")
|
||||
private Double serviceScore;
|
||||
|
||||
@ApiModelProperty(value = "物流描述")
|
||||
@ApiModelProperty(value = "物流评分")
|
||||
private Double deliveryScore;
|
||||
|
||||
@ApiModelProperty(value = "商品数量")
|
||||
|
@ -189,7 +189,7 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店铺详细细腻
|
||||
* 修改店铺详细信息
|
||||
*
|
||||
* @param storeEditDTO 修改店铺信息
|
||||
*/
|
||||
@ -304,7 +304,7 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
||||
|
||||
//获取当前操作的店铺
|
||||
Store store = getStoreByMember();
|
||||
//校验迪纳普状态
|
||||
//校验店铺状态
|
||||
checkStoreStatus(store);
|
||||
StoreDetail storeDetail = storeDetailService.getStoreDetail(store.getId());
|
||||
//设置店铺的银行信息
|
||||
@ -317,7 +317,7 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
||||
//获取当前操作的店铺
|
||||
Store store = getStoreByMember();
|
||||
|
||||
//校验迪纳普状态
|
||||
//校验店铺状态
|
||||
checkStoreStatus(store);
|
||||
BeanUtil.copyProperties(storeOtherInfoDTO, store);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user