二级缓存手动清理

This commit is contained in:
wangliwen 2022-06-27 17:59:30 +08:00
parent e1fb7b0b9e
commit f4670d45cd
1 changed files with 4 additions and 4 deletions

View File

@ -158,7 +158,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Override
@Transactional
@CacheEvict(key = selectDeptListKey, allEntries = true)
@CacheEvict(cacheNames = {selectDeptListKey}, allEntries = true)
public void insertWithAttrs(ResourceDTO dto) {
ResourceEntity resourceEntity = new ResourceEntity();
BeanUtils.copyProperties(dto, resourceEntity);
@ -186,7 +186,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Override
@Transactional
@CacheEvict(key = selectDeptListKey, allEntries = true)
@CacheEvict(allEntries = true)
public void deleteWithAttrs(JSONObject jsonObject) {
JSONArray jsonArray = jsonObject.getJSONArray("ids");
List<Long> idList = jsonArray.toJavaList(Long.class);
@ -200,7 +200,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Override
@Transactional
@CacheEvict(key = selectDeptListKey, allEntries = true)
@CacheEvict(allEntries = true)
public void updateWithAttrs(ResourceDTO dto) {
ResourceEntity resourceEntity = new ResourceEntity();
BeanUtils.copyProperties(dto, resourceEntity);
@ -763,7 +763,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
* 同步知识库
*/
@Override
@CacheEvict(key = selectDeptListKey, allEntries = true)
@CacheEvict(allEntries = true)
public void KnowledgeBase() {
final List<String> knowledgeUUID = jdbcTemplate.queryForList("SELECT note1 FROM tb_data_resource WHERE type ='知识库' AND note1 IS NOT NULL FOR UPDATE;", String.class).stream().distinct().collect(Collectors.toList());
final int pageSize = 100;