From adc191f03e20cded2fec0c9c3ca0f09df78528af Mon Sep 17 00:00:00 2001 From: Jary Date: Mon, 20 Oct 2025 22:21:47 +0800 Subject: [PATCH] =?UTF-8?q?fix#9002=20=E8=A7=A3=E5=86=B3=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=E6=9F=A5=E8=AF=A2=E5=87=BA=E7=8E=B0=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E4=B9=8B=E5=90=8E=EF=BC=8C=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=81=A2=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/service/impl/SysDictServiceImpl.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDictServiceImpl.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDictServiceImpl.java index 8d76a2a192..441aafcc5b 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDictServiceImpl.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDictServiceImpl.java @@ -376,11 +376,19 @@ public List queryTableDictTextByKeys(String table, String text, Strin if (isCustomDataSource) { DynamicDataSourceContextHolder.push(dataSource); } - List restData = sysDictMapper.queryTableDictByKeysAndFilterSql(table, text, code, filterSql, codeValues); - // 清理自定义的数据源 - if (isCustomDataSource) { - DynamicDataSourceContextHolder.clear(); + //update-begin---author:jarysun ---date:20251020 for:[issues/#9002]解决表字典查询出现异常之后,数据源不能恢复问题------------ + List restData = null; + + try { + restData = sysDictMapper.queryTableDictByKeysAndFilterSql(table, text, code, filterSql, codeValues); + } finally { + // 清理自定义的数据源 + if (isCustomDataSource) { + DynamicDataSourceContextHolder.clear(); + } } + //update-end---author:jarysun ---date:20251020 for:[issues/#9002]解决表字典查询出现异常之后,数据源不能恢复问题------------ + return restData; //update-end---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------ //update-end-author:taoyan date:20220113 for: @dict注解支持 dicttable 设置where条件