فهرست منبع

操作日志和登录日志增删查改

wangli 4 سال پیش
والد
کامیت
ba727493f5
19فایلهای تغییر یافته به همراه1185 افزوده شده و 28 حذف شده
  1. 128 0
      user_center/src/main/java/com/huaxu/controller/LoginLogController.java
  2. 127 0
      user_center/src/main/java/com/huaxu/controller/OperateLogController.java
  3. 7 8
      user_center/src/main/java/com/huaxu/controller/TenantController.java
  4. 81 0
      user_center/src/main/java/com/huaxu/dao/LoginLogMapper.java
  5. 80 0
      user_center/src/main/java/com/huaxu/dao/OperateLogMapper.java
  6. 7 7
      user_center/src/main/java/com/huaxu/dao/TenantMapper.java
  7. 32 0
      user_center/src/main/java/com/huaxu/dto/LoginLogDto.java
  8. 31 0
      user_center/src/main/java/com/huaxu/dto/OperateLogDto.java
  9. 37 0
      user_center/src/main/java/com/huaxu/entity/LoginLogEntity.java
  10. 36 0
      user_center/src/main/java/com/huaxu/entity/OperateLogEntity.java
  11. 4 4
      user_center/src/main/java/com/huaxu/entity/TenantEntity.java
  12. 80 0
      user_center/src/main/java/com/huaxu/service/LoginLogService.java
  13. 78 0
      user_center/src/main/java/com/huaxu/service/OperateLogService.java
  14. 3 4
      user_center/src/main/java/com/huaxu/service/TenantService.java
  15. 68 0
      user_center/src/main/java/com/huaxu/service/impl/LoginLogServiceImpl.java
  16. 68 0
      user_center/src/main/java/com/huaxu/service/impl/OperateLogServiceImpl.java
  17. 5 5
      user_center/src/main/java/com/huaxu/service/impl/TenantServiceImpl.java
  18. 159 0
      user_center/src/main/resources/mapper/LoginLog.xml
  19. 154 0
      user_center/src/main/resources/mapper/OperateLog.xml

+ 128 - 0
user_center/src/main/java/com/huaxu/controller/LoginLogController.java

@@ -0,0 +1,128 @@
+package com.huaxu.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.huaxu.dto.LoginLogDto;
+import com.huaxu.entity.LoginLogEntity;
+import com.huaxu.model.AjaxMessage;
+import com.huaxu.model.Pagination;
+import com.huaxu.model.ResultStatus;
+import com.huaxu.service.LoginLogService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @description 登录日志管理控制层
+ * @auto wangli
+ * @data 2020-10-27 9:19
+ */
+@RestController
+@RequestMapping("/loginLog")
+@Api(tags = "登录日志管理")
+public class LoginLogController {
+
+    @Autowired
+    private LoginLogService loginLogService;
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id
+     * @return 单条数据
+     */
+    @RequestMapping(value = "get", method = RequestMethod.POST)
+    @ApiOperation(value = "根据id查询登录日志")
+    public AjaxMessage<LoginLogDto> selectOne(
+            @ApiParam(value = "登录日志信息", required = true) @RequestParam Integer id) {
+        LoginLogDto result = loginLogService.selectById(id);
+
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+    /**
+     * 查询登录日志信息
+     *
+     * @param loginLogDto 参数对象
+     * @return 多条数据
+     */
+    @RequestMapping(value = "selectList", method = RequestMethod.POST)
+    @ApiOperation(value = "查询登录日志信息")
+    public AjaxMessage<List<LoginLogDto>> selectList(
+            @ApiParam(value = "登录日志信息", required = true) @RequestBody LoginLogDto loginLogDto) {
+        List<LoginLogDto> result = loginLogService.selectList(loginLogDto);
+
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+
+    /**
+     * 新增一条数据
+     *
+     * @param loginLogEntity 实体类
+     * @return Response对象
+     */
+    @RequestMapping(value = "insert", method = RequestMethod.POST)
+    @ApiOperation(value = "插入登录日志信息")
+    public AjaxMessage<Integer> insert(@ApiParam(value = "登录日志信息", required = true) @RequestBody LoginLogEntity loginLogEntity) {
+        int result = loginLogService.insert(loginLogEntity);
+
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+    /**
+     * 修改一条数据
+     *
+     * @param loginLogEntity 实体类
+     * @return Response对象
+     */
+    @RequestMapping(value = "update", method = RequestMethod.POST)
+    @ApiOperation(value = "修改登录日志信息")
+    public AjaxMessage<Integer> update(@ApiParam(value = "登录日志信息", required = true) @RequestBody LoginLogEntity loginLogEntity) {
+        int result = loginLogService.update(loginLogEntity);
+        return new AjaxMessage<>(ResultStatus.OK, result);
+
+    }
+
+    /**
+     * 单条删除数据
+     *
+     * @param id
+     * @return Response对象
+     */
+    @RequestMapping(value = "delete", method = RequestMethod.POST)
+    @ApiOperation(value = "删除登录日志信息")
+    public AjaxMessage<Integer> delete(@ApiParam(value = "登录日志信息", required = true) @RequestParam Integer id) {
+        int result = loginLogService.deleteById(id);
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+
+    /**
+     * 分页查询
+     *
+     * @param pageNum  偏移
+     * @param pageSize 条数
+     * @return Response对象
+     */
+    @RequestMapping(value = "selectPage", method = RequestMethod.POST)
+    @ApiOperation(value = "查询登录日志信息列表")
+    public AjaxMessage<Pagination<LoginLogDto>> selectPage(
+            @ApiParam(value = "登录日志信息", required = true) @RequestBody LoginLogDto loginLogDto,
+            @ApiParam(value = "页数,非必传,默认第一页",  defaultValue = "1")  int pageNum,
+            @ApiParam(value = "条数,非必传,默认15条",  defaultValue = "30")  int pageSize
+
+    ) {
+        IPage<LoginLogDto> iPage = new Page<>(pageNum, pageSize);
+
+        iPage = loginLogService.selectPage(iPage, loginLogDto);
+
+        Pagination<LoginLogDto> pages = new Pagination<>(iPage);
+
+        return new AjaxMessage<>(ResultStatus.OK, pages);
+    }
+}

+ 127 - 0
user_center/src/main/java/com/huaxu/controller/OperateLogController.java

@@ -0,0 +1,127 @@
+package com.huaxu.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.huaxu.dto.OperateLogDto;
+import com.huaxu.entity.OperateLogEntity;
+import com.huaxu.model.AjaxMessage;
+import com.huaxu.model.Pagination;
+import com.huaxu.model.ResultStatus;
+import com.huaxu.service.OperateLogService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @description
+ * @auto wangli
+ * @data 2020-10-27 9:19
+ */
+@RestController
+@RequestMapping("/operateLog")
+@Api(tags = "操作日志管理")
+public class OperateLogController {
+
+    @Autowired
+    private OperateLogService operateLogService;
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id
+     * @return 单条数据
+     */
+    @RequestMapping(value = "get", method = RequestMethod.POST)
+    @ApiOperation(value = "根据id查询操作日志")
+    public AjaxMessage<OperateLogDto> selectOne(
+            @ApiParam(value = "操作日志信息", required = true) @RequestParam Integer id) {
+        OperateLogDto result = operateLogService.selectById(id);
+
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+    /**
+     * 查询操作日志信息
+     *
+     * @param operateLogDto 参数对象
+     * @return 多条数据
+     */
+    @RequestMapping(value = "selectList", method = RequestMethod.POST)
+    @ApiOperation(value = "查询操作日志信息")
+    public AjaxMessage<List<OperateLogDto>> selectList(
+            @ApiParam(value = "操作日志信息", required = true) @RequestBody OperateLogDto operateLogDto) {
+        List<OperateLogDto> result = operateLogService.selectList(operateLogDto);
+
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+
+    /**
+     * 新增一条数据
+     *
+     * @param operateLogEntity 实体类
+     * @return Response对象
+     */
+    @RequestMapping(value = "insert", method = RequestMethod.POST)
+    @ApiOperation(value = "插入操作日志信息")
+    public AjaxMessage<Integer> insert(@ApiParam(value = "操作日志信息", required = true) @RequestBody OperateLogEntity operateLogEntity) {
+        int result = operateLogService.insert(operateLogEntity);
+
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+    /**
+     * 修改一条数据
+     *
+     * @param operateLogEntity 实体类
+     * @return Response对象
+     */
+    @RequestMapping(value = "update", method = RequestMethod.POST)
+    @ApiOperation(value = "修改操作日志信息")
+    public AjaxMessage<Integer> update(@ApiParam(value = "操作日志信息", required = true) @RequestBody OperateLogEntity operateLogEntity) {
+        int result = operateLogService.update(operateLogEntity);
+        return new AjaxMessage<>(ResultStatus.OK, result);
+
+    }
+
+    /**
+     * 单条删除数据
+     *
+     * @param id
+     * @return Response对象
+     */
+    @RequestMapping(value = "delete", method = RequestMethod.POST)
+    @ApiOperation(value = "删除操作日志信息")
+    public AjaxMessage<Integer> delete(@ApiParam(value = "操作日志信息", required = true) @RequestParam Integer id) {
+        int result = operateLogService.deleteById(id);
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+
+    /**
+     * 分页查询
+     *
+     * @param pageNum  偏移
+     * @param pageSize 条数
+     * @return Response对象
+     */
+    @RequestMapping(value = "selectPage", method = RequestMethod.POST)
+    @ApiOperation(value = "查询操作日志信息列表")
+    public AjaxMessage<Pagination<OperateLogDto>> selectPage(
+            @ApiParam(value = "操作日志信息", required = true) @RequestBody OperateLogDto operateLogDto,
+            @ApiParam(value = "页数,非必传,默认第一页",  defaultValue = "1")  int pageNum,
+            @ApiParam(value = "条数,非必传,默认15条",  defaultValue = "30")  int pageSize
+
+    ) {
+        IPage<OperateLogDto> iPage = new Page<>(pageNum, pageSize);
+
+        iPage = operateLogService.selectPage(iPage, operateLogDto);
+
+        Pagination<OperateLogDto> pages = new Pagination<>(iPage);
+
+        return new AjaxMessage<>(ResultStatus.OK, pages);
+    }
+}

+ 7 - 8
user_center/src/main/java/com/huaxu/controller/TenantController.java

@@ -19,15 +19,14 @@ import org.springframework.web.multipart.MultipartFile;
 import java.io.IOException;
 import java.util.List;
 
-/**
- * 租户(Tenant)控制层
- *
- * @author makejava
- * @since 2020-10-20 16:56:39
+ /**
+ * @description 租户(Tenant)控制层
+ * @auto wangli
+ * @data 2020-10-26 15:44
  */
 @RestController
 @RequestMapping("/tenant")
-@Api(tags = "租户接口")
+@Api(tags = "租户管理")
 public class TenantController {
     /**
      * 租户
@@ -46,7 +45,7 @@ public class TenantController {
     @RequestMapping(value = "get", method = RequestMethod.POST)
     @ApiOperation(value = "根据id查询租户")
     public AjaxMessage<TenantEntity> selectOne(
-            @ApiParam(value = "租户信息", required = true) Integer id) {
+            @ApiParam(value = "租户信息", required = true) @RequestParam Integer id) {
         TenantEntity result = tenantService.selectById(id);
 
         return new AjaxMessage<>(ResultStatus.OK, result);
@@ -121,7 +120,7 @@ public class TenantController {
      */
     @RequestMapping(value = "delete", method = RequestMethod.POST)
     @ApiOperation(value = "删除租户信息")
-    public AjaxMessage<Integer> delete(@ApiParam(value = "租户信息", required = true) Integer id) {
+    public AjaxMessage<Integer> delete(@ApiParam(value = "租户信息", required = true) @RequestParam Integer id) {
         int result = tenantService.deleteById(id);
         return new AjaxMessage<>(ResultStatus.OK, result);
     }

+ 81 - 0
user_center/src/main/java/com/huaxu/dao/LoginLogMapper.java

@@ -0,0 +1,81 @@
+package com.huaxu.dao;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.huaxu.dto.LoginLogDto;
+import com.huaxu.entity.LoginLogEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * @description 登录日志数据层
+ * @auto wangli
+ * @data 2020-10-26 17:05
+ */
+@Mapper
+public interface LoginLogMapper {
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    LoginLogDto selectById(Integer id);
+
+    /**
+     * 查询全部
+     *
+     * @return 对象列表
+     */
+    List<LoginLogDto> selectAll();
+
+    /**
+     * 通过实体作为筛选条件查询
+     *
+     * @param loginLogEntity 实例对象
+     * @return 对象列表
+     */
+    List<LoginLogDto> selectList(LoginLogEntity loginLogEntity);
+
+    /**
+     * 新增数据
+     *
+     * @param loginLogEntity 实例对象
+     * @return 影响行数
+     */
+    int insert(LoginLogEntity loginLogEntity);
+
+    /**
+     * 批量新增
+     *
+     * @param loginLogEntities 实例对象的集合
+     * @return 影响行数
+     */
+    int batchInsert(List<LoginLogEntity> loginLogEntities);
+
+    /**
+     * 修改数据
+     *
+     * @param loginLogEntity 实例对象
+     * @return 影响行数
+     */
+    int update(LoginLogEntity loginLogEntity);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+    /**
+     * 查询总数据数
+     *
+     * @return 数据总数
+     */
+    int count();
+
+    IPage<LoginLogDto> selectPage(IPage<LoginLogDto> page, LoginLogDto loginLogDto);
+
+}

+ 80 - 0
user_center/src/main/java/com/huaxu/dao/OperateLogMapper.java

@@ -0,0 +1,80 @@
+package com.huaxu.dao;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.huaxu.dto.OperateLogDto;
+import com.huaxu.entity.OperateLogEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * @description 操作日志数据层
+ * @auto wangli
+ * @data 2020-10-26 17:04
+ */
+@Mapper
+public interface OperateLogMapper {
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    OperateLogDto selectById(Integer id);
+
+    /**
+     * 查询全部
+     *
+     * @return 对象列表
+     */
+    List<OperateLogDto> selectAll();
+
+    /**
+     * 通过实体作为筛选条件查询
+     *
+     * @param operateLogDto 实例对象
+     * @return 对象列表
+     */
+    List<OperateLogDto> selectList(OperateLogDto operateLogDto);
+
+    /**
+     * 新增数据
+     *
+     * @param operateLogEntity 实例对象
+     * @return 影响行数
+     */
+    int insert(OperateLogEntity operateLogEntity);
+
+    /**
+     * 批量新增
+     *
+     * @param loginLogEntities 实例对象的集合
+     * @return 影响行数
+     */
+    int batchInsert(List<OperateLogEntity> loginLogEntities);
+
+    /**
+     * 修改数据
+     *
+     * @param operateLogEntity 实例对象
+     * @return 影响行数
+     */
+    int update(OperateLogEntity operateLogEntity);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+    /**
+     * 查询总数据数
+     *
+     * @return 数据总数
+     */
+    int count();
+
+    IPage<OperateLogDto> selectPage(IPage<OperateLogDto> page, OperateLogDto operateLogDto);
+}

+ 7 - 7
user_center/src/main/java/com/huaxu/dao/TenantMapper.java

@@ -32,18 +32,18 @@ public interface TenantMapper {
     /**
      * 通过实体作为筛选条件查询
      *
-     * @param TenantEntity 实例对象
+     * @param tenantEntity 实例对象
      * @return 对象列表
      */
-    List<TenantEntity> selectList(TenantEntity TenantEntity);
+    List<TenantEntity> selectList(TenantEntity tenantEntity);
 
     /**
      * 新增数据
      *
-     * @param TenantEntity 实例对象
+     * @param tenantEntity 实例对象
      * @return 影响行数
      */
-    int insert(TenantEntity TenantEntity);
+    int insert(TenantEntity tenantEntity);
 
     /**
      * 批量新增
@@ -56,10 +56,10 @@ public interface TenantMapper {
     /**
      * 修改数据
      *
-     * @param TenantEntity 实例对象
+     * @param tenantEntity 实例对象
      * @return 影响行数
      */
-    int update(TenantEntity TenantEntity);
+    int update(TenantEntity tenantEntity);
 
     /**
      * 通过主键删除数据
@@ -76,7 +76,7 @@ public interface TenantMapper {
      */
     int count();
 
-    IPage<TenantEntity> selectPage(IPage<TenantEntity> page, TenantEntity TenantEntity);
+    IPage<TenantEntity> selectPage(IPage<TenantEntity> page, TenantEntity tenantEntity);
 
 
 

+ 32 - 0
user_center/src/main/java/com/huaxu/dto/LoginLogDto.java

@@ -0,0 +1,32 @@
+package com.huaxu.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.huaxu.entity.LoginLogEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @description
+ * @auto wangli
+ * @data 2020-10-26 17:40
+ */
+@Data
+public class LoginLogDto extends LoginLogEntity {
+
+    @ApiModelProperty(value = "公司名称")
+    private String companyName;
+    @ApiModelProperty(value = "部门名称")
+    private String departmentName;
+
+    @ApiModelProperty(value = "查询条件(用户名/手机号)")
+    private String condition;
+    @ApiModelProperty(value = "查询条件(起始时间)" )
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date beginTime;
+
+    @ApiModelProperty(value = "查询条件(终止时间)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+}

+ 31 - 0
user_center/src/main/java/com/huaxu/dto/OperateLogDto.java

@@ -0,0 +1,31 @@
+package com.huaxu.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.huaxu.entity.OperateLogEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @description
+ * @auto wangli
+ * @data 2020-10-26 17:40
+ */
+@Data
+public class OperateLogDto extends OperateLogEntity {
+
+    @ApiModelProperty(value = "公司名称")
+    private String companyName;
+    @ApiModelProperty(value = "部门名称")
+    private String departmentName;
+
+    @ApiModelProperty(value = "查询条件(用户名/手机号)")
+    private String condition;
+    @ApiModelProperty(value = "查询条件(起始时间)" )
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date beginTime;
+    @ApiModelProperty(value = "查询条件(终止时间)" )
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+}

+ 37 - 0
user_center/src/main/java/com/huaxu/entity/LoginLogEntity.java

@@ -0,0 +1,37 @@
+package com.huaxu.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @description 登录日志实体类(uims_login_log)
+ * @auto wangli
+ * @data 2020-10-26 15:51
+ */
+@Data
+public class LoginLogEntity implements Serializable {
+
+    private static final long serialVersionUID = 2497615333704709016L;
+
+    @ApiModelProperty(value = "主键id")
+    private Long id ;
+    @ApiModelProperty(value = "用户名")
+    private String name;
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+    @ApiModelProperty(value = "公司id")
+    private Integer companyId;
+    @ApiModelProperty(value = "部门id")
+    private Integer departmentId;
+    @ApiModelProperty(value = "登录类型")
+    private Integer type;
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+    @ApiModelProperty(value = "登录IP")
+    private String loginIp;
+}

+ 36 - 0
user_center/src/main/java/com/huaxu/entity/OperateLogEntity.java

@@ -0,0 +1,36 @@
+package com.huaxu.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @description 操作日志实体类(uims_opr_log)
+ * @auto wangli
+ * @data 2020-10-26 15:53
+ */
+@Data
+public class OperateLogEntity implements Serializable {
+
+    private static final long serialVersionUID = 7048815501996712070L;
+
+    @ApiModelProperty(value = "主键id")
+    private Long id ;
+    @ApiModelProperty(value = "用户名")
+    private String userName;
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+    @ApiModelProperty(value = "公司id")
+    private Integer companyId;
+    @ApiModelProperty(value = "部门id")
+    private Integer departmentId;
+    @ApiModelProperty(value = "操作内容")
+    private String operateContent;
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+}

+ 4 - 4
user_center/src/main/java/com/huaxu/entity/TenantEntity.java

@@ -8,11 +8,11 @@ import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 import java.time.LocalDateTime;
 
-/**
- * 租户实体类(uims_tenant)
- * @description
+
+ /**
+ * @description 租户实体类(uims_tenant)
  * @auto wangli
- * @data 2020-10-26 9:43
+ * @data 2020-10-26 15:44
  */
 @Data
 @ApiModel("租户信息")

+ 80 - 0
user_center/src/main/java/com/huaxu/service/LoginLogService.java

@@ -0,0 +1,80 @@
+package com.huaxu.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.huaxu.dto.LoginLogDto;
+import com.huaxu.entity.LoginLogEntity;
+
+import java.util.List;
+
+/**
+ * @description 登录日志接口
+ * @auto wangli
+ * @data 2020-10-27 8:59
+ */
+public interface LoginLogService {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    LoginLogDto selectById(Integer id);
+
+    /**
+     * 查询全部
+     *
+     * @return 对象列表
+     */
+    List<LoginLogDto> selectAll();
+
+    /**
+     * 通过实体作为筛选条件查询
+     *
+     * @param loginLogEntity 实例对象
+     * @return 对象列表
+     */
+    List<LoginLogDto> selectList(LoginLogEntity loginLogEntity);
+
+    /**
+     * 新增数据
+     *
+     * @param loginLogEntity 实例对象
+     * @return 影响行数
+     */
+    int insert(LoginLogEntity loginLogEntity);
+
+    /**
+     * 批量新增
+     *
+     * @param loginLogEntities 实例对象的集合
+     * @return 影响行数
+     */
+    int batchInsert(List<LoginLogEntity> loginLogEntities);
+
+    /**
+     * 修改数据
+     *
+     * @param loginLogEntity 实例对象
+     * @return 影响行数
+     */
+    int update(LoginLogEntity loginLogEntity);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+    /**
+     * 查询总数据数
+     *
+     * @return 数据总数
+     */
+    int count();
+
+    IPage<LoginLogDto> selectPage(IPage<LoginLogDto> page, LoginLogDto loginLogDto);
+
+}

+ 78 - 0
user_center/src/main/java/com/huaxu/service/OperateLogService.java

@@ -0,0 +1,78 @@
+package com.huaxu.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.huaxu.dto.OperateLogDto;
+import com.huaxu.entity.OperateLogEntity;
+
+import java.util.List;
+
+/**
+ * @description 操作日志接口
+ * @auto wangli
+ * @data 2020-10-27 8:59
+ */
+public interface OperateLogService {
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    OperateLogDto selectById(Integer id);
+
+    /**
+     * 查询全部
+     *
+     * @return 对象列表
+     */
+    List<OperateLogDto> selectAll();
+
+    /**
+     * 通过实体作为筛选条件查询
+     *
+     * @param operateLogDto 实例对象
+     * @return 对象列表
+     */
+    List<OperateLogDto> selectList(OperateLogDto operateLogDto);
+
+    /**
+     * 新增数据
+     *
+     * @param operateLogEntity 实例对象
+     * @return 影响行数
+     */
+    int insert(OperateLogEntity operateLogEntity);
+
+    /**
+     * 批量新增
+     *
+     * @param loginLogEntities 实例对象的集合
+     * @return 影响行数
+     */
+    int batchInsert(List<OperateLogEntity> loginLogEntities);
+
+    /**
+     * 修改数据
+     *
+     * @param operateLogEntity 实例对象
+     * @return 影响行数
+     */
+    int update(OperateLogEntity operateLogEntity);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+    /**
+     * 查询总数据数
+     *
+     * @return 数据总数
+     */
+    int count();
+
+    IPage<OperateLogDto> selectPage(IPage<OperateLogDto> page, OperateLogDto operateLogDto);
+}

+ 3 - 4
user_center/src/main/java/com/huaxu/service/TenantService.java

@@ -6,10 +6,9 @@ import com.huaxu.entity.TenantEntity;
 import java.util.List;
 
 /**
- * 租户(Tenant)表服务接口
- *
- * @author makejava
- * @since 2020-10-20 17:08:13
+ * @description 租户管理接口
+ * @auto wangli
+ * @data 2020-10-26 15:44
  */
 public interface TenantService {
 

+ 68 - 0
user_center/src/main/java/com/huaxu/service/impl/LoginLogServiceImpl.java

@@ -0,0 +1,68 @@
+package com.huaxu.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.huaxu.dao.LoginLogMapper;
+import com.huaxu.dto.LoginLogDto;
+import com.huaxu.entity.LoginLogEntity;
+import com.huaxu.service.LoginLogService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @description 登录日志管理实现类
+ * @auto wangli
+ * @data 2020-10-27 9:03
+ */
+@Service("loginLogService")
+public class LoginLogServiceImpl implements LoginLogService {
+
+    @Resource
+    private LoginLogMapper loginLogMapper;
+
+    @Override
+    public LoginLogDto selectById(Integer id) {
+        return loginLogMapper.selectById(id);
+    }
+
+    @Override
+    public List<LoginLogDto> selectAll() {
+        return loginLogMapper.selectAll();
+    }
+
+    @Override
+    public List<LoginLogDto> selectList(LoginLogEntity loginLogEntity) {
+        return loginLogMapper.selectList(loginLogEntity);
+    }
+
+    @Override
+    public int insert(LoginLogEntity loginLogEntity) {
+        return loginLogMapper.insert(loginLogEntity);
+    }
+
+    @Override
+    public int batchInsert(List<LoginLogEntity> loginLogEntities) {
+        return loginLogMapper.batchInsert(loginLogEntities);
+    }
+
+    @Override
+    public int update(LoginLogEntity loginLogEntity) {
+        return loginLogMapper.update(loginLogEntity);
+    }
+
+    @Override
+    public int deleteById(Integer id) {
+        return loginLogMapper.deleteById(id);
+    }
+
+    @Override
+    public int count() {
+        return loginLogMapper.count();
+    }
+
+    @Override
+    public IPage<LoginLogDto> selectPage(IPage<LoginLogDto> page, LoginLogDto loginLogDto) {
+        return loginLogMapper.selectPage(page, loginLogDto);
+    }
+}

+ 68 - 0
user_center/src/main/java/com/huaxu/service/impl/OperateLogServiceImpl.java

@@ -0,0 +1,68 @@
+package com.huaxu.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.huaxu.dao.OperateLogMapper;
+import com.huaxu.dto.OperateLogDto;
+import com.huaxu.entity.OperateLogEntity;
+import com.huaxu.service.OperateLogService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @description  操作日志管理实现类
+ * @auto wangli
+ * @data 2020-10-27 9:03
+ */
+@Service("operateLogService")
+public class OperateLogServiceImpl implements OperateLogService {
+
+    @Resource
+    private OperateLogMapper operateLogMapper;
+
+    @Override
+    public OperateLogDto selectById(Integer id) {
+        return operateLogMapper.selectById(id);
+    }
+
+    @Override
+    public List<OperateLogDto> selectAll() {
+        return operateLogMapper.selectAll();
+    }
+
+    @Override
+    public List<OperateLogDto> selectList(OperateLogDto operateLogDto) {
+        return operateLogMapper.selectList(operateLogDto);
+    }
+
+    @Override
+    public int insert(OperateLogEntity operateLogEntity) {
+        return operateLogMapper.insert(operateLogEntity);
+    }
+
+    @Override
+    public int batchInsert(List<OperateLogEntity> loginLogEntities) {
+        return operateLogMapper.batchInsert(loginLogEntities);
+    }
+
+    @Override
+    public int update(OperateLogEntity operateLogEntity) {
+        return operateLogMapper.update(operateLogEntity);
+    }
+
+    @Override
+    public int deleteById(Integer id) {
+        return operateLogMapper.deleteById(id);
+    }
+
+    @Override
+    public int count() {
+        return operateLogMapper.count();
+    }
+
+    @Override
+    public IPage<OperateLogDto> selectPage(IPage<OperateLogDto> page, OperateLogDto operateLogDto) {
+        return operateLogMapper.selectPage(page, operateLogDto);
+    }
+}

+ 5 - 5
user_center/src/main/java/com/huaxu/service/impl/TenantServiceImpl.java

@@ -9,11 +9,11 @@ import org.springframework.stereotype.Service;
 
 import java.util.List;
 
-/**
- * 租户(App表)服务实现类
- *
- * @author makejava
- * @since 2020-10-20 17:08:14
+
+ /**
+ * @description 租户管理实现类
+ * @auto wangli
+ * @data 2020-10-26 15:44
  */
 @Service("tenantService")
 public class TenantServiceImpl implements TenantService {

+ 159 - 0
user_center/src/main/resources/mapper/LoginLog.xml

@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.huaxu.dao.LoginLogMapper">
+
+    <!-- 结果集 -->
+    <resultMap type="com.huaxu.dto.LoginLogDto" id="LoginLogMap">
+        <result property="id" column="id" jdbcType="BIGINT"/>
+        <result property="name" column="name" jdbcType="VARCHAR"/>
+        <result property="phone" column="phone" jdbcType="VARCHAR"/>
+        <result property="companyId" column="company_id" jdbcType="INTEGER"/>
+        <result property="departmentId" column="DEPARTMENT_ID" jdbcType="INTEGER"/>
+        <result property="type" column="type" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="loginIp" column="login_ip" jdbcType="VARCHAR"/>
+        <result property="companyName" column="companyName" jdbcType="VARCHAR"/>
+        <result property="departmentName" column="departmentName" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <!-- 基本字段 -->
+    <sql id="Base_Column_List">
+        a.id,
+        a.name,
+        a.phone,
+        a.company_id,
+        a.DEPARTMENT_ID,
+        a.type,
+        a.create_time,
+        a.login_ip,
+        com.ORG_NAME as "companyName",
+        dep.ORG_NAME as "departmentName"
+    </sql>
+    <!-- 外联表  -->
+    <sql id="loginLogJoins">
+        left join uims_org com on com.id = a.company_id
+        left join uims_org dep on dep.id = a.DEPARTMENT_ID
+    </sql>
+
+    <!-- 查询单个 -->
+    <select id="selectById" resultMap="LoginLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_login_log a
+        <include refid="loginLogJoins"/>
+        where a.id = #{id}
+    </select>
+    <!-- 查询全部 -->
+    <select id="selectAll" resultMap="LoginLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_login_log a
+        <include refid="loginLogJoins"/>
+    </select>
+    <!--通过实体作为筛选条件查询-->
+    <select id="selectList" resultMap="LoginLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_login_log a
+        <include refid="loginLogJoins"/>
+        <where>
+            <if test="id != null">
+                and a.id = #{id}
+            </if>
+            <if test="condition != null and condition != ''">
+                and (a.name like concat('%', #{condition},'%')
+                    or a.phone like concat('%', #{condition},'%'))
+            </if>
+            <if test="companyId != null">
+                and a.company_id = #{companyId}
+            </if>
+            <if test="departmentId != null">
+                and a.DEPARTMENT_ID = #{departmentId}
+            </if>
+            <if test="beginTime != null">
+                and a.create_time >= #{beginTime}
+            </if>
+            <if test="endTime != null">
+                and a.create_time &lt;= #{endTime}
+            </if>
+        </where>
+    </select>
+    <!-- 新增所有列 -->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into uims_login_log( name, phone, company_id, DEPARTMENT_ID, type, create_time, login_ip)
+        values (  #{name}, #{phone}, #{companyId}, #{departmentId}, #{type}, #{createTime}, #{loginIp})
+    </insert>
+    <!-- 批量新增 -->
+    <insert id="batchInsert">
+        insert into uims_login_log( name, phone, company_id, DEPARTMENT_ID, type, create_time, login_ip)
+        values
+        <foreach collection="loginLogs" item="item" index="index" separator=",">
+            ( #{item.name}, #{item.phone}, #{item.companyId}, #{item.departmentId}, #{item.type},
+            #{item.createTime}, #{item.loginIp} )
+        </foreach>
+    </insert>
+    <!-- 通过主键修改数据 -->
+    <update id="update">
+        update uims.uims_login_log
+        <set>
+            <if test="name != null and name != ''">
+                name = #{name},
+            </if>
+            <if test="phone != null and phone != ''">
+                phone = #{phone},
+            </if>
+            <if test="companyId != null">
+                company_id = #{companyId},
+            </if>
+            <if test="departmentId != null">
+                DEPARTMENT_ID = #{departmentId},
+            </if>
+            <if test="type != null and type != ''">
+                type = #{type},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+            <if test="loginIp != null and loginIp != ''">
+                login_ip = #{loginIp},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete from uims_login_log where id = #{id}
+    </delete>
+    <!-- 总数 -->
+    <select id="count" resultType="int">
+        select count(*) from uims_login_log
+    </select>
+    <select id="selectPage" resultMap="LoginLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_login_log a
+        <include refid="loginLogJoins"/>
+        <where>
+            <if test="id != null">
+                and a.id = #{loginLogDto.id}
+            </if>
+            <if test="condition != null and condition != ''">
+                and (a.name like concat('%', #{loginLogDto.condition},'%')
+                or a.phone like concat('%', #{loginLogDto.condition},'%'))
+            </if>
+            <if test="companyId != null">
+                and a.company_id = #{loginLogDto.companyId}
+            </if>
+            <if test="departmentId != null">
+                and a.DEPARTMENT_ID = #{loginLogDto.departmentId}
+            </if>
+            <if test="beginTime != null">
+                and a.create_time >= #{loginLogDto.beginTime}
+            </if>
+            <if test="endTime != null">
+                and a.create_time &lt;= #{loginLogDto.endTime}
+            </if>
+        </where>
+    </select>
+
+</mapper>

+ 154 - 0
user_center/src/main/resources/mapper/OperateLog.xml

@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.huaxu.dao.OperateLogMapper">
+
+
+    <!-- 结果集 -->
+    <resultMap type="com.huaxu.dto.OperateLogDto" id="OperateLogMap">
+        <result property="id" column="ID" jdbcType="BIGINT"/>
+        <result property="userName" column="USER_NAME" jdbcType="VARCHAR"/>
+        <result property="phone" column="PHONE" jdbcType="VARCHAR"/>
+        <result property="companyId" column="COMPANY_ID" jdbcType="INTEGER"/>
+        <result property="departmentId" column="DEPARTMENT_ID" jdbcType="INTEGER"/>
+        <result property="operateContent" column="OPERATE_CONTENT" jdbcType="VARCHAR"/>
+        <result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
+        <result property="companyName" column="companyName" jdbcType="VARCHAR"/>
+        <result property="departmentName" column="departmentName" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <!-- 基本字段 -->
+    <sql id="Base_Column_List">
+        a.id,
+        a.USER_NAME,
+        a.phone,
+        a.company_id,
+        a.DEPARTMENT_ID,
+        a.operate_content,
+        a.create_time,
+        com.ORG_NAME as "companyName",
+        dep.ORG_NAME as "departmentName"
+    </sql>
+    <!-- 外联表  -->
+    <sql id="loginLogJoins">
+        left join uims_org com on com.id = a.company_id
+        left join uims_org dep on dep.id = a.DEPARTMENT_ID
+    </sql>
+
+    <!-- 查询单个 -->
+    <select id="selectById" resultMap="OperateLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_opr_log a
+        <include refid="loginLogJoins"/>
+        where a.id = #{id}
+    </select>
+    <!-- 查询全部 -->
+    <select id="selectAll" resultMap="OperateLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_opr_log a
+        <include refid="loginLogJoins"/>
+    </select>
+    <!--通过实体作为筛选条件查询-->
+    <select id="selectList" resultMap="OperateLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_opr_log a
+        <include refid="loginLogJoins"/>
+        <where>
+            <if test="id != null">
+                and a.id = #{id}
+            </if>
+            <if test="condition != null and condition != ''">
+                and (a.USER_NAME like concat('%', #{condition},'%')
+                or a.phone like concat('%', #{condition},'%'))
+            </if>
+            <if test="companyId != null">
+                and a.company_id = #{companyId}
+            </if>
+            <if test="departmentId != null">
+                and a.DEPARTMENT_ID = #{departmentId}
+            </if>
+            <if test="beginTime != null">
+                and a.create_time >= #{beginTime}
+            </if>
+            <if test="endTime != null">
+                and a.create_time &lt;= #{endTime}
+            </if>
+        </where>
+    </select>
+    <!-- 新增所有列 -->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into uims_opr_log( USER_NAME, phone, company_id, DEPARTMENT_ID, operate_content, create_time )
+        values ( #{userName}, #{phone}, #{companyId}, #{departmentId}, #{operateContent}, #{createTime})
+    </insert>
+    <!-- 批量新增 -->
+    <insert id="batchInsert">
+        insert into uims_opr_log( USER_NAME, phone, company_id, DEPARTMENT_ID, operate_content, create_time )
+        values
+        <foreach collection="loginLogs" item="item" index="index" separator=",">
+            ( #{item.userName}, #{item.phone}, #{item.companyId}, #{item.departmentId}, #{item.operateContent},
+            #{item.createTime})
+        </foreach>
+    </insert>
+    <!-- 通过主键修改数据 -->
+    <update id="update">
+        update uims.uims_opr_log
+        <set>
+            <if test="userName != null and userName != ''">
+                USER_NAME = #{userName},
+            </if>
+            <if test="phone != null and phone != ''">
+                phone = #{phone},
+            </if>
+            <if test="companyId != null">
+                company_id = #{companyId},
+            </if>
+            <if test="departmentId != null">
+                DEPARTMENT_ID = #{departmentId},
+            </if>
+            <if test="operateContent != null and operateContent != ''">
+                operate_content = #{operateContent},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete from uims_opr_log where id = #{id}
+    </delete>
+    <!-- 总数 -->
+    <select id="count" resultType="int">
+        select count(*) from uims_opr_log
+    </select>
+    <select id="selectPage" resultMap="OperateLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_opr_log a
+        <include refid="loginLogJoins"/>
+        <where>
+            <if test="id != null">
+                and a.id = #{operateLogDto.id}
+            </if>
+            <if test="condition != null and condition != ''">
+                and (a.USER_NAME like concat('%', #{operateLogDto.condition},'%')
+                or a.phone like concat('%', #{operateLogDto.condition},'%'))
+            </if>
+            <if test="companyId != null">
+                and a.company_id = #{operateLogDto.companyId}
+            </if>
+            <if test="departmentId != null">
+                and a.DEPARTMENT_ID = #{operateLogDto.departmentId}
+            </if>
+            <if test="beginTime != null">
+                and a.create_time >= #{operateLogDto.beginTime}
+            </if>
+            <if test="endTime != null">
+                and a.create_time &lt;= #{operateLogDto.endTime}
+            </if>
+        </where>
+    </select>
+</mapper>