Merge branch 'Release-1.1' into develop

This commit is contained in:
doufenghu
2018-08-08 19:41:43 +08:00
8 changed files with 98 additions and 27 deletions

View File

@@ -15,11 +15,12 @@
<result column="EXCEPTION_INFO" jdbcType="BLOB" property="exceptionInfo" typeHandler="com.nis.util.BlobTypeHandler"/>
<result column="SERVER_IP" jdbcType="VARCHAR" property="serverIp" />
<result column="TRACE_CODE" jdbcType="VARCHAR" property="traceCode" />
<result column="REQUEST_URI" jdbcType="VARCHAR" property="requestURI" />
</resultMap>
<sql id="Base_Column_List">
ID, OPERATOR, VERSION, OPACTION,OPTIME, REQUEST_CONTENT,
REQUEST_TIME,REQUEST_IP,
CONSUMER_TIME,BUSINESS_CODE,EXCEPTION_INFO,SERVER_IP,TRACE_CODE
CONSUMER_TIME,BUSINESS_CODE,EXCEPTION_INFO,SERVER_IP,TRACE_CODE,REQUEST_URI
</sql>
<select id="getAllLog" parameterType="com.nis.domain.restful.ServicesRequestLogBean"
resultMap="ServicesRequestLogMap">
@@ -127,6 +128,10 @@
<if test="traceCode != null">
TRACE_CODE,
</if>
<if test="requestURI != null">
REQUEST_URI,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -166,6 +171,9 @@
<if test="traceCode != null">
#{traceCode,jdbcType=VARCHAR},
</if>
<if test="requestURI != null">
#{requestURI,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>

View File

@@ -10,7 +10,7 @@
#{beginDate} AND #{endDate}
<if test="requestContent != null and requestContent != ''">
AND a.request_Content LIKE
AND a.request_Content LIKE
<if test="dbName == 'oracle'">'%'||#{requestContent}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{requestContent}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{requestContent}, '%')</if>
@@ -18,22 +18,31 @@
<if test="traceCode != null and traceCode != ''">
AND a.trace_Code=#{traceCode}
</if>
<if test="businessCode != null and businessCode != ''">
AND a.business_Code=#{businessCode}
</if>
<if test="requestUri != null and requestUri != ''">
AND a.REQUEST_URI LIKE
<if test="dbName == 'oracle'">'%'||#{requestUri}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{requestUri}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{requestUri}, '%')</if>
</if>
<if test="exceptionInfo != null and exceptionInfo != ''">
AND a.exception_Info LIKE
AND a.exception_Info LIKE
<if test="dbName == 'oracle'">'%'||#{exceptionInfo}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{exceptionInfo}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{exceptionInfo}, '%')</if>
</if>
<if test="requestIp != null and requestIp != ''">
AND a.request_ip like
AND a.request_ip like
<if test="dbName == 'oracle'">'%'||#{requestIp}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{requestIp}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{requestIp}, '%')</if>
</if>
<if test="serverIp != null and serverIp != ''">
AND a.server_Ip like
AND a.server_Ip like
<if test="dbName == 'oracle'">'%'||#{serverIp}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{serverIp}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{serverIp}, '%')</if>
@@ -41,6 +50,11 @@
<if test="exception != null and exception != ''">
AND a.exception_Info!=''
</if>
<!-- 默认不显示查询类日志,日志量太大,如果显示在界面选择操作行为即可 -->
<if test="opAction == null or opAction == ''">
AND a.opAction!=4
</if>
<if test="opAction != null and opAction != ''">
AND a.opAction=#{opAction}
</if>

View File

@@ -186,6 +186,7 @@ public abstract class BaseLogService {
try {
if (!StringUtil.isBlank(entity.getSearchFoundEndTime())) {
sdf.setLenient(false);
sdf.parse(entity.getSearchFoundEndTime());
}
} catch (ParseException e) {
@@ -201,6 +202,7 @@ public abstract class BaseLogService {
try {
if (!StringUtil.isBlank(entity.getSearchFoundStartTime())) {
sdf.setLenient(false);
sdf.parse(entity.getSearchFoundStartTime());
}
} catch (ParseException e) {

View File

@@ -105,6 +105,7 @@ public class ServicesRequestLogService {
log.setBusinessCode(businessCode);
log.setExceptionInfo(exceptionInfo);
log.setTraceCode(traceCode);
log.setRequestURI(requestURI);
try {
if(Constants.SERVCER_HOST!=null){
log.setServerIp(Constants.SERVCER_HOST);