Browse Source

同步表结构不存在,提示错误信息

RuoYi 4 years ago
parent
commit
9f21f8816a

+ 4 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/service/impl/GenTableServiceImpl.java

@@ -290,6 +290,10 @@ public class GenTableServiceImpl implements IGenTableService
         List<String> tableColumnNames = tableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList());
 
         List<GenTableColumn> dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName);
+        if (StringUtils.isEmpty(dbTableColumns))
+        {
+            throw new BusinessException("同步数据失败,原表结构不存在");
+        }
         List<String> dbTableColumnNames = dbTableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList());
 
         dbTableColumns.forEach(column -> {