| | |
| | | package com.vci.ubcs.ddl.service.impl; |
| | | |
| | | |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | import com.alibaba.nacos.shaded.com.google.protobuf.ServiceException; |
| | | import com.vci.starter.word.bo.WordMergeStartTableDataBO; |
| | | import com.vci.ubcs.ddl.bo.DdlTableBO; |
| | | import com.vci.ubcs.ddl.bo.DdlTableInDataBaseBO; |
| | | import com.vci.ubcs.ddl.enums.BusinessTypeEnum; |
| | |
| | | import com.vci.ubcs.ddl.processor.ddl.DdlMapperProcessor; |
| | | import com.vci.ubcs.ddl.processor.dll.DllMapperProcessor; |
| | | import com.vci.ubcs.ddl.processor.dll.DllMapperProcessorStrategy; |
| | | import com.vci.ubcs.ddl.properties.DdlExportWordFieldProperties; |
| | | import com.vci.ubcs.ddl.properties.DdlPropertise; |
| | | import com.vci.ubcs.ddl.service.IDdlService; |
| | | import com.vci.ubcs.omd.cache.BtmTypeCache; |
| | |
| | | import com.vci.ubcs.starter.web.enumpck.BooleanEnum; |
| | | import com.vci.ubcs.starter.web.enumpck.VciFieldTypeEnum; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | |
| | | /** |
| | | * word导出的时候的域字段映射 |
| | | */ |
| | | @Autowired |
| | | private DdlExportWordFieldProperties wordFieldProperties; |
| | | // @Autowired |
| | | // private DdlExportWordFieldProperties wordFieldProperties; |
| | | |
| | | /** |
| | | * ddl数据操作服务 |
| | |
| | | * |
| | | * @param tableDataBO 要写入的数据 |
| | | * @return word 文件路径 |
| | | */ |
| | | *//* |
| | | @Override |
| | | public String writeDataToWord(WordMergeStartTableDataBO tableDataBO) { |
| | | return null; |
| | | } |
| | | }*/ |
| | | |
| | | /** |
| | | * 判断是否为兼容性的表,这些表不应该被创建和修改 |
| | |
| | | * @return 表信息集合 |
| | | */ |
| | | @Override |
| | | public List<DdlTableBO> getAllTableInfo() { |
| | | public List<BtmTypeVO> getAllTableInfo() { |
| | | List<String> allTableName = listAllTableName(); |
| | | if (!CollectionUtils.isEmpty(allTableName)) { |
| | | List<DdlTableBO> allTableBO = listTableInfoInDB(allTableName); |
| | | List<BtmTypeVO> btmTypeVOList = new ArrayList<>(); |
| | | allTableBO.forEach(table -> { |
| | | table.setColumns(selectTableColumnInfo(table.getTableName())); |
| | | BtmTypeVO vo = new BtmTypeVO(); |
| | | vo.setTableName(table.getTableName().toLowerCase()); |
| | | vo.setDescription(table.getTableDesc()); |
| | | List<DdlTableInDataBaseBO> columns = selectTableColumnInfo(table.getTableName()); |
| | | List<BtmTypeAttributeVO> attributes = new ArrayList<>(); |
| | | columns.forEach(col -> { |
| | | BtmTypeAttributeVO attributeVO = new BtmTypeAttributeVO(); |
| | | attributeVO.setId(col.getId().toLowerCase()); |
| | | attributeVO.setName(col.getName()); |
| | | attributeVO.setNullableFlag(col.getNullableFlag()); |
| | | attributeVO.setAttributeLength(col.getAttributeLength()); |
| | | attributeVO.setPrecisionLength(col.getPrecisionLength()); |
| | | attributeVO.setScaleLength(col.getScaleLength()); |
| | | VciFieldTypeEnum field = dllMapper.getFieldTypeByColumnStr(col.getAttrDataType(), col.getAttributeLength()); |
| | | if (field != null){ |
| | | attributeVO.setAttrDataType(field.name()); |
| | | } |
| | | if(col.getPrecisionLength() != null){ |
| | | attributeVO.setAttrDataType(VciFieldTypeEnum.VTDouble.name()); |
| | | } |
| | | attributes.add(attributeVO); |
| | | }); |
| | | vo.setAttributes(attributes); |
| | | btmTypeVOList.add(vo); |
| | | }); |
| | | return allTableBO; |
| | | return btmTypeVOList; |
| | | } |
| | | return new ArrayList<>(); |
| | | } |