| | |
| | | dataSourceTransactionManager.commit(transaction); |
| | | }else { |
| | | dataSourceTransactionManager.rollback(transaction); |
| | | return R.fail(result.getMsg()); |
| | | } |
| | | } |
| | | } catch (Throwable e) { |
| | | if (autoCreateTable) { |
| | | dataSourceTransactionManager.rollback(transaction); |
| | | throw new VciBaseException(e.getMessage()); |
| | | } |
| | | } |
| | | return R.data(btmTypeVO); |
| | |
| | | if (btmTypeDTO.isRevisionFlag()){ |
| | | // 需要控制版本 |
| | | // 检查使用的版本规则是否存在 |
| | | if (StringUtils.isNotBlank(btmTypeDTO.getRevisionRuleId())) { |
| | | if (!revisionRuleService.checkRevisionRuleExist(btmTypeDTO.getRevisionRuleId())) { |
| | | throw new VciBaseException("版本规则{0}[{1}]在系统中不存在,请先查证", |
| | | new Object[]{btmTypeDTO.getRevisionRuleId(), btmTypeDTO.getRevisionRuleName()}); |
| | | } |
| | | if (StringUtils.isNotBlank(btmTypeDTO.getRevisionRuleId())) { |
| | | if (!revisionRuleService.checkRevisionRuleExist(btmTypeDTO.getRevisionRuleId())) { |
| | | throw new VciBaseException("版本规则{0}[{1}]在系统中不存在,请先查证", |
| | | new Object[]{btmTypeDTO.getRevisionRuleId(), btmTypeDTO.getRevisionRuleName()}); |
| | | } |
| | | // btmTypeDTO.setAttributes(addAttributeByFieldMap(btmTypeDTO.getAttributes(),BtmTypeFieldConstant.REVISION_MANAGE_FIELD_MAP)); |
| | | } |
| | | } |
| | | if (btmTypeDTO.isLifeCycleFlag()){ |
| | | // 需要控制生命周期 |
| | |
| | | // new Object[]{btmTypeDTO.getSubLifeCycleId(), btmTypeDTO.getSubLifeCycleName()}); |
| | | // } |
| | | // } |
| | | // btmTypeDTO.setAttributes(addAttributeByFieldMap(btmTypeDTO.getAttributes(),BtmTypeFieldConstant.LIFECYCLE_MANAGE_FIELD_MAP)); |
| | | } |
| | | if (btmTypeDTO.isSecretFlag()){ |
| | | // 需要控制密级 |
| | | // btmTypeDTO.setAttributes(addAttributeByFieldMap(btmTypeDTO.getAttributes(),BtmTypeFieldConstant.SECRET_MANAGE_FIELD_MAP)); |
| | | } |
| | | } |
| | | @Override |
| | |
| | | @Override |
| | | public List<BtmTreeVO> treeDomain() { |
| | | try { |
| | | Map<String, String> domain = Optional.ofNullable(DomainRepeater.getDomain()).orElseGet(ArrayList::new).stream().collect(Collectors.toMap(s -> s.getValue(), t -> t.getLabel())); |
| | | Map<String, String> domain = Optional.ofNullable(DomainRepeater.getDomain()).orElseGet(ArrayList::new).stream().collect(Collectors.toMap(DomainVO::getValue, DomainVO::getLabel)); |
| | | List<BtmTypeVO> vos = BtmTypeWrapper.build().listEntityVO(baseMapper.selectAll()); |
| | | Map<String, List<BtmTypeVO>> domainMap = vos.stream().collect(Collectors.groupingBy(BtmTypeVO::getDomain)); |
| | | Map<String, List<BtmTypeVO>> domainMap = vos.stream().sorted(Comparator.comparing(BtmTypeVO::getId)).collect(Collectors.groupingBy(BtmTypeVO::getDomain)); |
| | | List<BtmTreeVO> treeList = new ArrayList<>(); |
| | | domainMap.forEach((k,v)-> { |
| | | if (domain.containsKey(k)){ |