From d0b970a2df5b4eab882bbc67b55bee6cc4a82949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Sat, 27 Jul 2024 14:01:22 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=20=E8=A1=A8=E7=BB=93=E6=9E=84=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dromara/gen/service/GenTableServiceImpl.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/service/GenTableServiceImpl.java b/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/service/GenTableServiceImpl.java index f18bc50f..85d0aad6 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/service/GenTableServiceImpl.java +++ b/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/service/GenTableServiceImpl.java @@ -17,6 +17,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.anyline.metadata.Column; import org.anyline.metadata.Table; +import org.anyline.proxy.CacheProxy; import org.anyline.proxy.ServiceProxy; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; @@ -293,11 +294,9 @@ public class GenTableServiceImpl implements IGenTableService { */ @DS("#dataName") private List selectDbTableColumnsByName(String tableName, String dataName) { - Table table = ServiceProxy.metadata().table(tableName); - if (Objects.isNull(table)) { - return new ArrayList<>(); - } - LinkedHashMap columns = table.getColumns(); + // 清理anyline缓存 + CacheProxy.clear(); + LinkedHashMap columns = ServiceProxy.metadata().columns(tableName); List tableColumns = new ArrayList<>(); columns.forEach((columnName, column) -> { GenTableColumn tableColumn = new GenTableColumn();