xiejun
2023-07-05 b04005e136d7de620bb66660cc268f5750ca7b42
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
@@ -9,6 +9,7 @@
import com.vci.ubcs.code.dto.CodeOrderDTO;
import com.vci.ubcs.code.dto.CodeOrderSecDTO;
import com.vci.ubcs.code.entity.*;
import com.vci.ubcs.code.enumpack.CodeDefaultLC;
import com.vci.ubcs.code.enumpack.CodeSecTypeEnum;
import com.vci.ubcs.code.mapper.CommonsMapper;
import com.vci.ubcs.code.service.*;
@@ -19,6 +20,11 @@
import com.vci.ubcs.code.vo.webserviceModel.attrmap.*;
import com.vci.ubcs.code.vo.webserviceModel.attrmap.DataObjectVO;
import com.vci.ubcs.code.vo.webserviceModel.classify.*;
import com.vci.ubcs.code.vo.webserviceModel.classify.QueryClassifyVO;
import com.vci.ubcs.code.vo.webserviceModel.classify.QueryData;
import com.vci.ubcs.code.vo.webserviceModel.classify.QueryLibraryVO;
import com.vci.ubcs.code.vo.webserviceModel.classify.ResultClassifyVO;
import com.vci.ubcs.code.vo.webserviceModel.coderule.*;
import com.vci.ubcs.code.vo.webserviceModel.data.*;
import com.vci.ubcs.code.vo.webserviceModel.result.json.*;
import com.vci.ubcs.code.vo.webserviceModel.result.xml.XMLResultClassfyVO;
@@ -29,6 +35,7 @@
import com.vci.ubcs.code.wrapper.CodeClassifyWrapper;
import com.vci.ubcs.omd.feign.IBtmTypeClient;
import com.vci.ubcs.omd.vo.BtmTypeVO;
import com.vci.ubcs.starter.revision.model.BaseModel;
import com.vci.ubcs.starter.revision.model.TreeQueryObject;
import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil;
import com.vci.ubcs.starter.web.constant.QueryOptionConstant;
@@ -46,6 +53,7 @@
import java.util.stream.Collectors;
import static com.vci.ubcs.code.constant.MdmEngineConstant.DEFAULT_SYNC_ATTR_LIST;
import static com.vci.ubcs.code.constant.MdmEngineConstant.IMPORT_ROW_INDEX;
import static com.vci.ubcs.code.enumpack.CodeSecTypeEnum.CODE_CLASSIFY_SEC;
/***
@@ -478,17 +486,48 @@
            errorid = "101";
            throw new Throwable("接口参数:账号信息获取失败");
         }
         if(!CollectionUtils.isEmpty(classifyIdList)){
            //先简称是否有关联模板,有模板要先删除
            List<CodeClassify> libIdDos = classifyService.selectByWrapper(Wrappers.<CodeClassify>query().lambda().in(CodeClassify::getId, classifyIdList));
            codeClassifyVOS=classifyService.codeClassifyDO2VOs(libIdDos);
         }else {
            List<CodeClassify> libIdDos = classifyService.selectByWrapper(Wrappers.<CodeClassify>query().lambda().eq(CodeClassify::getId, libId));
            String oid= libIdDos.get(0).getOid();
            TreeQueryObject treeQueryObject=new TreeQueryObject();
            treeQueryObject.setParentOid(oid);
            treeQueryObject.setQueryAllLevel(true);
            codeClassifyVOS=classifyService.selectCodeClassifyDOByTree(treeQueryObject);
         List<CodeClassify> libIdDos =classifyService.selectByWrapper(Wrappers.<CodeClassify>query().lambda().in(CodeClassify::getId, libId));
         if(CollectionUtils.isEmpty(libIdDos)) {
            CodeClassify libCodeClassify =libIdDos.get(0);
            String oid=libCodeClassify.getOid();
            if (!CollectionUtils.isEmpty(classifyIdList)) {
               //先简称是否有关联模板,有模板要先删除
               List<CodeClassify> childCodeClassifyList = classifyService.selectByWrapper(Wrappers.<CodeClassify>query().lambda().in(CodeClassify::getId, classifyIdList));
               List<CodeClassify>newchildCodeClassifyList=new ArrayList<>();
               if(!CollectionUtils.isEmpty(childCodeClassifyList)) {
                  Map<String,String> errorMap=new HashMap<>();
                  childCodeClassifyList.stream().forEach(codeClassify -> {
                     CodeClassifyVO toClassifyVO=   classifyService.getTopClassifyVO(codeClassify.getOid());
                     if(toClassifyVO.getOid().equals(libCodeClassify.getOid())){
                        newchildCodeClassifyList.add(codeClassify);
                     }
                  });
                  Map<String/**分类编号**/, CodeClassify/**分类对象**/> classifyfCodeMap = newchildCodeClassifyList.stream().collect(Collectors.toMap(s -> s.getId(), t -> t));
                  classifyIdList.stream().forEach(classifyfCode -> {
                     if(!classifyfCodeMap.containsKey(classifyfCode)) {
                        errorMap.put("error", errorMap.getOrDefault("error", "") + ";根据classCode:【" + classifyfCode + "】在library:【" + libCodeClassify.getId() + "】下未查询到");
                     }
                  });
                  if(errorMap.size()>0){
                     errorid = "101";
                     msg = errorMap.getOrDefault("error","");
                     throw new Throwable(msg);
                  }
                  codeClassifyVOS = classifyService.codeClassifyDO2VOs(newchildCodeClassifyList);
               }else{
                  errorid = "101";
                  msg = "接口参数:classCode 未查询到对应的分类信息";
                  throw new Throwable(msg);
               }
            } else {
               TreeQueryObject treeQueryObject = new TreeQueryObject();
               treeQueryObject.setParentOid(oid);
               treeQueryObject.setQueryAllLevel(true);
               codeClassifyVOS = classifyService.selectCodeClassifyDOByTree(treeQueryObject);
            }
         }else{
            errorid = "101";
            throw new Throwable("接口参数:账号信息获取失败");
         }
         LibraryVO libraryVo=new LibraryVO();
         libraryVo.setId(libId);
@@ -591,74 +630,120 @@
         String classCode=condtionVO.getClassCode();
         String library= condtionVO.getLibrary();
         String queryFileds= condtionVO.getQueryFileds();
         if(StringUtils.isBlank(library)){
            errorid = "101";
            msg = "接口参数:library 为null";
            throw new Throwable(msg);
         }
         List<CodeClassifyVO> codeClassifyVOS =new ArrayList<>();
         //先简称是否有关联模板,有模板要先删除
         List<CodeClassify> libIdDos =classifyService.selectByWrapper(Wrappers.<CodeClassify>query().lambda().in(CodeClassify::getId,VciBaseUtil.toInSql(classCode)));
         List<CodeClassify> libIdDos =classifyService.selectByWrapper(Wrappers.<CodeClassify>query().lambda().eq(CodeClassify::getId,library));
         if(!CollectionUtils.isEmpty(libIdDos)){
            CodeClassify currentCodeClassify=libIdDos.get(0);
            String oid=currentCodeClassify.getOid();
            TreeQueryObject treeQueryObject=new TreeQueryObject();
            treeQueryObject.setParentOid(oid);
            treeQueryObject.setQueryAllLevel(true);
            codeClassifyVOS=classifyService.selectCodeClassifyDOByTree(treeQueryObject);
            codeClassifyVOS.add(CodeClassifyWrapper.build().entityVO(currentCodeClassify));
            Map<String, CodeClassifyVO> oidCodeclassifyDOMap = codeClassifyVOS.stream().filter(systeDataObject -> systeDataObject != null && StringUtils.isNotBlank(systeDataObject.getOid())).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getOid(), t -> t));
            List<PropertyVO>  propertyVOS=condtionVO.getPro();
            Map<String,String> condtionMap=new HashMap<>();
            propertyVOS.stream().forEach(propertyVO -> {
               condtionMap.put(propertyVO.getFiledName(),propertyVO.getFiledValue());
            });
            condtionMap.put("codeclsfid", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oidCodeclassifyDOMap.keySet().toArray(new String[0])) + ")");
            R<BtmTypeVO> r= btmTypeClient.getDetail(library);
            BtmTypeVO btmTypeVO =r.getData();
            String tableName=btmTypeVO.getTableName();
            StringBuffer sb=new StringBuffer();
            sb.append(" select * from ");
            sb.append(tableName);
            sb.append(" where 1=1 ");
            sb.append(" id in (");
            sb.append( VciBaseUtil.toInSql(oidCodeclassifyDOMap.keySet().toArray(new String[0])) );
            sb.append(")");
            List<Map<String,String>> dataMapList=commonsMapper.queryByOnlySqlForMap( sb.toString());
            List<ClientBusinessObject> clientBusinessObjects=ChangeMapTOClientBusinessObjects(dataMapList);
            List<com.vci.ubcs.code.vo.webserviceModel.data.DataObjectVO> dataObjectVOS=new ArrayList<>();
            if(!CollectionUtils.isEmpty(clientBusinessObjects)){
               CodeClassifyTemplateVO templateVO = engineService.getUsedTemplateByClassifyOid(currentCodeClassify.getOid());
               Map<String, CodeClassifyTemplateAttrVO> filedAttributeMap = templateVO.getAttributes().stream().filter(attribute -> attribute != null && StringUtils.isNotBlank(attribute.getId())).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getId(), t -> t));
               clientBusinessObjects.stream().forEach(cbo -> {
                  com.vci.ubcs.code.vo.webserviceModel.data.DataObjectVO dataObjectVO=new com.vci.ubcs.code.vo.webserviceModel.data.DataObjectVO();
                  dataObjectVO.setCode(cbo.getId());
                  dataObjectVO.setStatus(cbo.getLcStatus());
                  String codeclsfid=cbo.getAttributeValue("codeclsfid");
                  if(oidCodeclassifyDOMap.containsKey(codeclsfid)){
                     CodeClassifyVO classifyVO=  oidCodeclassifyDOMap.get(codeclsfid);
                     dataObjectVO.setClassCode(classifyVO.getId());
            CodeClassify libCodeClassify=libIdDos.get(0);
            List<CodeClassify> codeClassifyList=classifyService.selectByWrapper(Wrappers.<CodeClassify>query().lambda().eq(CodeClassify::getId,classCode));
            if(!CollectionUtils.isEmpty(codeClassifyList)){
               final CodeClassify[] currentCodeClassify = {null};
               codeClassifyList.stream().forEach(codeClassify -> {
                  CodeClassifyVO codeClassifyVO=  classifyService.getTopClassifyVO(codeClassify.getOid());
                  if(codeClassifyVO.getOid().equals(libCodeClassify.getOid())){
                     currentCodeClassify[0] =codeClassify;
                  }
                  dataObjectVO.setLibrary(library);
                  String [] newQueryFileds=queryFileds.split(",");
                  List<PropertyVO> propertyVOList=new ArrayList<>();
                  for(String filed:newQueryFileds){
                     String value=cbo.getAttributeValue(filed);
                     if(filedAttributeMap.containsKey(filed)){
                        CodeClassifyTemplateAttrVO attrVO=  filedAttributeMap.get(filed);
                        PropertyVO propertyVO=new PropertyVO();
                        propertyVO.setFiledName(filed);
                        propertyVO.setFiledValue(value);
                        propertyVO.setOutname(attrVO.getName());
                        propertyVOList.add(propertyVO);
                     }
                  }
                  dataObjectVO.setPro(propertyVOList);
                  dataObjectVOS.add(dataObjectVO);
               });
               resultDataVO.setObject(dataObjectVOS);
               if(currentCodeClassify[0]==null){
                  errorid = "101";
                  msg = "接口参数:classCode 未查询到对应的分类信息";
                  throw new Throwable(msg);
               }
               List<CodeClassifyVO> dataCodeClassifyVOList =new ArrayList<>();
               String oid= currentCodeClassify[0].getOid();
               TreeQueryObject treeQueryObject=new TreeQueryObject();
               treeQueryObject.setParentOid(oid);
               treeQueryObject.setQueryAllLevel(true);
               dataCodeClassifyVOList=classifyService.selectCodeClassifyDOByTree(treeQueryObject);
               dataCodeClassifyVOList.add(CodeClassifyWrapper.build().entityVO(currentCodeClassify[0]));
               Map<String, CodeClassifyVO> oidCodeclassifyDOMap = dataCodeClassifyVOList.stream().filter(systeDataObject -> systeDataObject != null && StringUtils.isNotBlank(systeDataObject.getOid())).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getOid(), t -> t));
               List<PropertyVO>  propertyVOS=condtionVO.getPro();
               /*Map<String,String> condtionMap=new HashMap<>();
               propertyVOS.stream().forEach(propertyVO -> {
                  condtionMap.put(propertyVO.getFiledName(),propertyVO.getFiledValue());
               });
               condtionMap.put("codeclsfid", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oidCodeclassifyDOMap.keySet().toArray(new String[0])) + ")");
               List<String>statusList=new ArrayList<>();
               statusList.add(CodeDefaultLC.RELEASED.getValue());
               statusList.add(CodeDefaultLC.DISABLE.getValue());
               statusList.add(CodeDefaultLC.TASK_BACK.getValue());
               condtionMap.put("Lcstatus",  QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(statusList.toArray(new String[]{})) + ")" );
               condtionMap.put("islastr", "1");
               condtionMap.put("islastv", "1");*/
               List<String>statusList=new ArrayList<>();
               statusList.add(CodeDefaultLC.RELEASED.getValue());
               statusList.add(CodeDefaultLC.DISABLE.getValue());
               statusList.add(CodeDefaultLC.TASK_BACK.getValue());
               R<BtmTypeVO>  r= btmTypeClient.getDetail(libCodeClassify.getBtmTypeId());
               BtmTypeVO btmTypeVO =r.getData();
               String tableName=btmTypeVO.getTableName();
               StringBuffer sb=new StringBuffer();
               sb.append(" select * from  ");
               sb.append(tableName);
               sb.append(" where 1=1");
               propertyVOS.stream().forEach(propertyVO -> {
                  sb.append( " and  "+propertyVO.getFiledName()+"='"+propertyVO.getFiledValue()+"'");
               });
               sb.append(" and lastr=1 and lastv=1" );
               sb.append(" and codeclsfid in (" + VciBaseUtil.toInSql(oidCodeclassifyDOMap.keySet().toArray(new String[0])) +")");
               sb.append(" and Lcstatus in (" + VciBaseUtil.toInSql(statusList.toArray(new String[]{})) +")");
               List<Map<String,String>>  newDataList= commonsMapper.queryByOnlySqlForMap(sb.toString());
               List<ClientBusinessObject>clientBusinessObjects=new ArrayList<>();
               newDataList.stream().forEach(stringStringMap -> {
                  ClientBusinessObject clientBusinessObject=new ClientBusinessObject();
                  DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(stringStringMap,clientBusinessObject);
                  clientBusinessObjects.add(clientBusinessObject);
               });
               List<com.vci.ubcs.code.vo.webserviceModel.data.DataObjectVO> dataObjectVOS=new ArrayList<>();
               if(!CollectionUtils.isEmpty(clientBusinessObjects)){
                  CodeClassifyTemplateVO templateVO = engineService.getUsedTemplateByClassifyOid(currentCodeClassify[0].getOid());
                  Map<String, CodeClassifyTemplateAttrVO> filedAttributeMap = templateVO.getAttributes().stream().filter(attribute -> attribute != null && StringUtils.isNotBlank(attribute.getId())).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getId(), t -> t));
                  clientBusinessObjects.stream().forEach(cbo -> {
                     com.vci.ubcs.code.vo.webserviceModel.data.DataObjectVO dataObjectVO=new com.vci.ubcs.code.vo.webserviceModel.data.DataObjectVO();
                     dataObjectVO.setCode(cbo.getId());
                     dataObjectVO.setStatus(cbo.getLcStatus());
                     String codeclsfid=cbo.getAttributeValue("codeclsfid");
                     if(oidCodeclassifyDOMap.containsKey(codeclsfid)){
                        CodeClassifyVO codeClassifyVO=  oidCodeclassifyDOMap.get(codeclsfid);
                        dataObjectVO.setClassCode(codeClassifyVO.getId());
                     }
                     dataObjectVO.setLibrary(library);
                     String [] newQueryFileds=queryFileds.split(",");
                     List<PropertyVO> propertyVOList=new ArrayList<>();
                     for(String filed:newQueryFileds){
                        String value=cbo.getAttributeValue(filed);
                        if(filedAttributeMap.containsKey(filed)){
                           CodeClassifyTemplateAttrVO attrVO=  filedAttributeMap.get(filed);
                           PropertyVO propertyVO=new PropertyVO();
                           propertyVO.setFiledName(filed);
                           propertyVO.setFiledValue(value);
                           propertyVO.setOutname(attrVO.getName());
                           propertyVOList.add(propertyVO);
                        }
                     }
                     dataObjectVO.setPro(propertyVOList);
                     dataObjectVOS.add(dataObjectVO);
                  });
                  resultDataVO.setObject(dataObjectVOS);
               }
            }else{
               errorid = "101";
               msg = "接口参数:classCode 未查询到对应的分类信息";
               throw new Throwable(msg);
            }
         }else{
            errorid = "101";
            msg = "接口参数:library 未查询到对应的库节点信息";
         }
         errorid = "0";
         msg = "数据查询成功";
@@ -690,6 +775,8 @@
      return resultStr;
   }
   @Override
   public String queryClassifyRule(String data, String dataType) throws Throwable {
@@ -700,8 +787,9 @@
      String systemId="";
      log.info("查询分类的数据参数:->"+data);
      log.info("查询分类的数据类型:->"+dataType);
      ResultClassifyVO resultClassifyVO =new ResultClassifyVO();
      List<ClassifyVO> classifyVOList=new ArrayList<>();
      ResultClassifyRuleVO resultClassifyRuleVO =new ResultClassifyRuleVO();
      List<com.vci.ubcs.code.vo.webserviceModel.coderule.ResultClassifyVO> classifyVOList=new ArrayList<>();
      ResultClassifyRuleData resultClassifyRuleData=new ResultClassifyRuleData();
      try {
         if (StringUtils.isBlank(data)) {
            errorid = "101";
@@ -756,24 +844,123 @@
            treeQueryObject.setQueryAllLevel(true);
            codeClassifyVOS=classifyService.selectCodeClassifyDOByTree(treeQueryObject);
         }
         ResultLibraryVO resultLibraryVO=new ResultLibraryVO();
         resultLibraryVO.setId(libId);
         resultLibraryVO.setName("");
         if(!CollectionUtils.isEmpty(codeClassifyVOS)){
            errorid = "0";
            msg="成功!";
            codeClassifyVOS.stream().forEach(codeClassifyDO -> {
               //后去包含码段的编码规则
               CodeRuleVO codeRuleVO=   this.engineService.getCodeRuleByClassifyOid(codeClassifyDO.getOid());
               ResultCodeRuleVO resultCodeRuleVO=new ResultCodeRuleVO();
               if(codeRuleVO!=null){
                  CodeRuleVO resultClassifyRuleVO1=new CodeRuleVO();
                  List<CodeBasicSecVO>  codeBasicSecVOS=   codeRuleVO.getSecVOList();
                  List<CodeSectionVO> codeSectionVOList=new CopyOnWriteArrayList<>();
                  if(!CollectionUtils.isEmpty(codeBasicSecVOS)){
                     codeBasicSecVOS.stream().forEach(codeBasicSecVO -> {
                        List<CodeSectionValueVO> codeSectionValueVOList=new ArrayList<>();
                        String secType=   codeBasicSecVO.getSecType();
                        if(secType.equals("codevariablesec")){//可变码段
                           CodeSectionValueVO sectionValueVO=new CodeSectionValueVO("","","","","");
                           codeSectionValueVOList.add(sectionValueVO);
                        }else if(secType.equals("codefixedsec")){//固定码段
                           List<CodeFixedValueVO> fixedValueVOList=codeBasicSecVO.getFixedValueVOList();
                           fixedValueVOList.stream().forEach(codeFixedValueVO -> {
                           CodeSectionValueVO sectionValueVO=new CodeSectionValueVO(codeFixedValueVO.getOid(),codeFixedValueVO.getOrderNum()+"",codeFixedValueVO.getId(),codeFixedValueVO.getName(),codeFixedValueVO.getDescription());
                           codeSectionValueVOList.add(sectionValueVO);
                           });
                        }else if(secType.equals("codeclassifysec")){//分类码段
                           String  secOid=codeBasicSecVO.getOid();
                           String parentClassifySecOid= codeBasicSecVO.getParentClassifySecOid();
                           List<CodeClassifyValueVO> codeClassifyValueVOS=   this.codeClassifyValueService.listCodeClassifyValueBySecOid(secOid,parentClassifySecOid);
                           if(CollectionUtils.isEmpty(codeClassifyValueVOS)){
                              codeClassifyValueVOS.stream().forEach(codeClassifyValueVO -> {
                                 CodeSectionValueVO sectionValueVO=new CodeSectionValueVO(codeClassifyValueVO.getOid(),codeClassifyValueVO.getOrderNum()+"",codeClassifyValueVO.getId(),codeClassifyValueVO.getName(),codeClassifyValueVO.getDescription());
                              });
                           }
                        }else if(secType.equals("codedatesec")){//日期码段
                        }else if(secType.equals("coderefersec")){//引用码段
                        }else if(secType.equals("codelevelsec")) {//层级码段
                           int level = codeBasicSecVO.getCodeLevelValue();
                           CodeClassifyVO levelCodeClassifyVO = new CodeClassifyVO();
                           CodeClassifyFullInfoBO classifyFullInfoBO = this.classifyService.getClassifyFullInfo(codeClassifyDO.getOid());
                           if(codeBasicSecVO.getCodeLevelType().equals("code_level_special")){//指定层级
                              List<CodeClassifyVO> classifyVOS = classifyFullInfoBO.getParentClassifyVOs().stream().sorted(((o1, o2) -> o2.getDataLevel().compareTo(o1.getDataLevel()))).collect(Collectors.toList());
                              if (classifyVOS.size() >= level && level > 0) {
                                 levelCodeClassifyVO = classifyVOS.get(level - 1);
                              }
                           }else{//最小层
                              levelCodeClassifyVO=codeClassifyDO;
                           }
                           CodeSectionValueVO sectionValueVO=new CodeSectionValueVO(levelCodeClassifyVO.getOid(),"0",levelCodeClassifyVO.getId(),codeBasicSecVO.getName(),codeBasicSecVO.getDescription());
                           codeSectionValueVOList.add(sectionValueVO);
                        }else if(secType.equals("codeattrsec")){//属性码段
                        }else if(secType.equals("codeserialsec")){//流水码段
                        }
                        //构建规则码段
                        CodeSectionVO codeSectionVO=new CodeSectionVO();
                        codeSectionVO.setId(codeBasicSecVO.getOid());//主键
                        codeSectionVO.setName(codeBasicSecVO.getName());//码段名称
                        codeSectionVO.setCodeSecLength(codeBasicSecVO.getCodeSecLength());//码段长度
                        codeSectionVO.setNum(codeBasicSecVO.getId());//码段编号
                        codeSectionVO.setCodeDateFormatStr(codeBasicSecVO.getCodeDateFormatStr());//日期类型
                        codeSectionVO.setCodeSecLengthType(codeBasicSecVO.getCodeSecLengthType());//码段长度类型
                        codeSectionVO.setPkCodeRule(codeRuleVO.getOid());
                        codeSectionVO.setSecType(codeBasicSecVO.getSecType());//码段类型
                        codeSectionVO.setDescription(codeBasicSecVO.getDescription());
                        codeSectionVO.setParentClassifySecOid(codeBasicSecVO.getParentClassifySecOid());
                        codeSectionVO.setSectionValue(codeSectionValueVOList);
                        codeSectionVOList.add(codeSectionVO);
                     });
                  }
                  //构建规则信息
                  resultCodeRuleVO.setId(codeRuleVO.getOid());
                  resultCodeRuleVO.setNum(codeRuleVO.getId());
                  resultCodeRuleVO.setDescription(codeRuleVO.getDescription());
                  resultCodeRuleVO.setCodeSection(codeSectionVOList);
               }
               //构建分类信息
               com.vci.ubcs.code.vo.webserviceModel.coderule.ResultClassifyVO classifyVO=new com.vci.ubcs.code.vo.webserviceModel.coderule.ResultClassifyVO();
               classifyVO.setId(codeClassifyDO.getOid());
               classifyVO.setLcStatus(codeClassifyDO.getLcStatus());
               classifyVO.setClassCode(codeClassifyDO.getId());
               classifyVO.setDescription(codeClassifyDO.getDescription());
               classifyVO.setName(codeClassifyDO.getName());
               classifyVO.setPid(codeClassifyDO.getParentcodeclassifyoid());
               classifyVO.setFullPathName(codeClassifyDO.getPath());
               classifyVO.setCodeRule(resultCodeRuleVO);
               classifyVOList.add(classifyVO);
            });
            resultLibraryVO.setClassify(classifyVOList);
         }else{
            errorid = "100";
            msg="未查询到相关的分类信息";
         }
         issucess=true;
         resultClassifyRuleData.setLibrary(resultLibraryVO);
      }catch (Throwable e){
         e.printStackTrace();;
         msg="查询分类失败:"+e.getMessage();
      }finally {
      //   resultData.setErrorid(errorid);
      //   resultData.setMsg(msg);
      //   resultClassifyVO.setResultData(resultData);
         resultClassifyRuleData.setErrorid(errorid);
         resultClassifyRuleData.setMsg(msg);
         resultClassifyRuleVO.setData(resultClassifyRuleData);
      }
      if(dataType.equals("xml")){
         //组织返回接口信息
         XStream xStream = new XStream(new DomDriver());
         xStream.processAnnotations(XMLResultSystemVO.class);
         xStream.autodetectAnnotations(true);
         //resultStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + xStream.toXML(resultData);
         resultStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + xStream.toXML(resultClassifyRuleData);
      }else{
         Object object = JSONObject.toJSON(resultClassifyVO);
         Object object = JSONObject.toJSON(resultClassifyRuleVO);
         resultStr = object.toString();
      }
      try {