业务申请,新增申请客户名称和证件号校验

This commit is contained in:
user 2018-07-01 11:33:57 +08:00
parent f1b8750ec4
commit 37ff1b471f
2 changed files with 90 additions and 1 deletions

View File

@ -40,6 +40,7 @@
String sTempletNo = "BusnessApprovalApplyCreationInfo";//--模板号--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
doTemp.setHtmlEvent("Customer_type", "onchange", "setCertType");
//doTemp.setHtmlEvent("CustomerName", "onchange", "checkNameAndCertId");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
dwTemp.genHTMLObjectWindow("");
@ -72,6 +73,15 @@
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=Info06;Describe=定义按钮事件-;]~*/%>
<script type="text/javascript">
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 sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkNameAndCertId",sParams);
return sReturnInfo;
}
/*~[Describe=保存并初始化数据;InputParam=无;OutPutParam=无;]~*/
function saveRecord()
{
@ -155,7 +165,13 @@
/*~[Describe=确认新增申请;InputParam=无;OutPutParam=无;]~*/
function doCreation()
{
{
debugger;
var result = checkNameAndCertId();
if(result=="2"){
alert("客户名称或证件号已存在!请重新输入!");
return;
}
if(!checkCertInfo(true)) return ;
if(!iV_all(0)) return ;
saveRecord();

View File

@ -0,0 +1,73 @@
package com.tenwa.lease.flow.project.businessapply;
import jbo.app.tenwa.customer.CUSTOMER_CERT;
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.Transaction;
import com.tenwa.flow.baseBussion.BaseBussiness;
public class CustomerInfoCheck {
private String CustomerName;
private String certId;
private String customerType;
private String result;
public String checkNameAndCertId(JBOTransaction tx) throws JBOException{
if(customerType.equals("03")){//×ÔÈ»ÈË
BizObject fullname = JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"FULLNAME=:CustomerName").setParameter("CustomerName", this.CustomerName).getSingleResult(false);
BizObject cert=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"CERTID=:certid").setParameter("certid", this.certId).getSingleResult(false);
if(fullname==null&&cert==null){
this.result = "1";
}else{
this.result = "2";
}
}else if(customerType.equals("01")){//·¨ÈË
BizObject enterprisename = JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"FULLNAME=:CustomerName").setParameter("CustomerName", this.CustomerName).getSingleResult(false);
BizObject cert=JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"CERTID=:certid").setParameter("certid", this.certId).getSingleResult(false);
if(enterprisename==null&&cert==null){
this.result = "1";
}else{
this.result = "2";
}
}
return result;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public String getCustomerType() {
return customerType;
}
public void setCustomerType(String customerType) {
this.customerType = customerType;
}
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;
}
}