fix:地区修改后不生效,需要清空缓存才能得到最新的数据问题处理
This commit is contained in:
parent
9f17dcafbb
commit
9dd6bc2d6f
@ -19,6 +19,15 @@ import java.util.Map;
|
||||
@CacheConfig(cacheNames = "{regions}")
|
||||
public interface RegionService extends IService<Region> {
|
||||
|
||||
|
||||
/**
|
||||
* 更新地区
|
||||
*
|
||||
* @param region 地区
|
||||
* @return
|
||||
*/
|
||||
@CacheEvict(allEntries = true)
|
||||
boolean updateById(Region region);
|
||||
/**
|
||||
* 同步行政数据
|
||||
*
|
||||
|
@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@ -36,6 +37,13 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
|
||||
@Autowired
|
||||
private Cache cache;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean updateById(Region region) {
|
||||
return super.updateById(region);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void synchronizationData(String url) {
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user