Commit 5d559310 by hzc

修改操作日志逻辑

parent 588dfce7
......@@ -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.mapper.indicators.LoggingEventMapper;
import com.keymobile.indicators.service.LoggingEventService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
......@@ -138,11 +139,13 @@ public class LoggingEventServiceImpl implements LoggingEventService {
private Long getDateTime(String dateStr){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Long dateTime=null;
try {
Date date = simpleDateFormat.parse(dateStr);
dateTime= date.getTime();
} catch (Exception e) {
e.printStackTrace();
if(StringUtils.isNotBlank(dateStr)){
try {
Date date = simpleDateFormat.parse(dateStr);
dateTime= date.getTime();
} catch (Exception e) {
e.printStackTrace();
}
}
return dateTime;
}
......
......@@ -10,7 +10,7 @@ public enum ModelPathEnum {
LOG_INDICATOR_SHORTBOARD_RULE_API("indicator.shortboardrule","规则管理/短板筛选规则管理"),
LOG_INDICATOR_PARAMETER_API("indicator.parameter","数据填报/精益台账"),//台账管理
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_UPLOAD_FILE_API("indicator.uploadfile","数据填报/精益台账"),//文件管理
LOG_INDICATOR_SHORTBOARD_RECORD_API("indicator.shortboardrecord","短板管理/短板预警池"),
......
......@@ -3,9 +3,9 @@
<mapper namespace="com.keymobile.indicators.model.mapper.indicators.LoggingEventMapper">
<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>
GROUP BY logger_name
GROUP BY arg1
</select>
<select id="findVisitCount" resultType="com.keymobile.indicators.model.entity.indicators.LogStatistics">
......@@ -27,7 +27,7 @@
</select>
<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
<include refid="findWhereSql"></include>
order by timestmp desc
......@@ -43,10 +43,10 @@
and timestmp &lt;= #{endTime}
</if>
<if test="loggerName != null and loggerName!=''">
and logger_name = #{loggerName}
and arg1 = like concat('%',#{loggerName},'%')
</if>
<if test="employeeId != null and employeeId!=''">
and arg0 = #{employeeId}
and arg0 like concat(#{employeeId},':%')
</if>
<if test="url != null and 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