From 42bec653c9ad59ad07981f8938ae24b8312ae7f9 Mon Sep 17 00:00:00 2001 From: zhangjun Date: Wed, 26 Sep 2018 16:42:11 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=B5=84=E9=87=91=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/WEB-INF/etc/jbo/jbo_comm.xml | 2 + .../lease/app/quartzmession/LBTESTinfo.java | 67 +++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 src_tenwa/com/tenwa/lease/app/quartzmession/LBTESTinfo.java diff --git a/WebContent/WEB-INF/etc/jbo/jbo_comm.xml b/WebContent/WEB-INF/etc/jbo/jbo_comm.xml index eeae628c0..0a85c1f33 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_comm.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_comm.xml @@ -224,6 +224,8 @@ + + diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/LBTESTinfo.java b/src_tenwa/com/tenwa/lease/app/quartzmession/LBTESTinfo.java new file mode 100644 index 000000000..728b69b24 --- /dev/null +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/LBTESTinfo.java @@ -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(); + } + + } + + } + + From 722147b0d550db43b810e710ea16980f965cf833 Mon Sep 17 00:00:00 2001 From: liuzhao Date: Wed, 26 Sep 2018 16:59:27 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tenwa/lease/app/quartzmession/LBTESTinfo.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/LBTESTinfo.java b/src_tenwa/com/tenwa/lease/app/quartzmession/LBTESTinfo.java index 728b69b24..50a17c760 100644 --- a/src_tenwa/com/tenwa/lease/app/quartzmession/LBTESTinfo.java +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/LBTESTinfo.java @@ -35,21 +35,21 @@ public class LBTESTinfo implements Job{ try { JBOTransaction tx = JBOFactory.createJBOTransaction(); - BizObjectManager LCBizObjectManager =JBOFactory.getBizObjectManager(LC_SOURCE_OF_FUNDS.CLASS_NAME,tx); + //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,"+ + " (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 "+ + " lb_contract_info lci "+ "LEFT JOIN LB_LESSOR_INFO lit"+ " ON lci.id = lit.contract_id"+ - "LEFT JOIN OWN_INFO oi "+ + " 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' "+ + " 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); From 19b491259ef23b29029e6ee35009f9f2e7d81585 Mon Sep 17 00:00:00 2001 From: tangfutang Date: Wed, 26 Sep 2018 17:22:42 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=90=88=E5=90=8C=E6=96=B9=E7=A4=BE?= =?UTF-8?q?=E4=BC=9A=E7=BB=9F=E4=B8=80=E4=BF=A1=E7=94=A8=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Customer/Partner/Comm/Company/PartnerCompanyRegister.jsp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WebContent/Tenwa/Customer/Partner/Comm/Company/PartnerCompanyRegister.jsp b/WebContent/Tenwa/Customer/Partner/Comm/Company/PartnerCompanyRegister.jsp index 2e35c3100..4e280bad3 100644 --- a/WebContent/Tenwa/Customer/Partner/Comm/Company/PartnerCompanyRegister.jsp +++ b/WebContent/Tenwa/Customer/Partner/Comm/Company/PartnerCompanyRegister.jsp @@ -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; } From 6a146b9fab54100e501b8cfe64833bcc03a07f59 Mon Sep 17 00:00:00 2001 From: jianghongdong Date: Wed, 26 Sep 2018 17:26:35 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E8=B4=A2=E6=8A=A5=E4=B9=B1=E7=A0=81=E6=97=A0=E6=B3=95=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/Frame/page/js/as_control.js | 2 +- .../TraditionContractFileList.jsp | 2 +- WebContent/WEB-INF/web.xml | 9 ++ src/com/amarsoft/app/util/ExportExcel.java | 7 +- .../com/tenwa/lease/util/FileViewServlet.java | 116 ++++++++++++++++++ 5 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 src_tenwa/com/tenwa/lease/util/FileViewServlet.java diff --git a/WebContent/Frame/page/js/as_control.js b/WebContent/Frame/page/js/as_control.js index 71c90f517..8ee88dd66 100644 --- a/WebContent/Frame/page/js/as_control.js +++ b/WebContent/Frame/page/js/as_control.js @@ -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"]) $("").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) { diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBContractTemplate/TraditionContractFileList.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBContractTemplate/TraditionContractFileList.jsp index 5e8e59aff..1d3a9a323 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBContractTemplate/TraditionContractFileList.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBContractTemplate/TraditionContractFileList.jsp @@ -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)){ diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml index 318abcf2f..c20b734cf 100644 --- a/WebContent/WEB-INF/web.xml +++ b/WebContent/WEB-INF/web.xml @@ -206,6 +206,10 @@ FileViewServlet com.amarsoft.awe.common.attachment.FileViewServlet + + FileViewServlet1 + com.tenwa.lease.util.FileViewServlet + ShowImageServlet com.tenwa.doc.servlet.ShowImageServlet @@ -308,6 +312,10 @@ FileViewServlet /servlet/view/file + + FileViewServlet1 + /servlet/view/file1 + ShowImageServlet /servlet/view/image @@ -565,6 +573,7 @@ /resf/files/downloadPlist, /resf/files/downloadApp, /resf/files/downloadAppById, + /servlet/view/file1, diff --git a/src/com/amarsoft/app/util/ExportExcel.java b/src/com/amarsoft/app/util/ExportExcel.java index 0e016e328..b9134678a 100644 --- a/src/com/amarsoft/app/util/ExportExcel.java +++ b/src/com/amarsoft/app/util/ExportExcel.java @@ -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 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(); diff --git a/src_tenwa/com/tenwa/lease/util/FileViewServlet.java b/src_tenwa/com/tenwa/lease/util/FileViewServlet.java new file mode 100644 index 000000000..6928748fa --- /dev/null +++ b/src_tenwa/com/tenwa/lease/util/FileViewServlet.java @@ -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!"; } +} From 2df1eee29c3ca80166bab731e70f7531ae5b6b55 Mon Sep 17 00:00:00 2001 From: liuzhao Date: Wed, 26 Sep 2018 17:29:06 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E9=A3=8E=E9=99=A9=E9=A2=84=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Lease/Flow/RiskAlert/RiskAlertInfo.jsp | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/WebContent/Tenwa/Lease/Flow/RiskAlert/RiskAlertInfo.jsp b/WebContent/Tenwa/Lease/Flow/RiskAlert/RiskAlertInfo.jsp index 47f7793fe..57854bc1a 100644 --- a/WebContent/Tenwa/Lease/Flow/RiskAlert/RiskAlertInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/RiskAlert/RiskAlertInfo.jsp @@ -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; }