| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.atm.AttributeDef; |
| | | import com.vci.corba.omd.data.BusinessObject; |
| | | import com.vci.corba.omd.ltm.LinkType; |
| | | import com.vci.omd.utils.ObjectTool; |
| | | import com.vci.pagemodel.*; |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.enumpck.VciFieldTypeEnum; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | |
| | | import com.vci.starter.web.util.BeanUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.util.VciDateUtil; |
| | | import com.vci.web.model.OsLinkTypeDO; |
| | | import com.vci.web.pageModel.*; |
| | | import com.vci.model.OsLinkTypeDO; |
| | | import com.vci.web.service.*; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | |
| | | "inner JOIN user_col_comments c on t.TABLE_NAME = c.table_name and t.COLUMN_NAME = c.column_name where " + |
| | | "t.table_name = '" + VciBaseUtil.getTableName(btmTypeVO.getId()).toUpperCase(Locale.ROOT) + "' order by t.column_name asc"; |
| | | Map<String, OsBtmTypeAttributeVO> attributeVOMap = btmTypeVO.getAttributes().stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbosList = boService.queryBySql(sql, new HashMap<>()); |
| | | List<BusinessObject> cbosList = boService.queryBySql(sql, new HashMap<>()); |
| | | if(!CollectionUtils.isEmpty(cbosList)){ |
| | | cbosList.stream().forEach(cbo->{ |
| | | String attrId = cbo.getAttributeValue("column_name"); |
| | | String dataType = cbo.getAttributeValue("data_type"); |
| | | String attrId = ObjectTool.getBOAttributeValue(cbo,"column_name"); |
| | | String dataType = ObjectTool.getBOAttributeValue(cbo,"data_type"); |
| | | if(StringUtils.isNotBlank(dataType) && dataType.contains("(")){ |
| | | dataType = dataType.substring(0,dataType.indexOf("(")); |
| | | } |
| | |
| | | public void clearCache() { |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 修改链接类型中对应属性名的属性 |
| | | * @param apName |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @Override |
| | | public boolean alterAp(String apName) throws PLException { |
| | | String[] linkNames = null; |
| | | List<String> linkNameList = new ArrayList<String>(); |
| | | AttributeDef abItem = null; |
| | | try { |
| | | abItem = platformClientUtil.getAttributeService().getAttributeDefByName(apName); |
| | | } catch (PLException e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | if(abItem == null || abItem.equals("")){ |
| | | return true; |
| | | } |
| | | try { |
| | | linkNames = platformClientUtil.getLinkTypeService().getLTNamesByAPName(apName); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(linkNames == null || linkNames.length <= 0){ |
| | | return true; |
| | | } |
| | | |
| | | linkNameList = Arrays.asList(linkNames); |
| | | for(Iterator<String> i = linkNameList.iterator(); i.hasNext();){ |
| | | String linkName = i.next(); |
| | | try { |
| | | platformClientUtil.getLinkTypeService().modifyLTAttribute(linkName, apName); |
| | | } catch (PLException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | String erreMsg = "调整链接类型中【"+apName+"】属性时出现错误,原因:"+e.getMessage(); |
| | | logger.error(erreMsg); |
| | | throw new PLException("500",new String[]{erreMsg}); |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 判断该属性是否已经在链接类型中产生了数据 |
| | | * @param abName |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @Override |
| | | public boolean hasInstance(String abName) throws PLException { |
| | | String[] btmNames = platformClientUtil.getLinkTypeService().getLTNamesByAPName(abName); |
| | | if(btmNames == null || btmNames.length == 0){ |
| | | return false; |
| | | } |
| | | for(int i = 0; i < btmNames.length; i++){ |
| | | String btmName = btmNames[i]; |
| | | boolean flag; |
| | | flag = platformClientUtil.getLinkTypeService().hasData(btmName); |
| | | if(flag){ |
| | | return flag; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 获取连接类型名称集合 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<String> getAllLtName() throws PLException { |
| | | LinkType[] linkTypes = platformClientUtil.getLinkTypeService().getLinkTypes(); |
| | | if(null != linkTypes && linkTypes.length > 0){ |
| | | return Arrays.stream(linkTypes).map(linkType -> linkType.name).collect(Collectors.toList()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |