diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java index 0f599c619..f01c9782b 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java @@ -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 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")); diff --git a/src_app_fresh/apx/com/amarsoft/als/base/awe/execute/method/BusinessCustomerMethod.java b/src_app_fresh/apx/com/amarsoft/als/base/awe/execute/method/BusinessCustomerMethod.java index 649b1dbc1..e8b0bb136 100644 --- a/src_app_fresh/apx/com/amarsoft/als/base/awe/execute/method/BusinessCustomerMethod.java +++ b/src_app_fresh/apx/com/amarsoft/als/base/awe/execute/method/BusinessCustomerMethod.java @@ -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; } /** * 根据流程编号,获取客户ID(CUSTOMER_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();