From 68fd566d21b3efc3a670a5295289b1801f5a4155 Mon Sep 17 00:00:00 2001 From: ludc <ludc@vci-tech.com> Date: 星期四, 16 一月 2025 18:18:55 +0800 Subject: [PATCH] 流程部署接口上传 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java | 85 +++++++++++++++++++++++++----------------- 1 files changed, 50 insertions(+), 35 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 74c8dd5..9586abf 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,6 +1,5 @@ package com.vci.web.service.impl; -import com.vci.client.common.providers.WebServiceProvider; import com.vci.corba.common.PLException; import com.vci.corba.omd.atm.AttributeDef; import com.vci.corba.omd.btm.BTMServicePrx; @@ -13,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; @@ -20,17 +21,15 @@ import com.vci.starter.web.constant.FrameWorkLcStatusConstant; import com.vci.starter.web.enumpck.VciFieldTypeEnum; import com.vci.starter.web.exception.VciBaseException; -import com.vci.starter.web.util.BeanUtil; +import com.vci.starter.web.util.BeanUtilForVCI; +import com.vci.starter.web.util.Lcm.Func; import com.vci.starter.web.util.LocalFileUtil; import com.vci.starter.web.util.VciBaseUtil; 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 com.vci.web.util.PlatformClientUtil; import com.vci.web.util.WebUtil; import org.apache.commons.lang3.StringUtils; @@ -202,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(); @@ -244,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()); @@ -272,10 +271,10 @@ 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(); + lifeCyle.label = lifeCycleDTO.getName(); lifeCyle.description = lifeCycleDTO.getDescription() == null?"":lifeCycleDTO.getDescription(); lifeCyle.startState = lifeCycleDTO.getStartStatus() == null?"":lifeCycleDTO.getStartStatus(); lifeCyle.modifier = userId; @@ -736,7 +735,7 @@ OsBtmTypeAttributeVO idAttrVO = new OsBtmTypeAttributeVO(); idAttrVO.setId("id"); idAttrVO.setName("缂栧彿"); - idAttrVO.setAttrDataType(VciFieldTypeEnum.VTString.name()); + idAttrVO.setAttributeDataType(VciFieldTypeEnum.VTString.name()); idAttrVO.setAttributeLength(50); idAttrVO.setNullableFlag(true); attributes.add(idAttrVO); @@ -744,7 +743,7 @@ OsBtmTypeAttributeVO nameAttrVO = new OsBtmTypeAttributeVO(); nameAttrVO.setId("name"); nameAttrVO.setName("鍚嶇О"); - nameAttrVO.setAttrDataType(VciFieldTypeEnum.VTString.name()); + nameAttrVO.setAttributeDataType(VciFieldTypeEnum.VTString.name()); nameAttrVO.setAttributeLength(50); nameAttrVO.setNullableFlag(true); attributes.add(nameAttrVO); @@ -752,7 +751,7 @@ OsBtmTypeAttributeVO descAttrVO = new OsBtmTypeAttributeVO(); descAttrVO.setId("description"); descAttrVO.setName("鎻忚堪"); - descAttrVO.setAttrDataType(VciFieldTypeEnum.VTString.name()); + descAttrVO.setAttributeDataType(VciFieldTypeEnum.VTString.name()); descAttrVO.setAttributeLength(150); descAttrVO.setNullableFlag(true); attributes.add(descAttrVO); @@ -763,7 +762,14 @@ attributes.stream().forEach( t -> { int index = indexMap.get("index"); - Map<String,Object> columnData = attributeToWordMap(t,index); + Map<String,Object> columnData = null; + try { + columnData = attributeToWordMap(t,index); + } catch (PLException e) { + e.printStackTrace(); + String exceptionMessage = "灏嗗睘鎬у璞℃嫹璐濆埌word鏁版嵁瀵硅薄涓椂鍑虹幇閿欒锛屽師鍥狅細"+VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + } indexMap.put("index",index+1); columnDataList.add(columnData); }); @@ -795,7 +801,7 @@ List<OsBtmTypeAttributeVO> attributes = new ArrayList<>(); linkAttributes.stream().forEach(t -> { OsBtmTypeAttributeVO attributeVO = new OsBtmTypeAttributeVO(); - BeanUtil.convert(t,attributeVO); + BeanUtilForVCI.convert(t,attributeVO); attributeVO.setPkBtmType(t.getPkLinkType()); attributes.add(attributeVO); }); @@ -805,7 +811,14 @@ indexMap.put("index",1); attributes.stream().forEach( t -> { int index = indexMap.get("index"); - Map<String,Object> columnData = attributeToWordMap(t,index); + Map<String,Object> columnData = null; + try { + columnData = attributeToWordMap(t,index); + } catch (PLException e) { + e.printStackTrace(); + String exceptionMessage = "灏嗗睘鎬у璞℃嫹璐濆埌word鏁版嵁瀵硅薄涓椂鍑虹幇閿欒锛屽師鍥狅細"+VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + } indexMap.put("index",index+1); columnDataList.add(columnData); }); @@ -852,7 +865,13 @@ if(!CollectionUtils.isEmpty(btmTypeVOList)) { btmTypeVOList.stream().forEach(btmTypeVO -> { String btmId = btmTypeVO.getId(); - List<OsBtmTypeAttributeVO> attributeVOS = btmService.listAttributeByBtmId(btmId); + List<OsBtmTypeAttributeVO> attributeVOS = null; + try { + attributeVOS = btmService.listAttributeByBtmId(btmId); + } catch (PLException e) { + e.printStackTrace(); + throw new VciBaseException(VciBaseUtil.getExceptionMessage(e)); + } //鍏堟槸鍚嶇О int rowIndex = index[0]; WriteExcelData idED = new WriteExcelData(rowIndex, 0, btmId); @@ -895,7 +914,7 @@ //鐒跺悗灞炴�х殑涓枃鍚嶇О rowDataList.add(new WriteExcelData(rowIndex, 3, attributeVO.getName())); //灞炴�х殑绫诲瀷 - rowDataList.add(new WriteExcelData(rowIndex, 4, VciFieldTypeEnum.getTextByValue(attributeVO.getAttrDataType()))); + rowDataList.add(new WriteExcelData(rowIndex, 4, VciFieldTypeEnum.getTextByValue(attributeVO.getAttributeDataType()))); //鏄惁鍙互涓虹┖ rowDataList.add(new WriteExcelData(rowIndex, 5, attributeVO.isNullableFlag() ? "鏄�" : "鍚�")); //灞炴�ч暱搴� @@ -915,7 +934,15 @@ if(!CollectionUtils.isEmpty(linkTypeVOList)){ linkTypeVOList.stream().forEach(linkTypeVO->{ String linkTypeId = linkTypeVO.getId(); - List<OsLinkTypeAttributeVO> attributeVOS = linkTypeService.listAttributeByLinkId(linkTypeId); + List<OsLinkTypeAttributeVO> attributeVOS = null; + try { + attributeVOS = linkTypeService.listAttributeByLinkId(linkTypeId); + } catch (PLException e) { + e.printStackTrace(); + String errorLog = "鏌ヨ閾炬帴绫诲瀷鏃跺嚭鐜伴敊璇紝鍘熷洜锛�"+VciBaseUtil.getExceptionMessage(e); + logger.error(errorLog); + throw new VciBaseException(errorLog); + } //鍏堟槸鍚嶇О int rowIndex = index[0]; WriteExcelData idED = new WriteExcelData(rowIndex, 0, linkTypeId); @@ -1058,14 +1085,14 @@ * @param index 绱㈠紩 * @return 鏁版嵁鏄犲皠,key 鏄痺ord閲岀殑鍩熷瓧娈碉紝value鏄搴旂殑鍊� */ - private Map<String,Object> attributeToWordMap(OsBtmTypeAttributeVO btmTypeAttributeVO,int index){ + private Map<String,Object> attributeToWordMap(OsBtmTypeAttributeVO btmTypeAttributeVO,int index) throws PLException { Map<String,Object> columnData = new HashMap<>(); if(StringUtils.isNotBlank(wordFieldProperties.getColumnIndex())) { columnData.put(wordFieldProperties.getColumnIndex(), index); } columnData.put(wordFieldProperties.getColumnId(),btmTypeAttributeVO.getId().toLowerCase()); columnData.put(wordFieldProperties.getColumnName(),btmTypeAttributeVO.getName()); - String attrDataType = btmTypeAttributeVO.getAttrDataType(); + String attrDataType = btmTypeAttributeVO.getAttributeDataType(); String columnType = VciFieldTypeEnum.getTextByValue(attrDataType); if(StringUtils.isBlank(columnType)){ columnType = "瀛楃涓�"; @@ -1116,7 +1143,6 @@ return ""; } - /** * 娣诲姞灞炴�у埌oracle * @param addedAbList 娣诲姞鐨勫睘鎬� @@ -1161,10 +1187,6 @@ } } - - - - /** * 灏佽涓氬姟绫诲瀷 * @param btmItem 涓氬姟绫诲瀷鐨勫璞� @@ -1195,15 +1217,8 @@ } else { btmItem.verRuleName = 0; } - //鍖呭惈鐨勫睘鎬х殑鏁扮粍 - List<OsBtmTypeLinkAttributesDTO> attributesDTOList = btmTypeDTO.getAttributesDTOList(); - List<String> attrIdList = new ArrayList<String>(); - if (!CollectionUtils.isEmpty(attributesDTOList)) { - for (OsBtmTypeLinkAttributesDTO attr : attributesDTOList) { - attrIdList.add(attr.getId().toLowerCase()); - } - } - btmItem.apNameArray = attrIdList.toArray(new String[0]); + //鍖呭惈鐨勫睘鎬у悕绉� + btmItem.apNameArray = btmTypeDTO.getApNameArray().split(","); } /** @@ -1240,7 +1255,7 @@ linkType.modifyTime = now; linkType.id = ""; linkType.name = linkId; - linkType.tag = linkTypeDTO.getName(); + linkType.label = linkTypeDTO.getName(); linkType.description = linkTypeDTO.getDescription() == null ?"":linkTypeDTO.getDescription(); linkType.implClass = ""; linkType.shape = ""; -- Gitblit v1.9.3