| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.vci.client.omd.linktype.util.Tool; |
| | | import com.vci.client.omd.provider.BtmProvider; |
| | | import com.vci.client.omd.provider.LinkTypeProvider; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.atm.AttributeDef; |
| | | import com.vci.corba.omd.btm.BTMServicePrx; |
| | |
| | | import com.vci.corba.omd.lcm.TransitionVOEvent; |
| | | import com.vci.corba.omd.ltm.LinkType; |
| | | import com.vci.corba.omd.stm.StatePool; |
| | | import com.vci.dto.*; |
| | | import com.vci.pagemodel.*; |
| | | import com.vci.starter.poi.bo.WriteExcelData; |
| | | import com.vci.starter.poi.bo.WriteExcelOption; |
| | | import com.vci.starter.poi.util.ExcelUtil; |
| | |
| | | import com.vci.starter.web.util.VciDateUtil; |
| | | import com.vci.starter.word.bo.WordMergeStartTableDataBO; |
| | | import com.vci.starter.word.util.WordUtil; |
| | | import com.vci.web.dto.*; |
| | | import com.vci.web.pageModel.*; |
| | | import com.vci.web.properties.OsDDLExportWordFieldProperties; |
| | | import com.vci.web.service.*; |
| | | import com.vci.web.util.Func; |
| | |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.client.omd.attribpool.ui.VTDataTypePanel.*; |
| | | import static com.vci.omd.constants.AttributeConstants.*; |
| | | |
| | | |
| | | /** |
| | |
| | | * @param statusDTOList 要导入的状态的数据传输对象列表 |
| | | * @throws VciBaseException 查询或者执行出错的时候会抛出异常 |
| | | */ |
| | | private void importStatus( Collection<OsStatusDTO> statusDTOList) throws VciBaseException{ |
| | | private void importStatus( Collection<OsStatusDTO> statusDTOList) throws Exception { |
| | | //要导入的状态的所有英文名称 |
| | | List<String> statusIdList = new ArrayList<String>(); |
| | | Iterator<OsStatusDTO> iterator = statusDTOList.iterator(); |
| | |
| | | btmService.addBizType(btmItem); |
| | | //执行完成了需要创建表 |
| | | //获取的时候不一定刷新了缓存,这样就获取不到信息 |
| | | String btmTableName = BtmProvider.getInstance().getBTTableName(btmItem.name); |
| | | //OmdHelper |
| | | //todo 此占无法引用,后续会进行调整,再进行引用 |
| | | // String btmTableName = BtmProvider.getInstance().getBTTableName(btmItem.name); |
| | | String btmTableName = null; |
| | | String sql = "create Table " + btmTableName + "(" + "\n\tOID VARCHAR2(36) not null,\n\tREVISIONOID VARCHAR2(36),\n\tNAMEOID VARCHAR2(36),\n\tBtmName VARCHAR2(36),\n\tISLastR CHAR(1),\n\tISFirstR CHAR(1),\n\tISLastV CHAR(1),\n\tISFirstV CHAR(1),\n\tCreator VARCHAR2(36),\n\tCreateTime TIMESTAMP,\n\tLastModifier VARCHAR2(36),\n\tLastModifyTime TIMESTAMP,\n\tRevisionRule VARCHAR2(36),\n\tVersionRule VARCHAR2(36),\n\tRevisionSeq NUMBER,\n\tRevisionValue VARCHAR2(10),\n\tVersionSeq NUMBER,\n\tVersionValue VARCHAR2(10),\n\tLCTID VARCHAR2(36),\n\tLCStatus VARCHAR2(36),\n\tTS TIMESTAMP,\n\tID VARCHAR2(36),\n\tNAME VARCHAR2(128),\n\tDESCRIPTION VARCHAR2(255),\n\tOWNER VARCHAR2(36),\n\tCHECKINBY VARCHAR2(36),\n\tCHECKINTIME TIMESTAMP,\n\tCHECKOUTBY VARCHAR2(36),\n\tCHECKOUTTIME TIMESTAMP,\n\tCOPYFROMVERSION VARCHAR2(36),\n\t"; |
| | | String[] apNameArray = btmItem.apNameArray; |
| | | if(apNameArray!=null && apNameArray.length>0){ |
| | | for(String attrId : apNameArray){ |
| | | OsAttributeVO attrVO = attributeMap.get(attrId.toLowerCase().trim()); |
| | | if(attrVO!=null) { |
| | | String abSql = Tool.getInstance().getAbSql(attrService.attributeVO2DO(attrVO)); |
| | | sql = sql + abSql; |
| | | //todo 此占无法引用,后续会进行调整,再进行引用 |
| | | // String abSql = Tool.getInstance().getAbSql(attrService.attributeVO2DO(attrVO)); |
| | | // sql = sql + abSql; |
| | | }else{ |
| | | logger.info("业务类型{}里的属性{}没找到",btmTableName,attrId.toLowerCase().trim()); |
| | | } |
| | | } |
| | | } |
| | | String alterSql = BtmProvider.getInstance().getAddPKSql(btmItem.name); |
| | | // String alterSql = BtmProvider.getInstance().getAddPKSql(btmItem.name); |
| | | sql = sql.substring(0, sql.lastIndexOf(",")); |
| | | sql = sql + "\n)"; |
| | | //TODO 暂时不清楚用何种方式创建表,此处先注释掉 |
| | |
| | | */ |
| | | private void addAttrToDB(Collection<String> addedAbList,String btmType,boolean linkType){ |
| | | if (!CollectionUtils.isEmpty(addedAbList)) { |
| | | String tableName = linkType? LinkTypeProvider.getInstance().getLTTableName(btmType):BtmProvider.getInstance().getBTTableName(btmType); |
| | | //todo 此暂无法引用,后续会进行调整,再进行引用 |
| | | // String tableName = linkType? LinkTypeProvider.getInstance().getLTTableName(btmType):BtmProvider.getInstance().getBTTableName(btmType); |
| | | String tableName = null; |
| | | String addSql = "alter table " + tableName + " add("; |
| | | Map<String, OsAttributeVO> attributeMap = attrService.selectAllAttributeMap(); |
| | | for (String abName : addedAbList) { |
| | | AttributeDef abItem = attrService.attributeVO2DO(attributeMap.get(abName)); |
| | | addSql = addSql + Tool.getInstance().getAbSql(abItem); |
| | | //todo 此暂无法引用,后续会进行调整,再进行引用 |
| | | // addSql = addSql + Tool.getInstance().getAbSql(abItem); |
| | | } |
| | | addSql = VciBaseUtil.removeComma(addSql.replace("\n\t","")); |
| | | addSql = addSql + ")"; |
| | |
| | | */ |
| | | private void removeAttrToDB(Collection<String> removeAbList,String btmType,boolean linkType){ |
| | | if (!CollectionUtils.isEmpty(removeAbList)) { |
| | | String tableName = linkType?LinkTypeProvider.getInstance().getLTTableName(btmType):BtmProvider.getInstance().getBTTableName(btmType); |
| | | String removeSql = "alter table " + tableName + " drop("; |
| | | for (String abName : removeAbList) { |
| | | removeSql = removeSql + abName + ","; |
| | | } |
| | | removeSql = VciBaseUtil.removeComma(removeSql.replace("\n\t","")); |
| | | removeSql = removeSql + ")"; |
| | | //todo 此暂无法引用,后续会进行调整,再进行引用 |
| | | // String tableName = linkType?LinkTypeProvider.getInstance().getLTTableName(btmType):BtmProvider.getInstance().getBTTableName(btmType); |
| | | // String removeSql = "alter table " + tableName + " drop("; |
| | | // for (String abName : removeAbList) { |
| | | // removeSql = removeSql + abName + ","; |
| | | // } |
| | | // removeSql = VciBaseUtil.removeComma(removeSql.replace("\n\t","")); |
| | | // removeSql = removeSql + ")"; |
| | | //TODO 不清楚具体使用什么方法,暂时注释,但不要删除 |
| | | // DDLToolClient.getService().batchExecuteUpdateOracle(new String[]{removeSql}); |
| | | } |
| | |
| | | for(LinkType linkType : linkTypes){ |
| | | try{ |
| | | platformClientUtil.getLinkTypeService().addLinkType(linkType); |
| | | String tableName = LinkTypeProvider.getInstance().getLTTableName(linkType.name); |
| | | //todo 此暂无法引用,后续会进行调整,再进行引用 |
| | | // String tableName = LinkTypeProvider.getInstance().getLTTableName(linkType.name); |
| | | String tableName = null; |
| | | String sql = "create table " + tableName + "(" + "\n\tOID VARCHAR2(36) not null,\n\tCreator VARCHAR2(36),\n\tCreateTime TIMESTAMP,\n\tLastModifier VARCHAR2(36),\n\tLastModifyTime TIMESTAMP,\n\tTS TIMESTAMP,\n\t"; |
| | | String[] apNameArray = linkType.attributes; |
| | | if(apNameArray!=null && apNameArray.length>0){ |
| | | for(String attrId : apNameArray){ |
| | | OsAttributeVO attrVO = attributeMap.get(attrId.toLowerCase().trim()); |
| | | String abSql = Tool.getInstance().getAbSql(attrService.attributeVO2DO(attrVO)); |
| | | sql = sql + abSql; |
| | | //todo 此暂无法引用,后续会进行调整,再进行引用 |
| | | // String abSql = Tool.getInstance().getAbSql(attrService.attributeVO2DO(attrVO)); |
| | | // sql = sql + abSql; |
| | | } |
| | | } |
| | | sql = sql.substring(0, sql.lastIndexOf(",")); |