use of com.jeeagile.generator.entity.AgileGeneratorTable in project jeeagile by jeeagile.
the class AgileGeneratorTableServiceImpl method importTable.
@Override
public boolean importTable(List<String> tableNameList) {
for (String tableName : tableNameList) {
AgileGeneratorTable agileGeneratorTable = this.getBaseMapper().selectDbTableByTableName(tableName);
if (agileGeneratorTable == null || AgileStringUtil.isEmpty(agileGeneratorTable.getTableName())) {
throw new AgileValidateException("表(" + tableName + ")不存在!");
}
AgileGeneratorUtil.initGeneratorTable(agileGeneratorTable);
this.save(agileGeneratorTable);
List<AgileGeneratorTableColumn> agileGeneratorTableColumnList = this.getBaseMapper().selectDbTableColumnByTableName(tableName);
if (agileGeneratorTableColumnList != null && !agileGeneratorTableColumnList.isEmpty()) {
agileGeneratorTableColumnList.forEach(agileGeneratorTableColumn -> AgileGeneratorUtil.initColumnField(agileGeneratorTable, agileGeneratorTableColumn));
}
agileGeneratorTableColumnService.saveBatch(agileGeneratorTableColumnList);
}
return true;
}
use of com.jeeagile.generator.entity.AgileGeneratorTable in project jeeagile by jeeagile.
the class AgileGeneratorTableServiceImpl method selectTableInfoById.
@Override
public AgileGeneratorTableInfo selectTableInfoById(String agileGeneratorTableId) {
AgileGeneratorTableInfo agileGeneratorTableInfo = new AgileGeneratorTableInfo();
AgileGeneratorTable agileGeneratorTable = this.getById(agileGeneratorTableId);
BeanUtils.copyProperties(agileGeneratorTable, agileGeneratorTableInfo);
if (agileGeneratorTable != null && !AgileStringUtil.isEmpty(agileGeneratorTable.getId())) {
agileGeneratorTableInfo.setAgileGeneratorTableColumnList(agileGeneratorTableColumnService.selectListByTableId(agileGeneratorTableId));
}
return agileGeneratorTableInfo;
}
Aggregations