From bc56aae219a574eabfdb391d219116baaa8ba5ed Mon Sep 17 00:00:00 2001
From: 若依 <yzz_ivy@163.com>
Date: 星期五, 10 七月 2020 10:28:57 +0800
Subject: [PATCH] !33 RedisCache中所有方法参数添加final,并优化list和set存取效率,添加其它常用redis方法 RedisCache中所有方法参数添加final,并优化list和set存取效率,添加其它常用redis方法
---
ruoyi/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/ruoyi/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java
index 09d1e89..b10c549 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/tool/gen/service/GenTableServiceImpl.java
@@ -80,6 +80,7 @@
* @param genTable 业务信息
* @return 数据库表集合
*/
+ @Override
public List<GenTable> selectDbTableList(GenTable genTable)
{
return genTableMapper.selectDbTableList(genTable);
@@ -91,6 +92,7 @@
* @param tableNames 表名称组
* @return 数据库表集合
*/
+ @Override
public List<GenTable> selectDbTableListByNames(String[] tableNames)
{
return genTableMapper.selectDbTableListByNames(tableNames);
@@ -121,7 +123,7 @@
/**
* 删除业务对象
*
- * @param ids 需要删除的数据ID
+ * @param tableIds 需要删除的数据ID
* @return 结果
*/
@Override
@@ -142,9 +144,9 @@
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 @@
}
}
}
- catch (Exception e)
- {
- log.error("表名 " + table.getTableName() + " 导入失败:", e);
- }
+ }
+ catch (Exception e)
+ {
+ throw new CustomException("导入失败:" + e.getMessage());
}
}
@@ -173,6 +175,7 @@
* @param tableId 表编号
* @return 预览数据列表
*/
+ @Override
public Map<String, String> previewCode(Long tableId)
{
Map<String, String> dataMap = new LinkedHashMap<>();
@@ -262,6 +265,7 @@
zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table)));
IOUtils.write(sw.toString(), zip, Constants.UTF8);
IOUtils.closeQuietly(sw);
+ zip.flush();
zip.closeEntry();
}
catch (IOException e)
@@ -276,6 +280,7 @@
*
* @param genTable 业务信息
*/
+ @Override
public void validateEdit(GenTable genTable)
{
if (GenConstants.TPL_TREE.equals(genTable.getTplCategory()))
@@ -300,7 +305,7 @@
/**
* 设置主键列信息
*
- * @param genTable 业务表信息
+ * @param table 业务表信息
* @param columns 业务字段列表
*/
public void setPkColumn(GenTable table, List<GenTableColumn> columns)
--
Gitblit v1.9.2