From 08f1c2a5473ea10bd5d692d4d415b5a4c3b51c9b Mon Sep 17 00:00:00 2001 From: zhanglei Date: Fri, 20 Jul 2018 14:27:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E8=AF=81=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../validate/IdentityVerification.java | 3 - .../flow/project/validate/SoapRequest.java | 86 +++++++++++++------ 2 files changed, 60 insertions(+), 29 deletions(-) diff --git a/src_tenwa/com/tenwa/lease/flow/project/validate/IdentityVerification.java b/src_tenwa/com/tenwa/lease/flow/project/validate/IdentityVerification.java index 572948604..3dedef60e 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/validate/IdentityVerification.java +++ b/src_tenwa/com/tenwa/lease/flow/project/validate/IdentityVerification.java @@ -90,9 +90,6 @@ public class IdentityVerification { //读取授权文件 String license =ValidatePropertiesUtil.get("key"); String decode = new String(new BASE64Decoder().decodeBuffer(license)); - if(coborrowerResult == null || guarantorResultList == null){ - return "请完善共同申请人与担保人信息!"; - } //将申请人,共同申请人,担保人等信息传入该类构建xml入参参数 String inConditions = SoapRequest.XMLConfiguration(borrowerResult,coborrowerResult,guarantorResultList); String result = NciicClient.executeClient("NciicServices",decode,inConditions); diff --git a/src_tenwa/com/tenwa/lease/flow/project/validate/SoapRequest.java b/src_tenwa/com/tenwa/lease/flow/project/validate/SoapRequest.java index 1d24b4eb7..b06de9bed 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/validate/SoapRequest.java +++ b/src_tenwa/com/tenwa/lease/flow/project/validate/SoapRequest.java @@ -7,39 +7,73 @@ public class SoapRequest { public static String XMLConfiguration(BizObject biz1,BizObject biz2,List bizList) throws Exception { StringBuffer sb = new StringBuffer(""); - sb.append(""); - sb.append(""); - sb.append(""); - sb.append("安鹏国际融资租赁有限公司"); - sb.append(""); - sb.append(""); - sb.append("公民身份号码"); - sb.append("姓名"); - sb.append(""); - sb.append(""); - //入参申请人身份证号码 - sb.append(""+biz1.getAttribute("CERTID").getString()+""); - //入参申请人姓名 - sb.append(""+biz1.getAttribute("FULLNAME").getString()+""); - sb.append(""); - sb.append(""); - //入参共同申请人身份证号码 - sb.append(""+biz2.getAttribute("certid").getString()+""); - //入参共同申请人姓名 - sb.append(""+biz2.getAttribute("name").getString()+""); - sb.append(""); - for(int i=0;i"); + if(bizList.size()>0 && biz2 != null){ + sb.append(BaseXMLConfiguration(biz1)); + sb.append(""); //入参共同申请人身份证号码 - sb.append(""+bizList.get(i).getAttribute("CERTID").getString()+""); + sb.append(""+biz2.getAttribute("certid").getString()+""); //入参共同申请人姓名 - sb.append(""+bizList.get(i).getAttribute("FULLNAME").getString()+""); + sb.append(""+biz2.getAttribute("name").getString()+""); sb.append(""); + for(int i=0;i"); + //入参共同申请人身份证号码 + sb.append(""+bizList.get(i).getAttribute("CERTID").getString()+""); + //入参共同申请人姓名 + sb.append(""+bizList.get(i).getAttribute("FULLNAME").getString()+""); + sb.append(""); + } + sb.append(""); + }else if(biz2 == null && bizList.size()>0){ + sb.append(BaseXMLConfiguration(biz1)); + for(int i=0;i"); + //入参共同申请人身份证号码 + sb.append(""+bizList.get(i).getAttribute("CERTID").getString()+""); + //入参共同申请人姓名 + sb.append(""+bizList.get(i).getAttribute("FULLNAME").getString()+""); + sb.append(""); + } + sb.append(""); + }else if(biz2 != null && bizList.size()<=0){ + sb.append(BaseXMLConfiguration(biz1)); + sb.append(""); + //入参共同申请人身份证号码 + sb.append(""+biz2.getAttribute("certid").getString()+""); + //入参共同申请人姓名 + sb.append(""+biz2.getAttribute("name").getString()+""); + sb.append(""); + sb.append(""); + }else{ + sb.append(BaseXMLConfiguration(biz1)); } - sb.append(""); System.out.println("HttpClient 发送SOAP请求"); String xmldata = sb.toString(); System.out.println(xmldata); return xmldata; } + public static String BaseXMLConfiguration(BizObject biz1){ + try { + StringBuffer sb = new StringBuffer(""); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append("安鹏国际融资租赁有限公司"); + sb.append(""); + sb.append(""); + sb.append("公民身份号码"); + sb.append("姓名"); + sb.append(""); + sb.append(""); + //入参申请人身份证号码 + sb.append(""+biz1.getAttribute("CERTID").getString()+""); + //入参申请人姓名 + sb.append(""+biz1.getAttribute("FULLNAME").getString()+""); + sb.append(""); + return sb.toString(); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } }