添加批准函模板带值盖章和网约车生成合同时直接盖章

This commit is contained in:
tangfutang 2018-11-07 18:12:58 +08:00
parent f7f830d3b2
commit 1edbbad6c2
6 changed files with 244 additions and 1 deletions

View File

@ -309,7 +309,7 @@
alert(sReturn0);
}else{
RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","wordToPdf","FlowUnid=<%=flowunid%>,flagType=word");
if("01"=="<%=customertype%>"&&"1"!="<%=CurPage.getParameter("isNetCar")%>"){
if("01"=="<%=customertype%>"||"1"=="<%=CurPage.getParameter("isNetCar")%>"){
var falg = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","compnySignIng","FlowUnid=<%=flowunid%>,flagType=word,ProjectId=<%=projectId%>");
if("success"== falg ){
alert("Éú³É³É¹¦");

View File

@ -0,0 +1,166 @@
<%@page import="org.apache.catalina.User"%>
<%@page import="jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%>
<%@ page import="com.tenwa.doc.action.DocListInitAction" %>
<%@ page import="com.amarsoft.app.lc.workflow.action.GetFlowAction" %>
<%@ page import="com.amarsoft.app.util.*" %>
<%
/*
Author: undefined 2016-09-01
Content:
History Log:
*/
String userId = CurUser.getUserID();
String orgId =CurUser.getOrgID();
System.out.print(orgId);
String falg = "true";
if(userId.indexOf("8006")>-1){
falg = "false";
}
String compClientID = request.getParameter("CompClientID");
ASObjectModel doTemp = new ASObjectModel("LetterApprovaList");
/* if(userId.indexOf("8006")>-1){
doTemp.appendJboWhere(" O.orgid="+CurUser.getOrgID()+"");
} */
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1";
dwTemp.setPageSize(15);
dwTemp.MultiSelect = true;
dwTemp.genHTMLObjectWindow(userId);
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] =null;
sButtons=new String[][]{
{"true","All","Button","生成批准函","生成批准函","generateQuotation()","","","","btn_icon_generate"},
{"false","All","Button","批量下载","批量下载","lotdown()","","","","btn_icon_down"},
{"false","All","Button","公司盖章","公司盖章","stamp()","","","",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
//在加载完表格后调用
function afterSearch(){
for(var i=0;i<getRowCount(0);i++){
var html="";
html+='<a onclick=downloadFile(\''+getItemValue(0,i,"attrid")+'\')><font color="blue">'+"下载&nbsp&nbsp&nbsp&nbsp&nbsp"+'</font></a>';
getObj(0,i,"FILENAME").innerHTML=html+'<font >'+getObj(0,i,"FILENAME").innerHTML+'</font>';
};
}
function downloadFile(id){
if(typeof(id)==undefined || id=='') {
alert("请先生成租金通知书再下载!");
return;
}
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
window.open(sWebRootPath+"/servlet/view/docDownloadServlet?CompClientID=<%=sCompClientID%>&sqlString=save@"+id, "downloadTemplate");
}
function generateQuotation(){
var projectId=getItemValueArray(0,"ID");
var number = 0;
if(typeof(projectId)=="undefined"||projectId==null||projectId==""){alert("请选择数据");return;}
for(var i=0;i<projectId.length;i++){
var param={};
var tempParam={};
var sparam="";
//模板号
param["templateNo"]="2789f56a88374c2c97e4bacd7493791e";
//生成文件关联关系
tempParam["OBJECTTYPE"]="LetterApprova";
tempParam["PROJECTID"]=projectId[i];
tempParam["PROJ_ID"]=projectId[i];
//生成模板固定参数
tempParam["CurUserId"]="<%=CurUser.getUserID()%>";
tempParam["CurOrgId"]="<%=CurUser.getOrgID()%>";
tempParam["fileSavePath"]="<%=CurConfig.getConfigure("FileSavePath")%>";
param["templateParam"]=JSON.stringify(tempParam).replace(/,/g,"@");//生成模板的参数据
for(var key in param){
if(sparam.length>0){sparam+=",";}
sparam+=key+"="+param[key];
}
var deleteresult=RunJavaMethodTrans("com.tenwa.officetempalte.controller.RentNotinyDeleteAction","deletequtation","projectId="+projectId[i]+",objecttype=LetterApprova");
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
//word转pdf
var id = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","wordToPdfAnnex","ProjectId="+projectId[i]+",PLAN_LIST=LetterApprova");
if(typeof(id)=="undefined" || id.length <= 0 || id==""){
RunJavaMethodTrans("com.tenwa.officetempalte.controller.RentNotinyDeleteAction","deletequtation","projectId="+projectId[i]+",objecttype=LetterApprova");
}else{
var result=RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","collectionSignA","ProjectId="+projectId[i]+",flagType=LetterApprova");
if("success"==result){
number++;
}else{
RunJavaMethodTrans("com.tenwa.officetempalte.controller.RentNotinyDeleteAction","deletequtation","projectId="+projectId[i]+",objecttype=LetterApprova");
}
}
}
if(projectId.length==0){
alert("请先选择数据!!!");
return;
}else if(number==0){
alert("生成失败!!!");
}else if(number==projectId.length){
alert("生成成功!!!");
}else{
alert("部分生成成功!!!");
}
reloadSelf();
}
function lotdown(){
var attrids=getItemValueArray(0,"attrid");
if(typeof(attrids)=="undefined"||attrids==null||attrids==""){alert("请选择");return;}
for( var i=0;i<attrids.length;i++){
if(typeof(attrids[i])=="undefined"||attrids[i]==null||attrids[i]==""){
alert("请先生成租金通知书再下载!");
return;
}
}
lotdownloadFile(attrids);
}
function lotdownloadFile(id){
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
window.open(sWebRootPath+"/servlet/view/DownloadZipServlet?CompClientID=<%=sCompClientID%>&id="+id, "downloadTemplate");
}
function stamp(){
var flie = getItemValue(0,getRow(0),"FILENAME");
if(typeof(flie)=="undefined"||flie==null||flie==""){
alert("请先生成租金通知书!");
return;
}
var number = 0;
var PAYMENT_NUMBERS=getItemValueArray(0,"PAYMENT_NUMBER");
var PLAN_LISTS=getItemValueArray(0,"PLAN_LIST");
var contract_ids=getItemValueArray(0,"contract_id");
for(var i=0;i<PAYMENT_NUMBERS.length;i++){
var plan_number=PAYMENT_NUMBERS[i];//投放编号
var plan_list=PLAN_LISTS[i];//期次
var contractID = contract_ids[i];
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){
number++;
}
}
if(PAYMENT_NUMBERS.length==0){
alert("请先选择数据!!!");
return;
}else if(number==0){
alert("盖章失败!!!");
}else if(number==PAYMENT_NUMBERS.length){
alert("盖章成功!!!");
}else{
alert("部分盖章成功!!!");
}
location.reload();
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

Binary file not shown.

View File

@ -1628,6 +1628,8 @@ public void wordToPdfJar(JBOTransaction tx){
DOCRELATIVE=bom.createQuery(" OBJECTTYPE='TriditionSuspension' and FLOW_UNID=:flowunid ").setParameter("flowunid",FlowUnid).getSingleResult(false);
}else if("settletradition".equals(PLAN_LIST)){
DOCRELATIVE=bom.createQuery(" OBJECTTYPE='settletradition' and FLOW_UNID=:flowunid ").setParameter("flowunid",FlowUnid).getSingleResult(false);
}else if("LetterApprova".equals(PLAN_LIST)){
DOCRELATIVE=bom.createQuery(" OBJECTTYPE='LetterApprova' and PROJ_ID=:projectId ").setParameter("projectId",ProjectId).getSingleResult(false);
}else{
DOCRELATIVE=bom.createQuery("plan_number=:plan_number and plan_list=:plan_list").setParameter("plan_number",PAYMENT_NUMBER).setParameter("plan_list", PLAN_LIST).getSingleResult(false);
}
@ -2306,6 +2308,8 @@ public String claimSign(JBOTransaction tx) throws Exception {
BizObject DOCRELATIVE = null;
if("settle".equals(flagType)){
DOCRELATIVE=bom.createQuery("CONTRACT_ID=:contractid and objecttype='settle' ").setParameter("contractid",contract_id).getSingleResult(false);
}else if("LetterApprova".equals(flagType)){
DOCRELATIVE=bom.createQuery("PROJ_ID=:projectId and objecttype='LetterApprova' ").setParameter("projectId",ProjectId).getSingleResult(false);
}else{
DOCRELATIVE=bom.createQuery("plan_number=:plan_number and objecttype LIKE '%´òÓ¡´ß¿îº¯%' ").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false);
}

View File

@ -71,5 +71,51 @@ public class FindNotifyAction {
}
return attributeid;
}
//»ñÈ¡Åú×¼º¯µÄÊý¾Ý
public static String findFileNameApprova(String projectId) throws JBOException{
BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME);
BizObject DOCRELATIVE=bom.createQuery("PROJ_ID=:porjectId and OBJECTTYPE='LetterApprova'").setParameter("porjectId",projectId).getSingleResult(false);
String filename="";
if(DOCRELATIVE!=null){
String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString();
BizObjectManager bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME);
String DOCLIBRARYid=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(false).getAttribute("id").toString();
BizObjectManager bom2=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCATTRIBUTE.CLASS_NAME);
filename=bom2.createQuery("library_id=:library_id").setParameter("library_id", DOCLIBRARYid).getSingleResult(false).getAttribute("filename").toString();
}
return filename;
}
public static String findCreatimeApprova(String projectId) throws JBOException{
String creatime="";
BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME);
BizObject DOCRELATIVE=bom.createQuery("PROJ_ID=:porjectId and OBJECTTYPE='LetterApprova'").setParameter("porjectId",projectId).getSingleResult(false);
if(DOCRELATIVE!=null){
String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString();
BizObjectManager bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME);
String DOCLIBRARYid=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(false).getAttribute("id").toString();
BizObjectManager bom2=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCATTRIBUTE.CLASS_NAME);
creatime=bom2.createQuery("library_id=:library_id").setParameter("library_id", DOCLIBRARYid).getSingleResult(false).getAttribute("inputtime").toString();
}
return creatime;
}
public static String findAttributeidApprova(String projectId) throws JBOException{
String attributeid="";
BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME);
BizObject DOCRELATIVE=bom.createQuery("PROJ_ID=:porjectId and OBJECTTYPE='LetterApprova'").setParameter("porjectId",projectId).getSingleResult(false);
if(DOCRELATIVE!=null){
String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString();
BizObjectManager bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME);
String DOCLIBRARYid=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(false).getAttribute("id").toString();
BizObjectManager bom2=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCATTRIBUTE.CLASS_NAME);
attributeid=bom2.createQuery("library_id=:library_id").setParameter("library_id", DOCLIBRARYid).getSingleResult(false).getAttribute("id").toString();
}
return attributeid;
}
}

View File

@ -24,6 +24,9 @@ import com.tenwa.officetempalte.util.FileOperatorUtil;
public class RentNotinyDeleteAction {
String plan_number;
String plan_list;
String objecttype;//ÎļþÀàÐÍ
String projectId;//ÏîÄ¿id
String contractId;//ºÏͬid
public String getPlan_number() {
return plan_number;
@ -40,6 +43,28 @@ public class RentNotinyDeleteAction {
public void setPlan_list(String plan_list) {
this.plan_list = plan_list;
}
public String getObjecttype() {
return objecttype;
}
public void setObjecttype(String objecttype) {
this.objecttype = objecttype;
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public String getContractId() {
return contractId;
}
public void setContractId(String contractId) {
this.contractId = contractId;
}
//¸ù¾Ýǰ̨²ÎÊýÉú³ÉÎĵµ
public void deletequtation(JBOTransaction tx) throws Exception{
@ -47,6 +72,8 @@ public class RentNotinyDeleteAction {
BizObject DOCRELATIVE=null;
if("TriditionSuspension".equals(plan_list)){
DOCRELATIVE=bom.createQuery("FLOW_UNID=:flowunid and OBJECTTYPE=:objecttype").setParameter("flowunid",plan_number).setParameter("objecttype", plan_list).getSingleResult(false);
}else if("LetterApprova".equals(objecttype)){
DOCRELATIVE=bom.createQuery(" PROJ_ID=:projectId and OBJECTTYPE='LetterApprova'").setParameter("projectId",projectId).getSingleResult(false);
}else{
DOCRELATIVE=bom.createQuery("plan_number=:plan_number and plan_list=:plan_list").setParameter("plan_number",plan_number).setParameter("plan_list", plan_list).getSingleResult(false);
}