xiejun
2023-12-14 3a8545610608eaece0702a1fca82d09956fdd66d
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
@@ -315,7 +315,7 @@
                  //校验是否配置
                  DockingSystemConfig dockingSystemConfig=null;
                  dockingSystemConfig=checkIspass(finalSystemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_APPCODE.getValue(),codeClassifyVO.getOid());
                  if(dockingSystemConfig==null){
                  if(dockingSystemConfig==null||StringUtils.isBlank(dockingSystemConfig.getOid())){
                     errorid[0] ="101";
                     throw new Throwable("系统标识为【"+ finalSystemId +"】,集成分类为【"+codeClassifyVO.getName()+"】以上分类,"+sysIntegrationPushTypeEnum.ACCPET_APPCODE.getText()+"接口配置已停用或者未配置,请联系编码管理员!");
                  }
@@ -394,13 +394,6 @@
         resultStr= transferResultXMl(xmlResultSystemVO,dataType);
      }catch (Throwable e){
         e.printStackTrace();
         StringWriter sw = null;
         PrintWriter pw = null;
         sw = new StringWriter();
         pw = new PrintWriter(sw);
         e.printStackTrace(pw);//将出错的栈信息输出到printWriter中
         pw.flush();
         sw.flush();
         msg="申请编码失败:"+e.getMessage();
          /*  XMLResultSystemVO XMLResultSystemVO=new XMLResultSystemVO();
            XMLResultSystemVO.setErrorid(errorid);
@@ -570,6 +563,7 @@
            sb.append(VciBaseUtil.toInSql(codeList.toArray(new String[0])));
            sb.append(")");
            List<Map<String,String>> dataMapList=commonsMapper.queryByOnlySqlForMap(sb.toString());
            List<ClientBusinessObject> cboList=   ChangeMapTOClientBusinessObjects(dataMapList);
            ApplyDatasVO applyDatasVO=new ApplyDatasVO();
            ApplyDatasVO editDatasVO=new ApplyDatasVO();
@@ -1070,7 +1064,7 @@
               if(CODE_CHECKCONFIG) {
                  //校验是否配置
                  DockingSystemConfig dockingSystemConfig= checkIspass(finalSystemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getValue(),codeClassifyVO.getOid());
                  if(dockingSystemConfig==null){
                  if(dockingSystemConfig==null||StringUtils.isBlank(dockingSystemConfig.getOid())){
                     objerrorCode ="101";
                     throw new Throwable("系统标识为【"+ finalSystemId +"】,集成分类为【"+codeClassifyVO.getName()+"】以上分类,"+sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getText()+"接口配置已停用或者未配置,请联系编码管理员!");
                  }
@@ -1427,7 +1421,7 @@
               if(CODE_CHECKCONFIG) {
                  //校验是否配置
                  DockingSystemConfig dockingSystemConfig= checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYDATA.getValue(),currentCodeClassify[0].getOid());
                  if(dockingSystemConfig==null){
                  if(dockingSystemConfig==null||StringUtils.isBlank(dockingSystemConfig.getOid())){
                     errorid ="101";
                     throw new Throwable("系统标识为【"+ systemId +"】,集成分类为【"+currentCodeClassify[0].getName()+"】以上分类,"+sysIntegrationPushTypeEnum.ACCPET_QUERYDATA.getText()+"接口配置已停用或者未配置,请联系编码管理员!");
                  }
@@ -2078,7 +2072,7 @@
            //校验是否配置
            DockingSystemConfig dockingSystemConfig=null;
            dockingSystemConfig=checkIspass(finalSystemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_APPCODE.getValue(),codeClassifyVO.getOid());
            if(dockingSystemConfig==null){
            if(dockingSystemConfig==null||StringUtils.isBlank(dockingSystemConfig.getOid())){
               errorid[0] ="101";
               throw new Throwable("系统标识为【"+ finalSystemId +"】,集成分类为【"+codeClassifyVO.getName()+"】以上分类,"+sysIntegrationPushTypeEnum.ACCPET_APPCODE.getText()+"接口配置已停用或者未配置,请联系编码管理员!");
            }
@@ -2308,10 +2302,11 @@
   private List<ClientBusinessObject> ChangeMapTOClientBusinessObjects(List<Map<String,String>> oldDataMap){
      List<ClientBusinessObject> clientBusinessObjectList=new ArrayList<>();
      DefaultAttrAssimtUtil.mapToLowerCase(oldDataMap,true);
      final BladeUser user = AuthUtil.getUser();
      oldDataMap.stream().forEach(dataMap->{
         ClientBusinessObject clientBusinessObject=new ClientBusinessObject();
         DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(dataMap,clientBusinessObject,true,user);
         DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(dataMap,clientBusinessObject,false,user);
         for (String key:dataMap.keySet()){
            Object value= dataMap.getOrDefault(key,"");
            clientBusinessObject.setAttributeValue(key.toLowerCase(Locale.ROOT),value==null?"":value.toString());
@@ -2431,7 +2426,7 @@
      }catch (Throwable e){
         objerrorCode="1";
         e.printStackTrace();
         throw new Throwable("MDM集成属性配置文件读取失败");
         throw new Throwable("集成系统标识为:【"+systemId+"】,分类库为:【"+libray+"】的集成属性配置文件读取失败");
      }
      LinkedList<String> rowNameList=new LinkedList<>();
      LinkedHashMap<String,Integer> filedIndexMap=new LinkedHashMap<>();
@@ -2542,7 +2537,7 @@
      }catch (Throwable e){
         objerrorCode="1";
         e.printStackTrace();
         throw new Throwable("MDM集成属性配置文件读取失败");
         throw new Throwable("集成系统标识为:【"+systemId+"】,分类库为:【"+libray+"】的集成属性配置文件读取失败");
      }
      LinkedList<String> rowNameList=new LinkedList<>();
      LinkedHashMap<String,Integer> filedIndexMap=new LinkedHashMap<>();
@@ -2734,8 +2729,15 @@
    */
   private DockingSystemConfig  checkIspass(String systemId,String type,String operationType,String classOid){
      log.info("systemId:"+systemId+",type:"+SysIntegrationDataFlowTypeEnum.getTextByValue(type)+",operationType:"+sysIntegrationPushTypeEnum.getTextByValue(operationType)+",classOid:"+classOid);
      CodeClassifyVO codeClassifyVO= classifyService.getObjectByOid(classOid);
      classOid=codeClassifyVO.getOid();
      //CodeClassifyVO codeClassifyVO= classifyService.getObjectByOid(classOid);
      List<CodeClassify> codeClassifyList=  classifyService.selectAllLevelParentByOid(classOid);
      List<String> classifyOids=new ArrayList<>();
      if(!CollectionUtils.isEmpty(codeClassifyList)) {
         classifyOids = codeClassifyList.stream().map(CodeClassify::getOid).collect(Collectors.toList());
      }else{
         return null;
      }
      //classOid=codeClassifyVO.getOid();
      //根据类型去查询需要集成的分类或者数据
      LambdaQueryWrapper<DockingSystemConfig> queryWrapper = Wrappers.<DockingSystemConfig>lambdaQuery();
      queryWrapper.eq(DockingSystemConfig::getUsedFlag, MdmDuckingConstant.SEND_FLAG_TRUE);
@@ -2743,11 +2745,16 @@
      queryWrapper.eq(DockingSystemConfig::getDataFlowType,type);
      queryWrapper.eq(DockingSystemConfig::getPushType,operationType);
      if(StringUtils.isNotBlank(classOid)){
         queryWrapper.in(DockingSystemConfig::getClassifyOid,classOid);
         queryWrapper.in(DockingSystemConfig::getClassifyOid,classifyOids);
      }
      List<DockingSystemConfig> dockingSystemConfigList=new ArrayList<>();
      dockingSystemConfigList=   dockingSystemConfigList=dockingSystemConfigService.list(queryWrapper);
      if(!CollectionUtils.isEmpty(dockingSystemConfigList)){
         return   dockingSystemConfigList.get(0);
      }else{
         return null;
      }
      /*if(!CollectionUtils.isEmpty(dockingSystemConfigList)){
       return   dockingSystemConfigList.get(0);
      }else{
         if(StringUtils.isNotBlank(codeClassifyVO.getParentCodeClassifyOid())) {
@@ -2758,6 +2765,6 @@
         return dockingSystemConfigList.get(0);
      }else{
         return   new DockingSystemConfig();
      }
      }*/
   }
}