Commit f215601a by 罗绍泽

11

parent fe6cf87e
......@@ -30,25 +30,41 @@
<!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="1" />
<property name="minIdle" value="1" />
<property name="maxActive" value="20" />
<property name="maxActive" value="500" />
<!-- 配置获取连接等待超时的时间 -->
<property name="maxWait" value="60000" />
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="60000" />
<property name="timeBetweenEvictionRunsMillis" value="60000" />
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="300000" />
<!-- 超过时间限制是否回收,对于建立时间超过removeAbandonedTimeout的连接强制关闭 -->
<property name="removeAbandoned" value="true" />
<!-- 超过时间限制多长,单位秒 -->
<property name="removeAbandonedTimeout" value="60" />
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒:1分钟 -->
<property name="minEvictableIdleTimeMillis" value="60000" />
<!-- 配置一个连接在池中最长生存的时间,单位是毫秒:5分钟 -->
<property name="maxEvictableIdleTimeMillis" value="300000" />
<!-- 用来检测连接是否有效的sql,要求是一个查询语句 -->
<property name="validationQuery" value="SELECT 'x'" />
<property name="testWhileIdle" value="true" />
<property name="testOnBorrow" value="false" />
<property name="testOnReturn" value="false" />
<!-- 申请连接的时候检测 -->
<property name="testWhileIdle" value="true" />
<!-- 申请连接时执行validationQuery检测连接是否有效,配置为true会降低性能 -->
<property name="testOnBorrow" value="false" />
<!-- 归还连接时执行validationQuery检测连接是否有效,配置为true会降低性能 -->
<property name="testOnReturn" value="false" />
<!-- 连接池中的minIdle数量以内的连接,空闲时间超过minEvictableIdleTimeMillis,则会执行keepAlive操作 -->
<property name="keepAlive" value="true" />
<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<property name="poolPreparedStatements" value="true" />
<property name="maxPoolPreparedStatementPerConnectionSize" value="20" />
<!-- 是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭 -->
<property name="poolPreparedStatements" value="false" />
<!-- 要启用PSCache,必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true -->
<property name="maxPoolPreparedStatementPerConnectionSize" value="0" />
<!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
<property name="filters" value="stat" />
......@@ -65,25 +81,41 @@
<!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="1" />
<property name="minIdle" value="1" />
<property name="maxActive" value="20" />
<property name="maxActive" value="50" />
<!-- 配置获取连接等待超时的时间 -->
<property name="maxWait" value="60000" />
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="60000" />
<property name="timeBetweenEvictionRunsMillis" value="60000" />
<!-- 超过时间限制是否回收,对于建立时间超过removeAbandonedTimeout的连接强制关闭 -->
<property name="removeAbandoned" value="true" />
<!-- 超过时间限制多长,单位秒 -->
<property name="removeAbandonedTimeout" value="60" />
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="300000" />
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒:1分钟 -->
<property name="minEvictableIdleTimeMillis" value="60000" />
<!-- 配置一个连接在池中最长生存的时间,单位是毫秒:5分钟 -->
<property name="maxEvictableIdleTimeMillis" value="300000" />
<!-- 用来检测连接是否有效的sql,要求是一个查询语句 -->
<property name="validationQuery" value="SELECT 'x'" />
<property name="testWhileIdle" value="true" />
<property name="testOnBorrow" value="false" />
<property name="testOnReturn" value="false" />
<!-- 申请连接的时候检测 -->
<property name="testWhileIdle" value="true" />
<!-- 申请连接时执行validationQuery检测连接是否有效,配置为true会降低性能 -->
<property name="testOnBorrow" value="false" />
<!-- 归还连接时执行validationQuery检测连接是否有效,配置为true会降低性能 -->
<property name="testOnReturn" value="false" />
<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<property name="poolPreparedStatements" value="true" />
<property name="maxPoolPreparedStatementPerConnectionSize" value="20" />
<!-- 连接池中的minIdle数量以内的连接,空闲时间超过minEvictableIdleTimeMillis,则会执行keepAlive操作 -->
<property name="keepAlive" value="true" />
<!-- 是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭 -->
<property name="poolPreparedStatements" value="false" />
<!-- 要启用PSCache,必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true -->
<property name="maxPoolPreparedStatementPerConnectionSize" value="0" />
<!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
<property name="filters" value="stat" />
......@@ -100,25 +132,41 @@
<!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="1" />
<property name="minIdle" value="1" />
<property name="maxActive" value="20" />
<property name="maxActive" value="500" />
<!-- 配置获取连接等待超时的时间 -->
<property name="maxWait" value="60000" />
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="60000" />
<property name="timeBetweenEvictionRunsMillis" value="60000" />
<!-- 超过时间限制是否回收,对于建立时间超过removeAbandonedTimeout的连接强制关闭 -->
<property name="removeAbandoned" value="true" />
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="300000" />
<!-- 超过时间限制多长,单位秒 -->
<property name="removeAbandonedTimeout" value="60" />
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒:1分钟 -->
<property name="minEvictableIdleTimeMillis" value="60000" />
<!-- 配置一个连接在池中最长生存的时间,单位是毫秒:5分钟 -->
<property name="maxEvictableIdleTimeMillis" value="300000" />
<!-- 用来检测连接是否有效的sql,要求是一个查询语句 -->
<property name="validationQuery" value="SELECT 'x'" />
<property name="testWhileIdle" value="true" />
<property name="testOnBorrow" value="false" />
<property name="testOnReturn" value="false" />
<!-- 申请连接的时候检测 -->
<property name="testWhileIdle" value="true" />
<!-- 申请连接时执行validationQuery检测连接是否有效,配置为true会降低性能 -->
<property name="testOnBorrow" value="false" />
<!-- 归还连接时执行validationQuery检测连接是否有效,配置为true会降低性能 -->
<property name="testOnReturn" value="false" />
<!-- 连接池中的minIdle数量以内的连接,空闲时间超过minEvictableIdleTimeMillis,则会执行keepAlive操作 -->
<property name="keepAlive" value="true" />
<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<property name="poolPreparedStatements" value="true" />
<property name="maxPoolPreparedStatementPerConnectionSize" value="20" />
<!-- 是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭 -->
<property name="poolPreparedStatements" value="false" />
<!-- 要启用PSCache,必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true -->
<property name="maxPoolPreparedStatementPerConnectionSize" value="0" />
<!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
<property name="filters" value="stat" />
......
package com.gaowj.system.login;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jasig.cas.client.authentication.AttributePrincipal;
......@@ -36,29 +38,36 @@ public class CasAction extends BasicAction {
Map<String,Object> query = new HashMap<String,Object>();
query.put("EMID", username);
Map<String,Object> userInfoI = systemOpeBusiness.listLoginUserInfo(query).get(0);
Map<String,Object> sessionUser = new HashMap<String,Object>();
String u_all_m = systemOpeBusiness.getUserAllModule(userInfoI.get("CODE").toString());
sessionUser.put("CODE",userInfoI.get("CODE"));
sessionUser.put("EMID",userInfoI.get("EMID"));
sessionUser.put("EMSEX",userInfoI.get("EMSEX"));
sessionUser.put("EMDEPARTNAME",userInfoI.get("EMDEPARTNAME"));
sessionUser.put("EMDEPART",userInfoI.get("EMDEPART"));
sessionUser.put("EMNAME",userInfoI.get("EMNAME"));
sessionUser.put("BEFORETIME",userInfoI.get("BEFORETIME"));
sessionUser.put("SESSIONID", request.getSession().getId());
sessionUser.put("CURRENTTIME", jt.now_datetime());
sessionUser.put("LOGINIP", request.getRemoteAddr());
sessionUser.put("SERVERIP", request.getLocalAddr());
sessionUser.put("QUANXIAN",u_all_m);
request.getSession().setAttribute("userInfo", sessionUser);
//增加登陆日志
Map<String,Object> log = new HashMap<String,Object>();
log.put("CODE", sessionUser.get("CODE"));log.put("EMNAME", sessionUser.get("EMNAME"));log.put("EMIP", sessionUser.get("LOGINIP"));
log.put("OPENAME", "登陆");log.put("OPETIME", jt.String3date((String)sessionUser.get("CURRENTTIME")));log.put("TYPE", userInfoI.get("TYPE"));
log.put("OPETYPE", "B/S登陆");
systemOpeBusiness.insert_log(log);
Map<String,Object> userInfoI = null;
List<Map<String,Object>> listUser = systemOpeBusiness.listLoginUserInfo(query);
if(listUser.size()>0){
userInfoI = systemOpeBusiness.listLoginUserInfo(query).get(0);
Map<String,Object> sessionUser = new HashMap<String,Object>();
String u_all_m = systemOpeBusiness.getUserAllModule(userInfoI.get("CODE").toString());
sessionUser.put("CODE",userInfoI.get("CODE"));
sessionUser.put("EMID",userInfoI.get("EMID"));
sessionUser.put("EMSEX",userInfoI.get("EMSEX"));
sessionUser.put("EMDEPARTNAME",userInfoI.get("EMDEPARTNAME"));
sessionUser.put("EMDEPART",userInfoI.get("EMDEPART"));
sessionUser.put("EMNAME",userInfoI.get("EMNAME"));
sessionUser.put("BEFORETIME",userInfoI.get("BEFORETIME"));
sessionUser.put("BEFORETIME", jt.date3string((Date)userInfoI.get("BEFORETIME")));
sessionUser.put("SESSIONID", request.getSession().getId());
sessionUser.put("CURRENTTIME", jt.now_datetime());
sessionUser.put("LOGINIP", request.getRemoteAddr());
sessionUser.put("SERVERIP", request.getLocalAddr());
sessionUser.put("QUANXIAN",u_all_m);
sessionUser.put("SESSIONUSER", request.getSession());
request.getSession().setAttribute("userInfo", sessionUser);
//增加登陆日志
Map<String,Object> log = new HashMap<String,Object>();
log.put("CODE", sessionUser.get("CODE"));log.put("EMNAME", sessionUser.get("EMNAME"));log.put("EMIP", sessionUser.get("LOGINIP"));
log.put("OPENAME", "登陆");log.put("OPETIME", jt.String3date((String)sessionUser.get("CURRENTTIME")));log.put("TYPE", userInfoI.get("TYPE"));
log.put("OPETYPE", "B/S登陆");
systemOpeBusiness.insert_log(log);
}
}
String strRedirecturl = request.getParameter("redirectUrl");
String toUrl = "";
......
......@@ -345,10 +345,11 @@ public class actAction extends BasicAction {
String uuid = request.getParameter("uuid");
String uploadnew=request.getParameter("uploadnew");
String uploadpath=request.getParameter("uploadpath");
String downloadFilenameEncode1 = PropUtil.getValue("downloadFilenameEncode1", "quartz_service", "gbk");
String downloadFilenameEncode2 = PropUtil.getValue("downloadFilenameEncode2", "quartz_service", "iso8859-1");
super.setEncoding1(downloadFilenameEncode1);
super.setEncoding2(downloadFilenameEncode2);
// String downloadFilenameEncode1 = PropUtil.getValue("downloadFilenameEncode1", "quartz_service", "gbk");
// String downloadFilenameEncode2 = PropUtil.getValue("downloadFilenameEncode2", "quartz_service", "iso8859-1");
// super.setEncoding1(downloadFilenameEncode1);
// super.setEncoding2(downloadFilenameEncode2);
response.setCharacterEncoding("utf-8");
if(new File(uploadpath+"/"+uploadnew).exists()==false){
db2file(uuid,uploadpath,uploadnew,false);
ret_download = super.download();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment