From 1b90ae962aca266e72eabd6b7ce1c8a27606d376 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Sat, 10 Oct 2020 11:43:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=97=A5=E5=BF=97=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=BB=A5=E5=8F=8A=E5=8F=82=E6=95=B0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=EF=BC=8C=E5=88=86=E9=A1=B5=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../daqing/financial/hrauth/config/IPageConfig.java | 13 +++++++++++++ .../daqing/financial/hrauth/dao/LoginLogMapper.java | 3 ++- .../hrauth/service/impl/LoginLogServiceImpl.java | 5 ++--- .../resources/mapper/hrmsauth/LoginLogMapper.xml | 12 +++++------- .../framework/domain/hrms/LoginLogEntity.java | 4 ++++ .../domain/hrms/request/UserLoginLogRequest.java | 12 ++++-------- 6 files changed, 30 insertions(+), 19 deletions(-) create mode 100644 dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/config/IPageConfig.java diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/config/IPageConfig.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/config/IPageConfig.java new file mode 100644 index 00000000..c8772bed --- /dev/null +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/config/IPageConfig.java @@ -0,0 +1,13 @@ +package com.daqing.financial.hrauth.config; + +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class IPageConfig { + @Bean + public PaginationInterceptor paginationInterceptor() { + return new PaginationInterceptor(); + } +} diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/LoginLogMapper.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/LoginLogMapper.java index 3cc42d4a..848df054 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/LoginLogMapper.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/LoginLogMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.daqing.framework.domain.hrms.LoginLog; +import com.daqing.framework.domain.hrms.LoginLogEntity; import com.daqing.framework.domain.hrms.request.UserLoginLogRequest; import com.daqing.framework.domain.hrms.request.UserLoginRequest; import org.apache.ibatis.annotations.Mapper; @@ -11,5 +12,5 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface LoginLogMapper extends BaseMapper { - IPage pageByCondition(Page page,@Param("loginLog") UserLoginLogRequest userLoginLogRequest); + IPage pageByCondition(Page page, @Param("loginLog") UserLoginLogRequest userLoginLogRequest); } diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/LoginLogServiceImpl.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/LoginLogServiceImpl.java index a78ca32c..5ad03a4e 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/LoginLogServiceImpl.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/LoginLogServiceImpl.java @@ -6,9 +6,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.daqing.financial.hrauth.dao.LoginLogMapper; import com.daqing.financial.hrauth.service.LoginLogService; import com.daqing.framework.domain.hrms.LoginLog; -import com.daqing.framework.domain.hrms.SystemLog; +import com.daqing.framework.domain.hrms.LoginLogEntity; import com.daqing.framework.domain.hrms.request.UserLoginLogRequest; -import com.daqing.framework.domain.hrms.request.UserLoginRequest; import com.daqing.framework.utils.PageUtils; import org.springframework.stereotype.Service; @@ -23,7 +22,7 @@ public class LoginLogServiceImpl extends ServiceImpl i if (size <= 0) { size = 10; } - IPage loginLogVo = this.getBaseMapper().pageByCondition(new Page(page, size),userLoginLogRequest); + IPage loginLogVo = this.getBaseMapper().pageByCondition(new Page(page, size),userLoginLogRequest); return new PageUtils(loginLogVo); } diff --git a/dq-financial-hrms-auth/src/main/resources/mapper/hrmsauth/LoginLogMapper.xml b/dq-financial-hrms-auth/src/main/resources/mapper/hrmsauth/LoginLogMapper.xml index 866bd044..3e21b4b1 100644 --- a/dq-financial-hrms-auth/src/main/resources/mapper/hrmsauth/LoginLogMapper.xml +++ b/dq-financial-hrms-auth/src/main/resources/mapper/hrmsauth/LoginLogMapper.xml @@ -12,8 +12,8 @@ \ No newline at end of file diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/LoginLogEntity.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/LoginLogEntity.java index 691b50ae..f4c9c879 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/LoginLogEntity.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/LoginLogEntity.java @@ -3,7 +3,9 @@ package com.daqing.framework.domain.hrms; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @@ -21,9 +23,11 @@ public class LoginLogEntity { private int loginNum; //创建时间 + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") private Date createTime; //最新登录时间 + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") private Date newestTime; //员工姓名 diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UserLoginLogRequest.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UserLoginLogRequest.java index 45692174..1bf355c7 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UserLoginLogRequest.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UserLoginLogRequest.java @@ -13,14 +13,6 @@ import java.io.Serializable; */ @Data public class UserLoginLogRequest implements Serializable { - /** - * 姓名 - */ - private String name; - /** - * 工号 - */ - private String jobNumber; /** * 开始时间 */ @@ -29,4 +21,8 @@ public class UserLoginLogRequest implements Serializable { * 结束时间 */ private String endTime; + /** + * 查询条件为姓名或工号 + */ + private String jobNumberOrName; }