Commit 392d0842 authored by zhengyi's avatar zhengyi

修改缓存条件

parent b6bbaf5c
......@@ -62,7 +62,7 @@ public class WarehouseServiceImpl implements WarehouseService {
private DictDataApi dictDataApi;
@Override
@CacheEvict(cacheNames = "jd:warehouse:tree", key = "'all'")
@CacheEvict(cacheNames = "jd:warehouse:tree", key = "#createReqVO.tradeType")
public Long createWarehouse(WarehouseCreateReqVO createReqVO) {
// 插入
WarehouseDO warehouse = WarehouseConvert.INSTANCE.convert(createReqVO);
......@@ -73,7 +73,7 @@ public class WarehouseServiceImpl implements WarehouseService {
@Override
@Transactional(rollbackFor = Exception.class)
@CacheEvict(cacheNames = "jd:warehouse:tree", key = "'all'")
@CacheEvict(cacheNames = "jd:warehouse:tree", key = "#updateReqVO.tradeType")
public void updateWarehouse(WarehouseUpdateReqVO updateReqVO) {
Long id = updateReqVO.getId();
// 校验存在
......@@ -512,7 +512,7 @@ public class WarehouseServiceImpl implements WarehouseService {
}
@Override
@Cacheable(cacheNames = "jd:warehouse:tree", key = "'all'")
@Cacheable(cacheNames = "jd:warehouse:tree", key = "#tradeType")
public List<WarehouseTreeVO> getWarehouseTreeList(Integer tradeType) {
List<WarehouseTreeVO> list = warehouseMapper.getWarehouseTreeList(tradeType);
Map<Long, List<WarehouseTreeVO>> shiMap = list.stream()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment