From 9dd6bc2d6f74743020982666f1510fd9bf98ca32 Mon Sep 17 00:00:00 2001 From: Chopper711 Date: Thu, 3 Aug 2023 12:57:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=9C=B0=E5=8C=BA=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=90=8E=E4=B8=8D=E7=94=9F=E6=95=88=EF=BC=8C=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=B8=85=E7=A9=BA=E7=BC=93=E5=AD=98=E6=89=8D=E8=83=BD=E5=BE=97?= =?UTF-8?q?=E5=88=B0=E6=9C=80=E6=96=B0=E7=9A=84=E6=95=B0=E6=8D=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/lili/modules/system/service/RegionService.java | 9 +++++++++ .../modules/system/serviceimpl/RegionServiceImpl.java | 8 ++++++++ 2 files changed, 17 insertions(+) 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 {