业务申请校验手机号

This commit is contained in:
tangfutang 2018-11-22 21:19:25 +08:00
parent b17a60646c
commit c3b023ee91
5 changed files with 161 additions and 38 deletions

View File

@ -123,13 +123,25 @@
}
var phone = /^[1][3,4,5,7,8][0-9]{9}$/;
if(phone.test(mobile)){
setErrorTips("mobile","");
return true;
var customerType = "03";
var id = getItemValue(0,getRow(),"id");
var sParams = "certId="+id+",mobile="+mobile+",customerType="+customerType+",flowunid="+"<%=sFlowUnid%>";
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkMobileRepeat",sParams);
if("SUCCESS"!=sReturnInfo){
//setErrorTips("tel","该手机号已重复!");
setErrorTips("mobile",sReturnInfo);
//alert("该手机号已重复!");
return false;
}else{
setErrorTips("mobile","");
return true;
}
}else{
setErrorTips("mobile","手机号格式不正确!");
//alert("手机号格式不正确!");
return false;
}
/* if(CheckPhoneCode(mobile)){
return true;
}else{

View File

@ -150,8 +150,9 @@
var id = getItemValue(0,getRow(),"id");
var sParams = "certId="+id+",mobile="+tel+",customerType="+customerType+",flowunid="+"<%=FlowUnid%>";
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkMobileRepeat",sParams);
if(sReturnInfo=="8"){
setErrorTips("tel","该手机号已重复!");
if("SUCCESS"!=sReturnInfo){
//setErrorTips("tel","该手机号已重复!");
setErrorTips("tel",sReturnInfo);
//alert("该手机号已重复!");
return false;
}else{

View File

@ -283,6 +283,14 @@
setItemUnit(0,0,"tel","")
parent.parent.autoCloseDWDialog();
}
var customerType = "03";
var id = getItemValue(0,getRow(),"id");
var sParams = "CustomerName=Lessee3,certId="+id+",mobile="+tel+",customerType="+customerType+",flowunid="+"<%=flowunid%>";
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkMobileRepeat",sParams);
if("SUCCESS"!=sReturnInfo){
alert(sReturnInfo);
return;
}
}
if("01"==marriage){
var sResult = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoManage","saveCustomerFamily",

View File

@ -409,18 +409,82 @@
}
function saveRecord(leasfrom,projectSource,inputName,inputTel){//±£´æ
//校验申请人手机号和配偶手机号是否重复
var RepeatReault = "";
var customerType = "03";
var mobile = getItemValue(0,getRow(),"mobile");
var emergencyTel = getItemValue(0,getRow(),"EMERGENCY_CONTACT_TEL");
var remark = getItemValue(0,getRow(),"REMARK");
//校验申请人手机号和配偶手机号是否重复
var RepeatReault = "";
//RepeatReault = frame_list.window.checkRepeat(mobile,emergencyTel,remark);//传参基本信息校验三个手机号
RepeatReault = frame_list.checkRepeat(mobile);//传参校验基本信息手机号和配偶是否重复
if(RepeatReault=="false"){
alert("手机号有重复!");
return;
var id = getItemValue(0,getRow(),"id");
//检验承租人手机和紧急联系人的电话是否重复
if(typeof(mobile)!=undefined && mobile != ''){
if(mobile==emergencyTel){
alert("承租人和紧急联系人1手机号重复!");
return;
}else if(mobile==remark){
alert("承租人和紧急联系人2手机号重复!");
return;
}else{
var sParams = "CustomerName=Lessee,certId="+id+",mobile="+mobile+",customerType="+customerType+",flowunid="+"<%=flowunid%>";
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkMobileRepeat",sParams);
if("SUCCESS"!=sReturnInfo){
alert(sReturnInfo);
return;
}
}
RepeatReault = frame_list.checkRepeat(mobile);//传参校验基本信息手机号和配偶是否重复
if(RepeatReault=="false"){
alert("承租人和配偶手机号有重复!");
return;
}
}
//检验紧急联系人1手机号重复
if(typeof(emergencyTel)!=undefined && emergencyTel != ''){
if(emergencyTel==mobile){
alert("承租人和紧急联系人1手机号重复!");
return;
}else if(emergencyTel==remark){
alert("紧急联系人1和紧急联系人2手机号重复!");
return;
}else{
var sParams = "CustomerName=Lessee1,certId="+id+",mobile="+emergencyTel+",customerType="+customerType+",flowunid="+"<%=flowunid%>";
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkMobileRepeat",sParams);
if("SUCCESS"!=sReturnInfo){
alert(sReturnInfo);
return;
}
}
RepeatReault = frame_list.checkRepeat(emergencyTel);//传参校验基本信息手机号和配偶是否重复
if(RepeatReault=="false"){
alert("紧急联系人1和配偶手机号有重复!");
return;
}
}
//检验紧急联系人2手机号重复
if(typeof(remark)!=undefined && remark != ''){
if(remark==emergencyTel){
alert("紧急联系人1和紧急联系人2手机号重复!");
return;
}else if(mobile==remark){
alert("承租人和紧急联系人2手机号重复!");
return;
}else{
var sParams = "CustomerName=Lessee2,certId="+id+",mobile="+remark+",customerType="+customerType+",flowunid="+"<%=flowunid%>";
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkMobileRepeat",sParams);
if("SUCCESS"!=sReturnInfo){
alert(sReturnInfo);
return;
}
}
RepeatReault = frame_list.checkRepeat(remark);//传参校验基本信息手机号和配偶是否重复
if(RepeatReault=="false"){
alert("紧急联系人2和配偶手机号有重复!");
return;
}
}
//RepeatReault = frame_list.window.checkRepeat(mobile,emergencyTel,remark);//传参基本信息校验三个手机号
var mobileResult = checkTel();
if(mobileResult==false){

View File

@ -113,43 +113,81 @@ public class CustomerInfoCheck {
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").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);
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){
this.repeatResult = "7";
if(mobilePT==null && mobileFT==null && mobileLUT==null && emergencycontacttel==null && remark==null && mobileFTSpouse==null){
return "SUCCESS";
}else{
if(certId!=null){
boolean falg = false;
if(mobilePT!=null){
String id = mobilePT.getAttribute("ID").getString();
if(id.equals(certId)){
falg=true;
}
}else if(mobileFT!=null){
String id = mobileFT.getAttribute("ID").getString();
if(id.equals(certId)){
falg=true;
}
if("Lessee".equals(CustomerName)){
if(mobileFT!=null){
return "承租人跟共同申请人手机号重复!";
}else if(mobileLUT!=null){
String id = mobileLUT.getAttribute("ID").getString();
if(id.equals(certId)){
falg=true;
}
return "承租人跟担保人手机号重复!";
}
if(falg){
this.repeatResult = "7";
}else{
this.repeatResult = "8";
}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){
return "配偶跟共同申请人手机号重复!";
}else if(mobileLUT!=null){
return "配偶跟担保人手机号重复!";
}
}else{
this.repeatResult = "8";
}
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();
if(!id.equals(certId)){
return "手机号跟配偶人手机号重复!";
}
}
}
}
}
return repeatResult;
//
return "SUCCESS";
}
public String checkDebitCardMobile(JBOTransaction tx) throws JBOException{//校验扣款卡手机号