|
|
@@ -287,7 +287,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
287
|
287
|
{
|
|
288
|
288
|
GenTable table = genTableMapper.selectGenTableByName(tableName);
|
|
289
|
289
|
List<GenTableColumn> tableColumns = table.getColumns();
|
|
290
|
|
- Map<String, GenTableColumn> tableColumnMap = tableColumns.stream().collect(Collectors.toMap(GenTableColumn::getColumnName, Function.identity()));
|
|
|
290
|
+ Map<String, GenTableColumn> tableColumnMap = tableColumns.stream().collect(Collectors.toMap(GenTableColumn::getColumnName, Function.identity()));
|
|
291
|
291
|
|
|
292
|
292
|
List<GenTableColumn> dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName);
|
|
293
|
293
|
if (StringUtils.isEmpty(dbTableColumns))
|
|
|
@@ -302,12 +302,15 @@ public class GenTableServiceImpl implements IGenTableService
|
|
302
|
302
|
{
|
|
303
|
303
|
GenTableColumn prevColumn = tableColumnMap.get(column.getColumnName());
|
|
304
|
304
|
column.setColumnId(prevColumn.getColumnId());
|
|
305
|
|
- if (column.isList()) {
|
|
|
305
|
+ if (column.isList())
|
|
|
306
|
+ {
|
|
306
|
307
|
// 如果是列表,继续保留字典类型
|
|
307
|
308
|
column.setDictType(prevColumn.getDictType());
|
|
308
|
309
|
}
|
|
309
|
310
|
genTableColumnMapper.updateGenTableColumn(column);
|
|
310
|
|
- } else {
|
|
|
311
|
+ }
|
|
|
312
|
+ else
|
|
|
313
|
+ {
|
|
311
|
314
|
genTableColumnMapper.insertGenTableColumn(column);
|
|
312
|
315
|
}
|
|
313
|
316
|
});
|
|
|
@@ -368,7 +371,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
368
|
371
|
zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table)));
|
|
369
|
372
|
IOUtils.write(sw.toString(), zip, Constants.UTF8);
|
|
370
|
373
|
IOUtils.closeQuietly(sw);
|
|
371
|
|
- zip.flush();
|
|
|
374
|
+ zip.flush();
|
|
372
|
375
|
zip.closeEntry();
|
|
373
|
376
|
}
|
|
374
|
377
|
catch (IOException e)
|
|
|
@@ -451,6 +454,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
451
|
454
|
}
|
|
452
|
455
|
}
|
|
453
|
456
|
}
|
|
|
457
|
+
|
|
454
|
458
|
/**
|
|
455
|
459
|
* 设置主子表信息
|
|
456
|
460
|
*
|
|
|
@@ -480,7 +484,7 @@ public class GenTableServiceImpl implements IGenTableService
|
|
480
|
484
|
String treeName = paramsObj.getString(GenConstants.TREE_NAME);
|
|
481
|
485
|
String parentMenuId = paramsObj.getString(GenConstants.PARENT_MENU_ID);
|
|
482
|
486
|
String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME);
|
|
483
|
|
-
|
|
|
487
|
+
|
|
484
|
488
|
genTable.setTreeCode(treeCode);
|
|
485
|
489
|
genTable.setTreeParentCode(treeParentCode);
|
|
486
|
490
|
genTable.setTreeName(treeName);
|