diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitInfo.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitInfo.jsp index 5ddbe5ded..20eb2beee 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitInfo.jsp @@ -24,6 +24,7 @@ doTemp.setDefaultValue("project_id", ProjectId); doTemp.setDefaultValue("flowunid", sFlowUnid); doTemp.setHtmlEvent("MOBILE","onChange","checkMobileRepeat"); + doTemp.setHtmlEvent("CERTID","onChange","checkCertidRepeat"); // doTemp.setDefaultValue("DATA_STATE", "guarantee");//标记该数据是担保人信息 ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request); dwTemp.Style = "2";//freeform @@ -152,6 +153,9 @@ if(WorkTelResult==false){ return; } + if(!checkCertidRepeat()){ + return; + } as_save(0,"goBack()"); } @@ -162,5 +166,21 @@ AsControl.OpenView(url,sparam,"_self",""); } + function checkCertidRepeat(){ + var certtype = getItemValue(0,getRow(),"CERTTYPE"); + if("Ind01"==certtype){ + var id = getItemValue(0,getRow(),"ID"); + var certId = getItemValue(0,getRow(),"CERTID"); + var sParams ="id="+id+",certid="+certId+",flowunid=<%=sFlowUnid%>"; + var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkCertidRepeat",sParams); + if("success"!=sReturnInfo){ + setErrorTips("CERTID",sReturnInfo); + return false; + } + setErrorTips("CERTID",""); + return true; + } + return true; + } <%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyJoinTempInfo.jsp b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyJoinTempInfo.jsp index b30c55cdd..1007e287a 100644 --- a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyJoinTempInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyJoinTempInfo.jsp @@ -9,6 +9,7 @@ String sPrevUrl = CurPage.getParameter("PrevUrl"); String customerType = CurPage.getParameter("CustomerType"); String ProjectId = CurPage.getParameter("ProjectId"); + String flowunid = CurPage.getParameter("FlowUnid"); if(sPrevUrl == null) sPrevUrl = ""; String sTempletNo = "CustomerFamilyJoinTempInfo";//--模板号-- @@ -196,6 +197,9 @@ if(!checkSex()){ return; } + if(!checkCertidRepeat()){ + return; + } /*var ID = getItemValue(0,getRow(0),'ID'); if("undefined"==ID||""==ID || null==ID){ AsDebug.showMessage("提示","请选中一条数据!","","",true); @@ -238,6 +242,20 @@ }else{ setItemValue(0,getRow(),"SEX","1"); } + checkCertidRepeat(); + } + + function checkCertidRepeat(){ + var id = getItemValue(0,getRow(),"ID"); + var certId = getItemValue(0,getRow(),"CERTID"); + var sParams ="id="+id+",certid="+certId+",flowunid=<%=flowunid%>"; + var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkCertidRepeat",sParams); + if("success"!=sReturnInfo){ + setErrorTips("CERTID",sReturnInfo); + return false; + } + setErrorTips("CERTID",""); + return true; } <%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyTempInfo.jsp b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyTempInfo.jsp index 9a876d6c9..35778b053 100644 --- a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyTempInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyTempInfo.jsp @@ -233,6 +233,9 @@ if(!checkSex()){ return; } + if(!checkCertidRepeat()){ + return; + } } if(name.length > 0){ @@ -315,6 +318,20 @@ }else{ setItemValue(0,getRow(),"SEX","1"); } + checkCertidRepeat(); + } + + function checkCertidRepeat(){ + var id = getItemValue(0,getRow(),"ID"); + var certId = getItemValue(0,getRow(),"CERTID"); + var sParams ="id="+id+",certid="+certId+",flowunid=<%=flowunid%>"; + var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkCertidRepeat",sParams); + if("success"!=sReturnInfo){ + setErrorTips("CERTID",sReturnInfo); + return false; + } + setErrorTips("CERTID",""); + return true; } <%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/src_tenwa/com/tenwa/flow/comm/handler/BusinessCustomerInfoHandler.java b/src_tenwa/com/tenwa/flow/comm/handler/BusinessCustomerInfoHandler.java index f332ecdb9..cb5d19d20 100644 --- a/src_tenwa/com/tenwa/flow/comm/handler/BusinessCustomerInfoHandler.java +++ b/src_tenwa/com/tenwa/flow/comm/handler/BusinessCustomerInfoHandler.java @@ -1,6 +1,7 @@ package com.tenwa.flow.comm.handler; import jbo.app.tenwa.customer.CUSTOMER_ADDRESS_TEMP; +import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP; import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP; import com.amarsoft.are.jbo.BizObject; @@ -35,6 +36,7 @@ public class BusinessCustomerInfoHandler extends CommonHandler { throws Exception { BizObjectManager bomCAT= JBOFactory.getBizObjectManager(CUSTOMER_ADDRESS_TEMP.CLASS_NAME, tx); BizObjectManager bomLULT= JBOFactory.getBizObjectManager(LB_UNION_LESSEE_TEMP.CLASS_NAME, tx); + BizObjectManager cftManage = JBOFactory.getBizObjectManager(CUSTOMER_FAMILY_TEMP.CLASS_NAME, tx); BizObject boCAT=bomCAT.createQuery("customerid=:customerid and flowunid='"+bo.getAttribute("FLOWUNID").getString()+"'").setParameter("customerid", bo.getAttribute("customerid").getString()).getSingleResult(true); BizObject boLULT=bomLULT.createQuery("customer_id=:customerid and flowunid='"+bo.getAttribute("FLOWUNID").getString()+"'").setParameter("customerid", bo.getAttribute("customerid").getString()).getSingleResult(true); boLULT.setAttributeValue("customer_name", bo.getAttribute("fullname")); @@ -54,5 +56,11 @@ public class BusinessCustomerInfoHandler extends CommonHandler { boCAT.setAttributeValue("zipcode", bo.getAttribute("zipcode")); boCAT.setAttributeValue("fulladdress", bo.getAttribute("fulladdress")); bomCAT.saveObject(boCAT); + if(!("01".equals(bo.getAttribute("MARRIAGE").getString()))){ + BizObject cft = cftManage.createQuery("flowunid=:flowunid and Spouse_='Y'").setParameter("flowunid", bo.getAttribute("flowunid").getString()).getSingleResult(true); + if(cft!=null){ + cftManage.deleteObject(cft); + } + } } } diff --git a/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoCheck.java b/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoCheck.java index 5ffb657a8..3dfe91f27 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoCheck.java +++ b/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoCheck.java @@ -32,6 +32,7 @@ public class CustomerInfoCheck { private String custname; private String certtype; private String certid; + private String id; public String getCerttype() { return certtype; @@ -201,7 +202,39 @@ public class CustomerInfoCheck { } return CustomerId; } - + //检车身份证号是否重复 + public String checkCertidRepeat(JBOTransaction tx) throws Exception{ + BizObjectManager cptManage = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME, tx); + BizObjectManager cftManage = JBOFactory.getBizObjectManager(CUSTOMER_FAMILY_TEMP.CLASS_NAME, tx); + BizObjectManager lgutManage = JBOFactory.getBizObjectManager(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, tx); + + BizObject cpt = cptManage.createQuery("flowunid=:flowunid and CERTID=:certid").setParameter("flowunid", flowunid).setParameter("certid",certid).getSingleResult(false); + if(cpt!=null){ + return "该身份证已跟承租人身份证重复"; + } + BizObject cft = cftManage.createQuery("flowunid=:flowunid and CERTID=:certid").setParameter("flowunid", flowunid).setParameter("certid",certid).getSingleResult(false); + if(cft!=null){ + if(cft.getAttribute("ID").getString().equals(id)){ + return "success"; + }else if("Y".equals(cft.getAttribute("Spouse_").getString())){ + BizObject cptP = cptManage.createQuery("flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false); + if(cptP.getAttribute("MARRIAGE").getString().equals("01")){ + return "该身份证已跟配偶身份证重复"; + } + }else{ + return "该身份证已跟共同申请人身份证重复"; + } + } + BizObject lug = lgutManage.createQuery("flowunid=:flowunid and CERTID=:certid and CERTTYPE='Ind01' ").setParameter("flowunid", flowunid).setParameter("certid",certid).getSingleResult(false); + if(lug!=null){ + if(lug.getAttribute("ID").getString().equals(id)){ + return "success"; + }else{ + return "该身份证已跟担保人身份证重复"; + } + } + return "success"; + } public String getFlowunid() { return flowunid; @@ -274,5 +307,12 @@ public class CustomerInfoCheck { public void setMobileResult(String mobileResult) { this.mobileResult = mobileResult; } + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } }