| | |
| | | * @return 属性的信息,包含默认的属性 |
| | | */ |
| | | @Override |
| | | public DataGrid<BtmTypeAttributeVO> listClassifyLinkAttr(BaseQueryObject baseQueryObject) { |
| | | public DataGrid<BtmTypeAttributeVO> listClassifyLinkAttr(BaseQueryObject baseQueryObject) throws ServiceException{ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | |
| | | |
| | | Map<String,Object> condition = new HashMap<>(1); |
| | | condition.put("pkbtmtype",topClassifyVO.getBtmtypeid()); |
| | | BtmTypeVO data = btmTypeClient.getDetail(btmTypeOid).getData(); |
| | | List<BtmTypeAttributeVO> unDefaultAttributes = data.getAttributes(); |
| | | R<BtmTypeVO> btmTypeDetail = btmTypeClient.getDetail(btmTypeOid); |
| | | if(btmTypeDetail.getCode() != 200){ |
| | | throw new ServiceException("业务类型feign接口调用出错"); |
| | | } |
| | | List<BtmTypeAttributeVO> unDefaultAttributes = btmTypeDetail.getData().getAttributes(); |
| | | // List<CodeOsbtmtypeattributeEntity> unDefaultAttributes = codeOsbtmtypeattributeMapper.selectByMap(condition); |
| | | // List<OsBtmTypeAttributeVO> unDefaultAttributes = btmService. (topClassifyVO.getBtmtypeid()); |
| | | List<BtmTypeAttributeVO> attributeVOS = new ArrayList<>(); |
| | |
| | | BeanUtils.copyProperties(attr,attributeVO); |
| | | attributeVO.setAttrDataType(attr.getAttrDataType()); |
| | | attributeVO.setAttributeLength(attr.getAttributeLength()); |
| | | attributeVO.setBtmTypeId(data.getId()); |
| | | attributeVO.setBtmname(data.getName()); |
| | | attributeVO.setBtmTypeId(btmTypeDetail.getData().getId()); |
| | | attributeVO.setBtmname(btmTypeDetail.getData().getName()); |
| | | attributeVO.setAttrDataTypeText(EnumCache.getValue(EnumEnum.VCO_FIELD_TYPE,attr.getAttrDataType())); |
| | | boolean add = true; |
| | | if(StringUtils.isNotBlank(id) && !attributeVO.getId().contains(id.replace("*",""))){ |
| | |
| | | } |
| | | }); |
| | | } |
| | | R<BtmTypeVO> btmTypeVOR = btmTypeClient.getDefaultAttrByBtmId(topClassifyVO.getBtmtypeid()); |
| | | if(btmTypeVOR.getCode() != 200){ |
| | | throw new ServiceException("业务类型feign接口调用出错"); |
| | | } |
| | | List<BtmTypeAttributeVO> defaultAttrVOS = btmTypeVOR.getData().getAttributes(); |
| | | if(!CollectionUtils.isEmpty(defaultAttrVOS)){ |
| | | defaultAttrVOS.stream().forEach(attr->{ |
| | | boolean add = true; |
| | | if(StringUtils.isNotBlank(id) && !attr.getId().contains(id.replace("*",""))){ |
| | | add = false; |
| | | } |
| | | if(StringUtils.isNotBlank(name) && !attr.getId().contains(name.replace("*",""))){ |
| | | add = false; |
| | | } |
| | | if(add){ |
| | | attributeVOS.add(attr); |
| | | } |
| | | }); |
| | | } |
| | | DataGrid<BtmTypeAttributeVO> dataGrid = new DataGrid<>(); |
| | | dataGrid.setData(attributeVOS); |
| | | dataGrid.setTotal(attributeVOS.size()); |