diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBContractTemplate/contract_template.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBContractTemplate/contract_template.jsp index da96a1669..75f12449c 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBContractTemplate/contract_template.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBContractTemplate/contract_template.jsp @@ -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%>"){ diff --git a/src/com/tenwa/app/baseFileTemplate/handle/FileTemplateUtil.java b/src/com/tenwa/app/baseFileTemplate/handle/FileTemplateUtil.java index e57e38b65..df06e7193 100644 --- a/src/com/tenwa/app/baseFileTemplate/handle/FileTemplateUtil.java +++ b/src/com/tenwa/app/baseFileTemplate/handle/FileTemplateUtil.java @@ -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"; + } + } }