Merge branch 'develop' of http://git2.tenwa.com.cn/ApzlDev/apzl_leasing.git into zhouzebei
This commit is contained in:
commit
29985cbeaa
@ -466,7 +466,7 @@ AsControl.ExportFinanceReport = function(sObjectType, sObjectNo, sReportScope, s
|
||||
var sReportExcelPath = AsControl.RunJavaMethodSqlca("com.amarsoft.app.util.ExportExcel", "run", sParam);
|
||||
if(!sReportExcelPath) return;
|
||||
if(!frames["exportfsframe"]) $("<iframe name='exportfsframe' style='display:none;'></iframe>").appendTo("body");
|
||||
window.open(sWebRootPath+"/servlet/view/file?CompClientID="+sCompClientID+"&filename="+sReportExcelPath+"&viewtype=download", "exportfsframe");
|
||||
window.open(sWebRootPath+"/servlet/view/file1?CompClientID="+sCompClientID+"&filename="+sReportExcelPath+"&viewtype=download", "exportfsframe");
|
||||
};
|
||||
|
||||
AsControl.CallJavaMethodJSP = function (ClassName,MethodName,Args,ArgsObjectText) {
|
||||
|
||||
@ -82,7 +82,8 @@ include file="/Frame/resources/include/ui/include_info.jspf"%>
|
||||
var certid = getItemValue(0,getRow(),"certid");
|
||||
//判断组织机构代码合法性
|
||||
if(certType =='Ent02'){
|
||||
if(!checkORGRight1(certid) ){
|
||||
// if(!checkORGRight1(certid) ){
|
||||
if(!checkORGRight(certid) ){
|
||||
setErrorTips("certid","组织机构代码格式错误!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
dwTemp.Style="1"; //--设置为Grid风格--
|
||||
dwTemp.ReadOnly = "1"; //只读模式
|
||||
dwTemp.setPageSize(10);
|
||||
dwTemp.genHTMLObjectWindow(flowunid);
|
||||
dwTemp.genHTMLObjectWindow(contractid);//原是对应attr.flowunid
|
||||
|
||||
String button = "false";
|
||||
if("0010".equals(phaseno)){
|
||||
|
||||
@ -63,7 +63,28 @@
|
||||
}
|
||||
}
|
||||
function selectCustomer(){
|
||||
AsDialog.OpenSelector("SelectCustomerForRiskAlert","","",function(sReturn){
|
||||
|
||||
var flowno="<%=CurPage.getParameter("ApplyType")%>";
|
||||
var selname="";
|
||||
var orgId="<%=CurUser.getOrgID()%>".substring(0,7);
|
||||
var businessType="";
|
||||
if(flowno=="RiskAlertFlow"){
|
||||
businessType=" lci.businesstype='1'";
|
||||
}else{
|
||||
businessType=" (lci.businesstype='2' OR lci.businesstype='3')";
|
||||
/* if(orgId=="8009010"){
|
||||
businessType="2";
|
||||
}else if(orgId=="8009011"){
|
||||
businessType="3";
|
||||
}else{
|
||||
alert("µ±Ç°Óû§²»ÄÜ·¢Æğ£¡");
|
||||
return;
|
||||
} */
|
||||
}
|
||||
|
||||
|
||||
var userid="<%=CurUser.getUserID()%>";
|
||||
AsDialog.OpenSelector("SelectCustomerForRiskAlert","userid,"+userid+",businessType,"+businessType,"",function(sReturn){
|
||||
if(!sReturn||sReturn=="_CANCEL_" || sReturn=="_NONE_"){
|
||||
return;
|
||||
}
|
||||
|
||||
@ -224,6 +224,8 @@
|
||||
<attribute name="current_interest_money" label="当期利息费用(当月)" type="STRING" length="32"/>
|
||||
<attribute name="cumulative_interest_money" label="累计利息费用(投放日至当月)" type="STRING" length="32"/>
|
||||
<attribute name="CONTRACT_NO" label="合同编号" type="STRING" length="32"/>
|
||||
<attribute name="BUSINESSTYPE" label="项目所属业务部门" type="STRING" length="32"/>
|
||||
<attribute name="LEASE_ACC_NAME" label="投放主题" type="STRING" length="32"/>
|
||||
<attribute name="INPUTUSERID" label="登记人" type="STRING" length="32"/>
|
||||
<attribute name="INPUTORGID" label="登记部门" type="STRING" length="32"/>
|
||||
<attribute name="INPUTTIME" label="登记时间" type="STRING" length="32"/>
|
||||
|
||||
@ -206,6 +206,10 @@
|
||||
<servlet-name>FileViewServlet</servlet-name>
|
||||
<servlet-class>com.amarsoft.awe.common.attachment.FileViewServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>FileViewServlet1</servlet-name>
|
||||
<servlet-class>com.tenwa.lease.util.FileViewServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>ShowImageServlet</servlet-name>
|
||||
<servlet-class>com.tenwa.doc.servlet.ShowImageServlet</servlet-class>
|
||||
@ -308,6 +312,10 @@
|
||||
<servlet-name>FileViewServlet</servlet-name>
|
||||
<url-pattern>/servlet/view/file</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>FileViewServlet1</servlet-name>
|
||||
<url-pattern>/servlet/view/file1</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>ShowImageServlet</servlet-name>
|
||||
<url-pattern>/servlet/view/image</url-pattern>
|
||||
@ -565,6 +573,7 @@
|
||||
/resf/files/downloadPlist,
|
||||
/resf/files/downloadApp,
|
||||
/resf/files/downloadAppById,
|
||||
/servlet/view/file1,
|
||||
</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
|
||||
@ -3,6 +3,8 @@ package com.amarsoft.app.util;
|
||||
import java.awt.Color;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -88,7 +90,8 @@ public class ExportExcel
|
||||
List<BizObject> boRC = null;
|
||||
//根据报表编号找出对应的报表
|
||||
if(reportScope != null){
|
||||
sFileName = sDirPath + "/" + this.objectType + "-" + this.objectNo + "-" + this.reportScope + "-" + this.reportDate.replace("/", "") + "-" + String.valueOf(Math.random()).replace(".", "") + ".xlsx";
|
||||
|
||||
sFileName = sDirPath + "/" +NameManager.getCustomerName(this.objectNo)+"-"+ this.reportDate.replace("/", "") +".xlsx";//this.objectType + "-" + this.objectNo + "-" + this.reportScope + "-" + this.reportDate.replace("/", "") + "-" + String.valueOf(Math.random()).replace(".", "") + ".xlsx";
|
||||
boRC = JBOFactory.getBizObjectManager(REPORT_RECORD.CLASS_NAME).createQuery("objecttype=:ObjectType and reportscope=:ReportScope and reportdate=:ReportDate and objectno=:ObjectNo order by modelno")
|
||||
.setParameter("ObjectType", objectType)
|
||||
.setParameter("ReportScope", reportScope)
|
||||
@ -405,7 +408,9 @@ public class ExportExcel
|
||||
}
|
||||
}
|
||||
}
|
||||
// String codedfilename = URLEncoder.encode(sFileName, "UTF-8");//.replaceAll("+", "%20");
|
||||
FileOutputStream fos = new FileOutputStream(sFileName);
|
||||
// OutputStreamWriter oStreamWriter = new OutputStreamWriter(fos, "gbk");
|
||||
excel.write(fos);
|
||||
fos.flush();
|
||||
fos.close();
|
||||
|
||||
67
src_tenwa/com/tenwa/lease/app/quartzmession/LBTESTinfo.java
Normal file
67
src_tenwa/com/tenwa/lease/app/quartzmession/LBTESTinfo.java
Normal file
@ -0,0 +1,67 @@
|
||||
package com.tenwa.lease.app.quartzmession;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOException;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.util.StringFunction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.base.util.QuartzUtil;
|
||||
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||||
import com.tenwa.reckon.util.Conn;
|
||||
|
||||
import jbo.app.tenwa.customer.LB_TEST;
|
||||
import jbo.com.tenwa.entity.comm.own.LC_SOURCE_OF_FUNDS;
|
||||
|
||||
public class LBTESTinfo implements Job{
|
||||
@Override
|
||||
public void execute(JobExecutionContext arg0) throws JobExecutionException {
|
||||
String startime = StringFunction.getTodayNow();
|
||||
|
||||
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
|
||||
String curUserId = userId == null? "system" : userId.toString();
|
||||
|
||||
try {
|
||||
JBOTransaction tx = JBOFactory.createJBOTransaction();
|
||||
//BizObjectManager LCBizObjectManager =JBOFactory.getBizObjectManager(LC_SOURCE_OF_FUNDS.CLASS_NAME,tx);
|
||||
Transaction Sqlca = null;
|
||||
Sqlca = Transaction.createTransaction(tx);
|
||||
String insertSql="INSERT INTO LC_SOURCE_OF_FUNDS (id, contract_no, businesstype, lease_acc_name)"+
|
||||
" (SELECT REPLACE(UUID(), '-', '') AS id,"+
|
||||
"lci.contract_no AS contract_no,"+
|
||||
"CASE lci.businesstype WHEN '2' THEN '汽车类传统' WHEN '3' THEN '传统类' ELSE '汽车类' END AS businesstype,"+
|
||||
"CASE WHEN lci.businesstype='1' THEN oo.own_name ELSE oi.own_name END AS lease_acc_name FROM"+
|
||||
" lb_contract_info lci "+
|
||||
"LEFT JOIN LB_LESSOR_INFO lit"+
|
||||
" ON lci.id = lit.contract_id"+
|
||||
" LEFT JOIN OWN_INFO oi "+
|
||||
"ON lit.lessor = oi.own_number"+
|
||||
" LEFT JOIN OWN_INFO oo ON 1=1 AND oo.id='50ffe19bbff24153ac3406a3b4f5e40d'"+
|
||||
" WHERE lci.contract_status >= '31' "+
|
||||
"AND lci.contract_no NOT IN "+
|
||||
"(SELECT IFNULL(contract_no, '') AS contract_no FROM LC_SOURCE_OF_FUNDS))";
|
||||
Sqlca.executeSQL(insertSql);
|
||||
tx.commit();
|
||||
QuartzUtil.insertLog(startime, "com.tenwa.lease.app.quartzmession.LBTESTinfo", "success", "成功", curUserId);
|
||||
} catch (Exception e) {
|
||||
QuartzUtil.insertLog(startime, "com.tenwa.lease.app.quartzmession.LBTESTinfo", "error", "失败", curUserId);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
116
src_tenwa/com/tenwa/lease/util/FileViewServlet.java
Normal file
116
src_tenwa/com/tenwa/lease/util/FileViewServlet.java
Normal file
@ -0,0 +1,116 @@
|
||||
package com.tenwa.lease.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.util.DataConvert;
|
||||
|
||||
public class FileViewServlet extends javax.servlet.http.HttpServlet{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public FileViewServlet() {}
|
||||
|
||||
public void service(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, java.io.IOException {
|
||||
try {
|
||||
HttpSession session = request.getSession(true);
|
||||
if ((session == null) || (session.getAttributeNames() == null)) {
|
||||
throw new Exception("------Timeout------");
|
||||
}
|
||||
String sFileName = "";
|
||||
String sContentType = "text/html";
|
||||
String sViewType = "view";
|
||||
|
||||
sFileName = DataConvert.toString(request.getParameter("filename"));
|
||||
sFileName = new String(sFileName.getBytes("iso-8859-1"));
|
||||
sContentType = DataConvert.toString(request
|
||||
.getParameter("contenttype"));
|
||||
sViewType = DataConvert.toString(request.getParameter("viewtype"));
|
||||
|
||||
ARE.getLog().debug(
|
||||
"[FileViewServlet]" + sContentType + ":" + sFileName);
|
||||
|
||||
if (sFileName.indexOf("../") >= 0) {
|
||||
ARE.getLog().warn("[FileViewServlet-ERR]文件名包含非法参数!");
|
||||
return;
|
||||
}
|
||||
File dFile = null;
|
||||
dFile = new File(sFileName);
|
||||
if (!dFile.exists()) {
|
||||
ARE.getLog().warn(
|
||||
"[FileViewServlet-ERR]文件不存在:" + sFileName + "!");
|
||||
String sCon = "文件不存在 !";
|
||||
ServletOutputStream outStream = response.getOutputStream();
|
||||
outStream.println(DataConvert.toRealString(3, sCon));
|
||||
outStream.flush();
|
||||
outStream.close();
|
||||
} else {
|
||||
String sNewFileName = com.amarsoft.are.util.StringFunction
|
||||
.getFileName(sFileName);
|
||||
String browName = sNewFileName;
|
||||
String clientInfo = request.getHeader("User-agent");
|
||||
if (clientInfo != null) {
|
||||
if (clientInfo.indexOf("MSIE") > 0) {
|
||||
if ((clientInfo.indexOf("MSIE 6") > 0)
|
||||
|| (clientInfo.indexOf("MSIE 5") > 0)) {
|
||||
browName = new String(sNewFileName.getBytes("GBK"),
|
||||
"ISO-8859-1");
|
||||
} else {
|
||||
browName = URLEncoder.encode(sNewFileName, "UTF-8");
|
||||
}
|
||||
} else if (clientInfo.indexOf("Chrome") > 0) {
|
||||
browName = URLEncoder.encode(sNewFileName, "UTF-8");
|
||||
} else if (clientInfo.indexOf("Firefox") > 0) {
|
||||
browName = new String(sNewFileName.getBytes("UTF-8"),
|
||||
"ISO-8859-1");
|
||||
}
|
||||
}
|
||||
response.setContentType(sContentType + ";charset=GBK");
|
||||
if (sViewType.equals("view")) {
|
||||
response.setHeader("Content-Disposition", "filename="
|
||||
+ browName + ";");
|
||||
} else {
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment;filename=" + browName + ";");
|
||||
}
|
||||
int iContentLength = (int) dFile.length();
|
||||
if (iContentLength > 0) {
|
||||
ServletOutputStream outStream2 = response.getOutputStream();
|
||||
InputStream inStream = new FileInputStream(sFileName);
|
||||
|
||||
if (iContentLength > 102400)
|
||||
iContentLength = 102400;
|
||||
byte[] abyte0 = new byte[iContentLength];
|
||||
int k = -1;
|
||||
while ((k = inStream.read(abyte0, 0, iContentLength)) != -1) {
|
||||
if (k >= 10240) {
|
||||
ARE.getLog().debug("[FileViewServlet]Read:" + k);
|
||||
}
|
||||
outStream2.write(abyte0, 0, k);
|
||||
}
|
||||
inStream.close();
|
||||
|
||||
outStream2.flush();
|
||||
outStream2.close();
|
||||
}
|
||||
return;
|
||||
}
|
||||
} catch (Exception e1) {
|
||||
e1 = e1;
|
||||
ARE.getLog().error("[FileViewServlet-ERR]", e1);
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
public String getServletInfo() { return "This is a file view servlet!"; }
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user