| | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.TimeZone; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Bean |
| | | public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() { |
| | | return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault()); |
| | | return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getTimeZone("GMT+8")); |
| | | } |
| | | |
| | | @Bean |
| | |
| | | new LocalDateSerializer(dateFormatter)); |
| | | mapper.registerModule(module); |
| | | mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); |
| | | mapper.setTimeZone(TimeZone.getTimeZone("GMT+8")); |
| | | mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); |
| | | return mapper; |
| | | } |
| | | } |
| | |
| | | private String createBy;
|
| | |
|
| | | /** 创建时间 */
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
| | | private Date createTime;
|
| | |
|
| | | /** 更新者 */
|
| | | private String updateBy;
|
| | |
|
| | | /** 更新时间 */
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
| | | private Date updateTime;
|
| | |
|
| | | /** 备注 */
|
| | |
| | | package com.ruoyi.project.system.domain;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.TableField;
|
| | | import com.fasterxml.jackson.annotation.JsonFormat;
|
| | | import com.fasterxml.jackson.annotation.JsonIgnore;
|
| | | import com.ruoyi.common.xss.Xss;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
| | |
| | |
|
| | | /** 最后登录时间 */
|
| | | @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
| | | private Date loginDate;
|
| | |
|
| | | /** 部门对象 */
|
| | |
| | | select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, cost_time |
| | | from sys_oper_log |
| | | </sql> |
| | | |
| | | |
| | | <insert id="insertOperlog" parameterType="com.ruoyi.project.monitor.domain.SysOperLog"> |
| | | insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time) |
| | | values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate()) |
| | | </insert> |
| | | |
| | | |
| | | <select id="selectOperLogList" parameterType="com.ruoyi.project.monitor.domain.SysOperLog" resultMap="SysOperLogResult"> |
| | | <include refid="selectOperLogVo"/> |
| | | <where> |
| | |
| | | AND business_type in |
| | | <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")"> |
| | | #{businessType} |
| | | </foreach> |
| | | </foreach> |
| | | </if> |
| | | <if test="status != null"> |
| | | AND status = #{status} |
| | |
| | | AND oper_time <= #{params.endTime} |
| | | </if> |
| | | </where> |
| | | order by oper_id desc |
| | | order by oper_time 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} |
| | | </select> |
| | | |
| | | |
| | | <update id="cleanOperLog"> |
| | | truncate table sys_oper_log |
| | | </update> |
| | | |
| | | </mapper> |
| | | </mapper> |