diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBContractTemplate/contract_template.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBContractTemplate/contract_template.jsp index 029eb37e2..92b7eea52 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBContractTemplate/contract_template.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBContractTemplate/contract_template.jsp @@ -242,10 +242,14 @@ if("01"=="<%=customertype%>"){ var falg = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","compnySignIng","FlowUnid=<%=flowunid%>,flagType=word,ProjectId=<%=projectId%>"); if("success"== falg ){ - + alert("生成成功"); + }else{ + RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","companyUpdateDocContractStatus","FlowUnid=<%=flowunid%>"+",ProjectId=<%=projectId%>"); + alert("生成失败!!!"); } + }else{ + alert("生成成功"); } - alert("生成成功"); } reloadSelf(); } diff --git a/WebContent/Tenwa/Lease/Flow/RentNotify/RentNotifyList.jsp b/WebContent/Tenwa/Lease/Flow/RentNotify/RentNotifyList.jsp index da3617b53..e303182b1 100644 --- a/WebContent/Tenwa/Lease/Flow/RentNotify/RentNotifyList.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentNotify/RentNotifyList.jsp @@ -125,7 +125,7 @@ var plan_number=PAYMENT_NUMBERS[i];//投放编号 var plan_list=PLAN_LISTS[i];//期次 var contractID = getItemValue(0,getRow(0),"contract_id"); - var result=RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","claimSignA","PAYMENT_NUMBER="+plan_number+",PLAN_LIST="+plan_list+",contract_id="+contractID); + var result=RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","claimSignA","PAYMENT_NUMBER="+plan_number+",PLAN_LIST="+plan_list+",contract_id="+contractID+",flagType=start"); if("success"==result){ alert("盖章成功!!!"); location.reload(); diff --git a/src/com/tenwa/channelportal/action/ContractSignAction.java b/src/com/tenwa/channelportal/action/ContractSignAction.java index 917b28aee..5643df340 100644 --- a/src/com/tenwa/channelportal/action/ContractSignAction.java +++ b/src/com/tenwa/channelportal/action/ContractSignAction.java @@ -47,6 +47,7 @@ import com.amarsoft.context.ASUser; import com.caucho.hessian.client.HessianProxyFactory; import com.tenwa.app.dao.ContractSignInfo; import com.tenwa.lease.app.service.HttpRequestAppService; +import com.tenwa.lease.flow.contract.contractapproval.ContractTemplateCache; import com.tenwa.channelportal.action.generativecontract.Word2PdfUtil; import com.tenwa.channelportal.action.generativecontract.WordToPDFUtil; import com.tenwa.comm.util.date.DateAssistant; @@ -1913,7 +1914,7 @@ public String claimSign(JBOTransaction tx) throws Exception { BizObjectManager crManage = JBOFactory.getBizObjectManager(CUSTOMER_PERSON.CLASS_NAME, tx); BizObject cr = crManage.createQuery("CUSTOMERID=:customerid").setParameter("customerid", customerid).getSingleResult(false); if(cr != null){ - info = cr.getAttribute("FULLNAME").toString() + "@" + cr.getAttribute("mobile").toString(); + info = cr.getAttribute("FULLNAME").toString() + "@" + cr.getAttribute("mobile").toString()+"@"+flagType; } //获取需要盖章的文件信息 Map map=new HashMap(); @@ -2021,5 +2022,28 @@ public String claimSign(JBOTransaction tx) throws Exception { } return "success"; } + + public String companyUpdateDocContractStatus(JBOTransaction tx) throws Exception{ + BizObjectManager fboManger=JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME,tx); + BizObjectManager lctManger=JBOFactory.getBizObjectManager(LB_CONTRACT_TEMPLATE.CLASS_NAME,tx); + BizObject fbo = fboManger.createQuery("flow_unid=:flowunid").setParameter("flowunid",FlowUnid).getSingleResult(false); + BizObject lct = lctManger.createQuery("Contract_id=:contractid").setParameter("contractid", fbo.getAttribute("CONTRACT_ID").getString()).getSingleResult(false); + String attId = ContractTemplateCache.getContractTemplateID(lct.getAttribute("ID").getString()); + lctManger.deleteObject(lct); + BizObjectManager lclManager=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); + BizObjectManager lpiManager=JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME,tx); + try{ + lclManager.createQuery("update O set file_flag='no',message='1' where attribute_id=:attributeid").setParameter("attributeid",attId).executeUpdate(); + lpiManager.createQuery("update O set PROJECT_STATUS=13 where id=:id").setParameter("id",ProjectId).executeUpdate(); + //attBom.createQuery("update O set status='1' WHERE id='"+key.getAttribute("ATTRIBUTE_ID").toString()+"'").executeUpdate(); + tx.commit(); + }catch(Exception e){ + tx.rollback(); + e.printStackTrace(); + System.out.println(e.getMessage()); + return "error"; + } + return "success"; + } } \ No newline at end of file