录单时校验自然人承租人年龄
This commit is contained in:
parent
e7d9c89a88
commit
d30d2efa22
@ -139,14 +139,17 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkNameAndCertId(){//校验姓名和证件号
|
||||
function checkNameAndCertId(){//校验自然人承租人年龄
|
||||
//var customerName = getItemValue(0,getRow(),"CustomerName");
|
||||
var certId = getItemValue(0,getRow(),"certid");
|
||||
var customerType = getItemValue(0,getRow(),"Customer_type");
|
||||
//var sParams = "CustomerName="+customerName+",certId="+certId+",customerType="+customerType;
|
||||
var sParams = "certId="+certId+",customerType="+customerType;
|
||||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkNameAndCertId",sParams);
|
||||
return sReturnInfo;
|
||||
if(customerType=="03"){
|
||||
//var sParams = "CustomerName="+customerName+",certId="+certId+",customerType="+customerType;
|
||||
var sParams = "certId="+certId;
|
||||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkAndCertId",sParams);
|
||||
return sReturnInfo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*~[Describe=保存并初始化数据;InputParam=无;OutPutParam=无;]~*/
|
||||
@ -265,11 +268,11 @@
|
||||
/*~[Describe=确认新增申请;InputParam=无;OutPutParam=无;]~*/
|
||||
function doCreation()
|
||||
{
|
||||
// var result = checkNameAndCertId();
|
||||
// if(result=="2"){
|
||||
// alert("证件号已存在!请重新输入!");
|
||||
// return;
|
||||
// }
|
||||
var result = checkNameAndCertId();
|
||||
if(result=="false"){
|
||||
alert("年龄不满足!");
|
||||
return;
|
||||
}
|
||||
if(!checkCertInfo(true)) return ;
|
||||
if(!iV_all(0)) return ;
|
||||
saveRecord();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.tenwa.lease.flow.project.businessapply;
|
||||
|
||||
import com.tenwa.reckon.util.Conn;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_COMPANY;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_COMPANY_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_FAMILY;
|
||||
@ -17,6 +18,8 @@ import jbo.sys.CODE_LIBRARY;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
@ -272,6 +275,33 @@ public class CustomerInfoCheck {
|
||||
}
|
||||
return CustomerId;
|
||||
}
|
||||
|
||||
|
||||
public String checkAndCertId(JBOTransaction tx)throws Exception{
|
||||
String CustomerId="";
|
||||
Transaction Sqlca=null;
|
||||
Conn conn = new Conn(tx);
|
||||
String typr = "";
|
||||
try {
|
||||
Sqlca=Transaction.createTransaction(tx);
|
||||
String sql = "select \n" +
|
||||
"case when 18 < t.age+0 and t.age+0 < 65 then 'true' else 'false' end as zt\n" +
|
||||
"from (\n" +
|
||||
"select\n" +
|
||||
"\t(substring(now(),1,4)-substring('"+certId+"',7,4))-(substring('"+certId+"',11,4)-date_format(now(),'%m%d')>0) as age\n" +
|
||||
"from\n" +
|
||||
"\tdual\n" +
|
||||
") t";
|
||||
List<Map<String, String>> age = conn.executeQuery(sql);
|
||||
typr = age.get(0).get("zt");
|
||||
} catch (JBOException e) {
|
||||
e.printStackTrace();
|
||||
return "ERROR";
|
||||
}
|
||||
return typr;
|
||||
}
|
||||
|
||||
|
||||
//¼ì³µÉí·ÝÖ¤ºÅÊÇ·ñÖØ¸´
|
||||
public String checkCertidRepeat(JBOTransaction tx) throws Exception{
|
||||
BizObjectManager cptManage = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME, tx);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user