diff --git a/framework/src/main/java/cn/lili/modules/system/service/RegionService.java b/framework/src/main/java/cn/lili/modules/system/service/RegionService.java index 3696d7c3..8d57be21 100644 --- a/framework/src/main/java/cn/lili/modules/system/service/RegionService.java +++ b/framework/src/main/java/cn/lili/modules/system/service/RegionService.java @@ -19,6 +19,15 @@ import java.util.Map; @CacheConfig(cacheNames = "{regions}") public interface RegionService extends IService { + + /** + * 更新地区 + * + * @param region 地区 + * @return + */ + @CacheEvict(allEntries = true) + boolean updateById(Region region); /** * 同步行政数据 * diff --git a/framework/src/main/java/cn/lili/modules/system/serviceimpl/RegionServiceImpl.java b/framework/src/main/java/cn/lili/modules/system/serviceimpl/RegionServiceImpl.java index cccf1860..d23d9659 100644 --- a/framework/src/main/java/cn/lili/modules/system/serviceimpl/RegionServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/system/serviceimpl/RegionServiceImpl.java @@ -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 impleme @Autowired private Cache cache; + + @Override + @Transactional + public boolean updateById(Region region) { + return super.updateById(region); + } + @Override public void synchronizationData(String url) { try {