| | |
| | | import com.vci.ubcs.code.util.ClientBusinessObject; |
| | | import com.vci.ubcs.code.util.gennerAttrMapUtil; |
| | | import com.vci.ubcs.code.vo.pagemodel.*; |
| | | import com.vci.ubcs.code.vo.webserviceModel.applybz.ApplyBZParamVO; |
| | | import com.vci.ubcs.code.vo.webserviceModel.applybz.ApplyBZVO; |
| | | import com.vci.ubcs.code.vo.webserviceModel.person.*; |
| | | import com.vci.ubcs.code.vo.webserviceModel.apply.*; |
| | | import com.vci.ubcs.code.vo.webserviceModel.attrmap.*; |
| | |
| | | return resultStr; |
| | | } |
| | | |
| | | public String applyCodeForBZ(String data,String dataType){ |
| | | String resultStr = ""; |
| | | // log.info("方法->applyCodeForBZ start"); |
| | | // |
| | | // final String[] errorid = {"0"}; |
| | | // msg="成功"; |
| | | // objerrorCode="0"; |
| | | // objerrorMsg="成功"; |
| | | // log.info("申请编码的数据参数:->"+data); |
| | | // log.info("申请编码的数据类型:->"+dataType); |
| | | // String systemId=""; |
| | | // List<XMLResultClassfyVO> resultClassfyVOList = new ArrayList<>(); |
| | | // LinkedList<XMLResultDataObjectDetailDO> resultDataObjectDetailDOs = new LinkedList<>(); |
| | | // try{ |
| | | // try { |
| | | // if(StringUtils.isBlank(data)) { |
| | | // errorid[0] ="101"; |
| | | // throw new Throwable("接口参数:传递为空"); |
| | | // } |
| | | // ApplyBZParamVO applyBZParamVO =new ApplyBZParamVO(); |
| | | // //如果dataType是xml则,通过xml序列化成对象形式,如果是json则通过json转换成对象格式 |
| | | // try { |
| | | // if ("xml".equals(dataType)) { |
| | | // XStream xStream = new XStream(new DomDriver()); |
| | | // xStream.processAnnotations(RootDataVO.class); |
| | | // xStream.autodetectAnnotations(true); |
| | | // ApplyBZVO rootDataVO = (ApplyBZVO) xStream.fromXML(data); |
| | | // applyBZParamVO.setData(rootDataVO); |
| | | // } else { |
| | | // applyBZParamVO = JSONObject.toJavaObject(JSONObject.parseObject(data), ApplyBZParamVO.class); |
| | | // } |
| | | // }catch (Throwable e){ |
| | | // errorid[0] ="101"; |
| | | // throw new Throwable("接口参数:传入数据参数解析失败"); |
| | | // } |
| | | // ClassfysVO classfysVO = interParameterVO.getData().getClassifys(); |
| | | // systemId = interParameterVO.getData().getSystemId(); |
| | | // UserVO userVo = interParameterVO.getData().getUser(); |
| | | // //免密登录申请token,request中添加用户信息 |
| | | // passwordFreeLoginService.passwordFreeLogin(userVo.getUserName(),this.getRequest()); |
| | | // AuthUtil.getUser(); |
| | | // List<ClassfyVO> classVOList = classfysVO.getClassify(); |
| | | // InterParameterVO finalInterParameterVO = interParameterVO; |
| | | // //这是账号信息 |
| | | // SessionInfo sessionInfo = new SessionInfo(); |
| | | // sessionInfo.setUserId(userVo.getUserName()); |
| | | // sessionInfo.setUserName(userVo.getTrueName()); |
| | | // sessionInfo.setIp(userVo.getIp()); |
| | | // VciBaseUtil.setCurrentUserSessionInfo(sessionInfo); |
| | | //// List<XMLResultDataObjectDetailDO> allResultDataObjectDetailDOS=new ArrayList<>(); |
| | | // String finalSystemId = systemId; |
| | | // } catch (Throwable e) { |
| | | // List<ApplyDataVO> applyDataVOList= classVO.getObjects().getObject(); |
| | | // objerrorCode="1"; |
| | | // if(!CollectionUtils.isEmpty(applyDataVOList)) { |
| | | // applyDataVOList.stream().forEach(applyDataVO -> { |
| | | // XMLResultDataObjectDetailDO xmlResultDataObjectDetailDO = new XMLResultDataObjectDetailDO(); |
| | | // xmlResultDataObjectDetailDO.setCode(""); |
| | | // xmlResultDataObjectDetailDO.setId(applyDataVO.getId()); |
| | | // xmlResultDataObjectDetailDO.setErrorid(objerrorCode); |
| | | // xmlResultDataObjectDetailDO.setMsg("编码申请失败:" + e.getMessage()); |
| | | // resultDataObjectDetailDOs.add(xmlResultDataObjectDetailDO); |
| | | // }); |
| | | // }else{ |
| | | // XMLResultDataObjectDetailDO xmlResultDataObjectDetailDO = new XMLResultDataObjectDetailDO(); |
| | | // xmlResultDataObjectDetailDO.setCode(""); |
| | | // xmlResultDataObjectDetailDO.setId(""); |
| | | // xmlResultDataObjectDetailDO.setErrorid(objerrorCode); |
| | | // xmlResultDataObjectDetailDO.setMsg("编码申请失败:" + e.getMessage()); |
| | | // resultDataObjectDetailDOs.add(xmlResultDataObjectDetailDO); |
| | | // } |
| | | // e.printStackTrace(); |
| | | // }finally { |
| | | // XMLResultClassfyVO resultClassfyVO = new XMLResultClassfyVO(); |
| | | // resultClassfyVO.setClassCode(classVO.getClassCode()); |
| | | // resultClassfyVO.setLibrary(classVO.getLibrary()); |
| | | // resultClassfyVO.setFullclsfNamePath(classVO.getFullclsfNamePath()); |
| | | // resultClassfyVO.setObjects(resultDataObjectDetailDOs); |
| | | // resultClassfyVOList.add(resultClassfyVO); |
| | | // } |
| | | // XMLResultSystemVO xmlResultSystemVO=new XMLResultSystemVO(); |
| | | // xmlResultSystemVO.setClassifys(resultClassfyVOList); |
| | | // xmlResultSystemVO.setMsg(msg); |
| | | // xmlResultSystemVO.setErrorid(errorid[0]); |
| | | // resultStr= transferResultXMl(xmlResultSystemVO,dataType); |
| | | // }catch (Throwable e){ |
| | | // e.printStackTrace(); |
| | | // msg="申请编码失败:"+e.getMessage(); |
| | | // /* XMLResultSystemVO XMLResultSystemVO=new XMLResultSystemVO(); |
| | | // XMLResultSystemVO.setErrorid(errorid); |
| | | // XMLResultSystemVO.setMsg("申请编码失败:->"+e.getMessage()); |
| | | // XMLResultSystemVO.setClassifys(resultClassfyVOList); |
| | | // resultStr=transferResultXMl(XMLResultSystemVO,dataType); |
| | | // |
| | | // log.error("申请编码失败:->"+e); |
| | | // return resultStr;*/ |
| | | // }finally { |
| | | // XMLResultSystemVO xmlResultSystemVO=new XMLResultSystemVO(); |
| | | // xmlResultSystemVO.setClassifys(resultClassfyVOList); |
| | | // xmlResultSystemVO.setMsg(msg); |
| | | // xmlResultSystemVO.setErrorid(errorid[0]); |
| | | // resultStr= transferResultXMl(xmlResultSystemVO,dataType); |
| | | // final boolean[] issucess = {true}; |
| | | // if(!errorid[0].equals("0")) { |
| | | // issucess[0] = false; |
| | | // }else { |
| | | // if(!CollectionUtils.isEmpty(resultClassfyVOList)) { |
| | | // resultClassfyVOList.stream().forEach(xMLResultClassfyVO -> { |
| | | // xMLResultClassfyVO.getObjects().stream().forEach(objec -> { |
| | | // if (!(objec.getErrorid().equals("0") || objec.getErrorid().equals("204"))) { |
| | | // issucess[0] = false; |
| | | // msg=objec.getMsg(); |
| | | // } |
| | | // }); |
| | | // }); |
| | | // } |
| | | // } |
| | | // try { |
| | | // //记录日志 |
| | | // this.saveLogs(systemId, systemId, data, resultStr, issucess[0], msg, "applyCodeForBZ"); |
| | | // }catch (Throwable e){ |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // log.info("返回参数:"+resultStr); |
| | | //调用集团申请接口申请集团码 |
| | | return resultStr; |
| | | } |
| | | /*** |
| | | * 查询校验分类信息 |
| | | * @param classfyVO |