Commit 392d0842 authored by zhengyi's avatar zhengyi

修改缓存条件

parent b6bbaf5c
...@@ -62,7 +62,7 @@ public class WarehouseServiceImpl implements WarehouseService { ...@@ -62,7 +62,7 @@ public class WarehouseServiceImpl implements WarehouseService {
private DictDataApi dictDataApi; private DictDataApi dictDataApi;
@Override @Override
@CacheEvict(cacheNames = "jd:warehouse:tree", key = "'all'") @CacheEvict(cacheNames = "jd:warehouse:tree", key = "#createReqVO.tradeType")
public Long createWarehouse(WarehouseCreateReqVO createReqVO) { public Long createWarehouse(WarehouseCreateReqVO createReqVO) {
// 插入 // 插入
WarehouseDO warehouse = WarehouseConvert.INSTANCE.convert(createReqVO); WarehouseDO warehouse = WarehouseConvert.INSTANCE.convert(createReqVO);
...@@ -73,7 +73,7 @@ public class WarehouseServiceImpl implements WarehouseService { ...@@ -73,7 +73,7 @@ public class WarehouseServiceImpl implements WarehouseService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@CacheEvict(cacheNames = "jd:warehouse:tree", key = "'all'") @CacheEvict(cacheNames = "jd:warehouse:tree", key = "#updateReqVO.tradeType")
public void updateWarehouse(WarehouseUpdateReqVO updateReqVO) { public void updateWarehouse(WarehouseUpdateReqVO updateReqVO) {
Long id = updateReqVO.getId(); Long id = updateReqVO.getId();
// 校验存在 // 校验存在
...@@ -512,7 +512,7 @@ public class WarehouseServiceImpl implements WarehouseService { ...@@ -512,7 +512,7 @@ public class WarehouseServiceImpl implements WarehouseService {
} }
@Override @Override
@Cacheable(cacheNames = "jd:warehouse:tree", key = "'all'") @Cacheable(cacheNames = "jd:warehouse:tree", key = "#tradeType")
public List<WarehouseTreeVO> getWarehouseTreeList(Integer tradeType) { public List<WarehouseTreeVO> getWarehouseTreeList(Integer tradeType) {
List<WarehouseTreeVO> list = warehouseMapper.getWarehouseTreeList(tradeType); List<WarehouseTreeVO> list = warehouseMapper.getWarehouseTreeList(tradeType);
Map<Long, List<WarehouseTreeVO>> shiMap = list.stream() 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