From 0788a57bece6b358c2f0fdda110a21ff87ca9e96 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 2 Jul 2020 16:09:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=AF=BC=E5=85=A5=E8=A1=A8=E7=BB=93=E6=9E=84=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E5=BC=82=E5=B8=B8=E9=A1=B5=E9=9D=A2=E4=B8=8D=E6=8F=90?= =?UTF-8?q?=E9=86=92=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/gen/service/GenTableServiceImpl.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/GenTableServiceImpl.java b/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/GenTableServiceImpl.java index c5dd359..817dd3a 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/GenTableServiceImpl.java +++ b/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/GenTableServiceImpl.java @@ -23,6 +23,7 @@ import com.ruoyi.common.core.constant.Constants; import com.ruoyi.common.core.constant.GenConstants; import com.ruoyi.common.core.exception.CustomException; import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.gen.domain.GenTable; import com.ruoyi.gen.domain.GenTableColumn; import com.ruoyi.gen.mapper.GenTableColumnMapper; @@ -142,10 +143,10 @@ public class GenTableServiceImpl implements IGenTableService @Transactional public void importGenTable(List tableList) { - String operName = ""; - for (GenTable table : tableList) + String operName = SecurityUtils.getUsername(); + try { - try + for (GenTable table : tableList) { String tableName = table.getTableName(); GenUtils.initTable(table, operName); @@ -161,10 +162,10 @@ public class GenTableServiceImpl implements IGenTableService } } } - catch (Exception e) - { - log.error("表名 " + table.getTableName() + " 导入失败:", e); - } + } + catch (Exception e) + { + throw new CustomException("导入失败:" + e.getMessage()); } }