diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBProject/LBProjectInfo.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBProject/LBProjectInfo.jsp index 668f43469..fffeb95d2 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBProject/LBProjectInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBProject/LBProjectInfo.jsp @@ -193,6 +193,20 @@ function init(){ init(); + function selectManySubject(){ + AsDialog.OpenSelector("selectManySubject","","dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.5) + "px", + function(sReturn){ + if(!sReturn||sReturn=="_CANCEL_"||sReturn=="") + { + //alert(getHtmlMessage('1'));//请选择一条信息! + return; + } + sReturn = sReturn.split("@"); + setItemValue(0,0,"subjectid",sReturn[0]); + setItemValue(0,0,"subjectname",sReturn[1]); + },"请选择客户",''); + } + <%/*~END~*/%> diff --git a/WebContent/Tenwa/Lease/Flow/Project/BusinessApproval/ProjectApprovalCreationInfo.jsp b/WebContent/Tenwa/Lease/Flow/Project/BusinessApproval/ProjectApprovalCreationInfo.jsp index 981653cc8..f7fb6cd90 100644 --- a/WebContent/Tenwa/Lease/Flow/Project/BusinessApproval/ProjectApprovalCreationInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Project/BusinessApproval/ProjectApprovalCreationInfo.jsp @@ -78,7 +78,8 @@ $("#A_div_0150").attr("style","display:none;"); }) var operationType=''; - function changeProductName(){//清空产品名称 + var SubjectId=''; + function changeProductName(){//清空产品名称 setItemValue(0,getRow(0),"productName",""); } @@ -156,16 +157,16 @@ alert("请输入证件号码"); return; } - var messages = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","selectTitleName",""); + + var messages = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","selectTitleName","SubjectId="+SubjectId); message = messages.split("@"); if("error"==message[0]){ alert(message[1]); return; } - var sParams = "ApplyType=<%=sApplyType%>,CurUserID=<%=CurUser.getUserID()%>"; - sParams =sParams+",titleid="+message[0]+",titleName="+message[1]+",ProductId="+productId+",ProductName="+productname+",CustomerType="+customerType+",carAttributes="+carAttributes+",leasehold="+leasehold+",carSystem="+carSystem+",custname="+custname+",certtype="+certtype+",certid="+certid+",CustomerId="+CustomerId+",productModel="+productModel+",carSeries="+carSeries+",versionid="+versionid+",modelid="+modelid+",businessType="+businessType+",price="+price+",liter="+liter+",geartype="+geartype+",sourcetype=web,operationType="+operationType; + sParams =sParams+",SubjectId="+SubjectId+",SubjectName="+message[1]+",ProductId="+productId+",ProductName="+productname+",CustomerType="+customerType+",carAttributes="+carAttributes+",leasehold="+leasehold+",carSystem="+carSystem+",custname="+custname+",certtype="+certtype+",certid="+certid+",CustomerId="+CustomerId+",productModel="+productModel+",carSeries="+carSeries+",versionid="+versionid+",modelid="+modelid+",businessType="+businessType+",price="+price+",liter="+liter+",geartype="+geartype+",sourcetype=web,operationType="+operationType; if("BAIC_MOTOR"==operationType){ sParams = sParams+",distributorNo="+getItemValue(0,getRow(),"distributorNo")+",distributorName="+getItemValue(0,getRow(),"distributorName"); } @@ -347,6 +348,7 @@ MyOjbect.modelid = sReturn[7];//车型ID MyOjbect.modelname = sReturn[8];//车型名称 operationType = sReturn[11]; + SubjectId = sReturn[12]; setItemValue(0,0,"productName",sReturn[2]); setItemValue(0,0,"productId",sReturn[3]); diff --git a/WebContent/Tenwa/Lease/Flow/Project/ProjectApproval/ProjectApprovalCreationInfo.jsp b/WebContent/Tenwa/Lease/Flow/Project/ProjectApproval/ProjectApprovalCreationInfo.jsp index d3981b543..689b46ea1 100644 --- a/WebContent/Tenwa/Lease/Flow/Project/ProjectApproval/ProjectApprovalCreationInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Project/ProjectApproval/ProjectApprovalCreationInfo.jsp @@ -90,8 +90,16 @@ alert("该用户无权限发起申请!"); return; } + + var messages = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","selectTitleName","SubjectId="+SubjectId); + message = messages.split("@"); + if("error"==message[0]){ + alert(message[1]); + return; + } + var sParams = "ApplyType=<%=sApplyType%>,CurUserID=<%=CurUser.getUserID()%>"; - sParams =sParams+",CustId="+custid+",CustName=" + custname+",ProductId="+productid+",ProductName="+productname+",businesstype="+businesstype; + sParams =sParams+",SubjectId="+SubjectId+",SubjectName="+message[1]+",CustId="+custid+",CustName=" + custname+",ProductId="+productid+",ProductName="+productname+",businesstype="+businesstype; var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.projectapproval.ProjectApprovalStartAction","initFLow",sParams); if(typeof(sReturnInfo)=="undefined" || sReturnInfo=="" || sReturnInfo=="_CANCEL_" ) { @@ -127,6 +135,7 @@ diff --git a/WebContent/WEB-INF/etc/jbo/jbo_lease.xml b/WebContent/WEB-INF/etc/jbo/jbo_lease.xml index b68c16e96..788b19d8d 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_lease.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_lease.xml @@ -135,6 +135,7 @@ + @@ -280,6 +281,8 @@ + + @@ -789,6 +792,7 @@ + @@ -1056,7 +1060,7 @@ - + @@ -2739,6 +2743,7 @@ + diff --git a/WebContent/WEB-INF/etc/jbo/jbo_prd.xml b/WebContent/WEB-INF/etc/jbo/jbo_prd.xml index 4cddc2750..7e2b1755c 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_prd.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_prd.xml @@ -86,6 +86,7 @@ + @@ -163,22 +164,22 @@ - - - - - + + + + + - - - - - - - - - + + + + + + + + + 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 3a3a2cef3..a47659aa1 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoCheck.java +++ b/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoCheck.java @@ -1,507 +1,511 @@ -package com.tenwa.lease.flow.project.businessapply; - -import jbo.app.tenwa.customer.CUSTOMER_COMPANY; -import jbo.app.tenwa.customer.CUSTOMER_COMPANY_TEMP; -import jbo.app.tenwa.customer.CUSTOMER_FAMILY; -import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP; -import jbo.app.tenwa.customer.CUSTOMER_PERSON; -import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP; -import jbo.app.tenwa.customer.DISTRIBUTOR_INFO; -import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT; -import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT; -import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP; -import jbo.com.tenwa.lease.comm.LB_MANY_SUBJECT; -import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO; -import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP; - -import java.text.SimpleDateFormat; -import java.util.Date; - -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; -import com.amarsoft.awe.util.ASResultSet; -import com.amarsoft.awe.util.SqlObject; -import com.amarsoft.awe.util.Transaction; - -public class CustomerInfoCheck { - - private String CustomerName; - private String certId; - private String mobile; - private String customerType; - private String nameResult; - private String certResult; - private String mobileResult; - private String repeatResult; - private String flowunid; - private String custname; - private String certtype; - private String certid; - private String id; - private String projectNo; - private String FULLNAME; - - public String getFULLNAME() { - return FULLNAME; - } - - public void setFULLNAME(String fULLNAME) { - FULLNAME = fULLNAME; - } - - public String getCerttype() { - return certtype; - } - - public void setCerttype(String certtype) { - this.certtype = certtype; - } - - public String getCertid() { - return certid; - } - - public void setCertid(String certid) { - this.certid = certid; - } - - public String getCustname() { - return custname; - } - - public void setCustname(String custname) { - this.custname = custname; - } - - public String checkName(JBOTransaction tx) throws JBOException{//校验姓名是否存在 - if(customerType.equals("03")){//自然人 - BizObject fullname = JBOFactory.createBizObjectQuery(CUSTOMER_PERSON.CLASS_NAME,"FULLNAME=:CustomerName").setParameter("CustomerName", this.CustomerName).getSingleResult(false); - if(fullname==null){ - this.nameResult = "1"; - }else{ - this.nameResult = "2"; - } - }else if(customerType.equals("01")){//法人 - BizObject enterprisename = JBOFactory.createBizObjectQuery(CUSTOMER_COMPANY.CLASS_NAME,"enterprisename=:CustomerName").setParameter("CustomerName", this.CustomerName).getSingleResult(false); - if(enterprisename==null){ - this.nameResult = "1"; - }else{ - this.nameResult = "2"; - } - } - return nameResult; - } - - public String checkCertId(JBOTransaction tx) throws JBOException{//校验证件是否存在 - if(customerType.equals("03")){//自然人 - BizObject cert=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON.CLASS_NAME,"CERTID=:certid").setParameter("certid", this.certId).getSingleResult(false); - if(cert==null){ - this.certResult = "3"; - }else{ - this.certResult = "4"; - } - }else if(customerType.equals("01")){//法人 - BizObject cert=JBOFactory.createBizObjectQuery(CUSTOMER_COMPANY.CLASS_NAME,"certid=:certid").setParameter("certid", this.certId).getSingleResult(false); - if(cert==null){ - this.certResult = "3"; - }else{ - this.certResult = "4"; - } - } - return certResult; - } - - public String checkMobile(JBOTransaction tx) throws JBOException{//校验手机是否存在 - if(customerType.equals("03")){//自然人 - BizObject mobile=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON.CLASS_NAME,"mobile=:mobile").setParameter("mobile", this.mobile).getSingleResult(false); - if(mobile==null){ - this.mobileResult = "5"; - }else{ - this.mobileResult = "6"; - } - } - return mobileResult; - } - - public String checkMobileRepeat(JBOTransaction tx) throws JBOException{//校验手机号是否重复 - if(customerType.equals("03")){//自然人 - //BizObject mobileP=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON.CLASS_NAME,"mobile=:mobile").setParameter("mobile", this.mobile).getSingleResult(false); - BizObject mobilePT=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and mobile=:mobile").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); - BizObject emergencycontacttel=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and EMERGENCY_CONTACT_TEL=:mobile").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); - BizObject remark=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and REMARK=:mobile").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); - //BizObject mobileF=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY.CLASS_NAME,"tel=:mobile").setParameter("mobile", this.mobile).getSingleResult(false); - BizObject mobileFT=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY_TEMP.CLASS_NAME,"flowunid=:flowunid and tel=:mobile and Partner_='Y' ").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); - BizObject mobileFTSpouse=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY_TEMP.CLASS_NAME,"flowunid=:flowunid and tel=:mobile and Spouse_='Y' ").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); - //BizObject mobileLU=JBOFactory.createBizObjectQuery(LB_GUARANTEE_UNIT.CLASS_NAME,"MOBILE=:mobile").setParameter("mobile", this.mobile).getSingleResult(false); - BizObject mobileLUT=JBOFactory.createBizObjectQuery(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and MOBILE=:mobile").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); - //if(mobileP==null && mobilePT==null && mobileF==null && mobileFT==null && mobileLU==null && mobileLUT==null){ - if(mobilePT==null && mobileFT==null && mobileLUT==null && emergencycontacttel==null && remark==null && mobileFTSpouse==null){ - return "SUCCESS"; - }else{ - if("Lessee".equals(CustomerName)){ - if(mobileFT!=null){ - return "承租人跟共同申请人手机号重复!"; - }else if(mobileLUT!=null){ - return "承租人跟担保人手机号重复!"; - } - }else if("Lessee1".equals(CustomerName)){ - if(mobileFT!=null){ - return "紧急联系人1跟共同申请人手机号重复!"; - }else if(mobileLUT!=null){ - return "紧急联系人1跟担保人手机号重复!"; - } - }else if("Lessee2".equals(CustomerName)){ - if(mobileFT!=null){ - return "紧急联系人2跟共同申请人手机号重复!"; - }else if(mobileLUT!=null){ - return "紧急联系人2跟担保人手机号重复!"; - } - }else if("Lessee3".equals(CustomerName)){ - if(mobileFT!=null&&!(mobileFT.getAttribute("ID").getString().equals(certId))){ - return "配偶跟共同申请人手机号重复!"; - }else if(mobileLUT!=null){ - return "配偶跟担保人手机号重复!"; - } - }else{ - if(mobilePT!=null){ - String id = mobilePT.getAttribute("ID").getString(); - if(!id.equals(certId)){ - return "手机号跟承租人手机号重复!"; - } - }else if(emergencycontacttel!=null){ - String id = emergencycontacttel.getAttribute("ID").getString(); - if(!id.equals(certId)){ - return "手机号跟紧急联系人1手机号重复!"; - } - }else if(remark!=null){ - String id = remark.getAttribute("ID").getString(); - if(!id.equals(certId)){ - return "手机号跟紧急联系人2手机号重复!"; - } - } - if(mobileLUT!=null){ - String id = mobileLUT.getAttribute("ID").getString(); - if(!id.equals(certId)){ - return "手机号跟担保人手机号重复!"; - } - } - if(mobileFT!=null){ - String id = mobileFT.getAttribute("ID").getString(); - if(!id.equals(certId)){ - return "手机号跟共同申请人手机号重复!"; - } - } - if(mobileFTSpouse!=null){ - String id = mobileFTSpouse.getAttribute("ID").getString(); - String certid1 = mobileFTSpouse.getAttribute("certid").getString();// 配偶身份证号 - String name = mobileFTSpouse.getAttribute("name").getString();// 配偶名称 - - // 判断担保人名称和身份证是否与配偶相同, 相同则过滤, 不同则提示 - if(certid1.equals(certid) && name.equals(FULLNAME)){ - return "SUCCESS"; - }else{ - return "手机号跟配偶人手机号重复!"; - } - } - } - } - } - return "SUCCESS"; - } - - public String checkDebitCardMobile(JBOTransaction tx) throws JBOException{//校验扣款卡手机号 - if(customerType.equals("03")){//自然人校验共同人和担保人 - BizObject mobilePT=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and mobile=:mobile").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); - BizObject mobileFT=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY_TEMP.CLASS_NAME,"flowunid=:flowunid and tel=:mobile and Partner_='Y'").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); - if(mobilePT!=null || mobileFT!=null){ - this.mobileResult = "9"; - }else{ - this.mobileResult = "10"; - } - }else if(customerType.equals("01")){//法人校验共同人和担保人 - BizObject mobileFT=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY_TEMP.CLASS_NAME,"flowunid=:flowunid and tel=:mobile and Partner_='Y'").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); - BizObject mobileLUT=JBOFactory.createBizObjectQuery(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and MOBILE=:mobile").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); - if(mobileLUT!=null || mobileFT!=null){ - this.mobileResult = "9"; - }else{ - this.mobileResult = "10"; - } - } - return mobileResult; - } - - public String checkSex(JBOTransaction tx) throws Exception{ - BizObjectManager cptMange = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME, tx); - BizObject cpt = cptMange.createQuery("flowunid =:flowunid").setParameter("flowunid", flowunid).getSingleResult(false); - if(cpt!=null){ - String sex = cpt.getAttribute("sex").getString(); - if(sex.length()==0){ - return "error"; - }else{ - return sex; - } - } - return "error"; - } - - public String checkNameAndCertId(JBOTransaction tx)throws Exception{ - String CustomerId=""; - Transaction Sqlca=null; - try { - Sqlca=Transaction.createTransaction(tx); - String sql = "select c.CUSTOMERID from customer_cert c where exists ( select 1 from customer_type c1 where c1.custtype='cust_type.cust' and c1.customerid=c.customerid)and c.certid='"+certid+"' and c.certtype='"+certtype+"'"; - ASResultSet res = Sqlca.getASResultSet(new SqlObject(sql)); - while (res.next()) { - CustomerId=res.getString("CUSTOMERID"); - } - } catch (JBOException e) { - e.printStackTrace(); - return "ERROR"; - }finally{ - if(Sqlca !=null){ - Sqlca.commit(); - } - } - 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); - String MARRIAGE = cptP.getAttribute("MARRIAGE").getString(); - String name1 = cft.getAttribute("name").getString(); - - if("01".equals(MARRIAGE) && name1.equals(FULLNAME)){ - return "success"; - }else{ - 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 checkYesOrNoSpouse(JBOTransaction tx) throws Exception{ - String returns="true"; - BizObjectManager cftManage = JBOFactory.getBizObjectManager(CUSTOMER_FAMILY_TEMP.CLASS_NAME, tx); - BizObject cft = cftManage.createQuery("flowunid=:flowunid and CERTID=:certid and relative=:relative").setParameter("flowunid", flowunid).setParameter("certid",certid).setParameter("relative","01").getSingleResult(false); - if(cft!=null || !"".equals(cft)){ - returns= "false"; - } - return returns; - }*/ - - public String getFlowunid() { - return flowunid; - } - - public void setFlowunid(String flowunid) { - this.flowunid = flowunid; - } - - public String getRepeatResult() { - return repeatResult; - } - - public void setRepeatResult(String repeatResult) { - this.repeatResult = repeatResult; - } - - public String getMobile() { - return mobile; - } - - public void setMobile(String mobile) { - this.mobile = mobile; - } - - public String getCustomerName() { - return CustomerName; - } - - public void setCustomerName(String customerName) { - CustomerName = customerName; - } - - public String getCertId() { - return certId; - } - - public void setCertId(String certId) { - this.certId = certId; - } - - public String getCustomerType() { - return customerType; - } - - public void setCustomerType(String customerType) { - this.customerType = customerType; - } - - public String getNameResult() { - return nameResult; - } - - public void setNameResult(String nameResult) { - this.nameResult = nameResult; - } - - public String getCertResult() { - return certResult; - } - - public void setCertResult(String certResult) { - this.certResult = certResult; - } - - public String getMobileResult() { - return mobileResult; - } - - public void setMobileResult(String mobileResult) { - this.mobileResult = mobileResult; - } - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getProjectNo() { - return projectNo; - } - - public void setProjectNo(String projectNo) { - this.projectNo = projectNo; - } - - public String checkDistributorStatus(JBOTransaction tx)throws Exception{ - String mas="false"; - Transaction Sqlca=null; - try { - Sqlca=Transaction.createTransaction(tx); - BizObjectManager disManage = JBOFactory.getBizObjectManager(DISTRIBUTOR_INFO.CLASS_NAME, tx); - BizObject bo=disManage.createQuery("orgid=:orgid").setParameter("orgid",id).getSingleResult(false); - if(bo!=null&&"distributor_status04".equals(bo.getAttribute("distributor_status")==null?"":bo.getAttribute("distributor_status").getString())){ - mas="true"; - } - } catch (JBOException e) { - e.printStackTrace(); - return "false"; - } - return mas; - } - - public String checkProjectNo(JBOTransaction tx) throws JBOException{//校验姓名是否存在LB_PROJECT_INFO_TEMP - BizObjectManager lpitManage = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME, tx); - BizObjectManager lpiManage = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME, tx); - BizObject lpit = lpitManage.createQuery("PROJECT_NO=:projectNo").setParameter("projectNo", projectNo).getSingleResult(false); - BizObject lpi = lpiManage.createQuery("PROJECT_NO=:projectNo ").setParameter("projectNo", projectNo).getSingleResult(false); - if(lpi!=null&&!(lpi.getAttribute("PROJECT_STATUS").getString().equals("101"))){ - return "error"; - }else if(lpi!=null&&(lpi.getAttribute("PROJECT_STATUS").getString().equals("101"))) { - return "success"; - }else if(lpi==null&&lpit!=null){ - if(id.equals(lpit.getAttribute("ID").getString())){ - return "success"; - }else{ - return "error"; - } - - } - return "success"; - } - //检验所有手机号是否重复 - public String checkTel(JBOTransaction tx) throws JBOException{//校验手机是否存在 - String msg = ""; - //校验承租人,紧急联系人1和2 - BizObject mobile=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"select * FROM O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and (O.mobile=:mobile or O.EMERGENCY_CONTACT_TEL=:mobileOne or O.REMARK=:mobileTwo) AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')") - .setParameter("flowunid", flowunid).setParameter("mobile", this.mobile).setParameter("mobileOne", this.mobile).setParameter("mobileTwo", this.mobile).getSingleResult(false); - BizObject family=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY_TEMP.CLASS_NAME,"select * from O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and TEL=:mobile AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')").setParameter("flowunid", flowunid).setParameter("mobile", this.mobile).getSingleResult(false); - BizObject guarantee=JBOFactory.createBizObjectQuery(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,"select * from O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and MOBILE=:mobile AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')").setParameter("flowunid", flowunid).setParameter("mobile", this.mobile).getSingleResult(false); - if(mobile==null&&family==null&&guarantee==null){ - msg = "5"; - }else{ - msg = "6"; - } - return msg; - } - //校验所有的身份证号重复 - public String checkCertIdAll(JBOTransaction tx) throws JBOException{//校验身份证是否存在 - String msg = ""; - BizObject mobile=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"select * from O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and O.CERTID=:certId AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')").setParameter("flowunid", flowunid).setParameter("certId", this.certId).getSingleResult(false); - BizObject cert=JBOFactory.createBizObjectQuery(CUSTOMER_COMPANY_TEMP.CLASS_NAME,"select * from O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and O.CERTID=:certid AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')").setParameter("flowunid", flowunid).setParameter("certid", this.certId).getSingleResult(false); - BizObject family=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY_TEMP.CLASS_NAME,"select * from O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and O.CERTID=:certId AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')").setParameter("flowunid", flowunid).setParameter("certId", this.certId).getSingleResult(false); - BizObject guarantee=JBOFactory.createBizObjectQuery(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,"select * from O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and O.CERTID=:certId AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')").setParameter("flowunid", flowunid).setParameter("certId", this.certId).getSingleResult(false); - if(mobile==null&&family==null&&guarantee==null&&cert==null){ - msg = "3"; - }else{ - msg = "4"; - } - return msg; - } - //如果是北汽的产品修改FLOW_BUSSINESS_OBJECT中的flow_key - public String changFlowKey(JBOTransaction tx) throws Exception{ - BizObjectManager fboManage = JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME, tx); - BizObject fbo = fboManage.createQuery("FLOW_UNID=:flowunid").setParameter("flowunid", flowunid).getSingleResult(true); - if(fbo!=null){ - fbo.setAttributeValue("FLOW_KEY", projectNo); - String projectName = fbo.getAttribute("PROJ_NAME").getString(); - if(projectName!=null){ - String newProName = projectName.indexOf("-")==-1?projectName:projectName.substring(projectName.indexOf("-")); - fbo.setAttributeValue("PROJ_NAME", projectNo+newProName); - } - fboManage.saveObject(fbo); - tx.commit(); - return "true"; - } - return "false"; - } - //根据当前系统时间获取主题id和名称 - public String selectTitleName(JBOTransaction tx){ - try { - Date date1 = new Date() ; //获取系统时间 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); //日期格式 - String date = sdf.format(date1); //将系统时间转换成上方指定类型 - BizObjectManager lmsManage = JBOFactory.getBizObjectManager(LB_MANY_SUBJECT.CLASS_NAME, tx); - BizObject lms = lmsManage.createQuery(" start_time < :newtime and :newtime1< end_time").setParameter("newtime", date).setParameter("newtime1", date).getSingleResult(false); - if( null != lms){ - return lms.getAttribute("ID").getString()+"@"+lms.getAttribute("subject_name").getString(); - }else{ - return "error@没有查询符合要求的多主体!"; - } - } catch (JBOException e) { - e.printStackTrace(); - return "error@没有查询符合要求的多主体!"; - - } - } -} +package com.tenwa.lease.flow.project.businessapply; + +import jbo.app.tenwa.customer.CUSTOMER_COMPANY; +import jbo.app.tenwa.customer.CUSTOMER_COMPANY_TEMP; +import jbo.app.tenwa.customer.CUSTOMER_FAMILY; +import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP; +import jbo.app.tenwa.customer.CUSTOMER_PERSON; +import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP; +import jbo.app.tenwa.customer.DISTRIBUTOR_INFO; +import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT; +import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT; +import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP; +import jbo.com.tenwa.lease.comm.LB_MANY_SUBJECT; +import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO; +import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP; +import jbo.sys.CODE_LIBRARY; + +import java.text.SimpleDateFormat; +import java.util.Date; + +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; +import com.amarsoft.awe.util.ASResultSet; +import com.amarsoft.awe.util.SqlObject; +import com.amarsoft.awe.util.Transaction; + +public class CustomerInfoCheck { + + private String CustomerName; + private String certId; + private String mobile; + private String customerType; + private String nameResult; + private String certResult; + private String mobileResult; + private String repeatResult; + private String flowunid; + private String custname; + private String certtype; + private String certid; + private String id; + private String projectNo; + private String FULLNAME; + private String SubjectId; + + public String getFULLNAME() { + return FULLNAME; + } + + public void setFULLNAME(String fULLNAME) { + FULLNAME = fULLNAME; + } + + public String getCerttype() { + return certtype; + } + + public void setCerttype(String certtype) { + this.certtype = certtype; + } + + public String getCertid() { + return certid; + } + + public void setCertid(String certid) { + this.certid = certid; + } + + public String getCustname() { + return custname; + } + + public void setCustname(String custname) { + this.custname = custname; + } + + public String getSubjectId() { + return SubjectId; + } + + public void setSubjectId(String subjectId) { + SubjectId = subjectId; + } + + public String checkName(JBOTransaction tx) throws JBOException{//校验姓名是否存在 + if(customerType.equals("03")){//自然人 + BizObject fullname = JBOFactory.createBizObjectQuery(CUSTOMER_PERSON.CLASS_NAME,"FULLNAME=:CustomerName").setParameter("CustomerName", this.CustomerName).getSingleResult(false); + if(fullname==null){ + this.nameResult = "1"; + }else{ + this.nameResult = "2"; + } + }else if(customerType.equals("01")){//法人 + BizObject enterprisename = JBOFactory.createBizObjectQuery(CUSTOMER_COMPANY.CLASS_NAME,"enterprisename=:CustomerName").setParameter("CustomerName", this.CustomerName).getSingleResult(false); + if(enterprisename==null){ + this.nameResult = "1"; + }else{ + this.nameResult = "2"; + } + } + return nameResult; + } + + public String checkCertId(JBOTransaction tx) throws JBOException{//校验证件是否存在 + if(customerType.equals("03")){//自然人 + BizObject cert=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON.CLASS_NAME,"CERTID=:certid").setParameter("certid", this.certId).getSingleResult(false); + if(cert==null){ + this.certResult = "3"; + }else{ + this.certResult = "4"; + } + }else if(customerType.equals("01")){//法人 + BizObject cert=JBOFactory.createBizObjectQuery(CUSTOMER_COMPANY.CLASS_NAME,"certid=:certid").setParameter("certid", this.certId).getSingleResult(false); + if(cert==null){ + this.certResult = "3"; + }else{ + this.certResult = "4"; + } + } + return certResult; + } + + public String checkMobile(JBOTransaction tx) throws JBOException{//校验手机是否存在 + if(customerType.equals("03")){//自然人 + BizObject mobile=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON.CLASS_NAME,"mobile=:mobile").setParameter("mobile", this.mobile).getSingleResult(false); + if(mobile==null){ + this.mobileResult = "5"; + }else{ + this.mobileResult = "6"; + } + } + return mobileResult; + } + + public String checkMobileRepeat(JBOTransaction tx) throws JBOException{//校验手机号是否重复 + if(customerType.equals("03")){//自然人 + //BizObject mobileP=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON.CLASS_NAME,"mobile=:mobile").setParameter("mobile", this.mobile).getSingleResult(false); + BizObject mobilePT=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and mobile=:mobile").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); + BizObject emergencycontacttel=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and EMERGENCY_CONTACT_TEL=:mobile").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); + BizObject remark=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and REMARK=:mobile").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); + //BizObject mobileF=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY.CLASS_NAME,"tel=:mobile").setParameter("mobile", this.mobile).getSingleResult(false); + BizObject mobileFT=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY_TEMP.CLASS_NAME,"flowunid=:flowunid and tel=:mobile and Partner_='Y' ").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); + BizObject mobileFTSpouse=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY_TEMP.CLASS_NAME,"flowunid=:flowunid and tel=:mobile and Spouse_='Y' ").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); + //BizObject mobileLU=JBOFactory.createBizObjectQuery(LB_GUARANTEE_UNIT.CLASS_NAME,"MOBILE=:mobile").setParameter("mobile", this.mobile).getSingleResult(false); + BizObject mobileLUT=JBOFactory.createBizObjectQuery(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and MOBILE=:mobile").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); + //if(mobileP==null && mobilePT==null && mobileF==null && mobileFT==null && mobileLU==null && mobileLUT==null){ + if(mobilePT==null && mobileFT==null && mobileLUT==null && emergencycontacttel==null && remark==null && mobileFTSpouse==null){ + return "SUCCESS"; + }else{ + if("Lessee".equals(CustomerName)){ + if(mobileFT!=null){ + return "承租人跟共同申请人手机号重复!"; + }else if(mobileLUT!=null){ + return "承租人跟担保人手机号重复!"; + } + }else if("Lessee1".equals(CustomerName)){ + if(mobileFT!=null){ + return "紧急联系人1跟共同申请人手机号重复!"; + }else if(mobileLUT!=null){ + return "紧急联系人1跟担保人手机号重复!"; + } + }else if("Lessee2".equals(CustomerName)){ + if(mobileFT!=null){ + return "紧急联系人2跟共同申请人手机号重复!"; + }else if(mobileLUT!=null){ + return "紧急联系人2跟担保人手机号重复!"; + } + }else if("Lessee3".equals(CustomerName)){ + if(mobileFT!=null&&!(mobileFT.getAttribute("ID").getString().equals(certId))){ + return "配偶跟共同申请人手机号重复!"; + }else if(mobileLUT!=null){ + return "配偶跟担保人手机号重复!"; + } + }else{ + if(mobilePT!=null){ + String id = mobilePT.getAttribute("ID").getString(); + if(!id.equals(certId)){ + return "手机号跟承租人手机号重复!"; + } + }else if(emergencycontacttel!=null){ + String id = emergencycontacttel.getAttribute("ID").getString(); + if(!id.equals(certId)){ + return "手机号跟紧急联系人1手机号重复!"; + } + }else if(remark!=null){ + String id = remark.getAttribute("ID").getString(); + if(!id.equals(certId)){ + return "手机号跟紧急联系人2手机号重复!"; + } + } + if(mobileLUT!=null){ + String id = mobileLUT.getAttribute("ID").getString(); + if(!id.equals(certId)){ + return "手机号跟担保人手机号重复!"; + } + } + if(mobileFT!=null){ + String id = mobileFT.getAttribute("ID").getString(); + if(!id.equals(certId)){ + return "手机号跟共同申请人手机号重复!"; + } + } + if(mobileFTSpouse!=null){ + String id = mobileFTSpouse.getAttribute("ID").getString(); + String certid1 = mobileFTSpouse.getAttribute("certid").getString();// 配偶身份证号 + String name = mobileFTSpouse.getAttribute("name").getString();// 配偶名称 + + // 判断担保人名称和身份证是否与配偶相同, 相同则过滤, 不同则提示 + if(certid1.equals(certid) && name.equals(FULLNAME)){ + return "SUCCESS"; + }else{ + return "手机号跟配偶人手机号重复!"; + } + } + } + } + } + return "SUCCESS"; + } + + public String checkDebitCardMobile(JBOTransaction tx) throws JBOException{//校验扣款卡手机号 + if(customerType.equals("03")){//自然人校验共同人和担保人 + BizObject mobilePT=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and mobile=:mobile").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); + BizObject mobileFT=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY_TEMP.CLASS_NAME,"flowunid=:flowunid and tel=:mobile and Partner_='Y'").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); + if(mobilePT!=null || mobileFT!=null){ + this.mobileResult = "9"; + }else{ + this.mobileResult = "10"; + } + }else if(customerType.equals("01")){//法人校验共同人和担保人 + BizObject mobileFT=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY_TEMP.CLASS_NAME,"flowunid=:flowunid and tel=:mobile and Partner_='Y'").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); + BizObject mobileLUT=JBOFactory.createBizObjectQuery(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and MOBILE=:mobile").setParameter("flowunid", this.flowunid).setParameter("mobile", this.mobile).getSingleResult(false); + if(mobileLUT!=null || mobileFT!=null){ + this.mobileResult = "9"; + }else{ + this.mobileResult = "10"; + } + } + return mobileResult; + } + + public String checkSex(JBOTransaction tx) throws Exception{ + BizObjectManager cptMange = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME, tx); + BizObject cpt = cptMange.createQuery("flowunid =:flowunid").setParameter("flowunid", flowunid).getSingleResult(false); + if(cpt!=null){ + String sex = cpt.getAttribute("sex").getString(); + if(sex.length()==0){ + return "error"; + }else{ + return sex; + } + } + return "error"; + } + + public String checkNameAndCertId(JBOTransaction tx)throws Exception{ + String CustomerId=""; + Transaction Sqlca=null; + try { + Sqlca=Transaction.createTransaction(tx); + String sql = "select c.CUSTOMERID from customer_cert c where exists ( select 1 from customer_type c1 where c1.custtype='cust_type.cust' and c1.customerid=c.customerid)and c.certid='"+certid+"' and c.certtype='"+certtype+"'"; + ASResultSet res = Sqlca.getASResultSet(new SqlObject(sql)); + while (res.next()) { + CustomerId=res.getString("CUSTOMERID"); + } + } catch (JBOException e) { + e.printStackTrace(); + return "ERROR"; + }finally{ + if(Sqlca !=null){ + Sqlca.commit(); + } + } + 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); + String MARRIAGE = cptP.getAttribute("MARRIAGE").getString(); + String name1 = cft.getAttribute("name").getString(); + + if("01".equals(MARRIAGE) && name1.equals(FULLNAME)){ + return "success"; + }else{ + 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 checkYesOrNoSpouse(JBOTransaction tx) throws Exception{ + String returns="true"; + BizObjectManager cftManage = JBOFactory.getBizObjectManager(CUSTOMER_FAMILY_TEMP.CLASS_NAME, tx); + BizObject cft = cftManage.createQuery("flowunid=:flowunid and CERTID=:certid and relative=:relative").setParameter("flowunid", flowunid).setParameter("certid",certid).setParameter("relative","01").getSingleResult(false); + if(cft!=null || !"".equals(cft)){ + returns= "false"; + } + return returns; + }*/ + + public String getFlowunid() { + return flowunid; + } + + public void setFlowunid(String flowunid) { + this.flowunid = flowunid; + } + + public String getRepeatResult() { + return repeatResult; + } + + public void setRepeatResult(String repeatResult) { + this.repeatResult = repeatResult; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getCustomerName() { + return CustomerName; + } + + public void setCustomerName(String customerName) { + CustomerName = customerName; + } + + public String getCertId() { + return certId; + } + + public void setCertId(String certId) { + this.certId = certId; + } + + public String getCustomerType() { + return customerType; + } + + public void setCustomerType(String customerType) { + this.customerType = customerType; + } + + public String getNameResult() { + return nameResult; + } + + public void setNameResult(String nameResult) { + this.nameResult = nameResult; + } + + public String getCertResult() { + return certResult; + } + + public void setCertResult(String certResult) { + this.certResult = certResult; + } + + public String getMobileResult() { + return mobileResult; + } + + public void setMobileResult(String mobileResult) { + this.mobileResult = mobileResult; + } + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getProjectNo() { + return projectNo; + } + + public void setProjectNo(String projectNo) { + this.projectNo = projectNo; + } + + public String checkDistributorStatus(JBOTransaction tx)throws Exception{ + String mas="false"; + Transaction Sqlca=null; + try { + Sqlca=Transaction.createTransaction(tx); + BizObjectManager disManage = JBOFactory.getBizObjectManager(DISTRIBUTOR_INFO.CLASS_NAME, tx); + BizObject bo=disManage.createQuery("orgid=:orgid").setParameter("orgid",id).getSingleResult(false); + if(bo!=null&&"distributor_status04".equals(bo.getAttribute("distributor_status")==null?"":bo.getAttribute("distributor_status").getString())){ + mas="true"; + } + } catch (JBOException e) { + e.printStackTrace(); + return "false"; + } + return mas; + } + + public String checkProjectNo(JBOTransaction tx) throws JBOException{//校验姓名是否存在LB_PROJECT_INFO_TEMP + BizObjectManager lpitManage = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME, tx); + BizObjectManager lpiManage = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME, tx); + BizObject lpit = lpitManage.createQuery("PROJECT_NO=:projectNo").setParameter("projectNo", projectNo).getSingleResult(false); + BizObject lpi = lpiManage.createQuery("PROJECT_NO=:projectNo ").setParameter("projectNo", projectNo).getSingleResult(false); + if(lpi!=null&&!(lpi.getAttribute("PROJECT_STATUS").getString().equals("101"))){ + return "error"; + }else if(lpi!=null&&(lpi.getAttribute("PROJECT_STATUS").getString().equals("101"))) { + return "success"; + }else if(lpi==null&&lpit!=null){ + if(id.equals(lpit.getAttribute("ID").getString())){ + return "success"; + }else{ + return "error"; + } + + } + return "success"; + } + //检验所有手机号是否重复 + public String checkTel(JBOTransaction tx) throws JBOException{//校验手机是否存在 + String msg = ""; + //校验承租人,紧急联系人1和2 + BizObject mobile=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"select * FROM O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and (O.mobile=:mobile or O.EMERGENCY_CONTACT_TEL=:mobileOne or O.REMARK=:mobileTwo) AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')") + .setParameter("flowunid", flowunid).setParameter("mobile", this.mobile).setParameter("mobileOne", this.mobile).setParameter("mobileTwo", this.mobile).getSingleResult(false); + BizObject family=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY_TEMP.CLASS_NAME,"select * from O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and TEL=:mobile AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')").setParameter("flowunid", flowunid).setParameter("mobile", this.mobile).getSingleResult(false); + BizObject guarantee=JBOFactory.createBizObjectQuery(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,"select * from O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and MOBILE=:mobile AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')").setParameter("flowunid", flowunid).setParameter("mobile", this.mobile).getSingleResult(false); + if(mobile==null&&family==null&&guarantee==null){ + msg = "5"; + }else{ + msg = "6"; + } + return msg; + } + //校验所有的身份证号重复 + public String checkCertIdAll(JBOTransaction tx) throws JBOException{//校验身份证是否存在 + String msg = ""; + BizObject mobile=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"select * from O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and O.CERTID=:certId AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')").setParameter("flowunid", flowunid).setParameter("certId", this.certId).getSingleResult(false); + BizObject cert=JBOFactory.createBizObjectQuery(CUSTOMER_COMPANY_TEMP.CLASS_NAME,"select * from O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and O.CERTID=:certid AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')").setParameter("flowunid", flowunid).setParameter("certid", this.certId).getSingleResult(false); + BizObject family=JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY_TEMP.CLASS_NAME,"select * from O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and O.CERTID=:certId AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')").setParameter("flowunid", flowunid).setParameter("certId", this.certId).getSingleResult(false); + BizObject guarantee=JBOFactory.createBizObjectQuery(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,"select * from O LEFT JOIN jbo.sys.FLOW_OBJECT fo ON O.flowunid=fo.objectno where O.flowunid<>:flowunid and O.CERTID=:certId AND ((fo.flowno='BusinessApplyFlow' AND fo.phaseno<> '0010' AND fo.phaseno<> '0020') OR fo.flowno<>'BusinessApplyFlow')").setParameter("flowunid", flowunid).setParameter("certId", this.certId).getSingleResult(false); + if(mobile==null&&family==null&&guarantee==null&&cert==null){ + msg = "3"; + }else{ + msg = "4"; + } + return msg; + } + //如果是北汽的产品修改FLOW_BUSSINESS_OBJECT中的flow_key + public String changFlowKey(JBOTransaction tx) throws Exception{ + BizObjectManager fboManage = JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME, tx); + BizObject fbo = fboManage.createQuery("FLOW_UNID=:flowunid").setParameter("flowunid", flowunid).getSingleResult(true); + if(fbo!=null){ + fbo.setAttributeValue("FLOW_KEY", projectNo); + String projectName = fbo.getAttribute("PROJ_NAME").getString(); + if(projectName!=null){ + String newProName = projectName.indexOf("-")==-1?projectName:projectName.substring(projectName.indexOf("-")); + fbo.setAttributeValue("PROJ_NAME", projectNo+newProName); + } + fboManage.saveObject(fbo); + tx.commit(); + return "true"; + } + return "false"; + } + //根据当前系统时间获取主题id和名称 + public String selectTitleName(JBOTransaction tx){ + try { + BizObjectManager ciManage = JBOFactory.getBizObjectManager(CODE_LIBRARY.CLASS_NAME, tx); + BizObject ci = ciManage.createQuery(" codeno='ManySubject' and itemno=:SubjectId ").setParameter("SubjectId", SubjectId).getSingleResult(false); + return ci == null ? "error@没有查询符合要求的多主体!":"success@"+ci.getAttribute("itemname").toString(); + } catch (JBOException e) { + e.printStackTrace(); + return "error@系统异常!"; + + } + } + +} diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitBusiness.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitBusiness.java index 646968c98..94f4ef62a 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitBusiness.java @@ -62,6 +62,8 @@ public class LBProjectIntoTempInitBusiness extends BaseBussiness { bo.setAttributeValue("PROJECT_INDUSTRY", PROJECT_INDUSTRY); bo.setAttributeValue("InputUserID", asUser.getUserID()); bo.setAttributeValue("InputTime", StringFunction.getToday()); + bo.setAttributeValue("subjectid",this.getAttribute("SubjectId")); + bo.setAttributeValue("subjectname",this.getAttribute("SubjectName")); bm.saveObject(bo); String sMessage="true"; return sMessage; diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java index 2883d9288..c096542c6 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java @@ -325,7 +325,8 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness { bo.setAttributeValue("source_type",this.getAttribute("sourcetype"));//申请类型 bo.setAttributeValue("HaveCommission",haveCommission); bo.setAttributeValue("is_netcar",isNetCar == null ? "" : isNetCar); - bo.setAttributeValue("subjectid",this.getAttribute("titleid")); + bo.setAttributeValue("subjectid",this.getAttribute("SubjectId")); + bo.setAttributeValue("subjectname",this.getAttribute("SubjectName")); bomLPI.saveObject(bo); }catch (Exception e){ tx.rollback();