fix:新增电子签约确认函

This commit is contained in:
maliang 2021-10-11 14:39:12 +08:00
parent e25349b84f
commit dd1aa4cc8d
4 changed files with 236 additions and 1 deletions

View File

@ -0,0 +1,184 @@
<%@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";
String compClientID = request.getParameter("CompClientID");
ASObjectModel doTemp = new ASObjectModel("ElectronicSigningConfirmation");
if(userId.indexOf("8006")>-1){
falg = "false";
//按照用户维度进行权限调整(南京一贯通)
String sql="select count(1) nm from USER_INFO i,user_authority_check a where i.loginid=a.loginid and i.userid ='"+userId+"'";
String result = Sqlca.getString(new SqlObject(sql));
if("8006011".equals(orgId) || "8006053".equals(orgId) || !"0".equals(result)){
doTemp.appendJboWhere(" and lci.inputorgid='"+orgId+"'");
}else{
doTemp.appendJboWhere(" and O.PROJECT_MANAGE='"+userId+"'");
}
}
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"},
{"true","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,"PROJECT_ID");
//var contractNos=getItemValueArray(0,"CONTRACT_NUMBER");
var subjectIds=getItemValueArray(0,"SUBJECTID");
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="";
//根据合同编号 获取主体信息
//var subjectId = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","selectSubjectId","contractNo="+contractNos[i]);
//模板号
// if("aa740e4111c111eaaa0000163e0e11e6" == subjectIds[i]){//深圳电子签约确认书模板
// param["templateNo"]="69f0423f984a46128292fbd8768fcd2f";
// }else if("d989246c11c111eaaa0000163e0e11e6" == subjectIds[i]){//天津电子签约确认书模板
// param["templateNo"]="5edc6ce108494e5982c1aa0cc5c117a0";
// }else{
// alert("未找到对应主体信息!!!");
// break;
// }
param["templateNo"]="69f0423f984a46128292fbd8768fcd2f";
//生成文件关联关系
tempParam["OBJECTTYPE"]="ElectronicSigningConfirmation";
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=ElectronicSigningConfirmation");
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
//word转pdf
var wordTopdf = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","wordToPdfAnnex","ProjectId="+projectId[i]+",PLAN_LIST=ElectronicSigningConfirmation");
if(typeof(wordTopdf)=="undefined" || wordTopdf.length <= 0 || wordTopdf==""){
RunJavaMethodTrans("com.tenwa.officetempalte.controller.RentNotinyDeleteAction","deletequtation","projectId="+projectId[i]+",objecttype=ElectronicSigningConfirmation");
}else{
/* var result=RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","collectionSignA","ProjectId="+projectId[i]+",flagType=LoanNotice");
if("success"==result){
number++;
}else{
RunJavaMethodTrans("com.tenwa.officetempalte.controller.RentNotinyDeleteAction","deletequtation","projectId="+projectId[i]+",objecttype=LoanNotice");
} */
number++;
}
}
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 projectIds=getItemValueArray(0,"ID");
for(var i=0;i<projectIds.length;i++){
var projectId=projectIds[i];
var result=RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","TcollectionSignA","ProjectId="+projectId+",flagType=ElectronicSigningConfirmation");
if("success"==result){
number++;
}
}
if(projectIds.length==0){
alert("请先选择数据!!!");
return;
}else if(number==0){
alert("盖章失败!!!");
}else if(number==projectIds.length){
alert("盖章成功!!!");
}else{
alert("部分盖章成功!!!");
}
location.reload();
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -1777,6 +1777,8 @@ public void wordToPdfJar(JBOTransaction tx){
DOCRELATIVE=bom.createQuery(" OBJECTTYPE='LetterApprova' and PROJ_ID=:projectId ").setParameter("projectId",ProjectId).getSingleResult(false);
}else if("LoanNotice".equals(PLAN_LIST)){
DOCRELATIVE=bom.createQuery(" OBJECTTYPE='LoanNotice' and PROJ_ID=:projectId ").setParameter("projectId",ProjectId).getSingleResult(false);
}else if("ElectronicSigningConfirmation".equals(PLAN_LIST)){//µç×ÓǩԼȷÈÏÊé
DOCRELATIVE=bom.createQuery(" OBJECTTYPE='ElectronicSigningConfirmation' 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);

View File

@ -163,4 +163,51 @@ public class FindNotifyAction {
}
return attributeid;
}
//µç×ÓǩԼȷÈÏÊé
public static String findFileNameConfirmation(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='ElectronicSigningConfirmation'").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 findCreatimeConfirmation(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='ElectronicSigningConfirmation'").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 findAttributeidConfirmation(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='ElectronicSigningConfirmation'").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

@ -76,7 +76,9 @@ public class RentNotinyDeleteAction {
DOCRELATIVE=bom.createQuery(" PROJ_ID=:projectId and OBJECTTYPE='LetterApprova'").setParameter("projectId",projectId).getSingleResult(false);
}else if("LoanNotice".equals(objecttype)){
DOCRELATIVE=bom.createQuery(" PROJ_ID=:projectId and OBJECTTYPE='LoanNotice'").setParameter("projectId",projectId).getSingleResult(false);
}else if("contractInsurance".equals(objecttype)){
}else if("ElectronicSigningConfirmation".equals(objecttype)){//µç×ÓǩԼȷÈÏÊé
DOCRELATIVE=bom.createQuery(" PROJ_ID=:projectId and OBJECTTYPE='ElectronicSigningConfirmation'").setParameter("projectId",projectId).getSingleResult(false);
}else if("contractInsurance".equals(objecttype)){
DOCRELATIVE=bom.createQuery(" PROJ_ID=:projectId and OBJECTTYPE='contractInsurance' and PLAN_NUMBER=:plan_number").setParameter("projectId",projectId).setParameter("plan_number",plan_number).getSingleResult(false);
}
else{