From afd5c86b170c2fc63896a2475097cf1654a3c889 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期三, 27 十一月 2024 23:02:07 +0800 Subject: [PATCH] 业务类型树查询接口新增UIDataTree用来专门返回key:list形式的参数,修改多处Map<String,String>为Map<String,Object>。 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java | 41 ++++++++++++++++++++++++++++++++++------- 1 files changed, 34 insertions(+), 7 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java index bd33e47..4604743 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.ZipUtil; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +import com.vci.common.qt.object.QTConstants; import com.vci.constant.FrameWorkLangCodeConstant; import com.vci.corba.common.PLException; import com.vci.corba.omd.atm.AttributeDef; @@ -241,11 +242,12 @@ * @return 閾炬帴绫诲瀷 */ @Override - public OsLinkTypeVO getLinkTypeById(String id) { + public OsLinkTypeVO getLinkTypeById(String id) throws PLException { if(StringUtils.isBlank(id)){ return null; } - return self.selectAllLinkMap().getOrDefault(id.toLowerCase(),null); + LinkType linkType = platformClientUtil.getLinkTypeService().getLinkType(id); + return this.linkTypeDO2VO(linkType); } /** @@ -255,7 +257,7 @@ * @return 閾炬帴绫诲瀷鐨勫睘鎬� */ @Override - public List<OsLinkTypeAttributeVO> listAttributeByLinkId(String linkTypeId) { + public List<OsLinkTypeAttributeVO> listAttributeByLinkId(String linkTypeId) throws PLException { OsLinkTypeVO linkTypeVO = getLinkTypeById(linkTypeId); return linkTypeVO.getAttributes(); } @@ -319,7 +321,7 @@ } OsBtmTypeAttributeVO attributeVO = attributeVOMap.getOrDefault(attrId.toLowerCase(Locale.ROOT), null); if(attributeVO!=null){ - String vtType = attributeVO.getAttrDataType(); + String vtType = attributeVO.getAttributeDataType(); String attrType = ""; VciFieldTypeEnum fieldTypeEnum = VciFieldTypeEnum.forValue(vtType); if(fieldTypeEnum == null) { @@ -611,7 +613,7 @@ return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"娌℃湁瀵煎叆鐨勫睘鎬ф枃浠躲�傚鍏ョ粓姝紒"}); } } - BaseResult baseResult = attributeService.importAttributes(attrExcel); + BaseResult baseResult = attributeService.importAttributes(attrExcel,true); if(!baseResult.isSuccess()){ //鍒犻櫎涓婁紶鐨勬枃浠跺す FileUtil.del(defaultTempFolder + File.separator); @@ -648,7 +650,7 @@ }else if(!osLinkTypePO.getName().matches("^[A-Za-z]+$")){ throw new VciBaseException("绗��"+osLinkTypePO.getRowIndex()+"銆戣锛岄摼鎺ョ被鍨嬪悕绉板彧鑳戒负鑻辨枃瀛楁瘝"); }else if(excelReapeat.containsKey(osLinkTypePO.getName())){//灞炴�у悕琛ㄦ牸涓垽閲� - throw new VciBaseException("绗��"+excelReapeat.get(osLinkTypePO.getName())+"銆戣鍜岀銆�"+osLinkTypePO.getRowIndex()+"銆戣鏁版嵁锛屽睘鎬у悕閲嶅"); + throw new VciBaseException("绗��"+excelReapeat.get(osLinkTypePO.getName())+"銆戣鍜岀銆�"+osLinkTypePO.getRowIndex()+"銆戣鏁版嵁锛岄摼鎺ョ被鍨嬪悕閲嶅"); } try { LinkType historyLink = platformClientUtil.getLinkTypeService().getLinkType(osLinkTypePO.getName()); @@ -687,7 +689,7 @@ }); }catch (Exception e){ if(logger.isErrorEnabled()){ - logger.error("璇诲彇excel鍐呭鏃舵垨淇濆瓨鐢ㄦ埛淇℃伅鏃跺嚭鐜颁簡閿欒锛屽叿浣撳師鍥狅細",VciBaseUtil.getExceptionMessage(e)); + logger.error("璇诲彇excel鍐呭鏃舵垨淇濆瓨閾炬帴绫诲瀷淇℃伅鏃跺嚭鐜颁簡閿欒锛屽叿浣撳師鍥狅細",VciBaseUtil.getExceptionMessage(e)); } e.printStackTrace(); return BaseResult.fail(VciBaseUtil.getExceptionMessage(e),new String[]{},e); @@ -752,6 +754,31 @@ } return links; } + /** + * 鑾峰彇璁剧疆鎺掑簭瀛楁鐨勬帓搴忓瓧娈� + * @param linkType 閾炬帴绫诲瀷鐨勭紪鍙� + * @param btmType 涓氬姟绫诲瀷鐨勭紪鍙� + * @param direction 姝�/鍙嶅悜 + * @return 灞炴�х殑淇℃伅 + */ + @Override + public List<String> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction) throws PLException, ParseException { + List<String> abNames = new ArrayList<>(Arrays.asList("OID", "Creator", "CreateTime", "LastModifier", "LASTMODIFYTIME", "F_OID", + "F_REVISIONOID", "F_NAMEOID", "F_BtwName", "T_OID", "T_REVISIONOID", "T_NAMEOID", "T_BtwName", "TS" )); + AttributeDef[] attributes = platformClientUtil.getLinkTypeService().getAttributes(linkType); + for (AttributeDef attribute : attributes) { + abNames.add(String.valueOf(attribute.name)); + } + String wrapper = "T_OID."; + if(direction.equals(QTConstants.DIRECTION_OPPOSITE)){ + wrapper = "F_OID."; + } + List<OsBtmTypeAttributeVO> bizTypeQTDs = btmService.getBizTypeQTDs(btmType); + for (OsBtmTypeAttributeVO bizTypeQTD : bizTypeQTDs) { + abNames.add(wrapper + bizTypeQTD.getId()); + } + return abNames; + } /** * 淇閾炬帴绫诲瀷鐨剎ml鏂囦欢 -- Gitblit v1.9.3