mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-21 02:25:56 +08:00
update 更新 system 模块 (SysLogininfor, SysOperLog) 接口请求响应参数 ;
This commit is contained in:
parent
977a3e7752
commit
84ac020d28
@ -10,7 +10,8 @@ import com.ruoyi.common.excel.utils.ExcelUtil;
|
|||||||
import com.ruoyi.common.log.annotation.Log;
|
import com.ruoyi.common.log.annotation.Log;
|
||||||
import com.ruoyi.common.log.enums.BusinessType;
|
import com.ruoyi.common.log.enums.BusinessType;
|
||||||
import com.ruoyi.common.redis.utils.RedisUtils;
|
import com.ruoyi.common.redis.utils.RedisUtils;
|
||||||
import com.ruoyi.system.domain.SysLogininfor;
|
import com.ruoyi.system.domain.bo.SysLogininforBo;
|
||||||
|
import com.ruoyi.system.domain.vo.SysLogininforVo;
|
||||||
import com.ruoyi.system.service.ISysLogininforService;
|
import com.ruoyi.system.service.ISysLogininforService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -37,7 +38,7 @@ public class SysLogininforController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("monitor:logininfor:list")
|
@SaCheckPermission("monitor:logininfor:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<SysLogininfor> list(SysLogininfor logininfor, PageQuery pageQuery) {
|
public TableDataInfo<SysLogininforVo> list(SysLogininforBo logininfor, PageQuery pageQuery) {
|
||||||
return logininforService.selectPageLogininforList(logininfor, pageQuery);
|
return logininforService.selectPageLogininforList(logininfor, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,9 +48,9 @@ public class SysLogininforController extends BaseController {
|
|||||||
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
||||||
@SaCheckPermission("monitor:logininfor:export")
|
@SaCheckPermission("monitor:logininfor:export")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(SysLogininfor logininfor, HttpServletResponse response) {
|
public void export(SysLogininforBo logininfor, HttpServletResponse response) {
|
||||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
List<SysLogininforVo> list = logininforService.selectLogininforList(logininfor);
|
||||||
ExcelUtil.exportExcel(list, "登录日志", SysLogininfor.class, response);
|
ExcelUtil.exportExcel(list, "登录日志", SysLogininforVo.class, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -8,7 +8,8 @@ import com.ruoyi.common.core.domain.R;
|
|||||||
import com.ruoyi.common.mybatis.core.page.TableDataInfo;
|
import com.ruoyi.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.log.enums.BusinessType;
|
import com.ruoyi.common.log.enums.BusinessType;
|
||||||
import com.ruoyi.common.excel.utils.ExcelUtil;
|
import com.ruoyi.common.excel.utils.ExcelUtil;
|
||||||
import com.ruoyi.system.domain.SysOperLog;
|
import com.ruoyi.system.domain.bo.SysOperLogBo;
|
||||||
|
import com.ruoyi.system.domain.vo.SysOperLogVo;
|
||||||
import com.ruoyi.system.service.ISysOperLogService;
|
import com.ruoyi.system.service.ISysOperLogService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -35,7 +36,7 @@ public class SysOperlogController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("monitor:operlog:list")
|
@SaCheckPermission("monitor:operlog:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<SysOperLog> list(SysOperLog operLog, PageQuery pageQuery) {
|
public TableDataInfo<SysOperLogVo> list(SysOperLogBo operLog, PageQuery pageQuery) {
|
||||||
return operLogService.selectPageOperLogList(operLog, pageQuery);
|
return operLogService.selectPageOperLogList(operLog, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,9 +46,9 @@ public class SysOperlogController extends BaseController {
|
|||||||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||||
@SaCheckPermission("monitor:operlog:export")
|
@SaCheckPermission("monitor:operlog:export")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(SysOperLog operLog, HttpServletResponse response) {
|
public void export(SysOperLogBo operLog, HttpServletResponse response) {
|
||||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
List<SysOperLogVo> list = operLogService.selectOperLogList(operLog);
|
||||||
ExcelUtil.exportExcel(list, "操作日志", SysOperLog.class, response);
|
ExcelUtil.exportExcel(list, "操作日志", SysOperLogVo.class, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,19 +1,12 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ruoyi.common.excel.annotation.ExcelDictFormat;
|
|
||||||
import com.ruoyi.common.excel.convert.ExcelDictConvert;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统访问记录表 sys_logininfor
|
* 系统访问记录表 sys_logininfor
|
||||||
@ -23,7 +16,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("sys_logininfor")
|
@TableName("sys_logininfor")
|
||||||
@ExcelIgnoreUnannotated
|
|
||||||
public class SysLogininfor implements Serializable {
|
public class SysLogininfor implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
@ -32,63 +24,47 @@ public class SysLogininfor implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* ID
|
* ID
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "序号")
|
|
||||||
@TableId(value = "info_id")
|
@TableId(value = "info_id")
|
||||||
private Long infoId;
|
private Long infoId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户账号
|
* 用户账号
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "用户账号")
|
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录状态 0成功 1失败
|
* 登录状态 0成功 1失败
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "登录状态", converter = ExcelDictConvert.class)
|
|
||||||
@ExcelDictFormat(dictType = "sys_common_status")
|
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录IP地址
|
* 登录IP地址
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "登录地址")
|
|
||||||
private String ipaddr;
|
private String ipaddr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录地点
|
* 登录地点
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "登录地点")
|
|
||||||
private String loginLocation;
|
private String loginLocation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 浏览器类型
|
* 浏览器类型
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "浏览器")
|
|
||||||
private String browser;
|
private String browser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作系统
|
* 操作系统
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "操作系统")
|
|
||||||
private String os;
|
private String os;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提示消息
|
* 提示消息
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "提示消息")
|
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 访问时间
|
* 访问时间
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "访问时间")
|
|
||||||
private Date loginTime;
|
private Date loginTime;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求参数
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params = new HashMap<>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,19 +1,12 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ruoyi.common.excel.annotation.ExcelDictFormat;
|
|
||||||
import com.ruoyi.common.excel.convert.ExcelDictConvert;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作日志记录表 oper_log
|
* 操作日志记录表 oper_log
|
||||||
@ -23,7 +16,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("sys_oper_log")
|
@TableName("sys_oper_log")
|
||||||
@ExcelIgnoreUnannotated
|
|
||||||
public class SysOperLog implements Serializable {
|
public class SysOperLog implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
@ -32,7 +24,6 @@ public class SysOperLog implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 日志主键
|
* 日志主键
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "日志主键")
|
|
||||||
@TableId(value = "oper_id")
|
@TableId(value = "oper_id")
|
||||||
private Long operId;
|
private Long operId;
|
||||||
|
|
||||||
@ -44,106 +35,76 @@ public class SysOperLog implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 操作模块
|
* 操作模块
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "操作模块")
|
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务类型(0其它 1新增 2修改 3删除)
|
* 业务类型(0其它 1新增 2修改 3删除)
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "业务类型", converter = ExcelDictConvert.class)
|
|
||||||
@ExcelDictFormat(dictType = "sys_oper_type")
|
|
||||||
private Integer businessType;
|
private Integer businessType;
|
||||||
|
|
||||||
/**
|
|
||||||
* 业务类型数组
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Integer[] businessTypes;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求方法
|
* 请求方法
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "请求方法")
|
|
||||||
private String method;
|
private String method;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求方式
|
* 请求方式
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "请求方式")
|
|
||||||
private String requestMethod;
|
private String requestMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作类别(0其它 1后台用户 2手机端用户)
|
* 操作类别(0其它 1后台用户 2手机端用户)
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "操作类别", converter = ExcelDictConvert.class)
|
|
||||||
@ExcelDictFormat(readConverterExp = "0=其它,1=后台用户,2=手机端用户")
|
|
||||||
private Integer operatorType;
|
private Integer operatorType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作人员
|
* 操作人员
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "操作人员")
|
|
||||||
private String operName;
|
private String operName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门名称
|
* 部门名称
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "部门名称")
|
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求url
|
* 请求url
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "请求地址")
|
|
||||||
private String operUrl;
|
private String operUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作地址
|
* 操作地址
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "操作地址")
|
|
||||||
private String operIp;
|
private String operIp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作地点
|
* 操作地点
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "操作地点")
|
|
||||||
private String operLocation;
|
private String operLocation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求参数
|
* 请求参数
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "请求参数")
|
|
||||||
private String operParam;
|
private String operParam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回参数
|
* 返回参数
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "返回参数")
|
|
||||||
private String jsonResult;
|
private String jsonResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作状态(0正常 1异常)
|
* 操作状态(0正常 1异常)
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
|
||||||
@ExcelDictFormat(dictType = "sys_common_status")
|
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 错误消息
|
* 错误消息
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "错误消息")
|
|
||||||
private String errorMsg;
|
private String errorMsg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作时间
|
* 操作时间
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "操作时间")
|
|
||||||
private Date operTime;
|
private Date operTime;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求参数
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params = new HashMap<>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,74 @@
|
|||||||
|
package com.ruoyi.system.domain.bo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统访问记录业务对象 sys_logininfor
|
||||||
|
*
|
||||||
|
* @author Michelle.Chung
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SysLogininforBo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 访问ID
|
||||||
|
*/
|
||||||
|
private Long infoId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户编号
|
||||||
|
*/
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户账号
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录IP地址
|
||||||
|
*/
|
||||||
|
private String ipaddr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录地点
|
||||||
|
*/
|
||||||
|
private String loginLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 浏览器类型
|
||||||
|
*/
|
||||||
|
private String browser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作系统
|
||||||
|
*/
|
||||||
|
private String os;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录状态(0成功 1失败)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提示消息
|
||||||
|
*/
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 访问时间
|
||||||
|
*/
|
||||||
|
private Date loginTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求参数
|
||||||
|
*/
|
||||||
|
private Map<String, Object> params = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,116 @@
|
|||||||
|
package com.ruoyi.system.domain.bo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志记录业务对象 sys_oper_log
|
||||||
|
*
|
||||||
|
* @author Michelle.Chung
|
||||||
|
* @date 2023-02-07
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SysOperLogBo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志主键
|
||||||
|
*/
|
||||||
|
private Long operId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户编号
|
||||||
|
*/
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模块标题
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型(0其它 1新增 2修改 3删除)
|
||||||
|
*/
|
||||||
|
private Integer businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型数组
|
||||||
|
*/
|
||||||
|
private Integer[] businessTypes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方法名称
|
||||||
|
*/
|
||||||
|
private String method;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方式
|
||||||
|
*/
|
||||||
|
private String requestMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类别(0其它 1后台用户 2手机端用户)
|
||||||
|
*/
|
||||||
|
private Integer operatorType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人员
|
||||||
|
*/
|
||||||
|
private String operName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求URL
|
||||||
|
*/
|
||||||
|
private String operUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机地址
|
||||||
|
*/
|
||||||
|
private String operIp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作地点
|
||||||
|
*/
|
||||||
|
private String operLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求参数
|
||||||
|
*/
|
||||||
|
private String operParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回参数
|
||||||
|
*/
|
||||||
|
private String jsonResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作状态(0正常 1异常)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误消息
|
||||||
|
*/
|
||||||
|
private String errorMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作时间
|
||||||
|
*/
|
||||||
|
private Date operTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求参数
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Map<String, Object> params = new HashMap<>();
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,90 @@
|
|||||||
|
package com.ruoyi.system.domain.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.ruoyi.common.excel.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.excel.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统访问记录视图对象 sys_logininfor
|
||||||
|
*
|
||||||
|
* @author Michelle.Chung
|
||||||
|
* @date 2023-02-07
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class SysLogininforVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 访问ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "序号")
|
||||||
|
private Long infoId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户编号
|
||||||
|
*/
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户账号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "用户账号")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录状态(0成功 1失败)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "登录状态", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "sys_common_status")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录IP地址
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "登录地址")
|
||||||
|
private String ipaddr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录地点
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "登录地点")
|
||||||
|
private String loginLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 浏览器类型
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "浏览器")
|
||||||
|
private String browser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作系统
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "操作系统")
|
||||||
|
private String os;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提示消息
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "提示消息")
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 访问时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "访问时间")
|
||||||
|
private Date loginTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,138 @@
|
|||||||
|
package com.ruoyi.system.domain.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.ruoyi.common.excel.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.excel.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志记录视图对象 sys_oper_log
|
||||||
|
*
|
||||||
|
* @author Michelle.Chung
|
||||||
|
* @date 2023-02-07
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class SysOperLogVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志主键
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "日志主键")
|
||||||
|
private Long operId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户编号
|
||||||
|
*/
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模块标题
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "操作模块")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型(0其它 1新增 2修改 3删除)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "业务类型", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "sys_oper_type")
|
||||||
|
private Integer businessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型数组
|
||||||
|
*/
|
||||||
|
private Integer[] businessTypes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方法名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "请求方法")
|
||||||
|
private String method;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方式
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "请求方式")
|
||||||
|
private String requestMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类别(0其它 1后台用户 2手机端用户)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "操作类别", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "0=其它,1=后台用户,2=手机端用户")
|
||||||
|
private Integer operatorType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人员
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "操作人员")
|
||||||
|
private String operName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求URL
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "请求地址")
|
||||||
|
private String operUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机地址
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "操作地址")
|
||||||
|
private String operIp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作地点
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "操作地点")
|
||||||
|
private String operLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求参数
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "请求参数")
|
||||||
|
private String operParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回参数
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "返回参数")
|
||||||
|
private String jsonResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作状态(0正常 1异常)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(dictType = "sys_common_status")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误消息
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "错误消息")
|
||||||
|
private String errorMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "操作时间")
|
||||||
|
private Date operTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -2,12 +2,13 @@ package com.ruoyi.system.mapper;
|
|||||||
|
|
||||||
import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus;
|
import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
import com.ruoyi.system.domain.SysLogininfor;
|
import com.ruoyi.system.domain.SysLogininfor;
|
||||||
|
import com.ruoyi.system.domain.vo.SysLogininforVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统访问日志情况信息 数据层
|
* 系统访问日志情况信息 数据层
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysLogininforMapper extends BaseMapperPlus<SysLogininforMapper, SysLogininfor, SysLogininfor> {
|
public interface SysLogininforMapper extends BaseMapperPlus<SysLogininforMapper, SysLogininfor, SysLogininforVo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,12 +2,13 @@ package com.ruoyi.system.mapper;
|
|||||||
|
|
||||||
import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus;
|
import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
import com.ruoyi.system.domain.SysOperLog;
|
import com.ruoyi.system.domain.SysOperLog;
|
||||||
|
import com.ruoyi.system.domain.vo.SysOperLogVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作日志 数据层
|
* 操作日志 数据层
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysOperLogMapper extends BaseMapperPlus<SysOperLogMapper, SysOperLog, SysOperLog> {
|
public interface SysOperLogMapper extends BaseMapperPlus<SysOperLogMapper, SysOperLog, SysOperLogVo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,8 @@ package com.ruoyi.system.service;
|
|||||||
|
|
||||||
import com.ruoyi.common.mybatis.core.page.PageQuery;
|
import com.ruoyi.common.mybatis.core.page.PageQuery;
|
||||||
import com.ruoyi.common.mybatis.core.page.TableDataInfo;
|
import com.ruoyi.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.ruoyi.system.domain.SysLogininfor;
|
import com.ruoyi.system.domain.bo.SysLogininforBo;
|
||||||
|
import com.ruoyi.system.domain.vo.SysLogininforVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -14,14 +15,14 @@ import java.util.List;
|
|||||||
public interface ISysLogininforService {
|
public interface ISysLogininforService {
|
||||||
|
|
||||||
|
|
||||||
TableDataInfo<SysLogininfor> selectPageLogininforList(SysLogininfor logininfor, PageQuery pageQuery);
|
TableDataInfo<SysLogininforVo> selectPageLogininforList(SysLogininforBo logininfor, PageQuery pageQuery);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增系统登录日志
|
* 新增系统登录日志
|
||||||
*
|
*
|
||||||
* @param logininfor 访问日志对象
|
* @param bo 访问日志对象
|
||||||
*/
|
*/
|
||||||
void insertLogininfor(SysLogininfor logininfor);
|
void insertLogininfor(SysLogininforBo bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询系统登录日志集合
|
* 查询系统登录日志集合
|
||||||
@ -29,7 +30,7 @@ public interface ISysLogininforService {
|
|||||||
* @param logininfor 访问日志对象
|
* @param logininfor 访问日志对象
|
||||||
* @return 登录记录集合
|
* @return 登录记录集合
|
||||||
*/
|
*/
|
||||||
List<SysLogininfor> selectLogininforList(SysLogininfor logininfor);
|
List<SysLogininforVo> selectLogininforList(SysLogininforBo logininfor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除系统登录日志
|
* 批量删除系统登录日志
|
||||||
|
|||||||
@ -2,7 +2,8 @@ package com.ruoyi.system.service;
|
|||||||
|
|
||||||
import com.ruoyi.common.mybatis.core.page.PageQuery;
|
import com.ruoyi.common.mybatis.core.page.PageQuery;
|
||||||
import com.ruoyi.common.mybatis.core.page.TableDataInfo;
|
import com.ruoyi.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.ruoyi.system.domain.SysOperLog;
|
import com.ruoyi.system.domain.bo.SysOperLogBo;
|
||||||
|
import com.ruoyi.system.domain.vo.SysOperLogVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -13,14 +14,14 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface ISysOperLogService {
|
public interface ISysOperLogService {
|
||||||
|
|
||||||
TableDataInfo<SysOperLog> selectPageOperLogList(SysOperLog operLog, PageQuery pageQuery);
|
TableDataInfo<SysOperLogVo> selectPageOperLogList(SysOperLogBo operLog, PageQuery pageQuery);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增操作日志
|
* 新增操作日志
|
||||||
*
|
*
|
||||||
* @param operLog 操作日志对象
|
* @param bo 操作日志对象
|
||||||
*/
|
*/
|
||||||
void insertOperlog(SysOperLog operLog);
|
void insertOperlog(SysOperLogBo bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询系统操作日志集合
|
* 查询系统操作日志集合
|
||||||
@ -28,7 +29,7 @@ public interface ISysOperLogService {
|
|||||||
* @param operLog 操作日志对象
|
* @param operLog 操作日志对象
|
||||||
* @return 操作日志集合
|
* @return 操作日志集合
|
||||||
*/
|
*/
|
||||||
List<SysOperLog> selectOperLogList(SysOperLog operLog);
|
List<SysOperLogVo> selectOperLogList(SysOperLogBo operLog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除系统操作日志
|
* 批量删除系统操作日志
|
||||||
@ -44,7 +45,7 @@ public interface ISysOperLogService {
|
|||||||
* @param operId 操作ID
|
* @param operId 操作ID
|
||||||
* @return 操作日志对象
|
* @return 操作日志对象
|
||||||
*/
|
*/
|
||||||
SysOperLog selectOperLogById(Long operId);
|
SysOperLogVo selectOperLogById(Long operId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空操作日志
|
* 清空操作日志
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.system.service.impl;
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.http.useragent.UserAgent;
|
import cn.hutool.http.useragent.UserAgent;
|
||||||
import cn.hutool.http.useragent.UserAgentUtil;
|
import cn.hutool.http.useragent.UserAgentUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@ -12,6 +13,8 @@ import com.ruoyi.common.core.utils.ServletUtils;
|
|||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.common.core.utils.ip.AddressUtils;
|
import com.ruoyi.common.core.utils.ip.AddressUtils;
|
||||||
import com.ruoyi.system.domain.SysLogininfor;
|
import com.ruoyi.system.domain.SysLogininfor;
|
||||||
|
import com.ruoyi.system.domain.bo.SysLogininforBo;
|
||||||
|
import com.ruoyi.system.domain.vo.SysLogininforVo;
|
||||||
import com.ruoyi.system.mapper.SysLogininforMapper;
|
import com.ruoyi.system.mapper.SysLogininforMapper;
|
||||||
import com.ruoyi.system.service.ISysLogininforService;
|
import com.ruoyi.system.service.ISysLogininforService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -64,7 +67,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService {
|
|||||||
// 获取客户端浏览器
|
// 获取客户端浏览器
|
||||||
String browser = userAgent.getBrowser().getName();
|
String browser = userAgent.getBrowser().getName();
|
||||||
// 封装对象
|
// 封装对象
|
||||||
SysLogininfor logininfor = new SysLogininfor();
|
SysLogininforBo logininfor = new SysLogininforBo();
|
||||||
logininfor.setUserName(logininforEvent.getUsername());
|
logininfor.setUserName(logininforEvent.getUsername());
|
||||||
logininfor.setIpaddr(ip);
|
logininfor.setIpaddr(ip);
|
||||||
logininfor.setLoginLocation(address);
|
logininfor.setLoginLocation(address);
|
||||||
@ -89,7 +92,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<SysLogininfor> selectPageLogininforList(SysLogininfor logininfor, PageQuery pageQuery) {
|
public TableDataInfo<SysLogininforVo> selectPageLogininforList(SysLogininforBo logininfor, PageQuery pageQuery) {
|
||||||
Map<String, Object> params = logininfor.getParams();
|
Map<String, Object> params = logininfor.getParams();
|
||||||
LambdaQueryWrapper<SysLogininfor> lqw = new LambdaQueryWrapper<SysLogininfor>()
|
LambdaQueryWrapper<SysLogininfor> lqw = new LambdaQueryWrapper<SysLogininfor>()
|
||||||
.like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr())
|
.like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr())
|
||||||
@ -101,17 +104,18 @@ public class SysLogininforServiceImpl implements ISysLogininforService {
|
|||||||
pageQuery.setOrderByColumn("info_id");
|
pageQuery.setOrderByColumn("info_id");
|
||||||
pageQuery.setIsAsc("desc");
|
pageQuery.setIsAsc("desc");
|
||||||
}
|
}
|
||||||
Page<SysLogininfor> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
Page<SysLogininforVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
return TableDataInfo.build(page);
|
return TableDataInfo.build(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增系统登录日志
|
* 新增系统登录日志
|
||||||
*
|
*
|
||||||
* @param logininfor 访问日志对象
|
* @param bo 访问日志对象
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void insertLogininfor(SysLogininfor logininfor) {
|
public void insertLogininfor(SysLogininforBo bo) {
|
||||||
|
SysLogininfor logininfor = BeanUtil.toBean(bo, SysLogininfor.class);
|
||||||
logininfor.setLoginTime(new Date());
|
logininfor.setLoginTime(new Date());
|
||||||
baseMapper.insert(logininfor);
|
baseMapper.insert(logininfor);
|
||||||
}
|
}
|
||||||
@ -123,9 +127,9 @@ public class SysLogininforServiceImpl implements ISysLogininforService {
|
|||||||
* @return 登录记录集合
|
* @return 登录记录集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) {
|
public List<SysLogininforVo> selectLogininforList(SysLogininforBo logininfor) {
|
||||||
Map<String, Object> params = logininfor.getParams();
|
Map<String, Object> params = logininfor.getParams();
|
||||||
return baseMapper.selectList(new LambdaQueryWrapper<SysLogininfor>()
|
return baseMapper.selectVoList(new LambdaQueryWrapper<SysLogininfor>()
|
||||||
.like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr())
|
.like(StringUtils.isNotBlank(logininfor.getIpaddr()), SysLogininfor::getIpaddr, logininfor.getIpaddr())
|
||||||
.eq(StringUtils.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus())
|
.eq(StringUtils.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus())
|
||||||
.like(StringUtils.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName())
|
.like(StringUtils.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName())
|
||||||
|
|||||||
@ -10,6 +10,8 @@ import com.ruoyi.common.core.utils.StringUtils;
|
|||||||
import com.ruoyi.common.core.utils.ip.AddressUtils;
|
import com.ruoyi.common.core.utils.ip.AddressUtils;
|
||||||
import com.ruoyi.common.log.event.OperLogEvent;
|
import com.ruoyi.common.log.event.OperLogEvent;
|
||||||
import com.ruoyi.system.domain.SysOperLog;
|
import com.ruoyi.system.domain.SysOperLog;
|
||||||
|
import com.ruoyi.system.domain.bo.SysOperLogBo;
|
||||||
|
import com.ruoyi.system.domain.vo.SysOperLogVo;
|
||||||
import com.ruoyi.system.mapper.SysOperLogMapper;
|
import com.ruoyi.system.mapper.SysOperLogMapper;
|
||||||
import com.ruoyi.system.service.ISysOperLogService;
|
import com.ruoyi.system.service.ISysOperLogService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -41,14 +43,14 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
|
|||||||
@Async
|
@Async
|
||||||
@EventListener
|
@EventListener
|
||||||
public void recordOper(OperLogEvent operLogEvent) {
|
public void recordOper(OperLogEvent operLogEvent) {
|
||||||
SysOperLog operLog = BeanUtil.toBean(operLogEvent, SysOperLog.class);
|
SysOperLogBo operLog = BeanUtil.toBean(operLogEvent, SysOperLogBo.class);
|
||||||
// 远程查询操作地点
|
// 远程查询操作地点
|
||||||
operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp()));
|
operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp()));
|
||||||
insertOperlog(operLog);
|
insertOperlog(operLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<SysOperLog> selectPageOperLogList(SysOperLog operLog, PageQuery pageQuery) {
|
public TableDataInfo<SysOperLogVo> selectPageOperLogList(SysOperLogBo operLog, PageQuery pageQuery) {
|
||||||
Map<String, Object> params = operLog.getParams();
|
Map<String, Object> params = operLog.getParams();
|
||||||
LambdaQueryWrapper<SysOperLog> lqw = new LambdaQueryWrapper<SysOperLog>()
|
LambdaQueryWrapper<SysOperLog> lqw = new LambdaQueryWrapper<SysOperLog>()
|
||||||
.like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle())
|
.like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle())
|
||||||
@ -68,17 +70,18 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
|
|||||||
pageQuery.setOrderByColumn("oper_id");
|
pageQuery.setOrderByColumn("oper_id");
|
||||||
pageQuery.setIsAsc("desc");
|
pageQuery.setIsAsc("desc");
|
||||||
}
|
}
|
||||||
Page<SysOperLog> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
Page<SysOperLogVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
return TableDataInfo.build(page);
|
return TableDataInfo.build(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增操作日志
|
* 新增操作日志
|
||||||
*
|
*
|
||||||
* @param operLog 操作日志对象
|
* @param bo 操作日志对象
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void insertOperlog(SysOperLog operLog) {
|
public void insertOperlog(SysOperLogBo bo) {
|
||||||
|
SysOperLog operLog = BeanUtil.toBean(bo, SysOperLog.class);
|
||||||
operLog.setOperTime(new Date());
|
operLog.setOperTime(new Date());
|
||||||
baseMapper.insert(operLog);
|
baseMapper.insert(operLog);
|
||||||
}
|
}
|
||||||
@ -90,9 +93,9 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
|
|||||||
* @return 操作日志集合
|
* @return 操作日志集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysOperLog> selectOperLogList(SysOperLog operLog) {
|
public List<SysOperLogVo> selectOperLogList(SysOperLogBo operLog) {
|
||||||
Map<String, Object> params = operLog.getParams();
|
Map<String, Object> params = operLog.getParams();
|
||||||
return baseMapper.selectList(new LambdaQueryWrapper<SysOperLog>()
|
return baseMapper.selectVoList(new LambdaQueryWrapper<SysOperLog>()
|
||||||
.like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle())
|
.like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle())
|
||||||
.eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0,
|
.eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0,
|
||||||
SysOperLog::getBusinessType, operLog.getBusinessType())
|
SysOperLog::getBusinessType, operLog.getBusinessType())
|
||||||
@ -127,8 +130,8 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
|
|||||||
* @return 操作日志对象
|
* @return 操作日志对象
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysOperLog selectOperLogById(Long operId) {
|
public SysOperLogVo selectOperLogById(Long operId) {
|
||||||
return baseMapper.selectById(operId);
|
return baseMapper.selectVoById(operId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user