From 1e8424e321420782e84a6ac8e77343905425dc95 Mon Sep 17 00:00:00 2001 From: zhanglei Date: Sat, 21 Jul 2018 11:27:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E6=A0=A1=E9=AA=8C=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/validate/IdentityVerification.java | 16 ++++++++++------ .../lease/flow/project/validate/SoapRequest.java | 1 + 2 files changed, 11 insertions(+), 6 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 e3874b5da..1c79e7a06 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/validate/IdentityVerification.java +++ b/src_tenwa/com/tenwa/lease/flow/project/validate/IdentityVerification.java @@ -87,16 +87,16 @@ public class IdentityVerification { "O.BalancesHEET,"+ "ci.customertype "+ " FROM "+ - "O left join customer_info "+ - "ON O.customerid = ci.customerid "+ - " WHERE flowunid=:FLOWUNID "+ + "O left join jbo.app.CUSTOMER_INFO ci "+ + " ON O.customerid = ci.customerid "+ + " WHERE O.flowunid=:FLOWUNID "+ "AND O.BALANCESHEET = '申请人' ").setParameter("FLOWUNID",FlowUnid).getSingleResult(false); //判断用户是自然人还是法人 //将申请人,共同申请人,担保人等信息传入该类构建xml入参参数 String inConditions = ""; - if("03".equals(borrowerResult.getAttribute("customertype"))){ + if("03".equals(borrowerResult.getAttribute("customertype").toString())){ inConditions = SoapRequest.FirstXMLConfiguration(borrowerResult,coborrowerResult,guarantorResultList); - }else if("01".equals(borrowerResult.getAttribute("customertype"))){ + }else if("01".equals(borrowerResult.getAttribute("customertype").toString())){ if(coborrowerResult == null && guarantorResultList.size()<=0 ){ return "共同申请人与担保人信息都为空!"; }else{ @@ -108,21 +108,25 @@ public class IdentityVerification { String license =ValidatePropertiesUtil.get("key"); String decode = new String(new BASE64Decoder().decodeBuffer(license)); String result = NciicClient.executeClient("NciicServices",decode,inConditions); + //使用Document解析返回的响应XML Document document = DocumentHelper.parseText(result); Element rootElement = document.getRootElement(); String finalResult = ""; + //判断根元素rootElement若为RESPONSE则调用出现问题 if("RESPONSE".equals(rootElement.getName())){ Element rowElement = rootElement.element("ROWS").element("ROW"); @SuppressWarnings("unchecked") List elements = rowElement.elements(); String errormessage = elements.get(1).getText(); return "验证失败,错误原因:"+errormessage; + //若根元素是ROWS则调用成功 }else if("ROWS".equals(rootElement.getName())){ @SuppressWarnings("unchecked") List rowElement = rootElement.elements("ROW"); for(int i=0;i inputElements = rowElement.get(i).element("INPUT").elements(); String certid = inputElements.get(0).getText(); String name = inputElements.get(1).getText(); @@ -142,7 +146,7 @@ public class IdentityVerification { //获取第二个item @SuppressWarnings("unchecked") List outputNameElements= itemElements.get(1).elements(); - //判断第一个item中的第一个表情元素的名字 + //判断第一个item中的第一个标签元素的名字 if("gmsfhm".equals(outputCertIdElements.get(0).getName())){ String certIdResult = outputCertIdElements.get(1).getText(); String nameResult = outputNameElements.get(1).getText(); 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 e96f3a21a..240ccdb1a 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/validate/SoapRequest.java +++ b/src_tenwa/com/tenwa/lease/flow/project/validate/SoapRequest.java @@ -47,6 +47,7 @@ public class SoapRequest { sb.append(""); }else{ sb.append(BaseXMLConfiguration(biz1)); + sb.append(""); } System.out.println("HttpClient 发送SOAP请求"); String xmldata = sb.toString();