| | |
| | | int row = genTableMapper.updateGenTable(genTable);
|
| | | if (row > 0)
|
| | | {
|
| | | for (GenTableColumn cenTableColumn : genTable.getColumns())
|
| | | for (GenTableColumn genTableColumn : genTable.getColumns())
|
| | | {
|
| | | genTableColumnMapper.updateGenTableColumn(cenTableColumn);
|
| | | genTableColumnMapper.updateGenTableColumn(genTableColumn);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | */
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void importGenTable(List<GenTable> tableList)
|
| | | public void importGenTable(List<GenTable> tableList, String tplWebType)
|
| | | {
|
| | | String operName = SecurityUtils.getUsername();
|
| | | try
|
| | |
| | | for (GenTable table : tableList)
|
| | | {
|
| | | String tableName = table.getTableName();
|
| | | table.setTplWebType(tplWebType);
|
| | | GenUtils.initTable(table, operName);
|
| | | int row = genTableMapper.insertGenTable(table);
|
| | | if (row > 0)
|
| | |
| | | {
|
| | | throw new ServiceException("树名称字段不能为空");
|
| | | }
|
| | | else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory()))
|
| | | }
|
| | | else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory()))
|
| | | {
|
| | | if (StringUtils.isEmpty(genTable.getSubTableName()))
|
| | | {
|
| | | if (StringUtils.isEmpty(genTable.getSubTableName()))
|
| | | {
|
| | | throw new ServiceException("关联子表的表名不能为空");
|
| | | }
|
| | | else if (StringUtils.isEmpty(genTable.getSubTableFkName()))
|
| | | {
|
| | | throw new ServiceException("子表关联的外键名不能为空");
|
| | | }
|
| | | throw new ServiceException("关联子表的表名不能为空");
|
| | | }
|
| | | else if (StringUtils.isEmpty(genTable.getSubTableFkName()))
|
| | | {
|
| | | throw new ServiceException("子表关联的外键名不能为空");
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | String treeCode = paramsObj.getString(GenConstants.TREE_CODE);
|
| | | String treeParentCode = paramsObj.getString(GenConstants.TREE_PARENT_CODE);
|
| | | String treeName = paramsObj.getString(GenConstants.TREE_NAME);
|
| | | String parentMenuId = paramsObj.getString(GenConstants.PARENT_MENU_ID);
|
| | | Long parentMenuId = paramsObj.getLongValue(GenConstants.PARENT_MENU_ID);
|
| | | String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME);
|
| | |
|
| | | genTable.setTreeCode(treeCode);
|