校验合同编号是否重复
This commit is contained in:
parent
3243d9c800
commit
51d8bcc794
@ -272,6 +272,11 @@
|
||||
alert("请勾选合同模板!");
|
||||
return;
|
||||
}
|
||||
var contractNomessage = RunJavaMethodTrans("com.tenwa.app.baseFileTemplate.handle.FileTemplateUtil","CheckContractNo","contractId="+"<%=sContractId%>"+",contractNo="+"<%=CurPage.getParameter("ContractNo")%>");
|
||||
if("error"==contractNomessage){
|
||||
alert("合同编号重复,请取消申请重复发起!");
|
||||
return;
|
||||
}
|
||||
var message = RunJavaMethodTrans("com.tenwa.app.baseFileTemplate.handle.FileTemplateUtil","CheckCar","contractId="+"<%=sContractId%>"+",templateIds="+tempids+",flowunid="+"<%=flowunid%>");
|
||||
if(""!=message){
|
||||
if("01"=="<%=customertype%>"){
|
||||
|
||||
@ -8,6 +8,8 @@ import java.util.Map;
|
||||
import jbo.app.tenwa.doc.LB_DOCRELATIVE;
|
||||
import jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST;
|
||||
import jbo.com.tenwa.entity.comm.officetempalte.BF_TEMPLATE;
|
||||
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO;
|
||||
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_CONTRACT_TEMPLATE;
|
||||
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
|
||||
|
||||
@ -37,6 +39,7 @@ public class FileTemplateUtil {
|
||||
public String flowunid;//用于查询已经生成的合同
|
||||
public String leasform;//用判断租赁方式
|
||||
public String contractId;
|
||||
public String contractNo;
|
||||
public String isNetCar;//用于判断是否是网约车
|
||||
public String getTemplateCalss() {return templateCalss;}
|
||||
public void setTemplateCalss(String templateCalss) {this.templateCalss = templateCalss;}
|
||||
@ -83,6 +86,12 @@ public class FileTemplateUtil {
|
||||
public void setIsNetCar(String isNetCar) {
|
||||
this.isNetCar = isNetCar;
|
||||
}
|
||||
public String getContractNo() {
|
||||
return contractNo;
|
||||
}
|
||||
public void setContractNo(String contractNo) {
|
||||
this.contractNo = contractNo;
|
||||
}
|
||||
|
||||
public String getTemplateClass(Transaction Sqlca) throws Exception{
|
||||
String fileClass=templateCalss.replaceAll("@", ",");
|
||||
@ -229,6 +238,21 @@ public class FileTemplateUtil {
|
||||
return docName;
|
||||
}
|
||||
|
||||
public String CheckContractNo(JBOTransaction tx) throws Exception{
|
||||
BizObjectManager lciManager = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME);
|
||||
BizObjectManager lciTManager = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO_TEMP.CLASS_NAME);
|
||||
BizObject lci = lciManager.createQuery("contract_no=:contractNo").setParameter("contractNo", contractNo).getSingleResult(false);
|
||||
BizObject lcit = lciTManager.createQuery("contract_no=:contractNo").setParameter("contractNo", contractNo).getSingleResult(false);
|
||||
if(lci==null){
|
||||
if(lcit!=null&&lcit.getAttribute("id").getString().equals(contractId)){
|
||||
return "success";
|
||||
}else{
|
||||
return "error";
|
||||
}
|
||||
}else{
|
||||
return "error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user