1,新增根据flowunid获取customer_person_temp中的id。
2,新增身份校验接口。
This commit is contained in:
parent
055d4a027d
commit
b16c82bf69
@ -506,6 +506,8 @@
|
||||
apx.com.amarsoft.als.base.awe.controller,
|
||||
<!-- 扣款卡信息变更-->
|
||||
apx.com.amarsoft.als.business.change.controller,
|
||||
<!-- 信息校验-->
|
||||
apx.com.amarsoft.als.business.verification.controller,
|
||||
</param-value>
|
||||
</context-param>
|
||||
<!-- 对整个webapi进行一些通用处理的过滤器 -->
|
||||
|
||||
@ -1,16 +1,20 @@
|
||||
package apx.com.amarsoft.als.base.awe.execute.method;
|
||||
|
||||
import jbo.app.tenwa.customer.CUSTOMER_CERT;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOException;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
|
||||
public class BusinessCustomerMethod {
|
||||
|
||||
/**
|
||||
* 根据客户身份证号,获取客户编号
|
||||
* @param certId 身份证号
|
||||
* @return 客户编号customerid
|
||||
* @throws JBOException
|
||||
*/
|
||||
public String getCustomerIdByCertId(String certId) throws JBOException {
|
||||
BizObjectManager bom = JBOFactory
|
||||
.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME);
|
||||
@ -24,4 +28,24 @@ public class BusinessCustomerMethod {
|
||||
}
|
||||
return bo.getAttribute("customerid").toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据流程编号,获取客户ID(CUSTOMER_PERSON_TEMP表中,ID,流程编号均不唯一)
|
||||
* @param flowUnid 流程编号
|
||||
* @return 客户临时表id id
|
||||
* @throws JBOException
|
||||
*/
|
||||
public String getIdByFlowUnid(String flowUnid) throws JBOException {
|
||||
BizObjectManager bom = JBOFactory
|
||||
.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME);
|
||||
BizObject bo = bom.createQuery("flowunid=:flowunid and certtype='Ind01'")
|
||||
.setParameter("flowunid", flowUnid).getSingleResult(false);
|
||||
if (null == bo) {
|
||||
bo = bom.createQuery("flowunid=:flowunid and certtype='Ent02'")
|
||||
.setParameter("flowunid", flowUnid).getSingleResult(false);
|
||||
if(null == bo)
|
||||
return "";
|
||||
}
|
||||
return bo.getAttribute("id").toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
package apx.com.amarsoft.als.business.verification.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
import apx.com.amarsoft.als.business.verification.service.VerificationCustomerInfoService;
|
||||
import apx.com.amarsoft.als.business.verification.service.impl.VerificationCustomerInfoServiceImpl;
|
||||
|
||||
|
||||
@Path("/verification")
|
||||
public class VerificationCustomerInfoController {
|
||||
/**
|
||||
* ¿Í»§Éí·ÝУÑé
|
||||
* @param request
|
||||
* @param response
|
||||
* @param tx
|
||||
* @param sqlca
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Path("/check/customer/info")
|
||||
@POST
|
||||
public Map<String, Object> applyStart(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog().info(
|
||||
"[CONTROLLER] BusinessApplyStartController run .................");
|
||||
ARE.getLog().info("[Path] /check/customer/info" + " run .................");
|
||||
|
||||
VerificationCustomerInfoService service = new VerificationCustomerInfoServiceImpl();
|
||||
return service.checkCutomerInfo(request, response, tx, sqlca, ReturnMapUtil);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package apx.com.amarsoft.als.business.verification.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
|
||||
public interface VerificationCustomerInfoService {
|
||||
Map<String, Object> checkCutomerInfo(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package apx.com.amarsoft.als.business.verification.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.constant.RestfullConstant;
|
||||
import com.base.util.MultipartDataUtil;
|
||||
import com.base.util.ReturnMapUtil;
|
||||
import com.tenwa.lease.flow.project.validate.IdentityVerification;
|
||||
|
||||
import apx.com.amarsoft.als.base.awe.execute.method.BusinessCustomerMethod;
|
||||
import apx.com.amarsoft.als.business.verification.service.VerificationCustomerInfoService;
|
||||
|
||||
public class VerificationCustomerInfoServiceImpl implements VerificationCustomerInfoService {
|
||||
private Map<String, Object> fieldMap;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, Object> checkCutomerInfo(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
|
||||
//获取前台参数flowUnid
|
||||
String flowUnid = fieldMap.get("objectNo") == null ? "" : fieldMap.get("objectNo").toString();
|
||||
//根据flowUnid查询出 客户临时表(customer_person_temp)中的id
|
||||
BusinessCustomerMethod bcm = new BusinessCustomerMethod();
|
||||
String customerPersonTempId = bcm.getIdByFlowUnid(flowUnid);
|
||||
//根据此id,校验身份信息
|
||||
IdentityVerification iv = new IdentityVerification();
|
||||
iv.setId(customerPersonTempId);
|
||||
//调用校验方法
|
||||
String resultString = iv.doIdentityVerification(tx);
|
||||
//创建Map body 返回给前台json数据
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
//判断返回值是否为ERROR,N:发起成功 Y:验证失败 。 发起成功不代表验证成功,也可能有其他错误,如:ip地址受限。
|
||||
if(resultString.equals("ERROR")) {
|
||||
ReturnMapUtil.setReturnMap(null,
|
||||
RestfullConstant.baseProperty.get("FAIL").toString(),
|
||||
"验证失败");
|
||||
}else {
|
||||
//塞入验证结果供前台展示
|
||||
body.put("verificationResult", resultString);
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(),
|
||||
"发起成功");
|
||||
}
|
||||
//返回数据给前台
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user