fix:催收函客户及担保人

This commit is contained in:
maliang 2023-08-16 13:37:17 +08:00
parent 3efe5820a3
commit 6495171f25
3 changed files with 349 additions and 0 deletions

View File

@ -0,0 +1,160 @@
<%@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: 催收函-客户 ReminderLetterCustomer.jsp
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("ReminderLetterCustomer");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1";
dwTemp.setPageSize(pageSize==null?20:Integer.parseInt(pageSize));
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"]="69f0423f984a46128292fbd8768f558f";
//生成文件关联关系
tempParam["OBJECTTYPE"]="ReminderLetterCustomer";
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","deletequtationByType","projectId="+projectId[i]+",objecttype=ReminderLetterCustomer");
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
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=ReminderLetterCustomer");
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

@ -0,0 +1,160 @@
<%@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: 催收函-担保人 ReminderLetterGu.jsp
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("ReminderLetterGu");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1";
dwTemp.setPageSize(pageSize==null?20:Integer.parseInt(pageSize));
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"]="69f0423f984a46128292fbd8768f559f";
//生成文件关联关系
tempParam["OBJECTTYPE"]="ReminderLetterGu";
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","deletequtationByType","projectId="+projectId[i]+",objecttype=ReminderLetterGu");
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
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=ReminderLetterGu");
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

@ -135,4 +135,33 @@ public class RentNotinyDeleteAction {
}
//¸ù¾Ýǰ̨²ÎÊýÉú³ÉÎĵµ
public void deletequtationByType(JBOTransaction tx) throws Exception{
BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME);
BizObject DOCRELATIVE=null;
if(objecttype!=null){
DOCRELATIVE=bom.createQuery(" PROJ_ID=:projectId and OBJECTTYPE=:objecttype").
setParameter("projectId",projectId).setParameter("objecttype",objecttype).getSingleResult(false);
System.out.println("deletequtationBytype---------------------------:"+objecttype);
}
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);
String DOCATTRIBUTEid=bom2.createQuery("library_id=:library_id").setParameter("library_id", DOCLIBRARYid).getSingleResult(false).getAttribute("id").toString();
Map<String,String> condtion= new HashMap<String,String>();
condtion.put("id", DOCRELATIVEid);
DataOperatorUtil.deleteJBOByCondtion(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME, condtion, tx);
condtion.clear();
condtion.put("id", DOCLIBRARYid);
DataOperatorUtil.deleteJBOByCondtion(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME, condtion, tx);
condtion.clear();
condtion.put("id", DOCATTRIBUTEid);
DataOperatorUtil.deleteJBOByCondtion(jbo.app.tenwa.doc.LB_DOCATTRIBUTE.CLASS_NAME, condtion, tx);
}
}
}