| | |
| | | import com.alibaba.nacos.api.exception.NacosException; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.omd.cache.EnumCache; |
| | | import com.vci.ubcs.omd.constant.BtmTypeFieldConstant; |
| | | import com.vci.ubcs.omd.dto.BtmAndLinkTypeDdlDTO; |
| | | import com.vci.ubcs.omd.entity.Attribute; |
| | |
| | | import com.vci.ubcs.omd.service.IAttributeService; |
| | | import com.vci.ubcs.omd.service.IBtmTypeAttributeService; |
| | | import com.vci.ubcs.omd.service.IModifyAttributeService; |
| | | import com.vci.ubcs.omd.vo.BtmTypeTreeVO; |
| | | import com.vci.ubcs.omd.vo.*; |
| | | import com.vci.ubcs.omd.wrapper.BtmTypeWrapper; |
| | | import com.vci.ubcs.omd.wrapper.ModifyAttributeWrapper; |
| | | import com.vci.ubcs.starter.web.constant.OmdRegExpConstant; |
| | |
| | | import com.vci.ubcs.omd.entity.ModifyAttributeInfo; |
| | | import com.vci.ubcs.omd.mapper.BtmTypeMapper; |
| | | import com.vci.ubcs.omd.service.IBtmTypeService; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; |
| | | import com.vci.ubcs.omd.vo.LinkTypeVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.enumpck.BooleanEnum; |
| | | import com.vci.ubcs.starter.web.enumpck.VciFieldTypeEnum; |
| | |
| | | btmTypeDO.setTableName(getTableName(btmTypeDO.getId(),btmTypeDO.getDomain())); |
| | | } |
| | | // 添加属性 |
| | | btmTypeDTO.setOid(btmTypeDO.getOid()); |
| | | afterAttributes = addAttributeForBtm(btmTypeDTO); |
| | | baseMapper.insert(btmTypeDO); |
| | | }else { |
| | |
| | | // 需要控制密级 |
| | | btmTypeDTO.setAttributes(addAttributeByFieldMap(btmTypeDTO.getAttributes(),BtmTypeFieldConstant.SECRET_MANAGE_FIELD_MAP)); |
| | | } |
| | | if (StringUtils.isBlank(btmTypeDTO.getOid())) { |
| | | btmTypeDTO.setOid(VciBaseUtil.getPk()); |
| | | } |
| | | } |
| | | @Override |
| | | public boolean deleteLogic(@NotEmpty List<Long> ids) { |
| | |
| | | @Override |
| | | public List<BtmTypeTreeVO> treeDomain() { |
| | | try { |
| | | List<String> domain = DomainRepeater.getDomain(); |
| | | Map<String, String> domain = Optional.ofNullable(DomainRepeater.getDomain()).orElseGet(ArrayList::new).stream().collect(Collectors.toMap(s -> s.getValue(), t -> t.getLabel())); |
| | | List<BtmTypeVO> vos = BtmTypeWrapper.build().listEntityVO(baseMapper.selectAll()); |
| | | Map<String, List<BtmTypeVO>> domainMap = vos.stream().collect(Collectors.groupingBy(BtmTypeVO::getDomain)); |
| | | List<BtmTypeTreeVO> treeList = new ArrayList<>(); |
| | | domainMap.forEach((k,v)-> { |
| | | if (domain.contains(k)){ |
| | | if (domain.containsKey(k)){ |
| | | String label = domain.get(k); |
| | | BtmTypeTreeVO parent = new BtmTypeTreeVO(); |
| | | parent.setName(k); |
| | | parent.setName(label); |
| | | parent.setId(k); |
| | | parent.setChildList(v.stream().map(s -> { |
| | | BtmTypeTreeVO child = new BtmTypeTreeVO(); |
| | | child.setOid(s.getOid()); |
| | | child.setName(s.getId() + " " + (s.getName() == null ? "" : s.getName())); |
| | | child.setId(s.getId()); |
| | | return child; |
| | | }).collect(Collectors.toList())); |
| | | treeList.add(parent); |
| | |
| | | public List<BtmTypeVO> getFromTable(String domain) { |
| | | VciBaseUtil.alertNotNull(domain,"领域值"); |
| | | try { |
| | | if (!DomainRepeater.getDomain().contains(domain)){ |
| | | if (!DomainRepeater.getDomain().stream().collect(Collectors.toMap(DomainVO::getValue, DomainVO::getLabel)).containsKey(domain)){ |
| | | return null; |
| | | } |
| | | R result = DomainRepeater.getFromTable(domain); |
| | |
| | | Attribute attribute = new Attribute(); |
| | | attribute.setKey(attr.getId()); |
| | | attribute.setLabel(attr.getName()); |
| | | attribute.setDictKey(attr.getAttrDataType()); |
| | | attribute.setTypeCode("attributeType"); |
| | | attribute.setTypeKey(attr.getAttrDataType()); |
| | | // attribute.setDictKey(attr.getAttrDataType()); |
| | | attribute.setMaxLength(attr.getAttributeLength()); |
| | | attribute.setPrecision(attr.getPrecisionLength()); |
| | | attribute.setDescription(attr.getDescription()); |