增加系统业务配置操作日志功能,与系统日志菜单分离,增加相关国际化字典,并更新国际化部分翻译
This commit is contained in:
@@ -24,4 +24,11 @@ public class SysLogController extends BaseController {
|
||||
return "/sys/logList";
|
||||
}
|
||||
|
||||
@RequiresPermissions("sys:cfgOperationLog:view")
|
||||
@RequestMapping(value = {"cfgOperationLogList"})
|
||||
public String cfgOperationLogList(SysLog sysLog, HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
Page<SysLog> page = logService.findCfgOperationLogPage(new Page<SysLog>(request, response), sysLog);
|
||||
model.addAttribute("page", page);
|
||||
return "/sys/cfgOperationLogList";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.nis.web.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.SysLog;
|
||||
@MyBatisDao
|
||||
public interface SysLogDao extends CrudDao<SysLog>{
|
||||
|
||||
public void insertCfgOperationLog(SysLog log);
|
||||
public List<SysLog> findCfgOperationLogList(SysLog log);
|
||||
}
|
||||
@@ -28,6 +28,26 @@
|
||||
ORDER BY a.create_date DESC
|
||||
</select>
|
||||
|
||||
<select id="findCfgOperationLogList" resultType="sysLog">
|
||||
SELECT
|
||||
a.*
|
||||
FROM sys_cfg_operation_log a
|
||||
WHERE a.create_date BETWEEN #{beginDate} AND #{endDate}
|
||||
<if test="functionName != null and functionName != ''">
|
||||
AND a.function_name=#{functionName}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND a.create_by = #{createBy}
|
||||
</if>
|
||||
<if test="operation != null and operation != ''">
|
||||
AND a.operation=#{operation}
|
||||
</if>
|
||||
<if test="exception != null and exception != ''">
|
||||
AND a.state = 0
|
||||
</if>
|
||||
ORDER BY a.create_date DESC
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insert" parameterType="sysLog" useGeneratedKeys="true" keyProperty="id" >
|
||||
INSERT INTO sys_log(
|
||||
@@ -59,4 +79,49 @@
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertCfgOperationLog" parameterType="sysLog" useGeneratedKeys="true" keyProperty="id" >
|
||||
INSERT INTO sys_cfg_operation_log(
|
||||
type,
|
||||
title,
|
||||
create_by,
|
||||
create_date,
|
||||
remote_addr,
|
||||
user_agent,
|
||||
request_uri,
|
||||
method,
|
||||
state,
|
||||
consumer_time,
|
||||
params,
|
||||
exception,
|
||||
compile_id,
|
||||
cfg_id,
|
||||
function_id,
|
||||
method_name,
|
||||
audit_state,
|
||||
action,
|
||||
operation,
|
||||
function_name
|
||||
) VALUES (
|
||||
#{type},
|
||||
#{title},
|
||||
#{createBy},
|
||||
#{createDate},
|
||||
#{remoteAddr},
|
||||
#{userAgent},
|
||||
#{requestUri},
|
||||
#{method},
|
||||
#{state},
|
||||
#{consumerTime},
|
||||
#{params},
|
||||
#{exception},
|
||||
#{compileId},
|
||||
#{cfgId},
|
||||
#{functionId},
|
||||
#{methodName},
|
||||
#{auditState},
|
||||
#{action},
|
||||
#{operation},
|
||||
#{functionName}
|
||||
)
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.nis.web.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
@@ -9,8 +12,9 @@ import com.nis.web.dao.SysLogDao;
|
||||
|
||||
@Service
|
||||
public class LogService extends CrudService<SysLogDao, SysLog> {
|
||||
|
||||
public Page<SysLog> findPage(Page<SysLog> page, SysLog sysLog) {
|
||||
@Autowired
|
||||
protected SysLogDao sysLogDao;
|
||||
public Page<SysLog> findPage(Page<SysLog> page, SysLog sysLog) {
|
||||
|
||||
// 设置默认时间范围,默认当前月
|
||||
if (sysLog.getBeginDate() == null){
|
||||
@@ -24,4 +28,17 @@ public Page<SysLog> findPage(Page<SysLog> page, SysLog sysLog) {
|
||||
|
||||
}
|
||||
|
||||
public Page<SysLog> findCfgOperationLogPage(Page<SysLog> page, SysLog sysLog) {
|
||||
|
||||
// 设置默认时间范围,默认当前月
|
||||
if (sysLog.getBeginDate() == null){
|
||||
sysLog.setBeginDate(DateUtils.setDays(DateUtils.parseDate(DateUtils.getDate()), 1));
|
||||
}
|
||||
if (sysLog.getEndDate() == null){
|
||||
sysLog.setEndDate(DateUtils.addMonths(sysLog.getBeginDate(), 1));
|
||||
}
|
||||
sysLog.setPage(page);
|
||||
List<SysLog> list = sysLogDao.findCfgOperationLogList(sysLog);
|
||||
return page.setList(list);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user