From f0b8a8d9966d0ccbb23ee8baaedf4ff8ba6060ed Mon Sep 17 00:00:00 2001 From: ludc Date: 星期四, 08 八月 2024 18:15:42 +0800 Subject: [PATCH] 业务类型新增、修改、删除、查看使用范围、创建视图、一致性检查、一致性检查修复、删除数据、删除数据界面查询、删除全部类型接口上传。 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java | 58 +++++++++++++++++++++++++++++++++------------------------- 1 files changed, 33 insertions(+), 25 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java index b95a7d5..6119c1e 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java @@ -1,8 +1,5 @@ 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; @@ -15,6 +12,8 @@ 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; @@ -28,8 +27,6 @@ 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; @@ -48,7 +45,7 @@ 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.*; /** @@ -204,7 +201,7 @@ * @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(); @@ -246,7 +243,7 @@ * @param lifeCycleDTOList 瑕佸鍏ョ殑鐢熷懡鍛ㄦ湡鏁版嵁浼犺緭瀵硅薄鍒楄〃 * @throws VciBaseException 鏌ヨ鎴栬�呬繚瀛樺嚭閿欑殑鏃跺�欙紝浼氭姏鍑哄紓甯� */ - private void importLifeCycles(Collection<OsLifeCycleDTO> lifeCycleDTOList) throws VciBaseException{ + private void importLifeCycles(Collection<OsLifeCycleDTO> lifeCycleDTOList) throws VciBaseException, PLException { Set<String> existLifeCycleIds = lifeCycleService.selectAllLifeCycleMap().keySet(); //鐢熷懡鍛ㄦ湡鐨勫悕绉版病鏈夎浆涓哄皬鍐欙紝浣嗘槸骞冲彴鍙堝尯鍒嗗ぇ灏忓啓 List<String> existLifeCycleLowIds = existLifeCycleIds.stream().map(s->s.toLowerCase(Locale.ROOT)).collect(Collectors.toList()); @@ -274,7 +271,7 @@ lifeCyle.ts = VciDateUtil.getNowString(VciDateUtil.DateTimeMillFormat); lifeCyle.name = lifeCycleDTO.getId(); }else { - lifeCyle = lifeCycleService.lifeCycleVO2DO( allLifeCycleLowMap.get(lifeCycleId)); + lifeCyle = lifeCycleService.lifeCycleVO2DO(allLifeCycleLowMap.get(lifeCycleId)); edit = true; } lifeCyle.tag = lifeCycleDTO.getName(); @@ -630,21 +627,25 @@ 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 鏆傛椂涓嶆竻妤氱敤浣曠鏂瑰紡鍒涘缓琛紝姝ゅ鍏堟敞閲婃帀 @@ -1122,12 +1123,15 @@ */ 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 + ")"; @@ -1143,13 +1147,14 @@ */ 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}); } @@ -1275,14 +1280,17 @@ 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(",")); -- Gitblit v1.9.3