修复代码生成导入表结构出现异常页面不提醒问题
This commit is contained in:
parent
7ce70965c8
commit
7dde164be0
@ -80,6 +80,7 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
* @param genTable 业务信息
|
||||
* @return 数据库表集合
|
||||
*/
|
||||
@Override
|
||||
public List<GenTable> selectDbTableList(GenTable genTable)
|
||||
{
|
||||
return genTableMapper.selectDbTableList(genTable);
|
||||
@ -91,6 +92,7 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
* @param tableNames 表名称组
|
||||
* @return 数据库表集合
|
||||
*/
|
||||
@Override
|
||||
public List<GenTable> selectDbTableListByNames(String[] tableNames)
|
||||
{
|
||||
return genTableMapper.selectDbTableListByNames(tableNames);
|
||||
@ -121,7 +123,7 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
/**
|
||||
* 删除业务对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @param tableIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@ -142,9 +144,9 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
public void importGenTable(List<GenTable> tableList)
|
||||
{
|
||||
String operName = SecurityUtils.getUsername();
|
||||
for (GenTable table : tableList)
|
||||
try
|
||||
{
|
||||
try
|
||||
for (GenTable table : tableList)
|
||||
{
|
||||
String tableName = table.getTableName();
|
||||
GenUtils.initTable(table, operName);
|
||||
@ -160,10 +162,10 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("表名 " + table.getTableName() + " 导入失败:", e);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new CustomException("导入失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,6 +175,7 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
* @param tableId 表编号
|
||||
* @return 预览数据列表
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> previewCode(Long tableId)
|
||||
{
|
||||
Map<String, String> dataMap = new LinkedHashMap<>();
|
||||
@ -265,7 +268,7 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table)));
|
||||
IOUtils.write(sw.toString(), zip, Constants.UTF8);
|
||||
IOUtils.closeQuietly(sw);
|
||||
zip.flush();
|
||||
zip.flush();
|
||||
zip.closeEntry();
|
||||
}
|
||||
catch (IOException e)
|
||||
@ -280,6 +283,7 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
*
|
||||
* @param genTable 业务信息
|
||||
*/
|
||||
@Override
|
||||
public void validateEdit(GenTable genTable)
|
||||
{
|
||||
if (GenConstants.TPL_TREE.equals(genTable.getTplCategory()))
|
||||
@ -304,7 +308,7 @@ public class GenTableServiceImpl implements IGenTableService
|
||||
/**
|
||||
* 设置主键列信息
|
||||
*
|
||||
* @param genTable 业务表信息
|
||||
* @param table 业务表信息
|
||||
* @param columns 业务字段列表
|
||||
*/
|
||||
public void setPkColumn(GenTable table, List<GenTableColumn> columns)
|
||||
|
Loading…
Reference in New Issue
Block a user