| | |
| | | package com.vci.ubcs.ddl.service; |
| | | |
| | | import com.vci.starter.word.bo.WordMergeStartTableDataBO; |
| | | import com.vci.ubcs.ddl.bo.DdlTableBO; |
| | | import com.vci.ubcs.ddl.enums.DataBaseEnum; |
| | | import com.vci.ubcs.omd.dto.OmdBtmTypeDTO; |
| | | import com.vci.ubcs.omd.entity.OmdBtmTypeAttribute; |
| | | import com.vci.ubcs.omd.entity.OsModifyAttributeInfoDO; |
| | | import com.vci.ubcs.omd.vo.OmdBtmTypeAttributeVO; |
| | | import com.vci.ubcs.omd.vo.OmdBtmTypeVO; |
| | | import com.vci.ubcs.omd.vo.OsLinkTypeAttributeVO; |
| | | import com.vci.ubcs.omd.vo.OsLinkTypeVO; |
| | | import com.vci.ubcs.omd.dto.*; |
| | | import com.vci.ubcs.omd.entity.ModifyAttributeInfo; |
| | | import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.omd.vo.LinkTypeAttributeVO; |
| | | import com.vci.ubcs.omd.vo.LinkTypeVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | |
| | | * @date 2023/4/24 |
| | | */ |
| | | public interface IDdlService { |
| | | |
| | | /** |
| | | * 校验业务类型的数据库表中是否有数据 |
| | | * @param pkBtmType 业务类型的主键 |
| | | * @return true表示有数据,false表示没有数据 |
| | | * @throws VciBaseException 参数为空或者查询出错的时候会抛出异常 |
| | | */ |
| | | boolean checkTableHasData(String pkBtmType) throws VciBaseException; |
| | | |
| | | /** |
| | | * 根据业务类型或者链接类型的主键获取数据库表格的名称 |
| | | * @param pkBtmType 业务类型或者链接类型的主键 |
| | | * @return 数据库表名称 |
| | | */ |
| | | String getTableNameByBtmTypeOid(String pkBtmType); |
| | | |
| | | /** |
| | | * 根据业务类型获取链接类型的英文名称获取数据库表格的名称 |
| | | * @param id 业务类型获取链接类型的英文名称 |
| | | * @return 数据库表名称 |
| | | */ |
| | | String getTableNameByBtmTypeId(String id); |
| | | |
| | | /** |
| | | * 校验业务类型的数据库表中是否有数据 |
| | | * @param id 业务类型的英文名称 |
| | | * @return true表示有数据,false表示没有数据 |
| | | * @throws VciBaseException 参数为空或者查询出错的时候会抛出异常 |
| | | */ |
| | | boolean checkTableHasDataById(String id) throws VciBaseException; |
| | | |
| | | /** |
| | | * 批量将业务类型创建数据库表 |
| | | * @param pkBtmTypes 业务类型的主键 |
| | |
| | | void createDbTablesByOidCollection(Collection<String> oidCollection) throws VciBaseException; |
| | | |
| | | /** |
| | | * 获取创建的sql语句中属性部分 -- 业务类型 |
| | | * @param attributeVOList 属性的立碑 |
| | | * @return sql语句 |
| | | */ |
| | | String getCreateSqlByAttributeForBtm(List<BtmTypeAttributeVO> attributeVOList); |
| | | |
| | | /** |
| | | * 获取创建的sql语句中属性部分 -- 链接类型 |
| | | * @param attributeVOList 属性的立碑 |
| | | * @return sql语句 |
| | | */ |
| | | String getCreateSqlByAttributeForLink(List<LinkTypeAttributeVO> attributeVOList); |
| | | |
| | | /** |
| | | * 批量将业务类型创建数据库表 |
| | | * @param ids 业务类型的英文名称 |
| | | * @throws VciBaseException 参数为空或者创建表出现了错误的时候会抛出异常 |
| | |
| | | * @param modifyLengthAttrDOList 需要修改的属性对象 |
| | | * @throws VciBaseException 执行出错的时候会抛出异常 |
| | | */ |
| | | void changeColumnForBtm(List<OmdBtmTypeAttributeVO> modifyLengthAttrDOList) throws VciBaseException; |
| | | void changeColumnForBtm(List<BtmTypeAttributeVO> modifyLengthAttrDOList) throws VciBaseException; |
| | | |
| | | /** |
| | | * 修改链接类型中的属性字段的长度,注意在执行这个方法时就会将以前的事务提交。 |
| | | * @param modifyLengthAttrDOListForLinkType 需要修改的属性对象 |
| | | * @throws VciBaseException 执行出错的时候会抛出异常 |
| | | */ |
| | | void changeColumnForLink(List<OsLinkTypeAttributeVO> modifyLengthAttrDOListForLinkType) throws VciBaseException; |
| | | void changeColumnForLink(List<LinkTypeAttributeVO> modifyLengthAttrDOListForLinkType) throws VciBaseException; |
| | | |
| | | /** |
| | | * 添加属性字段到业务类型中,注意在执行这个方法时就会将以前的事务提交。 |
| | | * @param addAttrDOList 需要添加的属性对象 |
| | | * @throws VciBaseException 执行出错的时候会抛出异常 |
| | | */ |
| | | void addColumn2TableForBtm(List<OmdBtmTypeAttributeVO> addAttrDOList) throws VciBaseException; |
| | | void addColumn2TableForBtm(List<BtmTypeAttributeVO> addAttrDOList) throws VciBaseException; |
| | | |
| | | /** |
| | | * 添加属性字段到链接类型中,注意在执行这个方法时就会将以前的事务提交。 |
| | | * @param addAttrDOListForLinkType 需要添加的属性对象 |
| | | * @throws VciBaseException 执行出错的时候会抛出异常 |
| | | */ |
| | | void addColumn2TableForLink(List<OsLinkTypeAttributeVO> addAttrDOListForLinkType) throws VciBaseException; |
| | | void addColumn2TableForLink(List<LinkTypeAttributeVO> addAttrDOListForLinkType) throws VciBaseException; |
| | | |
| | | /** |
| | | * 判断表中是否有数据 |
| | |
| | | */ |
| | | void dropColumnByName(String tableName, String columnName); |
| | | |
| | | /** |
| | | * 校验业务类型或者链接类型的对应的表格是否存在 |
| | | * @param pkBtmType 业务类型或者链接类型的表格 |
| | | * @return true表示存在,false表示不存在 |
| | | */ |
| | | boolean checkTableExist(String pkBtmType); |
| | | |
| | | /** |
| | | * 根据表格的名称判断表格是否存在 |
| | |
| | | */ |
| | | boolean checkTableExistByTableName(String tableName); |
| | | |
| | | /** |
| | | * 校验业务类型或者链接类型所对应的表格是否存在 |
| | | * @param id 业务类型或者链接类型的英文名称 |
| | | * @return true表示存在,false表示不存在 |
| | | */ |
| | | boolean checkTableExistById(String id); |
| | | |
| | | /** |
| | | * 获取数据库和业务类型中的不同的地方 |
| | |
| | | * @param linkTypeVOList 链接类型对象,有属性时需要包含属性 |
| | | * @return 不同的地方,每一个业务类型或者链接类型一条数据 |
| | | */ |
| | | List<OsModifyAttributeInfoDO> checkDifferent(List<OmdBtmTypeVO> btmTypeVOList, List<OsLinkTypeVO> linkTypeVOList) throws VciBaseException; |
| | | List<ModifyAttributeInfo> checkDifferent(List<BtmTypeVO> btmTypeVOList, List<LinkTypeVO> linkTypeVOList) throws VciBaseException; |
| | | |
| | | /** |
| | | * 清理业务类型中和数据库里不一样的 |
| | | * @param differentAttributeList 不同的属性的列表 |
| | | * @param btmTypeVOList 业务类型数据 |
| | | * @param linkTypeVOList 链接类型数据 |
| | | * @throws VciBaseException 参数为空或者执行出错的时候会抛出异常 |
| | | */ |
| | | void reflexDifferent(List<OsModifyAttributeInfoDO> differentAttributeList) throws VciBaseException; |
| | | void reflexDifferent(List<ModifyAttributeInfo> differentAttributeList,List<BtmTypeVO> btmTypeVOList, List<LinkTypeVO> linkTypeVOList) throws VciBaseException; |
| | | |
| | | /** |
| | | * 获取数据库中所有的表格 |
| | |
| | | * 拷贝数据到word模板中 |
| | | * @param tableDataBO 要写入的数据 |
| | | * @return word 文件路径 |
| | | */ |
| | | String writeDataToWord(WordMergeStartTableDataBO tableDataBO); |
| | | *//* |
| | | String writeDataToWord(WordMergeStartTableDataBO tableDataBO);*/ |
| | | |
| | | /** |
| | | * 判断是否为兼容性的表,这些表不应该被创建和修改 |
| | |
| | | |
| | | /** |
| | | * 数据库新增或修改表 |
| | | * @param dto 业务类型传输对象 |
| | | * @param ddlDTO 业务类型传输对象 |
| | | * @return 执行结果 |
| | | */ |
| | | R submitBtmType(OmdBtmTypeDTO dto); |
| | | R submit(BtmAndLinkTypeDdlDTO ddlDTO) throws Throwable; |
| | | |
| | | /** |
| | | * 按表名获取表信息 |
| | |
| | | * 获取所有表信息 |
| | | * @return 表信息集合 |
| | | */ |
| | | List<DdlTableBO> getAllTableInfo(); |
| | | List<BtmTypeVO> getAllTableInfo(); |
| | | |
| | | /** |
| | | * 检查数据表是否存在数据,不存在则删除 |
| | | * @param tableCheckDTOList 需要检查的表集合 |
| | | * @return 检查结果 |
| | | */ |
| | | TableCheckResultDTO checkTableHasDataThenDelete(List<TableCheckDTO> tableCheckDTOList); |
| | | |
| | | /** |
| | | * 为表添加字段 |
| | | * @param addColumnDTO 添加的对象 |
| | | * @return 执行结果标识 |
| | | */ |
| | | Boolean addColumnForTable(TableAddColumnDTO addColumnDTO); |
| | | } |