身份证 生日 性别

This commit is contained in:
liujiaji 2018-08-14 13:25:35 +08:00
parent 6a2ff3a6a9
commit c0ba15f52f
2 changed files with 55 additions and 25 deletions

View File

@ -8,11 +8,16 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
import apx.com.amarsoft.als.apzl.apply.business.doc.upload.service.impl.BusinessDocUploadServiceImpl;
import apx.com.amarsoft.als.apzl.apply.business.start.bo.BusinessBO;
import apx.com.amarsoft.als.apzl.apply.business.start.init.InitDocListTools;
import apx.com.amarsoft.als.apzl.apply.business.start.service.BusinessApplyStartService;
import apx.com.amarsoft.als.base.awe.execute.method.BusinessCustomerMethod;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.Transaction;
import com.base.constant.RestfullConstant;
@ -38,7 +43,7 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService
tx.commit();
String sReturnInfo = bo.getMsg();
if (sReturnInfo.startsWith("success")) {
String serialNo = sReturnInfo.split("@")[1];
// String serialNo = sReturnInfo.split("@")[1];
// 获取当前申请的相关参数包含FlowUnid
Map<String, String> params = bo.getParams();
// 加载附件
@ -47,6 +52,34 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService
String certType = bo.getCerttype();
String date = DateUtil.getDateTime(new Date());
if ("ind01".equals(certType.toLowerCase())) {
BusinessCustomerMethod m = new BusinessCustomerMethod();
String customerId = m.getCustomerIdByFlowUnid(bo.getObjectNo());
String certId = bo.getCertid();
BizObjectManager custPersonM = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME);
BizObject custPerson = custPersonM.createQuery("O.flowunid=:flowunid and O.customerid=:customerid")
.setParameter("flowunid", bo.getObjectNo()).setParameter("customerid", customerId).getSingleResult(true);
if (null != custPerson && certId.length() == 18) {
String byear = certId.substring(6, 10);
String bmonth = certId.substring(10, 12);
String bdate = certId.substring(12, 14);
String birth = byear+"/"+bmonth+"/"+bdate;
custPerson.setAttributeValue("BIRTHDAY", birth);
String sex = certId.substring(16, 17);
if(Integer.parseInt(sex)%2==0){
sex = "2";
}else{
sex ="1";
}
custPerson.setAttributeValue("SEX", sex);
tx.join(custPersonM);
custPersonM.saveObject(custPerson);
tx.commit();
}
}
if (flag && "ind01".equals(certType.toLowerCase())
&& (fileList != null && fileList.size() > 0)) { // 承租人身份证正反面照片
fieldMap.put("objectNo".toUpperCase(), params.get("FlowUnid"));

View File

@ -3,6 +3,7 @@ package apx.com.amarsoft.als.base.awe.execute.method;
import net.sf.json.JSONObject;
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT;
import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP;
import com.amarsoft.are.ARE;
import com.amarsoft.are.jbo.BizObject;
@ -15,7 +16,9 @@ public class BusinessCustomerMethod {
/**
* 根据客户身份证号获取客户编号
* @param certId Éí·ÝÖ¤ºÅ
*
* @param certId
* Éí·ÝÖ¤ºÅ
* @return 客户编号customerid
* @throws JBOException
*/
@ -27,49 +30,43 @@ public class BusinessCustomerMethod {
if (null == bo) {
bo = bom.createQuery("certid=:certid and certtype='Ent02'")
.setParameter("certid", certId).getSingleResult(false);
if(null == bo)
if (null == bo)
return "";
}
return bo.getAttribute("customerid").toString();
}
public String getCustomerIdByFlowUnid(String flowUnid) throws JBOException {
String certId = "";
BizObjectManager fboM = JBOFactory
.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME);
BizObject fbo = fboM.createQuery("flow_unid=:flow_unid")
.setParameter("flow_unid", flowUnid).getSingleResult(false);
if (null == fbo) return "";
String jsonStr = fbo.getAttribute("FixedFlowParam") == null ? "" : fbo.getAttribute("FixedFlowParam").toString();
if ("".equals(jsonStr)) return "";
try {
JSONObject jo = JsonUtil.str2JSONObject(jsonStr);
certId = jo.get("certid") == null ? "" : jo.getString("certid");
} catch (Exception e) {
ARE.getLog().error(e);
BizObjectManager lulM = JBOFactory
.getBizObjectManager(LB_UNION_LESSEE_TEMP.CLASS_NAME);
BizObject lul = lulM.createQuery("flowunid=:flowunid")
.setParameter("flowunid", flowUnid).getSingleResult(false);
if (null == lul)
return "";
}
if ("".equals(certId)) return "";
return getCustomerIdByCertId(certId);
String customerId = lul.getAttribute("customer_id") == null ? "" : lul
.getAttribute("customer_id").toString();
return customerId;
}
/**
* 根据流程编号获取客户IDCUSTOMER_PERSON_TEMP表中ID流程编号均不唯一
* @param flowUnid Á÷³Ì±àºÅ
*
* @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'")
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)
if (null == bo)
return "";
}
return bo.getAttribute("id").toString();