更新合同变更后合同列表数据重复

This commit is contained in:
tangfutang 2018-08-05 15:34:01 +08:00
parent 680554c27c
commit 142d305907
3 changed files with 17 additions and 4 deletions

View File

@ -237,8 +237,12 @@
alert("请勾选合同模板!");
return;
}
var message = RunJavaMethodTrans("com.tenwa.app.baseFileTemplate.handle.FileTemplateUtil","CheckCar","templateIds="+tempids+",flowunid="+"<%=flowunid%>");
var message = RunJavaMethodTrans("com.tenwa.app.baseFileTemplate.handle.FileTemplateUtil","CheckCar","contractId="+"<%=sContractId%>"+",templateIds="+tempids+",flowunid="+"<%=flowunid%>");
if(""!=message){
if("01"=="<%=customertype%>"){
alert("合同已生成,无法再次生成!");
return;
}
alert(message);
location.reload();
return;

View File

@ -22,7 +22,7 @@
//doTemp.setHtmlEvent("MOBILE", "onchange", "checkMobile");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
if(PhaseNo.equals("0020")||PhaseNo.equals("0030")||PhaseNo.equals("0040")||PhaseNo.equals("0050")){
if(PhaseNo.equals("0030")||PhaseNo.equals("0040")||PhaseNo.equals("0050")){
dwTemp.ReadOnly = "-2";//Ö»¶Áģʽ
}
if((null!=RightType&&RightType.equals("ReadOnly"))||(null!=ishistory&&ishistory.equals("true"))){

View File

@ -36,6 +36,7 @@ public class FileTemplateUtil {
public String templateIds;//要生成的合同模板
public String flowunid;//用于查询已经生成的合同
public String leasform;//用判断租赁方式
public String contractId;
public String getTemplateCalss() {return templateCalss;}
public void setTemplateCalss(String templateCalss) {this.templateCalss = templateCalss;}
@ -69,6 +70,13 @@ public class FileTemplateUtil {
public void setLeasform(String leasform) {
this.leasform = leasform;
}
public String getContractId() {
return contractId;
}
public void setContractId(String contractId) {
this.contractId = contractId;
}
public String getTemplateClass(Transaction Sqlca) throws Exception{
String fileClass=templateCalss.replaceAll("@", ",");
List<String>tempFiles=new ArrayList<String>();
@ -167,6 +175,7 @@ public class FileTemplateUtil {
}
}
}
tx.commit();
return message.toString();
}
@ -193,7 +202,7 @@ public class FileTemplateUtil {
String[] bfids = templateIds.split("&");
BizObjectManager btManager = JBOFactory.getBizObjectManager(BF_TEMPLATE.CLASS_NAME);
BizObjectManager ldclManager = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME);
List<BizObject> ldcls = ldclManager.createQuery("select * from O where file_flag='yes' and flow_unid=:flowunid").setParameter("flowunid", flowunid).getResultList(false);
List<BizObject> ldcls = ldclManager.createQuery("select * from O where file_flag='yes' and ( flow_unid=:flowunid or contract_id=:contractid ) ").setParameter("flowunid", flowunid).setParameter("contractid", contractId).getResultList(false);
for(int i=0;i<bfids.length;i++){
BizObject templatename = btManager.createQuery("select templatename from O where id=:id").setParameter("id", bfids[i]).getSingleResult(false);
for(BizObject ldcl:ldcls){
@ -205,7 +214,7 @@ public class FileTemplateUtil {
if(docName.length()>0){
docName=docName+"已存在,请先删除后再生成!";
}
tx.commit();
return docName;
}