master
parent
54e2ff99bd
commit
a2a205eefb
|
@ -94,16 +94,14 @@ public class GenController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 导入表结构(保存)
|
* 导入表结构(保存)
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("tool:gen:import")
|
// @RequiresPermissions("tool:gen:import")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.IMPORT)
|
@Log(title = "代码生成", businessType = BusinessType.IMPORT)
|
||||||
@PostMapping("/importTable")
|
@PostMapping("/importTable")
|
||||||
public Result importTableSave(@RequestParam("tables") String tables, @RequestParam("dbName") String dbName)
|
public Result importTableSave(@RequestParam("tables") String tables, @RequestParam("dbName") String dbName)
|
||||||
{
|
{
|
||||||
String[] tableNames = Convert.toStrArray(tables);
|
String[] tableNames = Convert.toStrArray(tables);
|
||||||
// 查询表信息
|
// 查询表信息
|
||||||
System.out.println(dbName +" "+ tables +" "+ tableNames);
|
|
||||||
List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames,dbName);
|
List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames,dbName);
|
||||||
System.out.println(tableList);
|
|
||||||
genTableService.importGenTable(tableList);
|
genTableService.importGenTable(tableList);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,16 +168,12 @@ public class GenTableServiceImpl implements IGenTableService
|
||||||
{
|
{
|
||||||
String dbName = table.getDbName();
|
String dbName = table.getDbName();
|
||||||
String tableName = table.getTableName();
|
String tableName = table.getTableName();
|
||||||
System.out.println(1);
|
|
||||||
GenUtils.initTable(table, operName);
|
GenUtils.initTable(table, operName);
|
||||||
System.out.println(2);
|
|
||||||
int row = genTableMapper.insertGenTable(table);
|
int row = genTableMapper.insertGenTable(table);
|
||||||
System.out.println(3);
|
|
||||||
if (row > 0)
|
if (row > 0)
|
||||||
{
|
{
|
||||||
// 保存列信息
|
// 保存列信息
|
||||||
List<GenTableColumn> genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName, dbName);
|
List<GenTableColumn> genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName, dbName);
|
||||||
System.out.println(4);
|
|
||||||
for (GenTableColumn column : genTableColumns)
|
for (GenTableColumn column : genTableColumns)
|
||||||
{
|
{
|
||||||
GenUtils.initColumnField(column, table);
|
GenUtils.initColumnField(column, table);
|
||||||
|
|
|
@ -160,7 +160,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="tableComment != null and tableComment != ''">table_comment,</if>
|
<if test="tableComment != null and tableComment != ''">table_comment,</if>
|
||||||
<if test="className != null and className != ''">class_name,</if>
|
<if test="className != null and className != ''">class_name,</if>
|
||||||
<if test="tplCategory != null and tplCategory != ''">tpl_category,</if>
|
<if test="tplCategory != null and tplCategory != ''">tpl_category,</if>
|
||||||
<if test="tplWebType != null and tplWebType != ''">tpl_web_type,</if>
|
|
||||||
<if test="packageName != null and packageName != ''">package_name,</if>
|
<if test="packageName != null and packageName != ''">package_name,</if>
|
||||||
<if test="moduleName != null and moduleName != ''">module_name,</if>
|
<if test="moduleName != null and moduleName != ''">module_name,</if>
|
||||||
<if test="businessName != null and businessName != ''">business_name,</if>
|
<if test="businessName != null and businessName != ''">business_name,</if>
|
||||||
|
@ -177,7 +176,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="tableComment != null and tableComment != ''">#{tableComment},</if>
|
<if test="tableComment != null and tableComment != ''">#{tableComment},</if>
|
||||||
<if test="className != null and className != ''">#{className},</if>
|
<if test="className != null and className != ''">#{className},</if>
|
||||||
<if test="tplCategory != null and tplCategory != ''">#{tplCategory},</if>
|
<if test="tplCategory != null and tplCategory != ''">#{tplCategory},</if>
|
||||||
<if test="tplWebType != null and tplWebType != ''">#{tplWebType},</if>
|
|
||||||
<if test="packageName != null and packageName != ''">#{packageName},</if>
|
<if test="packageName != null and packageName != ''">#{packageName},</if>
|
||||||
<if test="moduleName != null and moduleName != ''">#{moduleName},</if>
|
<if test="moduleName != null and moduleName != ''">#{moduleName},</if>
|
||||||
<if test="businessName != null and businessName != ''">#{businessName},</if>
|
<if test="businessName != null and businessName != ''">#{businessName},</if>
|
||||||
|
|
Loading…
Reference in New Issue