| | |
| | | public List<OsBtmTypeVO> selectAllBtm() { |
| | | try { |
| | | return btmDO2VOs(Arrays.stream(platformClientUtil.getBtmService().getBizTypes("")).collect(Collectors.toList())); |
| | | } catch (PLException e) { |
| | | } catch (PLException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | @VciUnLog |
| | | public Map<String, OsBtmTypeVO> selectAllBtmMap() { |
| | | return Optional.ofNullable(self.selectAllBtm()).orElseGet(()->new ArrayList<OsBtmTypeVO>()).stream().collect(Collectors.toMap(s->s.getId().toLowerCase(), t->t,(o1,o2)->o1)); |
| | | return Optional.ofNullable(self.selectAllBtm()).orElseGet(() -> new ArrayList<OsBtmTypeVO>()).stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(), t -> t, (o1, o2) -> o1)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public List<OsBtmTypeVO> btmDO2VOs(Collection<BizType> btmItems) { |
| | | List<OsBtmTypeVO> VOS = new ArrayList<>(); |
| | | Optional.ofNullable(btmItems).orElseGet(()->new ArrayList<>()).stream().forEach(btmItem -> { |
| | | Optional.ofNullable(btmItems).orElseGet(() -> new ArrayList<>()).stream().forEach(btmItem -> { |
| | | OsBtmTypeVO vo = btmDO2VO(btmItem); |
| | | VOS.add(vo); |
| | | }); |
| | |
| | | @Override |
| | | public OsBtmTypeVO btmDO2VO(BizType btmItem) { |
| | | OsBtmTypeVO vo = new OsBtmTypeVO(); |
| | | if(btmItem !=null){ |
| | | if (btmItem != null) { |
| | | vo.setOid(btmItem.oid); |
| | | vo.setCreator(btmItem.creator); |
| | | vo.setLastModifier(btmItem.modifier); |
| | |
| | | // btmItem.createTimeæ¿å°çæ¯æ¶é´æ³ï¼ä½æ¯è¿å¿è¦çæ¯ä¾å¦2017-12-27 09:32:20.034è¿æ ·çæ ¼å¼ï¼æä»¥ä¸è°ç¨è¿ä¸ªæ¹æ³ï¼æ¹è°ç¨å
¶ä»æ¹æ³ |
| | | //vo.setCreateTime(VciDateUtil.str2Date(String.valueOf(btmItem.createTime),VciDateUtil.DateTimeFormat)); |
| | | vo.setCreateTime(Func.parse(btmItem.createTime, ConcurrentDateFormat.of(VciDateUtil.DateTimeFormat))); |
| | | vo.setLastModifyTime( Func.parse(btmItem.modifyTime, ConcurrentDateFormat.of(VciDateUtil.DateTimeFormat))); |
| | | vo.setLastModifyTime(Func.parse(btmItem.modifyTime, ConcurrentDateFormat.of(VciDateUtil.DateTimeFormat))); |
| | | vo.setTs(Func.parse(btmItem.ts, ConcurrentDateFormat.of(VciDateUtil.DateTimeMillFormat))); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | vo.setDelimiter(btmItem.delimiter); |
| | | vo.setfName(btmItem.fName); |
| | | vo.setVersionRule(String.valueOf(btmItem.verRuleName)); |
| | | if(StringUtils.isNotBlank(vo.getRevisionRuleName()) || vo.isInputRevisionFlag()){ |
| | | if (StringUtils.isNotBlank(vo.getRevisionRuleName()) || vo.isInputRevisionFlag()) { |
| | | vo.setRevisionFlag(true); |
| | | } |
| | | vo.setLifeCycleIds(Arrays.stream(btmItem.lifeCycles).collect(Collectors.joining(","))); |
| | | vo.setApNameArray(btmItem.apNameArray); |
| | | List<OsAttributeVO> attributeVOS = attributeService.listAttrByIds(Arrays.stream(btmItem.apNameArray).collect(Collectors.toList())); |
| | | List<OsBtmTypeAttributeVO> btmTypeAttributeVOS = new ArrayList<>(); |
| | | Optional.ofNullable(attributeVOS).orElseGet(()->new ArrayList<>()).stream().forEach(attributeVO->{ |
| | | Optional.ofNullable(attributeVOS).orElseGet(() -> new ArrayList<>()).stream().forEach(attributeVO -> { |
| | | OsBtmTypeAttributeVO btmTypeAttributeVO = new OsBtmTypeAttributeVO(); |
| | | BeanUtil.convert(attributeVO,btmTypeAttributeVO); |
| | | BeanUtil.convert(attributeVO, btmTypeAttributeVO); |
| | | btmTypeAttributeVO.setPkBtmType(vo.getOid()); |
| | | btmTypeAttributeVO.setBtmTypeId(vo.getId()); |
| | | btmTypeAttributeVO.setAttributeDataType(attributeVO.getAttributeDataType()); |
| | | btmTypeAttributeVO.setAttributeLength(attributeVO.getAttrLength()); |
| | | btmTypeAttributeVO.setDefaultValue(attributeVO.getDefaultValue()); |
| | | if("secretgrade".equalsIgnoreCase(attributeVO.getId())){ |
| | | if ("secretgrade".equalsIgnoreCase(attributeVO.getId())) { |
| | | vo.setSecretFlag(true); |
| | | } |
| | | if(StringUtils.isNotBlank(attributeVO.getBtmTypeId())){ |
| | | if (StringUtils.isNotBlank(attributeVO.getBtmTypeId())) { |
| | | btmTypeAttributeVO.setReferFlag(true); |
| | | btmTypeAttributeVO.setReferBtmTypeId(attributeVO.getBtmTypeId()); |
| | | } |
| | | if(StringUtils.isNotBlank(attributeVO.getEnumId())){ |
| | | if (StringUtils.isNotBlank(attributeVO.getEnumId())) { |
| | | btmTypeAttributeVO.setEnumFlag(true); |
| | | btmTypeAttributeVO.setEnumItemMap(enumService.getEnumValueMap(btmTypeAttributeVO.getEnumId())); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public List<OsBtmTypeVO> listBtmByIds(Collection<String> btmIds) { |
| | | if(CollectionUtils.isEmpty(btmIds)){ |
| | | if (CollectionUtils.isEmpty(btmIds)) { |
| | | return null; |
| | | } |
| | | Map<String, OsBtmTypeVO> btmTypeVOMap = self.selectAllBtmMap(); |
| | | List<OsBtmTypeVO> btmTypeVOS = new ArrayList<>(); |
| | | btmIds.stream().forEach(id->{ |
| | | if(btmTypeVOMap.containsKey(id.toLowerCase())){ |
| | | btmIds.stream().forEach(id -> { |
| | | if (btmTypeVOMap.containsKey(id.toLowerCase())) { |
| | | btmTypeVOS.add(btmTypeVOMap.get(id.toLowerCase())); |
| | | } |
| | | }); |
| | |
| | | */ |
| | | @Override |
| | | public OsBtmTypeVO getBtmById(String id) { |
| | | if(StringUtils.isBlank(id)){ |
| | | if (StringUtils.isBlank(id)) { |
| | | return null; |
| | | } |
| | | return self.selectAllBtmMap().getOrDefault(id.toLowerCase(),null); |
| | | return self.selectAllBtmMap().getOrDefault(id.toLowerCase(), null); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<OsUsedAttributeVO> listBtmUsedInfo(String btmName) { |
| | | return listBtmUsedInfo(btmName,false); |
| | | return listBtmUsedInfo(btmName, false); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸å¡ç±»åçå¨åªä¸ªå±æ§ä¸ä½¿ç¨ |
| | | * |
| | | * @param btmId ä¸å¡ç±»å |
| | | * @param btmId ä¸å¡ç±»å |
| | | * @param hasLink æ¯å¦å
å«é¾æ¥ç±»åä¸ |
| | | * @return å¼ç¨çä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public List<OsUsedAttributeVO> listBtmUsedInfo(String btmId, boolean hasLink){ |
| | | VciBaseUtil.alertNotNull(btmId,"ä¸å¡ç±»åçåç§°"); |
| | | List<OsAttributeVO> allReferThisBtmAttributes = Optional.ofNullable(attributeService.selectAllAttribute()).orElseGet(()->new ArrayList<>()).stream().filter(s->btmId.equalsIgnoreCase(s.getBtmTypeId())).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(allReferThisBtmAttributes)){ |
| | | public List<OsUsedAttributeVO> listBtmUsedInfo(String btmId, boolean hasLink) { |
| | | VciBaseUtil.alertNotNull(btmId, "ä¸å¡ç±»åçåç§°"); |
| | | List<OsAttributeVO> allReferThisBtmAttributes = Optional.ofNullable(attributeService.selectAllAttribute()).orElseGet(() -> new ArrayList<>()).stream().filter(s -> btmId.equalsIgnoreCase(s.getBtmTypeId())).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(allReferThisBtmAttributes)) { |
| | | return null; |
| | | } |
| | | //æ ¹æ®è¿äºå±æ§ï¼æ¾å®ä½¿ç¨çä¸å¡ç±»å |
| | | List<OsUsedAttributeVO> usedInfos= new ArrayList<>(); |
| | | List<OsUsedAttributeVO> usedInfos = new ArrayList<>(); |
| | | List<OsBtmTypeVO> btmTypeVOMap = self.selectAllBtmMap().values().stream().collect(Collectors.toList()); |
| | | List<OsLinkTypeVO> linkTypeVOS = linkTypeService.selectAllLinkMap().values().stream().collect(Collectors.toList()); |
| | | allReferThisBtmAttributes.stream().forEach(attribute->{ |
| | | allReferThisBtmAttributes.stream().forEach(attribute -> { |
| | | //å
¶ä»çä¸å¡ç±»åå
å«äºè¿ä¸ªå±æ§ç |
| | | List<OsBtmTypeVO> usedBtms = btmTypeVOMap.stream().filter(btmTypeVO -> !CollectionUtils.isEmpty(btmTypeVO.getAttributes()) && btmTypeVO.getAttributes().stream().anyMatch(s -> attribute.getId().equalsIgnoreCase(s.getId()))).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(usedBtms)){ |
| | | usedBtms.stream().forEach(btm->{ |
| | | btm.getAttributes().stream().filter(s->attribute.getId().equalsIgnoreCase(s.getId())).forEach(attrInBtm->{ |
| | | if (!CollectionUtils.isEmpty(usedBtms)) { |
| | | usedBtms.stream().forEach(btm -> { |
| | | btm.getAttributes().stream().filter(s -> attribute.getId().equalsIgnoreCase(s.getId())).forEach(attrInBtm -> { |
| | | OsUsedAttributeVO usedAttributeVO = new OsUsedAttributeVO(); |
| | | usedAttributeVO.setId(attrInBtm.getId()); |
| | | usedAttributeVO.setName(attrInBtm.getName()); |
| | |
| | | }); |
| | | }); |
| | | } |
| | | if(hasLink){ |
| | | List<OsLinkTypeVO> usedLinks = linkTypeVOS.stream().filter(linkTypeVO -> !CollectionUtils.isEmpty(linkTypeVO.getAttributes()) &&linkTypeVO.getAttributes().stream().anyMatch(s->attribute.getId().equalsIgnoreCase(s.getId())) ).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(usedLinks)){ |
| | | usedLinks.stream().forEach(link->{ |
| | | link.getAttributes().stream().filter(s->attribute.getId().equalsIgnoreCase(s.getId())).forEach(attrInBtm->{ |
| | | if (hasLink) { |
| | | List<OsLinkTypeVO> usedLinks = linkTypeVOS.stream().filter(linkTypeVO -> !CollectionUtils.isEmpty(linkTypeVO.getAttributes()) && linkTypeVO.getAttributes().stream().anyMatch(s -> attribute.getId().equalsIgnoreCase(s.getId()))).collect(Collectors.toList()); |
| | | if (!CollectionUtils.isEmpty(usedLinks)) { |
| | | usedLinks.stream().forEach(link -> { |
| | | link.getAttributes().stream().filter(s -> attribute.getId().equalsIgnoreCase(s.getId())).forEach(attrInBtm -> { |
| | | OsUsedAttributeVO usedAttributeVO = new OsUsedAttributeVO(); |
| | | usedAttributeVO.setId(attrInBtm.getId()); |
| | | usedAttributeVO.setName(attrInBtm.getName()); |
| | |
| | | */ |
| | | @Override |
| | | public List<OsBtmTypeAttributeVO> listAttributeByBtmId(String btmId) throws PLException { |
| | | VciBaseUtil.alertNotNull(btmId,"ä¸å¡ç±»åçç¼å·"); |
| | | VciBaseUtil.alertNotNull(btmId, "ä¸å¡ç±»åçç¼å·"); |
| | | BizType[] bizTypes = platformClientUtil.getBtmService().getBizTypes(btmId); |
| | | if(Func.isEmpty(bizTypes)){ |
| | | if (Func.isEmpty(bizTypes)) { |
| | | return new ArrayList<>(); |
| | | } |
| | | BizType bizType = bizTypes[0]; |
| | | OsBtmTypeVO btmTypeVO = btmDO2VO(bizType); |
| | | List<OsBtmTypeAttributeVO> attributes = btmTypeVO.getAttributes(); |
| | | if(attributes == null){ |
| | | if (attributes == null) { |
| | | attributes = new ArrayList<>(); |
| | | } |
| | | return attributes.stream().sorted(((o1, o2) -> o1.getId().toLowerCase(Locale.ROOT).compareTo(o2.getId().toLowerCase(Locale.ROOT)))).collect(Collectors.toList()); |
| | |
| | | @Override |
| | | public List<OsBtmTypeAttributeVO> listAttributeByBtmIdHasDefault(String btmId) throws PLException { |
| | | List<OsBtmTypeAttributeVO> attrVOs = listAttributeByBtmId(btmId); |
| | | if(attrVOs == null){ |
| | | if (attrVOs == null) { |
| | | attrVOs = new ArrayList<>(); |
| | | } |
| | | if(!CollectionUtils.isEmpty(attributeService.getDefaultAttributeVOs())) { |
| | | if (!CollectionUtils.isEmpty(attributeService.getDefaultAttributeVOs())) { |
| | | List<OsBtmTypeAttributeVO> finalAttrVOs = attrVOs; |
| | | attributeService.getDefaultAttributeVOs().stream().forEach(attr->{ |
| | | attributeService.getDefaultAttributeVOs().stream().forEach(attr -> { |
| | | OsBtmTypeAttributeVO attributeVO = new OsBtmTypeAttributeVO(); |
| | | BeanUtil.convert(attr, attributeVO); |
| | | attributeVO.setAttributeDataType(attr.getAttributeDataType()); |
| | |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¸å¡ç±»åä¸å¯¹åºå±æ§åç屿§ |
| | | * |
| | | * @param apName |
| | | * @return |
| | | * @throws PLException |
| | |
| | | } catch (PLException e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | if(abItem == null || abItem.equals("")){ |
| | | if (abItem == null || abItem.equals("")) { |
| | | return true; |
| | | } |
| | | try { |
| | |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(btmNames == null || btmNames.length <= 0){ |
| | | if (btmNames == null || btmNames.length <= 0) { |
| | | return true; |
| | | } |
| | | |
| | | btmNameList = Arrays.asList(btmNames); |
| | | for(Iterator<String> i = btmNameList.iterator(); i.hasNext();){ |
| | | for (Iterator<String> i = btmNameList.iterator(); i.hasNext(); ) { |
| | | String btmName = i.next(); |
| | | try { |
| | | platformClientUtil.getBtmService().modifyBTAttribute(btmName, apName); |
| | | } catch (PLException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | String erreMsg = "è°æ´ä¸å¡ç±»åä¸ã"+apName+"ã屿§æ¶åºç°é误ï¼åå ï¼"+e.getMessage(); |
| | | String erreMsg = "è°æ´ä¸å¡ç±»åä¸ã" + apName + "ã屿§æ¶åºç°é误ï¼åå ï¼" + e.getMessage(); |
| | | logger.error(erreMsg); |
| | | throw new PLException("500",new String[]{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.getBtmService().getBTNamesByAPName(abName); |
| | | if(btmNames == null || btmNames.length == 0){ |
| | | if (btmNames == null || btmNames.length == 0) { |
| | | return false; |
| | | } |
| | | for(int i = 0; i < btmNames.length; i++){ |
| | | for (int i = 0; i < btmNames.length; i++) { |
| | | String btmName = btmNames[i]; |
| | | boolean flag; |
| | | flag = platformClientUtil.getBtmService().hasData(btmName); |
| | | if(flag){ |
| | | if (flag) { |
| | | return flag; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * è·ååå以filterå¼å§çä¸å¡ç±»å(for æ¥è¯¢)ï¼ä¸»è¦ç¨äºå±æ§æ± çä¸å¡ç±»åéæ©å¯¹è¯æ¡ |
| | | * è·åå
¨é¨ä¸å¡ç±»åï¼ä¼ åfilter为"" |
| | | * |
| | | * @param btmName |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @Override |
| | | public BizType[] getBizTypes(String btmName) throws PLException { |
| | | if(null == btmName){ |
| | | if (null == btmName) { |
| | | btmName = ""; |
| | | } |
| | | return platformClientUtil.getBtmService().getBizTypes(btmName); |
| | |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åå表æ¥è¯¢ï¼éæ ç»æï¼ç¨äºUIå®ä¹å·¦ä¾§ä¸å¡ç±»åæ¥è¯¢ï¼åªè¿ånameålable |
| | | * |
| | | * @param btmName |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @Override |
| | | public Tree getBizTree(String btmName) throws PLException { |
| | | if(null == btmName){ |
| | | if (null == btmName) { |
| | | btmName = ""; |
| | | } |
| | | Tree returnTree = new Tree(); |
| | | BizType[] bizTypes = platformClientUtil.getBtmService().getBizTypes(btmName); |
| | | if(Func.isEmpty(bizTypes)){ |
| | | if (Func.isEmpty(bizTypes)) { |
| | | return returnTree; |
| | | } |
| | | returnTree.setOid(""); |
| | |
| | | List<Tree> trees = new ArrayList<>(); |
| | | Arrays.stream(bizTypes).forEach(bizType -> { |
| | | Tree tree = new Tree(); |
| | | tree.setText(bizType.name + " " +bizType.label); |
| | | tree.setText(bizType.name + " " + bizType.label); |
| | | tree.setOid(bizType.oid); |
| | | tree.setLeaf(true); |
| | | tree.setParentName(bizType.fName); |
| | | Map<String, String> atrrMap = new HashMap<>(); |
| | | atrrMap.put("name",bizType.name); |
| | | atrrMap.put("lable",bizType.label); |
| | | atrrMap.put("name", bizType.name); |
| | | atrrMap.put("lable", bizType.label); |
| | | tree.setAttributes(atrrMap); |
| | | trees.add(tree); |
| | | }); |
| | |
| | | */ |
| | | @Override |
| | | public DataGrid<OsBtmTypeVO> referDataGrid(Map<String, String> conditionMap, PageHelper pageHelper) { |
| | | DataGrid<OsBtmTypeVO> dataGrid = queryObjectServiceInfoBySql(conditionMap, pageHelper, "plbtmtype",OsBtmTypeVO.class,((data, obj) -> { |
| | | DataGrid<OsBtmTypeVO> dataGrid = queryObjectServiceInfoBySql(conditionMap, pageHelper, "plbtmtype", OsBtmTypeVO.class, ((data, obj) -> { |
| | | obj.setTableName(VciBaseUtil.getTableName(obj.getId())); |
| | | })); |
| | | return dataGrid; |
| | |
| | | @Override |
| | | public OsBtmTypeVO selectByOid(String oid) { |
| | | List<OsBtmTypeVO> btmTypeVOS = self.selectAllBtmMap().values().stream().collect(Collectors.toList()); |
| | | return Optional.ofNullable(btmTypeVOS).orElseGet(()->new ArrayList<>()).stream().filter(s->s.getOid().equalsIgnoreCase(oid)).findFirst().orElseGet(()->null); |
| | | return Optional.ofNullable(btmTypeVOS).orElseGet(() -> new ArrayList<>()).stream().filter(s -> s.getOid().equalsIgnoreCase(oid)).findFirst().orElseGet(() -> null); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public String getNameById(String id) { |
| | | OsBtmTypeVO btmTypeVO = getBtmById(id); |
| | | if(btmTypeVO == null){ |
| | | throw new VciBaseException("ä¸å¡ç±»å[{0}]å¨ç³»ç»éä¸åå¨",new String[]{id}); |
| | | if (btmTypeVO == null) { |
| | | throw new VciBaseException("ä¸å¡ç±»å[{0}]å¨ç³»ç»éä¸åå¨", new String[]{id}); |
| | | } |
| | | return btmTypeVO.getName(); |
| | | } |
| | |
| | | List<OsERNodeVO> nodeVOList = new ArrayList<>(); |
| | | List<OsERRelationVO> relationVOList = new ArrayList<>(); |
| | | //çå½åè¿ä¸ªä¸å¡ç±»åï¼åç
§äºå
¶ä»çåªäºä¸å¡ç±»å .æä»¬ä¸æ¾ç¤ºå¼ç¨å½åä¸å¡ç±»åçä¸å¡ç±»å |
| | | splicingBtmType2Json(nodeVOList, relationVOList, btmTypeVO,true); |
| | | splicingBtmType2Json(nodeVOList, relationVOList, btmTypeVO, true); |
| | | loadAllLinkTypeByBtmType(nodeVOList, relationVOList, btmTypeVO); |
| | | OsERVO osERVO = new OsERVO(); |
| | | osERVO.setTabViewList(nodeVOList); |
| | |
| | | List<OsUsedAttributeVO> usedAttributeVOS = listBtmUsedInfo(btmTypeVO.getId()); |
| | | List<OsERNodeVO> nodeVOList = new ArrayList<>(); |
| | | List<OsERRelationVO> relationVOList = new ArrayList<>(); |
| | | splicingBtmType2Json(nodeVOList, relationVOList, btmTypeVO,false); |
| | | if(!CollectionUtils.isEmpty(usedAttributeVOS)){ |
| | | usedAttributeVOS.stream().forEach(usedAttr->{ |
| | | splicingBtmType2Json(nodeVOList, relationVOList, btmTypeVO, false); |
| | | if (!CollectionUtils.isEmpty(usedAttributeVOS)) { |
| | | usedAttributeVOS.stream().forEach(usedAttr -> { |
| | | //ä¸å¡ç±»åå龿¥ç±»å齿å¯è½ |
| | | if(BooleanEnum.TRUE.getValue().equalsIgnoreCase(usedAttr.getBusinessType())){ |
| | | if (BooleanEnum.TRUE.getValue().equalsIgnoreCase(usedAttr.getBusinessType())) { |
| | | //ä¸å¡ç±»å |
| | | OsBtmTypeVO linkBtmVO = self.selectAllBtmMap().get(usedAttr.getPkBtmType().toLowerCase(Locale.ROOT)); |
| | | splicingBtmType2Json(nodeVOList, relationVOList, linkBtmVO,false); |
| | | splicingBtmType2Json(nodeVOList, relationVOList, linkBtmVO, false); |
| | | OsERRelationVO relationVO = new OsERRelationVO(); |
| | | relationVO.setTo(btmTypeVO.getId() + " " + btmTypeVO.getName()); |
| | | relationVO.setFrom(linkBtmVO.getId() + " " + linkBtmVO.getName()); |
| | | relationVO.setToText("å¼ç¨"); |
| | | relationVOList.add(relationVO); |
| | | }else{ |
| | | } else { |
| | | //æ¯é¾æ¥ç±»å |
| | | OsLinkTypeVO linkTypeVO = linkTypeService.selectAllLinkMap().get(usedAttr.getPkBtmType().toLowerCase(Locale.ROOT)); |
| | | List<OsLinkTypeVO> linkTypeVOList = new ArrayList<>(); |
| | | linkTypeVOList.add(linkTypeVO); |
| | | splicingLinkType2Json(nodeVOList, relationVOList,linkTypeVOList,btmTypeVO,true); |
| | | splicingLinkType2Json(nodeVOList, relationVOList, linkTypeVOList, btmTypeVO, true); |
| | | } |
| | | }); |
| | | } |
| | |
| | | |
| | | /** |
| | | * è·åææä¸å¡ç±»åï¼æ å½¢ç»æï¼ |
| | | * |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | |
| | | BizType[] bizTypes = getBizTypes(""); |
| | | OsBtmTypeVO osBtmTypeVO = null; |
| | | List<OsBtmTypeVO> osBtmTypeVOS = btmDO2VOs(Arrays.asList(bizTypes)); |
| | | for(int i = 0; i < osBtmTypeVOS.size(); i++){ |
| | | for (int i = 0; i < osBtmTypeVOS.size(); i++) { |
| | | osBtmTypeVO = osBtmTypeVOS.get(i); |
| | | |
| | | if(osBtmTypeVO.getfName().equals("")){ |
| | | if (osBtmTypeVO.getfName().equals("")) { |
| | | Tree tree = new Tree(); |
| | | tree.setOid(osBtmTypeVO.getOid()); |
| | | tree.setParentName(null); |
| | | tree.setParentId(null); |
| | | tree.setLeaf(true); |
| | | tree.setId(osBtmTypeVO.getId()); |
| | | tree.setText(osBtmTypeVO.getDescription()); |
| | | tree.setAttributes(WebUtil.objectToMapString(osBtmTypeVO)); |
| | | tree.setChildren(getChildren(osBtmTypeVOS,osBtmTypeVO)); |
| | | tree.setChildren(getChildren(osBtmTypeVOS, osBtmTypeVO)); |
| | | rootTreeList.add(tree); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * è·åææä¸å¡ç±»ååç§°éå |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<String> getAllBtmName() throws PLException { |
| | | BizType[] bizTypes = platformClientUtil.getBtmService().getBizTypes(""); |
| | | if(null != bizTypes && bizTypes.length > 0){ |
| | | if (null != bizTypes && bizTypes.length > 0) { |
| | | return Arrays.stream(bizTypes).map(bizType -> bizType.name).collect(Collectors.toList()); |
| | | } |
| | | return null; |
| | |
| | | |
| | | /** |
| | | * è·åä¸å¡å
¨é¨å±æ§ç±»å |
| | | * |
| | | * @param btmName ä¸å¡ç±»ååç§° |
| | | * @return 屿§çä¿¡æ¯ |
| | | */ |
| | |
| | | vo.setOwner(attribute.creator); |
| | | vo.setLastModifyTime(new Date(attribute.modifyTime)); |
| | | String maxLength = AttributeConstants.getOtherValueByType(attribute.other, AttributeConstants.LENGTH); |
| | | if(StringUtils.isNotBlank(maxLength)){ |
| | | if (StringUtils.isNotBlank(maxLength)) { |
| | | vo.setAttributeLength(Integer.valueOf(maxLength)); |
| | | } |
| | | osBtms.add(vo); |
| | |
| | | |
| | | /** |
| | | * dto转do对象 |
| | | * |
| | | * @return |
| | | */ |
| | | private BizType dto2BizType(OsBtmTypeDTO dto){ |
| | | private BizType dto2BizType(OsBtmTypeDTO dto) { |
| | | BizType bizType = new BizType(); |
| | | bizType.oid = dto.getOid(); |
| | | bizType.name =dto.getId(); |
| | | bizType.name = dto.getId(); |
| | | bizType.isAbstract = dto.isAbstractFlag(); |
| | | bizType.label = dto.getName(); |
| | | bizType.fName = dto.getfName(); |
| | |
| | | |
| | | bizType.delimiter = (dto.getDelimiter() == null ? "" : dto.getDelimiter()); |
| | | |
| | | bizType.verRuleName = Func.isBlank(dto.getVersionRule()) ? 0:Short.parseShort(dto.getVersionRule()); |
| | | bizType.verRuleName = Func.isBlank(dto.getVersionRule()) ? 0 : Short.parseShort(dto.getVersionRule()); |
| | | |
| | | //bizType.imageName = dto.get; |
| | | //List<String> attrIdList = dto.getAttributesDTOList().stream().map(OsBtmTypeLinkAttributesDTO::getId).collect(Collectors.toList()); |
| | |
| | | bizType.apNameArray = dto.getApNameArray().split(",");//attrIdList.toArray(new String[attrIdList.size()]); |
| | | String userId = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(); |
| | | long timeMillis = System.currentTimeMillis(); |
| | | bizType.creator = Func.isBlank(dto.getCreator()) ? userId:dto.getCreator(); |
| | | bizType.createTime = Func.isEmpty(dto.getCreateTime()) ? timeMillis:dto.getCreateTime().getTime(); |
| | | bizType.creator = Func.isBlank(dto.getCreator()) ? userId : dto.getCreator(); |
| | | bizType.createTime = Func.isEmpty(dto.getCreateTime()) ? timeMillis : dto.getCreateTime().getTime(); |
| | | bizType.modifier = userId; |
| | | bizType.modifyTime = timeMillis; |
| | | bizType.ts = Func.isEmpty(dto.getTs())? timeMillis:dto.getTs().getTime(); |
| | | bizType.ts = Func.isEmpty(dto.getTs()) ? timeMillis : dto.getTs().getTime(); |
| | | return bizType; |
| | | } |
| | | |
| | | /** |
| | | * å建æ°çä¸å¡ç±»å |
| | | * |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @Override |
| | | public boolean addBtmType(OsBtmTypeDTO btmTypeDTO) throws PLException { |
| | | VciBaseUtil.alertNotNull(btmTypeDTO,"å建çä¸å¡ç±»å对象"); |
| | | VciBaseUtil.alertNotNull(btmTypeDTO, "å建çä¸å¡ç±»å对象"); |
| | | //ä¸å¡ç±»ååç§°æ£æ¥ |
| | | checkName(btmTypeDTO.getId()); |
| | | //çå½å¨ææ£æ¥ |
| | |
| | | |
| | | /** |
| | | * æ£æ¥ä¸å¡ç±»ååç§°æ¯å¦åè§ |
| | | * |
| | | * @param btmName |
| | | * @throws PLException |
| | | */ |
| | | private void checkName(String btmName) throws PLException { |
| | | if (Func.isBlank(btmName)) { |
| | | throw new PLException("500",new String[]{"ä¸å¡ç±»ååä¸è½ä¸ºç©º!"}); |
| | | throw new PLException("500", new String[]{"ä¸å¡ç±»ååä¸è½ä¸ºç©º!"}); |
| | | } |
| | | |
| | | if (!btmName.matches("[a-z A-Z]*")) { |
| | | throw new PLException("500",new String[]{"ä¸å¡ç±»åååªè½ä¸ºè±æåæ¯!"}); |
| | | throw new PLException("500", new String[]{"ä¸å¡ç±»åååªè½ä¸ºè±æåæ¯!"}); |
| | | } |
| | | |
| | | int maxLength = platformClientUtil.getBtmService().getBTNameMaxLength(); |
| | | |
| | | if (btmName.length() > maxLength) { |
| | | throw new PLException("500",new String[]{"ä¸å¡ç±»ååé¿åº¦ä¸è½è¶
è¿" + maxLength}); |
| | | throw new PLException("500", new String[]{"ä¸å¡ç±»ååé¿åº¦ä¸è½è¶
è¿" + maxLength}); |
| | | } |
| | | |
| | | if (platformClientUtil.getBtmService().checkRowIsExists(btmName)) { |
| | | throw new PLException("500",new String[]{"ä¸å¡ç±»ååå·²ç»åå¨"}); |
| | | throw new PLException("500", new String[]{"ä¸å¡ç±»ååå·²ç»åå¨"}); |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | private void checkLifeCycle(OsBtmTypeDTO btmTypeDTO) throws PLException { |
| | | if (Func.isBlank(btmTypeDTO.getLifeCycleId())) { |
| | | throw new PLException("500",new String[]{"çå½å¨æä¸è½ä¸ºç©º"}); |
| | | throw new PLException("500", new String[]{"çå½å¨æä¸è½ä¸ºç©º"}); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éæ©ä¸çº§çæ¬ï¼å¿
须鿩ææå·¥è¾å
¥çæ¬å·è§å; éæ©äºçº§çæ¬ï¼å¿
须鿩ææå·¥è¾å
¥çæ¬å·è§å, (çæ¬¡å·å·²ç»é»è®¤éæ©). |
| | | * |
| | | * @return |
| | | */ |
| | | private void checkVersionInfo(OsBtmTypeDTO dto) throws PLException { |
| | | //éè¦æå¨è¾å
¥çæ¬æ¶revisionRuleIdä¸è½ä¸ºç©º |
| | | if (dto.getRevLevel() == 1 || dto.getRevLevel() == 2) { |
| | | if (Func.isBlank(dto.getRevisionRuleId()) && !dto.isInputRevisionFlag()) { |
| | | throw new PLException("500",new String[]{"çæ¬å·è§åä¸è½ä¸ºç©º"}); |
| | | throw new PLException("500", new String[]{"çæ¬å·è§åä¸è½ä¸ºç©º"}); |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * çæ¬æºå¶ä¿®æ¹: ä»
å
许类åä»"ä¸å¯ä¿®è®¢"åæ´è³"ä¸çº§çæ¬ç®¡çæºå¶","äºçº§çæ¬ç®¡çæºå¶è¿è¡è°æ´"; "ä¸çº§çæ¬ç®¡çæºå¶"åæ´è³"äºçº§çæ¬ç®¡çæºå¶"; |
| | | * ä¸¤ç§æ¹å¼. |
| | | * |
| | | * @param dbBizType å½åä¿®æ¹åçä¸å¡ç±»åï¼åºä¸åå¨çï¼ |
| | | * @param dto å½åä¿®æ¹ä¸å¡ç±»å |
| | | * @param dto å½åä¿®æ¹ä¸å¡ç±»å |
| | | * @throws PLException |
| | | */ |
| | | private void checkRevLevel(BizType dbBizType,OsBtmTypeDTO dto) throws PLException { |
| | | if (dbBizType.revLevel == 1 && dto.getRevLevel()==0) { |
| | | throw new PLException("500",new String[]{"çæ¬åæ´é误ï¼ä¸è½ä»ä¸çº§å为ä¸å¯ä¿®è®¢"}); |
| | | private void checkRevLevel(BizType dbBizType, OsBtmTypeDTO dto) throws PLException { |
| | | if (dbBizType.revLevel == 1 && dto.getRevLevel() == 0) { |
| | | throw new PLException("500", new String[]{"çæ¬åæ´é误ï¼ä¸è½ä»ä¸çº§å为ä¸å¯ä¿®è®¢"}); |
| | | } |
| | | if (dbBizType.revLevel == 2 && (dto.getRevLevel() == 1 || dto.getRevLevel() == 0)) { |
| | | throw new PLException("500",new String[]{"çæ¬åæ´é误ï¼ä¸è½ä»äºçº§å为ä¸çº§æä¸å¯ä¿®è®¢"}); |
| | | throw new PLException("500", new String[]{"çæ¬åæ´é误ï¼ä¸è½ä»äºçº§å为ä¸çº§æä¸å¯ä¿®è®¢"}); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¸å¡ç±»å |
| | | * |
| | | * @param btmTypeDTO |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @Override |
| | | public boolean updateBtmType(OsBtmTypeDTO btmTypeDTO) throws PLException { |
| | | VciBaseUtil.alertNotNull(btmTypeDTO,"ä¿®æ¹çä¸å¡ç±»å对象"); |
| | | VciBaseUtil.alertNotNull(btmTypeDTO, "ä¿®æ¹çä¸å¡ç±»å对象"); |
| | | //æ£æ¥çå½å¨ææ¯å¦åè§ |
| | | checkLifeCycle(btmTypeDTO); |
| | | //æ¥è¯¢æ°æ®åºä¸çä¸å¡ç±»å |
| | | String id = btmTypeDTO.getId(); |
| | | BizType dbBizType = platformClientUtil.getBtmService().getBizTypeByName(id); |
| | | if(Func.isEmpty(dbBizType) || Func.isBlank(dbBizType.oid)){ |
| | | throw new PLException("500",new String[]{"å½åä¿®æ¹çä¸å¡ç±»åä¸åå¨ï¼"}); |
| | | if (Func.isEmpty(dbBizType) || Func.isBlank(dbBizType.oid)) { |
| | | throw new PLException("500", new String[]{"å½åä¿®æ¹çä¸å¡ç±»åä¸åå¨ï¼"}); |
| | | } |
| | | //æ£æ¥çæ¬è§åä¿®æ¹æ¯å¦åè§ |
| | | checkRevLevel(dbBizType,btmTypeDTO); |
| | | checkRevLevel(dbBizType, btmTypeDTO); |
| | | checkVersionInfo(btmTypeDTO); |
| | | //å¤çä¸å¡ç±»åä¸ç屿§ |
| | | List<String> lastAttrList = new ArrayList<>(Arrays.asList(btmTypeDTO.getApNameArray().split(","))); |
| | |
| | | |
| | | /** |
| | | * å é¤ä¸å¡ç±»å |
| | | * |
| | | * @param btmTypeDTO |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @Override |
| | | public boolean deleteBtmType(OsBtmTypeDTO btmTypeDTO) throws PLException { |
| | | VciBaseUtil.alertNotNull(btmTypeDTO,"å é¤çä¸å¡ç±»å"); |
| | | VciBaseUtil.alertNotNull(btmTypeDTO, "å é¤çä¸å¡ç±»å"); |
| | | String btmName = btmTypeDTO.getId(); |
| | | //åªè½å é¤å¶åèç¹ |
| | | if(Func.isNotBlank(btmTypeDTO.getfName())){ |
| | | throw new PLException("500",new String[]{"åªè½å é¤å¶åèç¹"}); |
| | | if (Func.isNotBlank(btmTypeDTO.getfName())) { |
| | | throw new PLException("500", new String[]{"åªè½å é¤å¶åèç¹"}); |
| | | } |
| | | // ä¸å¡ç±»åè¢«é¾æ¥ç±»å使ç¨, ä¸è½å é¤ |
| | | List<String> usedNameList = linkTypeService.getUsedBtmLinkList(btmName); |
| | | if (usedNameList != null && usedNameList.size() > 0) { |
| | | throw new PLException("500",new String[]{"该类åå·²è¢«é¾æ¥ç±»å使ç¨ï¼ç¦æ¢å é¤"}); |
| | | throw new PLException("500", new String[]{"该类åå·²è¢«é¾æ¥ç±»å使ç¨ï¼ç¦æ¢å é¤"}); |
| | | } |
| | | // ä¸å¡ç±»åå·²ç»çæäºä¸å¡å¯¹è±¡, ä¸è½å é¤ |
| | | if (hasInstanceByBtmName(btmName)) { |
| | | throw new PLException("500",new String[]{"该类åå·²æå®ä¾ï¼ç¦æ¢å é¤"}); |
| | | throw new PLException("500", new String[]{"该类åå·²æå®ä¾ï¼ç¦æ¢å é¤"}); |
| | | } |
| | | |
| | | |
| | | BizType bizType = new BizType(); |
| | | bizType.ts = btmTypeDTO.getTs().getTime(); |
| | | bizType.oid = btmTypeDTO.getOid(); |
| | |
| | | |
| | | /** |
| | | * ä¸è´æ§æ£æ¥ |
| | | * |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | |
| | | public BaseResult checkBtmConsistency() throws PLException { |
| | | String[] result = platformClientUtil.getBtmService().btmConsistencyCheck(); |
| | | Map<String, String> dbCheckMap = new HashMap<String, String>(); |
| | | for(int i = 0; i < result.length; i++){ |
| | | for (int i = 0; i < result.length; i++) { |
| | | String info = result[i]; |
| | | if(info.equals("")){ |
| | | if (info.equals("")) { |
| | | continue; |
| | | } |
| | | String[] infos = info.split("/DML"); |
| | |
| | | String dml = infos[1]; |
| | | dbCheckMap.put(typeName, dml); |
| | | } |
| | | if(dbCheckMap.size() < 1){ |
| | | if (dbCheckMap.size() < 1) { |
| | | return BaseResult.successMsg("æ°æ®åºä¸çè¡¨ç»æä¸ç±»åä¸è´,æ éä¿®å¤!!"); |
| | | }else{ |
| | | } else { |
| | | //éè¦ä¿®å¤æ¶å°±éè¦çé¢å¤èµ·å¯¹è¯æ¡è¿è¡å¤ç |
| | | List<Map> list = new ArrayList<>(); |
| | | list.add(dbCheckMap); |
| | |
| | | |
| | | /** |
| | | * ä¸è´æ§æ£æ¥ä¿®å¤åè½ |
| | | * |
| | | * @param repairData |
| | | * @return |
| | | */ |
| | | @Override |
| | | public BaseResult executeRepair(String repairData) throws Exception { |
| | | Map<String, String> dbCheckMap = new ObjectMapper().readValue(repairData, new TypeReference<Map<String,String>>(){}); |
| | | Map<String, String> dbCheckMap = new ObjectMapper().readValue(repairData, new TypeReference<Map<String, String>>() { |
| | | }); |
| | | List<String> list = this.getRepairDML(dbCheckMap); |
| | | if(list.size() < 1){ |
| | | if (list.size() < 1) { |
| | | return BaseResult.success(); |
| | | } |
| | | try { |
| | | String[] result = platformClientUtil.getBtmService().executeRepair(list.toArray(new String[0])); |
| | | return BaseResult.success(result); |
| | | }catch (PLException e){ |
| | | return BaseResult.fail("ä¸å¡ç±»åä¿®å¤å¤±è´¥ï¼åå ï¼"+VciBaseUtil.getExceptionMessage(e)); |
| | | } catch (PLException e) { |
| | | return BaseResult.fail("ä¸å¡ç±»åä¿®å¤å¤±è´¥ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å建è§å¾ |
| | | * |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | |
| | | |
| | | /** |
| | | * å 餿°æ®çé¢çæ¥è¯¢ |
| | | * |
| | | * @return ä¸å¡ç±»åï¼é¾æ¥ç±»å |
| | | */ |
| | | @Override |
| | |
| | | List<String> allBtmName = this.getAllBtmName(); |
| | | //è·å龿¥ç±»ååç§°éå |
| | | List<String> allLinkType = linkTypeService.getAllLtName(); |
| | | Map<String,List> map = new HashMap<>(); |
| | | map.put("btmType",allBtmName); |
| | | map.put("linkType",allLinkType); |
| | | map.put("table",tableList); |
| | | map.put("workFlow",workFlowTableList); |
| | | Map<String, List> map = new HashMap<>(); |
| | | map.put("btmType", allBtmName); |
| | | map.put("linkType", allLinkType); |
| | | map.put("table", tableList); |
| | | map.put("workFlow", workFlowTableList); |
| | | List<Map> list = new ArrayList<>(); |
| | | list.add(map); |
| | | return BaseResult.dataList(list); |
| | |
| | | |
| | | /** |
| | | * å 餿°æ® |
| | | * @param btmNames ä¸å¡ç±»åå |
| | | * |
| | | * @param btmNames ä¸å¡ç±»åå |
| | | * @param linkNames 龿¥ç±»åå |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @Override |
| | | public List<Map> truncateTable(String[] btmNames,String[] linkNames) throws PLException { |
| | | public List<Map> truncateTable(String[] btmNames, String[] linkNames) throws PLException { |
| | | List<Map> returnMapList = new ArrayList<>(); |
| | | Map<String, List<String>> map = new HashMap<>(); |
| | | map.put("btmSuccess",new ArrayList<>()); |
| | | map.put("btmFail",new ArrayList<>()); |
| | | map.put("linkSuccess",new ArrayList<>()); |
| | | map.put("linkFail",new ArrayList<>()); |
| | | if(Func.isNotEmpty(btmNames)){ |
| | | for(int i = 0; i < btmNames.length; i++){ |
| | | map.put("btmSuccess", new ArrayList<>()); |
| | | map.put("btmFail", new ArrayList<>()); |
| | | map.put("linkSuccess", new ArrayList<>()); |
| | | map.put("linkFail", new ArrayList<>()); |
| | | if (Func.isNotEmpty(btmNames)) { |
| | | for (int i = 0; i < btmNames.length; i++) { |
| | | String btName = btmNames[i]; |
| | | try { |
| | | if(platformClientUtil.getBtmService().truncateTable(btName)){ |
| | | if (platformClientUtil.getBtmService().truncateTable(btName)) { |
| | | //ä¿®æ¹æåè®°å½ä¸æåçä¸å¡ç±»åå |
| | | map.get("btmSuccess").add(btName); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | if(Func.isNotEmpty(linkNames)){ |
| | | if (Func.isNotEmpty(linkNames)) { |
| | | //truncate龿¥ç±»åæ°æ® |
| | | for(int i = 0; i < linkNames.length; i++){ |
| | | for (int i = 0; i < linkNames.length; i++) { |
| | | String ltName = linkNames[i]; |
| | | try { |
| | | if(platformClientUtil.getLinkTypeService().truncateTable(ltName)){ |
| | | if (platformClientUtil.getLinkTypeService().truncateTable(ltName)) { |
| | | map.get("linkSuccess").add(ltName); |
| | | } |
| | | } catch (PLException e1) { |
| | |
| | | |
| | | /** |
| | | * å é¤å
¨é¨ç±»å |
| | | * |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | |
| | | public BaseResult deleteAllType() throws PLException { |
| | | DeleteType deleteType = new DeleteType(); |
| | | //è·åå¾
å é¤çä¸å¡ç±»å |
| | | List<BizType> delBtList = deleteType.getDelBtList(); |
| | | List<BizType> delBtList = deleteType.getDelBtList(); |
| | | //è·åå¾
å é¤ç龿¥ç±»å |
| | | List<LinkType> ltNames = deleteType.getDelLtList(); |
| | | //è·åå¾
å é¤ç屿§ |
| | |
| | | platformClientUtil.getBtmService().deleteBtsAndTables(delBtList.toArray(new BizType[0])); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "æ¸
é¤ä¸å¡ç±»åå对åºè¡¨æ ¼æ¶åºç°å¼å¸¸ï¼åå ï¼"+VciBaseUtil.getExceptionMessage(e); |
| | | String exceptionMessage = "æ¸
é¤ä¸å¡ç±»åå对åºè¡¨æ ¼æ¶åºç°å¼å¸¸ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | |
| | | ClientServiceProvider.getOMDService().getLinkTypeService().deleteLtsAndTables(ltNames.toArray(new LinkType[0])); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "æ¸
é¤é¾æ¥ç±»åæ¶åºç°å¼å¸¸ï¼åå ï¼"+VciBaseUtil.getExceptionMessage(e); |
| | | String exceptionMessage = "æ¸
é¤é¾æ¥ç±»åæ¶åºç°å¼å¸¸ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | |
| | | platformClientUtil.getAttributeService().deleteAttributeDefs(abs); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "æ¸
é¤å±æ§æ± 屿§æ¶åºç°å¼å¸¸ï¼åå ï¼"+VciBaseUtil.getExceptionMessage(e); |
| | | String exceptionMessage = "æ¸
é¤å±æ§æ± 屿§æ¶åºç°å¼å¸¸ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | |
| | | platformClientUtil.getEnumService().deleteEnumTypes(delEnumList.toArray(new EnumType[0])); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "æ¸
é¤æä¸¾ç±»åæ¶åºç°å¼å¸¸ï¼åå ï¼"+VciBaseUtil.getExceptionMessage(e); |
| | | String exceptionMessage = "æ¸
é¤æä¸¾ç±»åæ¶åºç°å¼å¸¸ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | |
| | | platformClientUtil.getLifeCycleService().deleteLifeCycles(delLCList.toArray(new LifeCycle[0])); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "æ¸
é¤çå½å¨ææ¶åºç°å¼å¸¸ï¼åå ï¼"+VciBaseUtil.getExceptionMessage(e); |
| | | String exceptionMessage = "æ¸
é¤çå½å¨ææ¶åºç°å¼å¸¸ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | |
| | | platformClientUtil.getStatePoolService().deleteStatePools(delStateList.toArray(new StatePool[0])); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "æ¸
é¤ç¶ææ± ç¶ææ¶åºç°å¼å¸¸ï¼åå ï¼"+VciBaseUtil.getExceptionMessage(e); |
| | | String exceptionMessage = "æ¸
é¤ç¶ææ± ç¶ææ¶åºç°å¼å¸¸ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | |
| | | platformClientUtil.getVersionService().deleteVersionRules(delVRList.toArray(new VersionRule[0])); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "æ¸
é¤çæ¬è§åæ¶åºç°å¼å¸¸ï¼åå ï¼"+VciBaseUtil.getExceptionMessage(e); |
| | | String exceptionMessage = "æ¸
é¤çæ¬è§åæ¶åºç°å¼å¸¸ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸å¡ç±»ååç§°åå
¶ä¸ç屿§åç§°è·åå·²æçç´¢å¼ |
| | | * |
| | | * @param conditionMap æ ¹æ®æ¥è¯¢æ¡ä»¶ä¼ å: typename:ä¸å¡ç±»åå; |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<IndexObject> getIndexByCondition(Map<String,String> conditionMap) throws PLException { |
| | | if(Func.isEmpty(conditionMap)){ |
| | | public List<IndexObject> getIndexByCondition(Map<String, String> conditionMap) throws PLException { |
| | | if (Func.isEmpty(conditionMap)) { |
| | | return new ArrayList<>(); |
| | | } |
| | | List<String> indexNameList = new ArrayList<String>(); |
| | |
| | | //HashMap<String, String> indexmap = new HashMap<String, String>(); |
| | | BusinessObject findBTMObjects[] = platformClientUtil.getQueryService().findBTMObjects(qtl.getId(), OQTool.qtTOXMl(qtl).asXML()); |
| | | List<IndexObject> indexObjects = new ArrayList<>(); |
| | | for(int i = 0; i < findBTMObjects.length; i++) { |
| | | for (int i = 0; i < findBTMObjects.length; i++) { |
| | | BusinessObject findBTMObject = findBTMObjects[i]; |
| | | IndexObject indexObject = new IndexObject(); |
| | | indexObject.setOid(findBTMObject.oid); |
| | | indexObject.setDescription(findBTMObject.description); |
| | | indexObject.setCreateTime(Func.format(new Date(findBTMObject.createTime),DateUtil.PATTERN_DATE)); |
| | | indexObject.setIndexName(ObjectTool.getBOAttributeValue(findBTMObject,"indexname")); |
| | | indexObject.setTypeName(ObjectTool.getBOAttributeValue(findBTMObject,"typename")); |
| | | indexObject.setAttrNames(ObjectTool.getBOAttributeValue(findBTMObject,"attrname")); |
| | | indexObject.setCreateTime(Func.format(new Date(findBTMObject.createTime), DateUtil.PATTERN_DATE)); |
| | | indexObject.setIndexName(ObjectTool.getBOAttributeValue(findBTMObject, "indexname")); |
| | | indexObject.setTypeName(ObjectTool.getBOAttributeValue(findBTMObject, "typename")); |
| | | indexObject.setAttrNames(ObjectTool.getBOAttributeValue(findBTMObject, "attrname")); |
| | | indexObjects.add(indexObject); |
| | | } |
| | | return indexObjects; |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸å¡ç±»ååç§°åå
¶ä¸ç屿§åç§°å é¤ç´¢å¼ |
| | | * |
| | | * @param btmName |
| | | * @param indexName |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean delIndex(String btmName, String indexName) throws PLException { |
| | | VciBaseUtil.alertNotNull(btmName,"ä¸å¡ç±»åå",indexName,"ç´¢å¼å"); |
| | | VciBaseUtil.alertNotNull(btmName, "ä¸å¡ç±»åå", indexName, "ç´¢å¼å"); |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("typename",btmName); |
| | | conditionMap.put("indexname",indexName); |
| | | conditionMap.put("typename", btmName); |
| | | conditionMap.put("indexname", indexName); |
| | | List<IndexObject> bo2 = getIndexByCondition(conditionMap); |
| | | if(bo2!=null && bo2.size()>0) { |
| | | if (bo2 != null && bo2.size() > 0) { |
| | | String[] indexAttr = {indexName}; |
| | | |
| | | boolean alterFlag = platformClientUtil.getBtmService().dropIndex(btmName, indexAttr); |
| | |
| | | for (int i = 0; i < bo2.size(); i++) { |
| | | String oid = bo2.get(i).getOid(); |
| | | BusinessObject bo = platformClientUtil.getBOFactoryService().readBusinessObject(oid, "indexobject"); |
| | | platformClientUtil.getBOFactoryService().deleteBusinessObject(bo,1); |
| | | platformClientUtil.getBOFactoryService().deleteBusinessObject(bo, 1); |
| | | } |
| | | } |
| | | return true; |
| | |
| | | |
| | | /** |
| | | * ç»ä¸å¡ç±»åä¸çæå®å±æ§æ°å¢ç´¢å¼ |
| | | * |
| | | * @param indexObjectList |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean addIndex(List<IndexObject> indexObjectList) throws PLException { |
| | | VciBaseUtil.alertNotNull(indexObjectList,"æ°å¢çç´¢å¼ä¿¡æ¯"); |
| | | VciBaseUtil.alertNotNull(indexObjectList, "æ°å¢çç´¢å¼ä¿¡æ¯"); |
| | | String btmName = indexObjectList.get(0).getTypeName(); |
| | | String indexNames = indexObjectList.stream().map(IndexObject::getIndexName).collect(Collectors.joining(",")); |
| | | String[] oldindexAttr = {indexNames}; |
| | |
| | | List<BusinessObject> boList = new ArrayList<>(); |
| | | //å
æ¥è¯¢å½åæ·»å ç´¢å¼æ¯å¦å·²ç»åå¨ï¼å¦æåå¨å°±å
å é¤åæ°å¢å®ç°æ¿æ¢æä½ |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("typename",btmName); |
| | | conditionMap.put("typename", btmName); |
| | | //å
è¿æ ·å¤çï¼å端ç°å¨åªåäºå次ä¿åï¼æä»¥ä¸ç¨in |
| | | conditionMap.put("indexname", indexNames); |
| | | List<IndexObject> indexObjects = getIndexByCondition(conditionMap); |
| | | if(indexObjects!=null && indexObjects.size()>0){ |
| | | if (indexObjects != null && indexObjects.size() > 0) { |
| | | //ç´¢å¼ä¸å卿¶å é¤å°±ä¼æ¥éç´¢å¼ä¸åå¨ï¼æä»¥è¿éæç´¢å¼æå»å é¤ |
| | | boolean b = platformClientUtil.getBtmService().dropIndex(btmName, oldindexAttr); |
| | | if(b){ |
| | | for(int i = 0; i < indexObjects.size(); i ++){ |
| | | if (b) { |
| | | for (int i = 0; i < indexObjects.size(); i++) { |
| | | String oid = (String) indexObjects.get(i).getOid(); |
| | | bo = platformClientUtil.getBOFactoryService().readBusinessObject(oid,"indexobject"); |
| | | platformClientUtil.getBOFactoryService().deleteBusinessObject(bo,1); |
| | | bo = platformClientUtil.getBOFactoryService().readBusinessObject(oid, "indexobject"); |
| | | platformClientUtil.getBOFactoryService().deleteBusinessObject(bo, 1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | for(int i = 0; i < indexObjectList.size(); i ++){ |
| | | for (int i = 0; i < indexObjectList.size(); i++) { |
| | | IndexObject indexObject = indexObjectList.get(i); |
| | | //bo = platformClientUtil.getBOFService().initBusinessObject("indexobject"); |
| | | bo = boService.createCBOByBtmName("indexobject"); |
| | |
| | | attributeValues.add(new AttributeValue("attrname", indexObject.getAttrNames())); |
| | | bo.newAttrValList = attributeValues.toArray(new AttributeValue[attributeValues.size()]); |
| | | bo.description = indexObject.getDescription(); |
| | | String[] indexAttr = {indexObject.getIndexName(),indexObject.getAttrNames()}; |
| | | String[] indexAttr = {indexObject.getIndexName(), indexObject.getAttrNames()}; |
| | | //ç»æå®ä¸å¡ç±»åçæå®å±æ§åå»ºç´¢å¼ |
| | | boolean alterFlag = platformClientUtil.getBtmService().addIndex(btmName, indexAttr); |
| | | //ç´¢å¼å建æåä¹åï¼éè¦å卿åç´¢å¼å°ç´¢å¼è¡¨ä¸ |
| | | if(!alterFlag){ |
| | | if (!alterFlag) { |
| | | return false; |
| | | } |
| | | boList.add(bo); |
| | |
| | | //platformClientUtil.getBOFactoryService().createBusinessObject(bo,false,false); |
| | | } |
| | | //æ·»å ç´¢å¼ä¿¡æ¯å°ç´¢å¼çä¸å¡è¡¨ä¸ |
| | | platformClientUtil.getBOFactoryService().batchCreateBusinessObject(boList.toArray(new BusinessObject[boList.size()]),false,false); |
| | | platformClientUtil.getBOFactoryService().batchCreateBusinessObject(boList.toArray(new BusinessObject[boList.size()]), false, false); |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 导åºä¸å¡ç±»å |
| | | * oid ä¸å¡ç±»ååç§° |
| | | * |
| | | * @return åå»ºç»æ |
| | | */ |
| | | @Override |
| | |
| | | //设置åå |
| | | List<String> columns = new ArrayList<>( |
| | | Arrays.asList("ç±»ååç§°", "æ ç¾", "ç»§æ¿èª", "å®ç°ç±»", "æè¿°", "çæ¬è§å", "çæ¬å·è§å", |
| | | "æ¯å¦æå·¥è¾å
¥","åé符", "çæ¬¡å·è§å","çå½å¨æ", "å¤éçå½å¨æå表","屿§å表") |
| | | "æ¯å¦æå·¥è¾å
¥", "åé符", "çæ¬¡å·è§å", "çå½å¨æ", "å¤éçå½å¨æå表", "屿§å表") |
| | | ); |
| | | try { |
| | | new File(excelPath).createNewFile(); |
| | |
| | | List<WriteExcelData> excelDataList = new ArrayList<>(); |
| | | //设置å头 |
| | | for (int index = 0; index < columns.size(); index++) { |
| | | excelDataList.add(new WriteExcelData(0,index, columns.get(index))); |
| | | excelDataList.add(new WriteExcelData(0, index, columns.get(index))); |
| | | } |
| | | HashSet<String> attributes = new HashSet<>(); |
| | | int i = 0; |
| | | for (String name : names.split(",")) { |
| | | BizType bizType = platformClientUtil.getBtmService().getBizTypeByName(name); |
| | | excelDataList.add(new WriteExcelData(i+1,0, bizType.name)); |
| | | excelDataList.add(new WriteExcelData(i+1,1, bizType.label)); |
| | | excelDataList.add(new WriteExcelData(i+1,2, bizType.fName)); |
| | | excelDataList.add(new WriteExcelData(i+1,3, bizType.implClass)); |
| | | excelDataList.add(new WriteExcelData(i+1,4, bizType.description)); |
| | | excelDataList.add(new WriteExcelData(i+1,5, bizType.revLevel)); |
| | | excelDataList.add(new WriteExcelData(i+1,6, bizType.revRuleName)); |
| | | excelDataList.add(new WriteExcelData(i+1,7, bizType.revInput)); |
| | | excelDataList.add(new WriteExcelData(i+1,8, bizType.delimiter)); |
| | | excelDataList.add(new WriteExcelData(i+1,9, bizType.verRuleName)); |
| | | excelDataList.add(new WriteExcelData(i+1,10, bizType.lifeCycle)); |
| | | excelDataList.add(new WriteExcelData(i+1,11, String.join(",",bizType.lifeCycles))); |
| | | excelDataList.add(new WriteExcelData(i+1,12, String.join(",",bizType.apNameArray))); |
| | | excelDataList.add(new WriteExcelData(i + 1, 0, bizType.name)); |
| | | excelDataList.add(new WriteExcelData(i + 1, 1, bizType.label)); |
| | | excelDataList.add(new WriteExcelData(i + 1, 2, bizType.fName)); |
| | | excelDataList.add(new WriteExcelData(i + 1, 3, bizType.implClass)); |
| | | excelDataList.add(new WriteExcelData(i + 1, 4, bizType.description)); |
| | | excelDataList.add(new WriteExcelData(i + 1, 5, bizType.revLevel)); |
| | | excelDataList.add(new WriteExcelData(i + 1, 6, bizType.revRuleName)); |
| | | excelDataList.add(new WriteExcelData(i + 1, 7, bizType.revInput)); |
| | | excelDataList.add(new WriteExcelData(i + 1, 8, bizType.delimiter)); |
| | | excelDataList.add(new WriteExcelData(i + 1, 9, bizType.verRuleName)); |
| | | excelDataList.add(new WriteExcelData(i + 1, 10, bizType.lifeCycle)); |
| | | excelDataList.add(new WriteExcelData(i + 1, 11, String.join(",", bizType.lifeCycles))); |
| | | excelDataList.add(new WriteExcelData(i + 1, 12, String.join(",", bizType.apNameArray))); |
| | | attributes.addAll(Arrays.asList(bizType.apNameArray)); |
| | | i++; |
| | | } |
| | |
| | | ExcelUtil.writeDataToFile(excelPath, excelOption); |
| | | //导åºå±æ§ |
| | | String attrPath = attributeService.exportAttributes("btmattr", |
| | | attributes.stream().collect(Collectors.joining(",")),true); |
| | | attributes.stream().collect(Collectors.joining(",")), true); |
| | | //ç§»å¨å±æ§å°é¾æ¥ç±»åæä»¶å¤¹éé¢å» |
| | | FileUtil.move(new File(attrPath), new File(defaultTempFolder),true); |
| | | FileUtil.del(attrPath.substring(0,attrPath.lastIndexOf("\\"))); |
| | | }catch (IOException e) { |
| | | FileUtil.move(new File(attrPath), new File(defaultTempFolder), true); |
| | | FileUtil.del(attrPath.substring(0, attrPath.lastIndexOf("\\"))); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | File zip = ZipUtil.zip(defaultTempFolder); |
| | | FileUtil.del(defaultTempFolder + File.separator); |
| | | ControllerUtil.writeFileToResponse(response,zip.getAbsoluteFile()); |
| | | ControllerUtil.writeFileToResponse(response, zip.getAbsoluteFile()); |
| | | } |
| | | |
| | | /** |
| | | * 导å
¥ä¸å¡ç±»å |
| | | * |
| | | * @param file ä¸ä¼ çæä»¶ |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | } |
| | | //TODOï¼å¯¼å
¥å±æ§ï¼ä½æ¯è¿ä¸ªé»è¾å®é
ä¸åå¨ä¸äºé®é¢ï¼å¯¼å
¥ç屿§åªæ¯ä¸å¡ç±»åç屿§ä¸åºè¯¥å»ç»å±æ§æ± 导å
¥ï¼å¯è½æ¯æ³ç屿§ä¸åå¨çå°±æ°å¢ä¸æ¬¡ |
| | | BaseResult baseResult = attributeService.importAttributes(attrExcel,true); |
| | | if(!baseResult.isSuccess()){ |
| | | BaseResult baseResult = attributeService.importAttributes(attrExcel, true); |
| | | if (!baseResult.isSuccess()) { |
| | | //å é¤ä¸ä¼ çæä»¶å¤¹ |
| | | FileUtil.del(defaultTempFolder + File.separator); |
| | | return baseResult; |
| | |
| | | return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"没æå¯¼å
¥ç龿¥æä»¶ã导å
¥ç»æ¢ï¼"}); |
| | | } |
| | | } |
| | | try{ |
| | | try { |
| | | //1ã读åexcelä¸çæ°æ®ï¼ç»æå¯¹è±¡ |
| | | ReadExcelOption excelOption = new ReadExcelOption(); |
| | | List<OsBtmTypePO> poList = ExcelUtil.readDataObjectFromExcel(btmExcel, OsBtmTypePO.class,excelOption,(value, po, fieldName)->{}); |
| | | List<OsBtmTypePO> poList = ExcelUtil.readDataObjectFromExcel(btmExcel, OsBtmTypePO.class, excelOption, (value, po, fieldName) -> { |
| | | }); |
| | | //å»é¤é½æ¯ç©ºçæ
åµ |
| | | if(CollectionUtils.isEmpty(poList)){ |
| | | return BaseResult.fail(ExcelLangCodeConstant.IMPORT_CONTENT_NULL,new String[]{}); |
| | | if (CollectionUtils.isEmpty(poList)) { |
| | | return BaseResult.fail(ExcelLangCodeConstant.IMPORT_CONTENT_NULL, new String[]{}); |
| | | } |
| | | //å½åexcel䏿¯å¦éå¤ç¨çå¤éMap:ï¼keyï¼å¤é屿§ï¼valueï¼è¡å·ï¼ |
| | | Map<String, String> excelReapeat = new HashMap<>(); |
| | |
| | | |
| | | //夿å¿
填屿§æ¯å¦ä¸ºç©ºï¼ç¨æ·æ¯å¦å·²åå¨ï¼ä»¥åé¨é¨æ¯å¦å¡«éçæ ¡éªé»è¾ |
| | | poList.stream().forEach(osBtmTypePO -> { |
| | | if(Func.isBlank(osBtmTypePO.getName())){//屿§åå¤ç©º |
| | | throw new VciBaseException("第ã"+osBtmTypePO.getRowIndex()+"ãè¡ï¼name"); |
| | | }else if(osBtmTypePO.getName().length() > maxLength){ |
| | | throw new VciBaseException("第ã"+osBtmTypePO.getRowIndex()+"ãè¡ï¼ä¸å¡ç±»ååé¿åº¦ä¸è½è¶
è¿" + maxLength); |
| | | }else if(!osBtmTypePO.getName().matches("^[A-Za-z]+$")){ |
| | | throw new VciBaseException("第ã"+osBtmTypePO.getRowIndex()+"ãè¡ï¼ä¸å¡ç±»ååç§°åªè½ä¸ºè±æåæ¯"); |
| | | }else if (osBtmTypePO.getName().length() > maxLength) { |
| | | throw new VciBaseException("第ã"+osBtmTypePO.getRowIndex()+"ãè¡ï¼ä¸å¡ç±»ååé¿åº¦ä¸è½è¶
è¿" + maxLength); |
| | | }else if(excelReapeat.containsKey(osBtmTypePO.getName())){//ä¸å¡ç±»ååå¨è¡¨æ ¼ä¸å¤é |
| | | throw new VciBaseException("第ã"+excelReapeat.get(osBtmTypePO.getName())+"ãè¡å第ã"+osBtmTypePO.getRowIndex()+"ãè¡æ°æ®ï¼ä¸å¡ç±»ååéå¤"); |
| | | }else if (Func.isBlank(osBtmTypePO.getLifeCycle())) { |
| | | throw new VciBaseException("第ã"+osBtmTypePO.getRowIndex()+"ãè¡ï¼çå½å¨æä¸è½ä¸ºç©º"); |
| | | }else if ("true".equalsIgnoreCase(osBtmTypePO.getRevInput()) && Func.isBlank(osBtmTypePO.getRevRuleName())) { |
| | | throw new VciBaseException("第ã"+osBtmTypePO.getRowIndex()+"ãè¡ï¼çæ¬å·è§åä¸è½ä¸ºç©º"); |
| | | if (Func.isBlank(osBtmTypePO.getName())) {//屿§åå¤ç©º |
| | | throw new VciBaseException("第ã" + osBtmTypePO.getRowIndex() + "ãè¡ï¼name"); |
| | | } else if (osBtmTypePO.getName().length() > maxLength) { |
| | | throw new VciBaseException("第ã" + osBtmTypePO.getRowIndex() + "ãè¡ï¼ä¸å¡ç±»ååé¿åº¦ä¸è½è¶
è¿" + maxLength); |
| | | } else if (!osBtmTypePO.getName().matches("^[A-Za-z]+$")) { |
| | | throw new VciBaseException("第ã" + osBtmTypePO.getRowIndex() + "ãè¡ï¼ä¸å¡ç±»ååç§°åªè½ä¸ºè±æåæ¯"); |
| | | } else if (osBtmTypePO.getName().length() > maxLength) { |
| | | throw new VciBaseException("第ã" + osBtmTypePO.getRowIndex() + "ãè¡ï¼ä¸å¡ç±»ååé¿åº¦ä¸è½è¶
è¿" + maxLength); |
| | | } else if (excelReapeat.containsKey(osBtmTypePO.getName())) {//ä¸å¡ç±»ååå¨è¡¨æ ¼ä¸å¤é |
| | | throw new VciBaseException("第ã" + excelReapeat.get(osBtmTypePO.getName()) + "ãè¡å第ã" + osBtmTypePO.getRowIndex() + "ãè¡æ°æ®ï¼ä¸å¡ç±»ååéå¤"); |
| | | } else if (Func.isBlank(osBtmTypePO.getLifeCycle())) { |
| | | throw new VciBaseException("第ã" + osBtmTypePO.getRowIndex() + "ãè¡ï¼çå½å¨æä¸è½ä¸ºç©º"); |
| | | } else if ("true".equalsIgnoreCase(osBtmTypePO.getRevInput()) && Func.isBlank(osBtmTypePO.getRevRuleName())) { |
| | | throw new VciBaseException("第ã" + osBtmTypePO.getRowIndex() + "ãè¡ï¼çæ¬å·è§åä¸è½ä¸ºç©º"); |
| | | } |
| | | try { |
| | | BizType historyBtm = platformClientUtil.getBtmService().getBizTypeByName(osBtmTypePO.getName()); |
| | | //å·²ææ¤æ°æ®è¿è¡å é¤è¦ç |
| | | if(historyBtm != null && !historyBtm.name.equals("")){ |
| | | if (historyBtm != null && !historyBtm.name.equals("")) { |
| | | platformClientUtil.getBtmService().deleteBizType(historyBtm); |
| | | } |
| | | } catch (PLException e) { |
| | |
| | | } |
| | | |
| | | //屿§åexcelä¸å¤éå¤ç |
| | | excelReapeat.put(osBtmTypePO.getName(),osBtmTypePO.getRowIndex()); |
| | | excelReapeat.put(osBtmTypePO.getName(), osBtmTypePO.getRowIndex()); |
| | | BizType bizType = new BizType(); |
| | | bizType.name = osBtmTypePO.getName(); |
| | | bizType.label = osBtmTypePO.getLable(); |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | }); |
| | | }catch (Exception e){ |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error("读åexcelå
å®¹æ¶æä¿åä¸å¡ç±»åä¿¡æ¯æ¶åºç°äºé误ï¼å
·ä½åå ï¼",VciBaseUtil.getExceptionMessage(e)); |
| | | } catch (Exception e) { |
| | | if (logger.isErrorEnabled()) { |
| | | logger.error("读åexcelå
å®¹æ¶æä¿åä¸å¡ç±»åä¿¡æ¯æ¶åºç°äºé误ï¼å
·ä½åå ï¼", VciBaseUtil.getExceptionMessage(e)); |
| | | } |
| | | e.printStackTrace(); |
| | | return BaseResult.fail(VciBaseUtil.getExceptionMessage(e),new String[]{},e); |
| | | return BaseResult.fail(VciBaseUtil.getExceptionMessage(e), new String[]{}, e); |
| | | } |
| | | //å é¤ä¸ä¼ çæä»¶å¤¹ |
| | | FileUtil.del(defaultTempFolder + File.separator); |
| | |
| | | |
| | | /** |
| | | * è·åéè¦ä¿®å¤ç伪sql |
| | | * |
| | | * @param dbCheckMap |
| | | * @return |
| | | */ |
| | | private List<String> getRepairDML(Map<String, String> dbCheckMap) { |
| | | List<String> list = new ArrayList<String>(); |
| | | for(Iterator<String> ite = dbCheckMap.keySet().iterator(); ite.hasNext();){ |
| | | for (Iterator<String> ite = dbCheckMap.keySet().iterator(); ite.hasNext(); ) { |
| | | String type = ite.next(); |
| | | String dml = dbCheckMap.get(type); |
| | | list.add(type + "/DML" + dml); |
| | |
| | | e.printStackTrace(); |
| | | String exceptionMessage = VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | throw new PLException("500",new String[]{exceptionMessage}); |
| | | throw new PLException("500", new String[]{exceptionMessage}); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | private List<Tree> getChildren(List<OsBtmTypeVO> osBtmTypeVOS,OsBtmTypeVO parentBIzType){ |
| | | List<Tree> trees= new ArrayList<>(); |
| | | private List<Tree> getChildren(List<OsBtmTypeVO> osBtmTypeVOS, OsBtmTypeVO parentBIzType) { |
| | | List<Tree> trees = new ArrayList<>(); |
| | | for (OsBtmTypeVO bizType : osBtmTypeVOS) { |
| | | if(StringUtils.isBlank(bizType.getfName())){ |
| | | if (StringUtils.isBlank(bizType.getfName())) { |
| | | continue; |
| | | } |
| | | if(bizType.getfName().equals(parentBIzType.getId())){ |
| | | if (bizType.getfName().equals(parentBIzType.getId())) { |
| | | Tree tree = new Tree(); |
| | | tree.setOid(bizType.getOid()); |
| | | tree.setParentName(parentBIzType.getfName()); |
| | |
| | | tree.setLeaf(true); |
| | | tree.setText(bizType.getDescription()); |
| | | tree.setAttributes(WebUtil.objectToMapString(bizType)); |
| | | tree.setChildren(getChildren(osBtmTypeVOS,bizType)); |
| | | tree.setChildren(getChildren(osBtmTypeVOS, bizType)); |
| | | trees.add(tree); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * å°ä¸å¡ç±»åæ¼æ¥json |
| | | * |
| | | * @param nodeVOList 对象èç¹çä¿¡æ¯ |
| | | * @param relationVOList å
³ç³»çä¿¡æ¯ |
| | | * @param btmTypeVO ä¸å¡ç±»åæ¾ç¤ºå¯¹è±¡ |
| | | * @param hasRefer å
å«åç
§ |
| | | * @param nodeVOList 对象èç¹çä¿¡æ¯ |
| | | * @param relationVOList å
³ç³»çä¿¡æ¯ |
| | | * @param btmTypeVO ä¸å¡ç±»åæ¾ç¤ºå¯¹è±¡ |
| | | * @param hasRefer å
å«åç
§ |
| | | */ |
| | | private void splicingBtmType2Json(List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList, OsBtmTypeVO btmTypeVO,boolean hasRefer) { |
| | | private void splicingBtmType2Json(List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList, OsBtmTypeVO btmTypeVO, boolean hasRefer) { |
| | | OsERNodeVO nodeVO = new OsERNodeVO(); |
| | | nodeVO.setKey(btmTypeVO.getId() + " " + btmTypeVO.getName()); |
| | | List<OsERNodePropertyVO> itemList = new ArrayList<>(); |
| | |
| | | OsERNodePropertyVO nodePropertyVO = new OsERNodePropertyVO(); |
| | | nodePropertyVO.setName(attribute.getId() + " " + attribute.getName()); |
| | | nodePropertyVO.setKey("oid".equals(attribute.getId().toLowerCase())); |
| | | if(StringUtils.isNotBlank(attribute.getReferBtmTypeId())){ |
| | | if (StringUtils.isNotBlank(attribute.getReferBtmTypeId())) { |
| | | //åç
§ç屿§ï¼è®¾ç½®ä¸ºé»è² |
| | | nodePropertyVO.setColor("#FEDD32FF"); |
| | | }else{ |
| | | } else { |
| | | nodePropertyVO.setColor("#000"); |
| | | } |
| | | itemList.add(nodePropertyVO); |
| | | //夿åç
§ |
| | | if(hasRefer) { |
| | | if (hasRefer) { |
| | | selectReferenceBtmType(attribute, btmTypeVO, nodeVOList, relationVOList); |
| | | } |
| | | }); |
| | |
| | | /** |
| | | * 夿ä¸å¡ç±»åç屿§æ¯ä¸æ¯åç
§ç±»åï¼å¹¶å°åç
§æ·»å å°ERå¾ä¸ |
| | | * |
| | | * @param attribute ä¸å¡ç±»å屿§ |
| | | * @param nodeVOList èç¹ä¿¡æ¯ |
| | | * @param btmTypeVO ä¸å¡ç±»å |
| | | * @param attribute ä¸å¡ç±»å屿§ |
| | | * @param nodeVOList èç¹ä¿¡æ¯ |
| | | * @param btmTypeVO ä¸å¡ç±»å |
| | | * @param relationVOList å
³ç³»ä¿¡æ¯ |
| | | */ |
| | | private void selectReferenceBtmType(OsBtmTypeAttributeVO attribute, OsBtmTypeVO btmTypeVO, |
| | |
| | | nodeVO.setKey(referenceBtmType.getId() + " " + referenceBtmType.getName()); |
| | | |
| | | List<OsERNodePropertyVO> items = new ArrayList<>(); |
| | | if(referenceBtmType.getId().equalsIgnoreCase(btmTypeVO.getId())){ |
| | | if (referenceBtmType.getId().equalsIgnoreCase(btmTypeVO.getId())) { |
| | | //åç
§èªå·±çå
容 |
| | | OsERRelationVO relationVO = new OsERRelationVO(); |
| | | relationVO.setTo(referenceBtmType.getId() + " " + referenceBtmType.getName()); |
| | | relationVO.setFrom(btmTypeVO.getId() + " " + btmTypeVO.getName()); |
| | | relationVO.setToText("èªåç
§"); |
| | | relationVOList.add(relationVO); |
| | | }else { |
| | | } else { |
| | | referenceBtmAttributes.forEach(attr -> { |
| | | OsERNodePropertyVO nodePropertyVO = new OsERNodePropertyVO(); |
| | | nodePropertyVO.setName(attr.getId() + " " + attr.getName()); |
| | |
| | | /** |
| | | * å è½½ä¸å¡ç±»åæå
³èç龿¥ç±»å |
| | | * |
| | | * @param nodeVOList èç¹ä¿¡æ¯ |
| | | * @param nodeVOList èç¹ä¿¡æ¯ |
| | | * @param relationVOList å
³ç³»çä¿¡æ¯ |
| | | * @param btmTypeVO ä¸å¡ç±»å |
| | | * @param btmTypeVO ä¸å¡ç±»å |
| | | */ |
| | | private void loadAllLinkTypeByBtmType(List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList, OsBtmTypeVO btmTypeVO) { |
| | | Map<String, OsLinkTypeVO> linkTypeVOMap = linkTypeService.selectAllLinkMap(); |
| | | Collection<OsLinkTypeVO> linkTypeVOS = linkTypeVOMap.values(); |
| | | Set<OsLinkTypeVO> fromLinkTypeVOList = linkTypeVOS.stream().filter(link -> |
| | | Arrays.stream(link.getFromBtmType().split(",")).anyMatch(s->s.equalsIgnoreCase(btmTypeVO.getId())) |
| | | Arrays.stream(link.getFromBtmType().split(",")).anyMatch(s -> s.equalsIgnoreCase(btmTypeVO.getId())) |
| | | ).collect(Collectors.toSet()); |
| | | Set<OsLinkTypeVO> toLinkTypeList = linkTypeVOS.stream().filter(link -> |
| | | Arrays.stream(link.getToBtmType().split(",")).anyMatch(s->s.equalsIgnoreCase(btmTypeVO.getId()))).collect(Collectors.toSet()); |
| | | Arrays.stream(link.getToBtmType().split(",")).anyMatch(s -> s.equalsIgnoreCase(btmTypeVO.getId()))).collect(Collectors.toSet()); |
| | | List<OsLinkTypeVO> linkTypeVOList = new ArrayList<>(); |
| | | linkTypeVOList.addAll(fromLinkTypeVOList); |
| | | linkTypeVOList.addAll(toLinkTypeList); |
| | | if (!CollectionUtils.isEmpty(linkTypeVOList)) { |
| | | splicingLinkType2Json(nodeVOList, relationVOList,linkTypeVOList,btmTypeVO,false); |
| | | splicingLinkType2Json(nodeVOList, relationVOList, linkTypeVOList, btmTypeVO, false); |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * å°é¾æ¥ç±»åæ¼æ¥æjson |
| | | * |
| | | * @param nodeVOList èç¹ä¿¡æ¯ |
| | | * @param relationVOList å
³ç³»ä¿¡æ¯ |
| | | * @param linkTypeVOs 龿¥ç±»å |
| | | * @param btmTypeVO ä¸å¡ç±»åçæ¾ç¤ºå¯¹è±¡ |
| | | * @param used æ¯å¦ä¸ºè¢«ä½¿ç¨ |
| | | * @param nodeVOList èç¹ä¿¡æ¯ |
| | | * @param relationVOList å
³ç³»ä¿¡æ¯ |
| | | * @param linkTypeVOs 龿¥ç±»å |
| | | * @param btmTypeVO ä¸å¡ç±»åçæ¾ç¤ºå¯¹è±¡ |
| | | * @param used æ¯å¦ä¸ºè¢«ä½¿ç¨ |
| | | */ |
| | | private void splicingLinkType2Json(List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList, |
| | | List<OsLinkTypeVO> linkTypeVOs,OsBtmTypeVO btmTypeVO,boolean used) { |
| | | List<OsLinkTypeVO> linkTypeVOs, OsBtmTypeVO btmTypeVO, boolean used) { |
| | | linkTypeVOs.forEach(link -> { |
| | | List<OsLinkTypeAttributeVO> attributeList = link.getAttributes(); |
| | | OsERNodeVO nodeVO= new OsERNodeVO(); |
| | | OsERNodeVO nodeVO = new OsERNodeVO(); |
| | | nodeVO.setKey(link.getId() + " " + link.getName()); |
| | | List<OsERNodePropertyVO> items = new ArrayList<>(); |
| | | attributeList.forEach(attr -> { |
| | | OsERNodePropertyVO nodePropertyVO = new OsERNodePropertyVO(); |
| | | nodePropertyVO.setName(attr.getId() + " " + attr.getName()); |
| | | nodePropertyVO.setKey("oid".equals(attr.getId().toLowerCase())); |
| | | if(StringUtils.isNotBlank(attr.getReferBtmTypeId())) { |
| | | if (StringUtils.isNotBlank(attr.getReferBtmTypeId())) { |
| | | nodePropertyVO.setColor("#FEDD32FF"); |
| | | }else { |
| | | } else { |
| | | nodePropertyVO.setColor("#1c446f"); |
| | | } |
| | | items.add(nodePropertyVO); |
| | | //夿åç
§ |
| | | if(!used) { |
| | | if (!used) { |
| | | selectReferenceLinkType(attr, link, nodeVOList, relationVOList); |
| | | } |
| | | }); |
| | |
| | | |
| | | nodeVOList.add(nodeVO); |
| | | |
| | | if(used){ |
| | | if (used) { |
| | | relationVO.setText("被å¼ç¨"); |
| | | } |
| | | //妿å½åçfrom端ï¼é£ä¹å°±æ¾ç¤ºto端ç |
| | | //妿å½åçæ¯to端çï¼é£ä¹å°±æ¾ç¤ºfrom端çå
容 |
| | | if(Arrays.stream(link.getFromBtmType().split(",")).anyMatch(s->s.equalsIgnoreCase(btmTypeVO.getId()))){ |
| | | if (Arrays.stream(link.getFromBtmType().split(",")).anyMatch(s -> s.equalsIgnoreCase(btmTypeVO.getId()))) { |
| | | //è¿ä¸ªæ¯from端 |
| | | if(!used) { |
| | | relationVO.setToText("from端"); |
| | | } |
| | | if (!used) { |
| | | relationVO.setToText("from端"); |
| | | } |
| | | //æ¾è¿ä¸ªé¾æ¥ç±»åçto端çä¸å¡ç±»å |
| | | link.getToBtmTypeVOS().stream().forEach(toBtm->{ |
| | | splicingBtmType2JsonForLink(nodeVOList,relationVOList,link,toBtm,true); |
| | | }); |
| | | }else{ |
| | | if(!used) { |
| | | link.getToBtmTypeVOS().stream().forEach(toBtm -> { |
| | | splicingBtmType2JsonForLink(nodeVOList, relationVOList, link, toBtm, true); |
| | | }); |
| | | } else { |
| | | if (!used) { |
| | | relationVO.setToText("to端"); |
| | | } |
| | | link.getFromBtmTypeVOS().stream().forEach(fromBtm->{ |
| | | splicingBtmType2JsonForLink(nodeVOList,relationVOList,link,fromBtm,false); |
| | | link.getFromBtmTypeVOS().stream().forEach(fromBtm -> { |
| | | splicingBtmType2JsonForLink(nodeVOList, relationVOList, link, fromBtm, false); |
| | | }); |
| | | } |
| | | relationVOList.add(relationVO); |
| | |
| | | |
| | | /** |
| | | * 龿¥ç±»åå
³é®çä¸å¡ç±»å |
| | | * @param nodeVOList 对象å表 |
| | | * |
| | | * @param nodeVOList 对象å表 |
| | | * @param relationVOList å
³èå
³ç³»å表 |
| | | * @param link 龿¥ç±»å |
| | | * @param btmTypeVO ä¸å¡ç±»å |
| | | * @param to æ¯å¦ä¸ºto端 |
| | | * @param link 龿¥ç±»å |
| | | * @param btmTypeVO ä¸å¡ç±»å |
| | | * @param to æ¯å¦ä¸ºto端 |
| | | */ |
| | | private void splicingBtmType2JsonForLink(List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList, OsLinkTypeVO link, OsBtmTypeVO btmTypeVO, boolean to) { |
| | | OsERNodeVO nodeVO = new OsERNodeVO(); |
| | |
| | | OsERRelationVO relationVO = new OsERRelationVO(); |
| | | relationVO.setFrom(link.getId() + " " + link.getName()); |
| | | relationVO.setTo(btmTypeVO.getId() + " " + btmTypeVO.getName()); |
| | | relationVO.setToText(to?"to端":"from端"); |
| | | relationVO.setToText(to ? "to端" : "from端"); |
| | | relationVOList.add(relationVO); |
| | | nodeVOList.add(nodeVO); |
| | | } |
| | |
| | | /** |
| | | * 夿龿¥ç±»åç屿§æ¯ä¸æ¯åç
§ç±»åï¼å¹¶å°åç
§æ·»å å°ERå¾ä¸ |
| | | * |
| | | * @param attr 龿¥ç±»åç屿§ |
| | | * @param linkTypeVO 龿¥ç±»åçå
容 |
| | | * @param nodeVOList èç¹å¯¹è±¡ |
| | | * @param attr 龿¥ç±»åç屿§ |
| | | * @param linkTypeVO 龿¥ç±»åçå
容 |
| | | * @param nodeVOList èç¹å¯¹è±¡ |
| | | * @param relationVOList å
³ç³»å¯¹è±¡ |
| | | */ |
| | | private void selectReferenceLinkType(OsLinkTypeAttributeVO attr, OsLinkTypeVO linkTypeVO,List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList) { |
| | | private void selectReferenceLinkType(OsLinkTypeAttributeVO attr, OsLinkTypeVO linkTypeVO, List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList) { |
| | | if (StringUtils.isNotBlank(attr.getReferBtmTypeId())) { |
| | | //æ¯åç
§ç±»åç |
| | | OsBtmTypeVO referenceBtmType = getBtmById(attr.getReferBtmTypeId()); |
| | |
| | | /** |
| | | * å°è£
å é¤å
¨é¨ç±»åç¸å
³çæ¥è¯¢æ¹æ³çå
é¨ç±» |
| | | */ |
| | | private class DeleteType{ |
| | | private class DeleteType { |
| | | |
| | | private List<String> exceptBts, exceptAbs, exceptEnums, exceptRev, exceptLCs, exceptStates; |
| | | |
| | |
| | | |
| | | /** |
| | | * è·åéè¦å é¤çä¸å¡ç±»å |
| | | * |
| | | * @return |
| | | */ |
| | | public List<BizType> getDelBtList() throws PLException { |
| | | List<BizType> list = new ArrayList<>(); |
| | | BizType[] bts = platformClientUtil.getBtmService().getBizTypes(""); |
| | | for(BizType bt : bts){ |
| | | for (BizType bt : bts) { |
| | | boolean exceptFlag = false; |
| | | for(String except : exceptBts){ |
| | | if(except.equalsIgnoreCase(bt.name)){ |
| | | for (String except : exceptBts) { |
| | | if (except.equalsIgnoreCase(bt.name)) { |
| | | exceptFlag = true; |
| | | break; |
| | | } |
| | | } |
| | | if(!exceptFlag){ |
| | | if (!exceptFlag) { |
| | | list.add(bt); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * è·åéè¦å é¤ç龿¥ç±»å |
| | | * |
| | | * @return |
| | | */ |
| | | public List<LinkType> getDelLtList() throws PLException { |
| | |
| | | |
| | | /** |
| | | * è·åå¾
å é¤ç屿§ |
| | | * |
| | | * @return |
| | | */ |
| | | public List<String> getDelAbList() { |
| | |
| | | } |
| | | //便®ä¿ççç±»åæé ä¿çç屿§ |
| | | exceptAbs = new ArrayList<String>(); |
| | | for(String except : exceptBts){ |
| | | for (String except : exceptBts) { |
| | | String[] btmApNameArray = null; |
| | | try { |
| | | btmApNameArray = platformClientUtil.getBtmService().getAttributeNames(except); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(btmApNameArray != null){ |
| | | for(String abName : btmApNameArray){ |
| | | if(!exceptAbs.contains(abName)){ |
| | | if (btmApNameArray != null) { |
| | | for (String abName : btmApNameArray) { |
| | | if (!exceptAbs.contains(abName)) { |
| | | exceptAbs.add(abName); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //æé å¯å é¤ç屿§ |
| | | if(attribItems != null){ |
| | | for(AttributeDef ab : attribItems){ |
| | | if (attribItems != null) { |
| | | for (AttributeDef ab : attribItems) { |
| | | String abName = ab.name; |
| | | if(!exceptAbs.contains(abName)){ |
| | | if (!exceptAbs.contains(abName)) { |
| | | list.add(abName); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * è·åå¾
å é¤çæä¸¾ç±»å |
| | | * |
| | | * @return |
| | | */ |
| | | public List<EnumType> getDelEnumList() { |
| | |
| | | exceptEnums = new ArrayList<String>(); |
| | | EnumType[] emItems = ClientServiceProvider.getOMDService().getEnumService().getEnumTypes("", 0, 0); |
| | | AttributeDef[] abs = platformClientUtil.getAttributeService().getAttributeDefsByNames(exceptAbs.toArray(new String[0])); |
| | | for(AttributeDef ab : abs){ |
| | | for (AttributeDef ab : abs) { |
| | | OtherInfo otherInfo = OtherInfo.getOtherInfoByText(ab.other); |
| | | String enumName = otherInfo.getEnumName(); |
| | | if(enumName != null && !enumName.equals("") && !exceptEnums.contains(enumName)){ |
| | | if (enumName != null && !enumName.equals("") && !exceptEnums.contains(enumName)) { |
| | | exceptEnums.add(enumName); |
| | | } |
| | | } |
| | | for(EnumType em : emItems){ |
| | | if(!exceptEnums.contains(em.name)){ |
| | | for (EnumType em : emItems) { |
| | | if (!exceptEnums.contains(em.name)) { |
| | | list.add(em); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * è·åå¾
å é¤ççå½å¨æ |
| | | * |
| | | * @return |
| | | */ |
| | | public List<LifeCycle> getDelLCList(){ |
| | | public List<LifeCycle> getDelLCList() { |
| | | List<LifeCycle> list = new ArrayList<LifeCycle>(); |
| | | exceptLCs = new ArrayList<String>(); |
| | | exceptStates = new ArrayList<String>(); |
| | | for(String btName : exceptBts){ |
| | | for (String btName : exceptBts) { |
| | | try { |
| | | BizType bt = platformClientUtil.getBtmService().getBizTypeByName(btName); |
| | | String lcName = bt.lifeCycle; |
| | | if(lcName != null && !lcName.equals("") && !exceptLCs.contains(lcName)){ |
| | | if (lcName != null && !lcName.equals("") && !exceptLCs.contains(lcName)) { |
| | | exceptLCs.add(lcName); |
| | | } |
| | | } catch (PLException e) { |
| | |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(lcs != null){ |
| | | for(LifeCycle lc : lcs){ |
| | | if (lcs != null) { |
| | | for (LifeCycle lc : lcs) { |
| | | String name = lc.name; |
| | | if(name != null && !name.equals("") && !exceptLCs.contains(name)){ |
| | | if (name != null && !name.equals("") && !exceptLCs.contains(name)) { |
| | | list.add(lc); |
| | | }else{ |
| | | } else { |
| | | //ä¿ççç¶ææ± |
| | | Bound[] bounds = lc.bounds; |
| | | for(Bound bound : bounds){ |
| | | for (Bound bound : bounds) { |
| | | String sName = bound.name; |
| | | exceptStates.add(sName); |
| | | } |
| | |
| | | |
| | | /** |
| | | * è·åå¾
å é¤çç¶æ |
| | | * |
| | | * @return |
| | | */ |
| | | public List<StatePool> getDelSPList(){ |
| | | public List<StatePool> getDelSPList() { |
| | | List<StatePool> list = new ArrayList<StatePool>(); |
| | | StatePool[] states = null; |
| | | try { |
| | |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(states != null){ |
| | | for(StatePool state : states){ |
| | | if (states != null) { |
| | | for (StatePool state : states) { |
| | | String name = state.name; |
| | | if(name != null && !name.equals("") && !exceptStates.contains(name)){ |
| | | if (name != null && !name.equals("") && !exceptStates.contains(name)) { |
| | | list.add(state); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * è·åå¾
å é¤ççæ¬è§å |
| | | * |
| | | * @return |
| | | */ |
| | | public List<VersionRule> getDelVRList(){ |
| | | public List<VersionRule> getDelVRList() { |
| | | List<VersionRule> list = new ArrayList<VersionRule>(); |
| | | exceptRev = new ArrayList<String>(); |
| | | for(String btName : exceptBts){ |
| | | for (String btName : exceptBts) { |
| | | try { |
| | | BizType bt = platformClientUtil.getBtmService().getBizTypeByName(btName); |
| | | String revName = bt.revRuleName; |
| | | if(revName != null && !revName.equals("") && !exceptRev.contains(revName)){ |
| | | if (revName != null && !revName.equals("") && !exceptRev.contains(revName)) { |
| | | exceptRev.add(revName); |
| | | } |
| | | } catch (PLException e) { |
| | |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(revs != null){ |
| | | for(VersionRule rev : revs){ |
| | | if (revs != null) { |
| | | for (VersionRule rev : revs) { |
| | | String name = rev.name; |
| | | if(name != null && !name.equals("") && !exceptRev.contains(name)){ |
| | | if (name != null && !name.equals("") && !exceptRev.contains(name)) { |
| | | list.add(rev); |
| | | } |
| | | } |