Commit 5d559310 by hzc

修改操作日志逻辑

parent 588dfce7
...@@ -4,6 +4,7 @@ import com.keymobile.indicators.model.entity.indicators.LogStatistics; ...@@ -4,6 +4,7 @@ import com.keymobile.indicators.model.entity.indicators.LogStatistics;
import com.keymobile.indicators.model.entity.indicators.LoggingEvent; import com.keymobile.indicators.model.entity.indicators.LoggingEvent;
import com.keymobile.indicators.model.mapper.indicators.LoggingEventMapper; import com.keymobile.indicators.model.mapper.indicators.LoggingEventMapper;
import com.keymobile.indicators.service.LoggingEventService; import com.keymobile.indicators.service.LoggingEventService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -138,11 +139,13 @@ public class LoggingEventServiceImpl implements LoggingEventService { ...@@ -138,11 +139,13 @@ public class LoggingEventServiceImpl implements LoggingEventService {
private Long getDateTime(String dateStr){ private Long getDateTime(String dateStr){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Long dateTime=null; Long dateTime=null;
try { if(StringUtils.isNotBlank(dateStr)){
Date date = simpleDateFormat.parse(dateStr); try {
dateTime= date.getTime(); Date date = simpleDateFormat.parse(dateStr);
} catch (Exception e) { dateTime= date.getTime();
e.printStackTrace(); } catch (Exception e) {
e.printStackTrace();
}
} }
return dateTime; return dateTime;
} }
......
...@@ -10,7 +10,7 @@ public enum ModelPathEnum { ...@@ -10,7 +10,7 @@ public enum ModelPathEnum {
LOG_INDICATOR_SHORTBOARD_RULE_API("indicator.shortboardrule","规则管理/短板筛选规则管理"), LOG_INDICATOR_SHORTBOARD_RULE_API("indicator.shortboardrule","规则管理/短板筛选规则管理"),
LOG_INDICATOR_PARAMETER_API("indicator.parameter","数据填报/精益台账"),//台账管理 LOG_INDICATOR_PARAMETER_API("indicator.parameter","数据填报/精益台账"),//台账管理
LOG_INDICATOR_BASEDATACHECK("indicator.basedatacheck","数据填报/数据项稽核"), LOG_INDICATOR_BASEDATACHECK("indicator.basedatacheck","数据填报/数据项稽核"),
LOG_INDICATOR_SHORTBOARD_UNIT_API("indicator.shortboardunit","短板管理/短板规则"), LOG_INDICATOR_SHORTBOARD_UNIT_API("indicator.shortboardunit","短板管理/短板单元"),
LOG_INDICATOR_SHORTBOARD_TASK_API("indicator.shortboardtask","短板管理/短板清单"), LOG_INDICATOR_SHORTBOARD_TASK_API("indicator.shortboardtask","短板管理/短板清单"),
LOG_INDICATOR_UPLOAD_FILE_API("indicator.uploadfile","数据填报/精益台账"),//文件管理 LOG_INDICATOR_UPLOAD_FILE_API("indicator.uploadfile","数据填报/精益台账"),//文件管理
LOG_INDICATOR_SHORTBOARD_RECORD_API("indicator.shortboardrecord","短板管理/短板预警池"), LOG_INDICATOR_SHORTBOARD_RECORD_API("indicator.shortboardrecord","短板管理/短板预警池"),
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
<mapper namespace="com.keymobile.indicators.model.mapper.indicators.LoggingEventMapper"> <mapper namespace="com.keymobile.indicators.model.mapper.indicators.LoggingEventMapper">
<select id="findClassNameAndCount" resultType="com.keymobile.indicators.model.entity.indicators.LogStatistics"> <select id="findClassNameAndCount" resultType="com.keymobile.indicators.model.entity.indicators.LogStatistics">
SELECT logger_name ,count(*)AS count from logging_event SELECT arg1 as loggerNameChinese ,count(*)AS count from logging_event
<include refid="findWhereSql"></include> <include refid="findWhereSql"></include>
GROUP BY logger_name GROUP BY arg1
</select> </select>
<select id="findVisitCount" resultType="com.keymobile.indicators.model.entity.indicators.LogStatistics"> <select id="findVisitCount" resultType="com.keymobile.indicators.model.entity.indicators.LogStatistics">
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</select> </select>
<select id="findVisitMsg" resultType="com.keymobile.indicators.model.entity.indicators.LoggingEvent"> <select id="findVisitMsg" resultType="com.keymobile.indicators.model.entity.indicators.LoggingEvent">
SELECT FROM_UNIXTIME(timestmp/1000,'%Y-%m-%d %H:%m:%s') as date_time, formatted_message, logger_name, arg0 as employee_id, arg2 as login_ip, arg3 as url, event_id SELECT FROM_UNIXTIME(timestmp/1000,'%Y-%m-%d %H:%m:%s') as date_time, formatted_message,arg1 as loggerNameChinese, arg0 as employee_id, arg2 as login_ip, arg3 as url, event_id
FROM logging_event FROM logging_event
<include refid="findWhereSql"></include> <include refid="findWhereSql"></include>
order by timestmp desc order by timestmp desc
...@@ -43,10 +43,10 @@ ...@@ -43,10 +43,10 @@
and timestmp &lt;= #{endTime} and timestmp &lt;= #{endTime}
</if> </if>
<if test="loggerName != null and loggerName!=''"> <if test="loggerName != null and loggerName!=''">
and logger_name = #{loggerName} and arg1 = like concat('%',#{loggerName},'%')
</if> </if>
<if test="employeeId != null and employeeId!=''"> <if test="employeeId != null and employeeId!=''">
and arg0 = #{employeeId} and arg0 like concat(#{employeeId},':%')
</if> </if>
<if test="url != null and url!=''"> <if test="url != null and url!=''">
and arg3 = #{url} and arg3 = #{url}
......
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