'修改日志管理的operType和fruit字段'
This commit is contained in:
parent
90f8a73100
commit
93a4b26947
|
|
@ -69,7 +69,7 @@ public class SysLogsVo {
|
|||
*操作类型
|
||||
*/
|
||||
@ApiModelProperty(value = "操作类型 增删改查 登陆 登出")
|
||||
private String operaType;
|
||||
private String operType;
|
||||
/**
|
||||
* 操作方法
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import java.util.UUID;
|
|||
|
||||
/**
|
||||
* 记录日志方法
|
||||
*
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
@Component
|
||||
|
|
@ -30,7 +30,7 @@ public class SysRecordLogService
|
|||
|
||||
/**
|
||||
* 记录登录信息
|
||||
*
|
||||
*
|
||||
* @param username 用户名
|
||||
* @param status 状态
|
||||
* @param message 消息内容
|
||||
|
|
@ -75,7 +75,7 @@ public class SysRecordLogService
|
|||
sysLogsVo.setMethod("login()");
|
||||
sysLogsVo.setParams("{\"username\":\""+username+"\"}");
|
||||
sysLogsVo.setOperateDetail("用户登陆系统");
|
||||
sysLogsVo.setOperaType("登陆");
|
||||
sysLogsVo.setOperType("登陆");
|
||||
sysLogsVo.setOperaUri("/login");
|
||||
sysLogsVo.setLogType(0);
|
||||
if (StringUtils.isNotEmpty(result)){
|
||||
|
|
@ -110,7 +110,7 @@ public class SysRecordLogService
|
|||
SysLogsVo sysLogsVo = new SysLogsVo();
|
||||
sysLogsVo.setGrade("高");
|
||||
String uuid= UUID.randomUUID().toString().replace("-","").toUpperCase();
|
||||
sysLogsVo.setOperaType("登陆");
|
||||
sysLogsVo.setOperType("登陆");
|
||||
sysLogsVo.setOperaUri("/login");
|
||||
sysLogsVo.setLogType(2);
|
||||
sysLogsVo.setResult("成功");
|
||||
|
|
@ -161,7 +161,7 @@ public class SysRecordLogService
|
|||
sysLogsVo.setMethod("logout()");
|
||||
sysLogsVo.setParams("{\"username\":\""+username+"\"}");
|
||||
sysLogsVo.setOperateDetail("用户退出登录");
|
||||
sysLogsVo.setOperaType("登出");
|
||||
sysLogsVo.setOperType("登出");
|
||||
sysLogsVo.setOperaUri("/logout");
|
||||
if (StringUtils.isNotEmpty(result)){
|
||||
sysLogsVo.setResult(result);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import com.bonus.common.security.utils.SecurityUtils;
|
|||
|
||||
/**
|
||||
* 操作日志记录处理
|
||||
*
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
@Aspect
|
||||
|
|
@ -110,7 +110,7 @@ public class LogAspect
|
|||
}
|
||||
//操作模块及路径
|
||||
sysLogsVo.setModel(controllerLog.module());
|
||||
sysLogsVo.setOperaType(controllerLog.businessType());
|
||||
sysLogsVo.setOperType(controllerLog.businessType());
|
||||
sysLogsVo.setLogType(controllerLog.logType());
|
||||
if(StringUtils.isEmpty(controllerLog.details())){
|
||||
sysLogsVo.setOperateDetail("进行了数据的"+controllerLog.businessType());
|
||||
|
|
@ -157,7 +157,7 @@ public class LogAspect
|
|||
|
||||
/**
|
||||
* 获取注解中对方法的描述信息 用于Controller层注解
|
||||
*
|
||||
*
|
||||
* @param log 日志
|
||||
* @param sysLogsVo 操作日志
|
||||
* @throws Exception
|
||||
|
|
@ -182,7 +182,7 @@ public class LogAspect
|
|||
|
||||
/**
|
||||
* 获取请求的参数,放到log中
|
||||
*
|
||||
*
|
||||
* @param operLog 操作日志
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
|
|
@ -237,7 +237,7 @@ public class LogAspect
|
|||
|
||||
/**
|
||||
* 判断是否需要过滤的对象。
|
||||
*
|
||||
*
|
||||
* @param o 对象信息。
|
||||
* @return 如果是需要过滤的对象,则返回true;否则返回false。
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class SysLogServiceImpl implements ISysLogService {
|
|||
sysLog.setGrade("高");
|
||||
sysLog.setErrType("越权访问");
|
||||
sysLog.setFailureReason("页面未授权");
|
||||
sysLog.setOperaType("查询");
|
||||
sysLog.setOperType("查询");
|
||||
sysLog.setOperateDetail("查看页面");
|
||||
String module=mapper.getModuleName(sysLog);
|
||||
sysLog.setLogType(2);
|
||||
|
|
@ -213,7 +213,7 @@ public class SysLogServiceImpl implements ISysLogService {
|
|||
List<Integer> nums=new ArrayList<>();
|
||||
List<SysLogsVo> list=mapper.getLogsList(dto);
|
||||
list.forEach(vo->{
|
||||
typeList.add(vo.getOperaType());
|
||||
typeList.add(vo.getOperType());
|
||||
nums.add(vo.getNum());
|
||||
});
|
||||
map.put("list",typeList);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
</update>
|
||||
<select id="getSystemLogs" resultType="com.bonus.system.api.domain.SysLogsVo">
|
||||
SELECT log_id,opera_user_name operaUserName,ip,user_id userId,model,
|
||||
oper_time operTime,method,params,result fruit,
|
||||
oper_time operTime,method,params,
|
||||
operate_detail operateDetail,oper_type operType,oper_uri operUri,
|
||||
log_type logType,failure_reason failureReason,grade,
|
||||
err_type errType,method_type methodType,times
|
||||
|
|
@ -88,9 +88,7 @@
|
|||
<if test="params!=null and params!=''">
|
||||
and params LIKE concat('%',#{params},'%')
|
||||
</if>
|
||||
<if test="fruit!=null and fruit!=''">
|
||||
and result =#{fruit}
|
||||
</if>
|
||||
|
||||
<if test="errType!=null and errType!=''">
|
||||
and err_type=#{errType}
|
||||
</if>
|
||||
|
|
@ -172,7 +170,7 @@
|
|||
</select>
|
||||
|
||||
<select id="getAllLogs" resultType="com.bonus.system.api.domain.SysLogsVo">
|
||||
select count(1) num,result fruit
|
||||
select count(1) num
|
||||
from sys_logs
|
||||
where oper_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime},' 23:59:59')
|
||||
GROUP BY result
|
||||
|
|
@ -206,4 +204,4 @@
|
|||
where log_type=#{logType}
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, oper_time, cost_time
|
||||
from sys_oper_log
|
||||
</sql>
|
||||
|
||||
|
||||
<insert id="insertOperlog" parameterType="SysOperLog">
|
||||
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, cost_time, oper_time)
|
||||
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate())
|
||||
|
|
@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)values (
|
||||
#{logId},#{operaUserName},#{ip},#{userId},
|
||||
#{model},#{operaTime},#{method},#{params},
|
||||
#{operateDetail},#{operaType},#{operaUri},
|
||||
#{operateDetail},#{operType},#{operaUri},
|
||||
#{logType},#{result},#{times},
|
||||
#{failureReason},#{grade},#{errType},
|
||||
#{methodType},#{title},#{resultData}
|
||||
|
|
@ -65,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND business_type in
|
||||
<foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
|
||||
#{businessType}
|
||||
</foreach>
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
|
|
@ -82,14 +82,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
order by oper_id desc
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="deleteOperLogByIds" parameterType="Long">
|
||||
delete from sys_oper_log where oper_id in
|
||||
<foreach collection="array" item="operId" open="(" separator="," close=")">
|
||||
#{operId}
|
||||
</foreach>
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="selectOperLogById" parameterType="Long" resultMap="SysOperLogResult">
|
||||
<include refid="selectOperLogVo"/>
|
||||
where oper_id = #{operId}
|
||||
|
|
@ -109,4 +109,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
truncate table sys_oper_log
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue