use of com.albedo.java.modules.gen.domain.TableDo in project albedo by somowhere.
the class TableServiceImpl method saveOrUpdate.
@Override
public void saveOrUpdate(TableDto tableDto) {
TableDo tableDo = new TableDo();
copyDtoToBean(tableDto, tableDo);
super.saveOrUpdate(tableDo);
logger.debug("Save Information for Table: {}", tableDo);
for (TableColumnDo item : tableDo.getColumnFormList()) {
item.setTableId(tableDo.getId());
}
List<TableColumnDo> tableColumnDoEntities = tableColumnService.list(Wrappers.<TableColumnDo>query().eq(TableColumnDo.F_SQL_GENTABLEID, tableDo.getId()));
for (TableColumnDo item : tableDo.getColumnFormList()) {
for (TableColumnDo tableColumnDo : tableColumnDoEntities) {
if (tableColumnDo.getId().equals(item.getId())) {
item.setVersion(tableColumnDo.getVersion());
break;
}
}
}
tableColumnService.saveOrUpdateBatch(tableDo.getColumnFormList());
}
use of com.albedo.java.modules.gen.domain.TableDo in project albedo by somowhere.
the class SchemeServiceImpl method findFormData.
@Override
@Transactional(readOnly = true)
public SchemeFormDataVo findFormData(SchemeDto schemeDto, String loginId) {
SchemeFormDataVo schemeFormDataVo = new SchemeFormDataVo();
ArgumentAssert.notNull(schemeDto, "生成方案不能为空");
if (StringUtil.isNotEmpty(schemeDto.getId())) {
schemeDto = super.getOneDto(schemeDto.getId());
}
if (StringUtil.isBlank(schemeDto.getPackageName())) {
schemeDto.setPackageName("com.albedo.java.modules");
}
if (StringUtil.isBlank(schemeDto.getFunctionAuthor())) {
schemeDto.setFunctionAuthor(loginId);
}
schemeFormDataVo.setSchemeVo(schemeDto);
GenConfig config = GenUtil.getConfig();
schemeFormDataVo.setConfig(config);
schemeFormDataVo.setCategoryList(CollUtil.convertSelectVoList(config.getCategoryList(), DictDo.F_VAL, DictDo.F_NAME));
schemeFormDataVo.setViewTypeList(CollUtil.convertSelectVoList(config.getViewTypeList(), DictDo.F_VAL, DictDo.F_NAME));
List<TableDo> tableDoList = tableService.list(), list = Lists.newArrayList();
List<String> tableIds = Lists.newArrayList();
if (StringUtil.isNotEmpty(schemeDto.getId())) {
List<SchemeDo> schemeDoList = findAllListIdNot(schemeDto.getId());
tableIds = CollUtil.extractToList(schemeDoList, "tableId");
}
for (TableDo tableDo : tableDoList) {
if (!tableIds.contains(tableDo.getId())) {
list.add(tableDo);
}
}
schemeFormDataVo.setTableList(CollUtil.convertSelectVoList(list, TableDo.F_ID, TableDo.F_NAMESANDTITLE));
return schemeFormDataVo;
}
Aggregations