xiejun
2023-07-13 2871cb99e018f6bf9e2ef76a424a1429a7c818f0
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
@@ -47,7 +47,7 @@
import org.slf4j.LoggerFactory;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.launch.constant.AppConstant;
import com.vci.ubcs.core.log.exception.ServiceException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
@@ -116,9 +116,6 @@
      return codeClassifyMapper.selectObjs(wrapper);
   }
   @Override
   public IPage<CodeClassifyVO> selectPlCodeClassifyPage(IPage<CodeClassifyVO> page, CodeClassifyVO plCodeClassify) {
@@ -200,8 +197,7 @@
    * @return  数据对象
    */
   private CodeClassify selectByOid(String oid){
      CodeClassify codeClassifyEntity = codeClassifyMapper.selectById(oid.trim());
      CodeClassify codeClassifyEntity = codeClassifyMapper.selectClassifyByKeyAndReseRel("'"+oid.trim()+"'").get(0);
      if(codeClassifyEntity == null || StringUtils.isBlank(codeClassifyEntity.getOid())){
         throw new ServiceException("dataOidNotExist");//根据主键id未查到相关数据
      }
@@ -544,7 +540,9 @@
    */
   @Override
   public List<CodeClassifyVO> getIdPathToNamePathByParentId(String classifyId, boolean enable) {
      return codeClassifyMapper.getIdPathToNamePathByParentId(classifyId);
      List<CodeClassify>  doList=   codeClassifyMapper.getIdPathToNamePathByParentId(classifyId);
      List<CodeClassifyVO> voList = codeClassifyDO2VOs(doList);
      return voList;
   }
@@ -589,7 +587,7 @@
      codeClassifyVOS.add(codeClassifyVO);
      //查询一下规则的编号,和关键属性重复规则
      List<String> codeRuleOids = codeClassifyVOS.stream().filter(s -> StringUtils.isNotBlank(s.getCoderuleoid())).map(CodeClassifyVO::getCoderuleoid).collect(Collectors.toList());
      List<String> codeRuleOids = codeClassifyVOS.stream().filter(s -> StringUtils.isNotBlank(s.getCodeRuleOid())).map(CodeClassifyVO::getCodeRuleOid).collect(Collectors.toList());
      Map<String, CodeRuleVO> ruleVOMap = new HashMap<>();
      if(!CollectionUtils.isEmpty(codeRuleOids)){
         VciBaseUtil.switchCollectionForOracleIn(codeRuleOids).stream().forEach(ruleOids->{
@@ -599,7 +597,7 @@
         });
      }
      //找关键属性规则
      List<String> keyRuleOids = codeClassifyVOS.stream().filter(s -> StringUtils.isNotBlank(s.getCodekeyattrrepeatoid())).map(CodeClassifyVO::getCodekeyattrrepeatoid).collect(Collectors.toList());
      List<String> keyRuleOids = codeClassifyVOS.stream().filter(s -> StringUtils.isNotBlank(s.getCodeKeyAttrRepeatOid())).map(CodeClassifyVO::getCodeKeyAttrRepeatOid).collect(Collectors.toList());
      Map<String, CodeKeyAttrRepeatRuleVO> keyRuleVOMap = new HashMap<>();
      if(!CollectionUtils.isEmpty(keyRuleOids)){
         VciBaseUtil.switchCollectionForOracleIn(keyRuleOids).stream().forEach(ruleOids->{
@@ -631,12 +629,12 @@
         CodeClassifyVO vo = codeClassifyVOS.get(i);
         excelDataList.add(new WriteExcelData(i+1,0,vo.getId()));
         excelDataList.add(new WriteExcelData(i+1,1,vo.getName()));
         excelDataList.add(new WriteExcelData(i+1,2,vo.getBtmtypeid()));
         excelDataList.add(new WriteExcelData(i+1,3,vo.getBtmtypename()));
         excelDataList.add(new WriteExcelData(i+1,4, StringUtils.isNotBlank(vo.getCoderuleoid())?ruleVOMap.getOrDefault(vo.getCoderuleoid(),new CodeRuleVO()).getId():""));
         excelDataList.add(new WriteExcelData(i+1,5, StringUtils.isNotBlank(vo.getCoderuleoid())?ruleVOMap.getOrDefault(vo.getCoderuleoid(),new CodeRuleVO()).getName():""));
         excelDataList.add(new WriteExcelData(i+1,6, StringUtils.isNotBlank(vo.getCodekeyattrrepeatoid())?keyRuleVOMap.getOrDefault(vo.getCodekeyattrrepeatoid(),new CodeKeyAttrRepeatRuleVO()).getId():""));
         excelDataList.add(new WriteExcelData(i+1,7, StringUtils.isNotBlank(vo.getCodekeyattrrepeatoid())?keyRuleVOMap.getOrDefault(vo.getCodekeyattrrepeatoid(),new CodeKeyAttrRepeatRuleVO()).getName():""));
         excelDataList.add(new WriteExcelData(i+1,2,vo.getBtmTypeId()));
         excelDataList.add(new WriteExcelData(i+1,3,vo.getBtmTypeName()));
         excelDataList.add(new WriteExcelData(i+1,4, StringUtils.isNotBlank(vo.getCodeRuleOid())?ruleVOMap.getOrDefault(vo.getCodeRuleOid(),new CodeRuleVO()).getId():""));
         excelDataList.add(new WriteExcelData(i+1,5, StringUtils.isNotBlank(vo.getCodeRuleOid())?ruleVOMap.getOrDefault(vo.getCodeRuleOid(),new CodeRuleVO()).getName():""));
         excelDataList.add(new WriteExcelData(i+1,6, StringUtils.isNotBlank(vo.getCodeKeyAttrRepeatOid())?keyRuleVOMap.getOrDefault(vo.getCodeKeyAttrRepeatOid(),new CodeKeyAttrRepeatRuleVO()).getId():""));
         excelDataList.add(new WriteExcelData(i+1,7, StringUtils.isNotBlank(vo.getCodeKeyAttrRepeatOid())?keyRuleVOMap.getOrDefault(vo.getCodeKeyAttrRepeatOid(),new CodeKeyAttrRepeatRuleVO()).getName():""));
         excelDataList.add(new WriteExcelData(i+1,8,vo.getOid().equalsIgnoreCase(codeClassify.getOid())?vo.getPath():codeClassify.getPath() + vo.getPath()));
         excelDataList.add(new WriteExcelData(i+1,9,FrameworkDataLCStatus.getTextByValue(vo.getLcStatus())));
         excelDataList.add(new WriteExcelData(i+1,10,vo.getDataLevel()));
@@ -934,12 +932,12 @@
         return new DataGrid<>();
      }
      CodeClassifyVO topClassifyVO = getTopClassifyVO(classifyOid);
      if(topClassifyVO == null || StringUtils.isBlank(topClassifyVO.getBtmtypeid())){
      if(topClassifyVO == null || StringUtils.isBlank(topClassifyVO.getBtmTypeId())){
         return new DataGrid<>();
      }
      Map<String,Object> condition = new HashMap<>(1);
      condition.put("pkbtmtype",topClassifyVO.getBtmtypeid());
      condition.put("pkbtmtype",topClassifyVO.getBtmTypeId());
      R<BtmTypeVO> btmTypeDetail = btmTypeClient.getDetail(btmTypeOid);
      if(btmTypeDetail.getCode() != 200){
         throw new ServiceException("业务类型feign接口调用出错");
@@ -969,7 +967,7 @@
            }
         });
      }
      R<BtmTypeVO> btmTypeVOR = btmTypeClient.getDefaultAttrByBtmId(topClassifyVO.getBtmtypeid());
      R<BtmTypeVO> btmTypeVOR = btmTypeClient.getDefaultAttrByBtmId(topClassifyVO.getBtmTypeId());
      if(btmTypeVOR.getCode() != 200){
         throw new ServiceException("业务类型feign接口调用出错");
      }
@@ -1185,7 +1183,7 @@
      fullInfo.setParentClassifyVOs(codeClassifyDO2VOs(codeClassifyList));
      if(!CollectionUtils.isEmpty(fullInfo.getParentClassifyVOs())){
         fullInfo.setTopClassifyVO(fullInfo.getParentClassifyVOs().stream().filter(s->StringUtils.isBlank(s.getParentcodeclassifyoid())).findFirst().orElseGet(()->null));
         fullInfo.setTopClassifyVO(fullInfo.getParentClassifyVOs().stream().filter(s->StringUtils.isBlank(s.getParentCodeClassifyOid())).findFirst().orElseGet(()->null));
      }
      return fullInfo;
   }