This commit is contained in:
liuzhao 2018-09-21 18:31:26 +08:00
commit b80d3f519a
7 changed files with 384 additions and 2 deletions

View File

@ -43,7 +43,7 @@
return;
}
var equipOverMoney = getItemValue(0,getRow(0),"money");
if(confirm("是否要进行货扣?")){
if(confirm("是否进行抵扣?")){
AsDialog.OpenSelector("SelectPaymentFundList","paymentNumber,"+getItemValue(0,getRow(0),"payment_number"),"dialogWidth=" + parseInt(window.screen.width * 0.9) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
if(!sReturn||sReturn=="_CANCEL_"){
return;

View File

@ -0,0 +1,162 @@
<%@page import="java.util.Date"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%>
<%
/*
Author: undefined 2016-08-06
Content:
History Log:
*/
Date d=new Date();
SimpleDateFormat df=new SimpleDateFormat("yyyy/MM/dd");
String now=df.format(new Date(d.getTime()));//yyyy/MM/dd格式
ASObjectModel doTemp = new ASObjectModel("TGeneratedReminderLetterList");
/* String sCondtion=DataRightManager.getRightCondition(CurUser,"O", "contract");
doTemp.appendJboWhere(sCondtion); */
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.MultiSelect=true;
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.setPageSize(10);
//dwTemp.genHTMLObjectWindow(StringFunction.getToday("yyyy/MM/dd"));
dwTemp.genHTMLObjectWindow("3");
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
{"true","","Button","生成催收函","生成催收函","exportExcel('1')","","","","btn_icon_transfer",""},
{"true","","Button","批量下载","批量下载","lotdown()","","","","btn_icon_transfer",""},
{"true","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 exportExcel(sReturn){
var number = 0;
var payment_numbers = getItemValueArray(0,'payment_number');
for(var i=0;i<payment_numbers.length;i++){
if(typeof(payment_numbers[i])=="undefined" || payment_numbers[i].length>0 ){
var param={};
var tempParam={};
var sparam="";
//模板号
param["templateNo"]="e8b80876a3fe45eebe11cb9b8072ab33";
//生成文件关联关系
tempParam["OBJECTTYPE"]="TriditionCollection";
tempParam["FLOW_UNID"]="<%=new java.util.Date().getTime()%>";
tempParam["ID"]=getItemValue(0,getRow(0),"ID");
tempParam["contract_id"]=getItemValue(0,getRow(0),"ID");
tempParam["payment_number"]=getItemValue(0,getRow(0),"PAYMENT_NUMBER");
tempParam["payment_number"]=payment_numbers[i];
tempParam["PLAN_NUMBER"]=payment_numbers[i];
tempParam["businesstype"]="3";
//生成模板固定参数
tempParam["CurUserId"]="<%=CurUser.getUserID()%>";
tempParam["CurOrgId"]="<%=CurUser.getOrgID()%>";
tempParam["fileSavePath"]="<%=CurConfig.getConfigure("FileSavePath")%>";
tempParam["SendDate"]=sReturn;
param["templateParam"]=JSON.stringify(tempParam).replace(/,/g,"@");//生成模板的参数据
for(var key in param){
if(sparam.length>0){sparam+=",";}
sparam+=key+"="+param[key];
}
RunJavaMethodTrans("com.tenwa.officetempalte.controller.RentCollectDeleteAction","deletequtation","plan_number="+payment_numbers[i]);
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
var id = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","wordToPdfAnnex","PAYMENT_NUMBER="+payment_numbers[i]+",PLAN_LIST=TriditionCollection");
if(typeof(id)=="undefined" || id.length <= 0 || id==""){
RunJavaMethodTrans("com.tenwa.officetempalte.controller.RentCollectDeleteAction","deletequtation","plan_number="+payment_numbers[i]);
}else{
number++;
}
}
}
if(payment_numbers.length==0){
alert("请先选择数据!!!");
return;
}else if(number==0){
alert("生成失败!!!");
}else if(number==payment_numbers.length){
alert("生成成功!!!");
}else{
alert("部分生成成功!!!");
}
reloadSelf();
}
function downloadFile(id){
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 lotdown(){
var attrids=getItemValueArray(0,"attrid");
if(typeof(attrids)=="undefined"||attrids==null||attrids==""){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 getNowFormatDate() {
var date = new Date();
var seperator1 = "-";
var seperator2 = ":";
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
+ " " + date.getHours() + seperator2 + date.getMinutes()
+ seperator2 + date.getSeconds();
return currentdate;
}
function stamp(){
var number = 0;
var singNumber = 0;
var PAYMENT_NUMBERS=getItemValueArray(0,"PAYMENT_NUMBER");
var PLAN_LISTS=getItemValueArray(0,"PLAN_LIST");
var FILENAMES=getItemValueArray(0,"FILENAME");
for(var i=0;i<PAYMENT_NUMBERS.length;i++){
var flie = FILENAMES[i];
if(flie.length>0){
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","TcollectionSignA","PAYMENT_NUMBER="+plan_number+",PLAN_LIST="+null+",contract_id="+contractID+",flagType=TriditionCollection");
if("success"==result){
number++;
}
}else{
singNumber++;
}
}
if(PAYMENT_NUMBERS.length==0){
alert("请先选择数据!!!");
return;
}else if(PAYMENT_NUMBERS.length==singNumber){
alert("请选先生成催收函!!!");
}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"%>

View File

@ -0,0 +1,148 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_simplelist.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 flowunid = CurPage.getParameter("FlowUnid");
BizObject flow = GetFlowAction.getFlowBussinessObject(flowunid);
String projid = flow.getAttribute("proj_id").getString();
String contract_id = flow.getAttribute("contract_id").getString();
String ishistory = CurPage.getParameter("ishistory");
String nodeNo=CurPage.getParameter("NodeNo");
String RightType = CurPage.getParameter("RightType");
String sTempletNo = CurPage.getParameter("TempletNo");//模板号
sTempletNo = "TriditionSuspensionList";
String userName = CurUser.getUserName();
String compClientID = request.getParameter("CompClientID");
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
doTemp.setVisible("ACTION", true);
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,
request);
dwTemp.Style = "1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1";
dwTemp.setPageSize(50);
// dwTemp.genHTMLObjectWindow(docname+","+contract_id);
//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","公司盖章","公司盖章","stamp()","","","",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
//在加载完表格后调用
function afterSearch(){
var ishistory = "<%=ishistory%>";
var RightType = "<%=RightType%>";
for(var i=0;i<getRowCount(0);i++){
var html="";
html+='<a onclick=downloadFile(\''+getItemValue(0,i,"V.attrid")+'\')><font color="blue">'+getObj(0,i,"FILENAME").innerHTML+'</font></a>';
getObj(0,i,"FILENAME").innerHTML=html;
};
for(var i=0;i<getRowCount(0);i++){
html='<a class="btn_icon_detail" onclick="viewOffice()">&nbsp</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
if((null ==RightType||RightType!="ReadOnly")&&(null==ishistory||ishistory!="true")){
html+=' <a class="btn_icon_edit" onclick="editOffice()">&nbsp;</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a class="btn_icon_delete"onclick="deleteFile()">&nbsp;</a>&nbsp;&nbsp;&nbsp; ';
}
getObj(0,i,"ACTION").innerHTML=html;
}
setColumnWidth(0,"ACTION",150);
}
function viewOffice(){
var id = getItemValue(0,getRow(),"V.attrid");
var filename = getItemValue(0,getRow(),"FILENAME");
var filetype=filename.substr(filename.indexOf(".")+1);
var status=1;
AsDialog.PopView("/Tenwa/Core/OfficeTemplate/OnlineOperation/online/editOfficeOnLine.jsp","filetype="+filetype+"&status="+status+"&id="+id+"&CompClientID=<%=compClientID%>","dialogWidth=1024px;dialogHeight=1000px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(sPhaseInfo){
if(typeof(sPhaseInfo)=="undefined" || sPhaseInfo=="" || sPhaseInfo==null || sPhaseInfo=="null" || sPhaseInfo=="_CANCEL_") {
return;
}else if(sPhaseInfo == "Success" || sPhaseInfo == "success"){
alert("提交成功!");
reloadSelf();
}else{
alert("提交失败!");
}
},"查看文档");
}
function editOffice(){
var id = getItemValue(0,getRow(),"V.attrid");
var filename = getItemValue(0,getRow(),"FILENAME");
var filetype=filename.substr(filename.indexOf(".")+1);
var status=2;
AsDialog.PopView("/Tenwa/Core/OfficeTemplate/OnlineOperation/online/editOfficeOnLine.jsp","filetype="+filetype+"&status="+status+"&id="+id+"&CompClientID=<%=compClientID%>","dialogWidth=1024px;dialogHeight=1000px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(sPhaseInfo){
if(typeof(sPhaseInfo)=="undefined" || sPhaseInfo=="" || sPhaseInfo==null || sPhaseInfo=="null" || sPhaseInfo=="_CANCEL_") {
return;
}else if(sPhaseInfo == "Success" || sPhaseInfo == "success"){
alert("提交成功!");
reloadSelf();
}else{
alert("提交失败!");
}
},"编辑文档");
}
function deleteFile(){
var id = getItemValue(0,getRow(),"V.attrid");
var sParams="attId="+id;
var sReturnInfo = RunJavaMethodTrans("com.tenwa.doc.action.DocListAction","deleteFile",sParams);
reloadSelf();
}
function downloadFile(id){
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 param={};
var tempParam={};
var sparam="";
//模板号
// param["templateNo"]="e1fc3afacfbc46fea0a881ac20de23cc";
param["templateNo"]="184be06d0dfc4609a6705959c30e2d31";
//生成文件关联关系
tempParam["OBJECTTYPE"]="TriditionSuspension";
tempParam["FLOW_UNID"]="<%=flowunid%>";
tempParam["PROJ_ID"]="<%=projid%>";
tempParam["contract_id"]="<%=contract_id%>";
//生成模板固定参数
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","plan_number="+plan_number+",plan_list="+plan_list);
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
//word转pdf
var id = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","wordToPdfAnnex","FlowUnid=<%=flowunid%>,PLAN_LIST=TriditionSuspension");
reloadSelf();
}
function stamp(){
var result=RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","TcollectionSignA","FlowUnid=<%=flowunid%>,flagType=TriditionSuspension");
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -1622,6 +1622,10 @@ public void wordToPdfJar(JBOTransaction tx){
DOCRELATIVE=bom.createQuery(" OBJECTTYPE='transfer' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false);
}else if("AdjustmentNotice".equals(PLAN_LIST)){
DOCRELATIVE=bom.createQuery(" OBJECTTYPE='AdjustmentNotice' and FLOW_UNID=:flowunid ").setParameter("flowunid",FlowUnid).getSingleResult(false);
}else if("TriditionCollection".equals(PLAN_LIST)){
DOCRELATIVE=bom.createQuery(" OBJECTTYPE='TriditionCollection' and plan_number=:plan_number").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false);
}else if("TriditionSuspension".equals(PLAN_LIST)){
DOCRELATIVE=bom.createQuery(" OBJECTTYPE='TriditionSuspension' and FLOW_UNID=:flowunid ").setParameter("flowunid",FlowUnid).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);
}
@ -2449,7 +2453,11 @@ public String claimSign(JBOTransaction tx) throws Exception {
DOCRELATIVE=bom.createQuery(" OBJECTTYPE='transfer' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false);
}else if("AdjustmentNotice".equals(flagType)){
DOCRELATIVE=bom.createQuery(" OBJECTTYPE='AdjustmentNotice' and FLOW_UNID=:flowunid ").setParameter("flowunid",FlowUnid).getSingleResult(false);
}else{
}else if("TriditionCollection".equals(flagType)){
DOCRELATIVE=bom.createQuery("plan_number=:plan_number and objecttype='TriditionCollection' ").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false);
}else if("TriditionSuspension".equals(flagType)){
DOCRELATIVE=bom.createQuery(" OBJECTTYPE='TriditionSuspension' and FLOW_UNID=:flowunid ").setParameter("flowunid",FlowUnid).getSingleResult(false);
}else {
DOCRELATIVE=bom.createQuery("plan_number=:plan_number and objecttype LIKE '%´òÓ¡´ß¿îº¯%' ").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false);
}
if (DOCRELATIVE != null) {

View File

@ -113,4 +113,68 @@ public class FindCollectAction {
}
return attributeid;
}
public static String TfindFileName(String plan_number) throws JBOException{
String filename = "";
BizObjectManager bom = JBOFactory
.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME);
BizObject DOCRELATIVE = bom.createQuery("plan_number=:plan_number and plan_list is null and objecttype='TriditionCollection'")
.setParameter("plan_number", plan_number)
.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);
filename = bom2.createQuery("library_id=:library_id")
.setParameter("library_id", DOCLIBRARYid)
.getSingleResult(false).getAttribute("filename").toString();
}
return filename;
}
public static String TfindAttributeid(String plan_number) throws JBOException{
String attributeid="";
BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME);
BizObject DOCRELATIVE=bom.createQuery("plan_number=:plan_number and plan_list is null and objecttype='TriditionCollection'").setParameter("plan_number",plan_number).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;
}
public static String TfindCreatime(String plan_number) throws JBOException{
String creatime = "";
BizObjectManager bom = JBOFactory
.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME);
BizObject DOCRELATIVE = bom.createQuery("plan_number=:plan_number and plan_list is null and objecttype='TriditionCollection'")
.setParameter("plan_number", plan_number)
.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;
}
}