ludc
2023-06-05 dd6942743fa3936a1bbcbe6f4102c028d8021d5c
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
@@ -873,7 +873,7 @@
    * @return 属性的信息,包含默认的属性
    */
   @Override
   public DataGrid<BtmTypeAttributeVO> listClassifyLinkAttr(BaseQueryObject baseQueryObject) {
   public DataGrid<BtmTypeAttributeVO> listClassifyLinkAttr(BaseQueryObject baseQueryObject) throws ServiceException{
      if(baseQueryObject == null){
         baseQueryObject = new BaseQueryObject();
      }
@@ -897,8 +897,11 @@
      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<>();
@@ -908,8 +911,8 @@
            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("*",""))){
@@ -923,6 +926,25 @@
            }
         });
      }
      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());