yuxc
2023-07-25 007eff2ea8fbacf5356faa00c62b773b08d83666
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
@@ -53,6 +53,7 @@
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@@ -79,6 +80,9 @@
   @Resource
   private IBtmTypeClient btmTypeClient;
   @Value("${user-info.tenant-id}")
   private String tenantId;
   /**
    * 日志
@@ -127,6 +131,13 @@
      if(StringUtils.isNotBlank(codeClassifyEntity.getParentCodeClassifyOid()) && StringUtils.isNotBlank(codeClassifyEntity.getBtmTypeId())){
         return R.fail("只有在顶层的主题库分类才能设置业务类型");
      }
      QueryWrapper<CodeClassify> classifyQueryWrapper = new QueryWrapper<>();
      classifyQueryWrapper.eq("parentCodeClassifyOid",codeClassifyEntity.getParentCodeClassifyOid());
      classifyQueryWrapper.eq("id",codeClassifyEntity.getId());
      List<CodeClassify> codeClassifyList = baseMapper.selectList(classifyQueryWrapper);
      if(codeClassifyList.size()!=0){
         return R.fail("当前分类下不允许分类编号重复,请检查!!!");
      }
      codeClassifyEntity.setCreator(String.valueOf(AuthUtil.getUser().getUserId()));
      codeClassifyEntity.setCreateTime(new Date());
@@ -480,12 +491,12 @@
      }
      if(StringUtils.isNotBlank(id) || StringUtils.isNotBlank(lcStatus) ){
         doList = codeClassifyMapper
            .selectCodeClassifyDOByTree(treeQueryObject.getConditionMap().get("id"),treeQueryObject.getConditionMap().get("lcStatus"),treeQueryObject.getParentOid());
            .selectCodeClassifyDOByTree(treeQueryObject.getConditionMap().get("id"),treeQueryObject.getConditionMap().get("lcStatus"),treeQueryObject.getParentOid(), AuthUtil.getTenantId().equals(this.tenantId) ? "":AuthUtil.getTenantId());
      }else{
         doList =codeClassifyMapper.selectCodeClassifyVOByTree(treeQueryObject.getParentOid());
         doList =codeClassifyMapper.selectCodeClassifyVOByTree(treeQueryObject.getParentOid(), AuthUtil.getTenantId().equals(this.tenantId) ? "":AuthUtil.getTenantId());
      }
      List<CodeClassifyVO> voList = codeClassifyDO2VOs(doList);
      TreeWrapperOptions treeWrapperOptions = new TreeWrapperOptions(PARENT_FIELD_NAME.toLowerCase(Locale.ROOT));
      TreeWrapperOptions treeWrapperOptions = new TreeWrapperOptions(PARENT_FIELD_NAME);
      treeWrapperOptions.copyFromTreeQuery(treeQueryObject);
      List<Tree> tree= revisionModelUtil.doList2Trees(voList,treeWrapperOptions,(CodeClassifyVO s) ->{
         //可以在这里处理树节点的显示
@@ -513,7 +524,7 @@
    */
   @Override
   public List<CodeClassifyVO> selectCodeClassifyDOByTree(TreeQueryObject treeQueryObject) {
      List<CodeClassify> doList =codeClassifyMapper.selectCodeClassifyVOByTree(treeQueryObject.getParentOid());
      List<CodeClassify> doList =codeClassifyMapper.selectCodeClassifyVOByTree(treeQueryObject.getParentOid(),AuthUtil.getTenantId());
      List<CodeClassifyVO> voList = codeClassifyDO2VOs(doList);
      return voList;
   }
@@ -544,7 +555,6 @@
      List<CodeClassifyVO> voList = codeClassifyDO2VOs(doList);
      return voList;
   }
   //   /**
//    * 根据树形查询对象来查询数据对象
@@ -939,7 +949,7 @@
      Map<String,Object> condition = new HashMap<>(1);
      condition.put("pkbtmtype",topClassifyVO.getBtmTypeId());
      R<BtmTypeVO> btmTypeDetail = btmTypeClient.getDetail(btmTypeOid);
      if(btmTypeDetail.getCode() != 200){
      if(!btmTypeDetail.isSuccess()){
         throw new ServiceException("业务类型feign接口调用出错");
      }
      List<BtmTypeAttributeVO> unDefaultAttributes = btmTypeDetail.getData().getAttributes();
@@ -968,7 +978,7 @@
         });
      }
      R<BtmTypeVO> btmTypeVOR = btmTypeClient.getDefaultAttrByBtmId(topClassifyVO.getBtmTypeId());
      if(btmTypeVOR.getCode() != 200){
      if(!btmTypeVOR.isSuccess()){
         throw new ServiceException("业务类型feign接口调用出错");
      }
      List<BtmTypeAttributeVO> defaultAttrVOS = btmTypeVOR.getData().getAttributes();