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 3dedef60e..e3874b5da 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/validate/IdentityVerification.java +++ b/src_tenwa/com/tenwa/lease/flow/project/validate/IdentityVerification.java @@ -65,14 +65,7 @@ public class IdentityVerification { BizObject queryResult = bom4.createQuery("select result from O where flowunid=:FLOWUNID").setParameter("FLOWUNID",FlowUnid).getSingleResult(false); if(queryResult!=null){ return "身份证校验已执行过,不可重复执行"; - }else{ - //查询借款人 - BizObject borrowerResult = bom1.createQuery("SELECT "+ - "fullname,"+ - "certid "+ - "FROM "+ - "O WHERE flowunid=:FLOWUNID "+ - "AND O.BALANCESHEET = '申请人' ").setParameter("FLOWUNID",FlowUnid).getSingleResult(false); + }else{ //查询共同借款人 BizObject coborrowerResult = bom2.createQuery("SELECT "+ "name,"+ @@ -87,11 +80,33 @@ public class IdentityVerification { "FROM "+ "O WHERE flowunid=:FLOWUNID " ).setParameter("FLOWUNID",FlowUnid).getResultList(false); + //查询借款人 + BizObject borrowerResult = bom1.createQuery("SELECT "+ + "O.fullname,"+ + "O.certid,"+ + "O.BalancesHEET,"+ + "ci.customertype "+ + " FROM "+ + "O left join customer_info "+ + "ON O.customerid = ci.customerid "+ + " WHERE flowunid=:FLOWUNID "+ + "AND O.BALANCESHEET = '申请人' ").setParameter("FLOWUNID",FlowUnid).getSingleResult(false); + //判断用户是自然人还是法人 + //将申请人,共同申请人,担保人等信息传入该类构建xml入参参数 + String inConditions = ""; + if("03".equals(borrowerResult.getAttribute("customertype"))){ + inConditions = SoapRequest.FirstXMLConfiguration(borrowerResult,coborrowerResult,guarantorResultList); + }else if("01".equals(borrowerResult.getAttribute("customertype"))){ + if(coborrowerResult == null && guarantorResultList.size()<=0 ){ + return "共同申请人与担保人信息都为空!"; + }else{ + inConditions = SoapRequest.SecondXMLConfiguration(coborrowerResult,guarantorResultList); + } + } + System.err.println(inConditions); //读取授权文件 String license =ValidatePropertiesUtil.get("key"); String decode = new String(new BASE64Decoder().decodeBuffer(license)); - //将申请人,共同申请人,担保人等信息传入该类构建xml入参参数 - String inConditions = SoapRequest.XMLConfiguration(borrowerResult,coborrowerResult,guarantorResultList); String result = NciicClient.executeClient("NciicServices",decode,inConditions); Document document = DocumentHelper.parseText(result); Element rootElement = document.getRootElement(); 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 b06de9bed..e96f3a21a 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/validate/SoapRequest.java +++ b/src_tenwa/com/tenwa/lease/flow/project/validate/SoapRequest.java @@ -5,7 +5,8 @@ import com.amarsoft.are.jbo.BizObject; public class SoapRequest { - public static String XMLConfiguration(BizObject biz1,BizObject biz2,List bizList) throws Exception { + //自然人拼接请求XML方法 + public static String FirstXMLConfiguration(BizObject biz1,BizObject biz2,List bizList) throws Exception { StringBuffer sb = new StringBuffer(""); if(bizList.size()>0 && biz2 != null){ sb.append(BaseXMLConfiguration(biz1)); @@ -52,6 +53,44 @@ public class SoapRequest { System.out.println(xmldata); return xmldata; } + //法人拼接请求XML方法 + public static String SecondXMLConfiguration(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(""); + if(biz2 != null){ + sb.append(""); + //入参共同申请人身份证号码 + sb.append(""+biz2.getAttribute("certid").getString()+""); + //入参共同申请人姓名 + sb.append(""+biz2.getAttribute("name").getString()+""); + sb.append(""); + } + if(bizList != null){ + 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(""); + 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("");