hexiao hace 2 años
padre
commit
d8221c0b92
Se han modificado 46 ficheros con 661 adiciones y 1255 borrados
  1. 23 52
      base-system/src/main/java/com/ozs/system/domain/SysCache.java
  2. 2 0
      base-system/src/main/java/com/ozs/system/domain/SysConfig.java
  3. 38 102
      base-system/src/main/java/com/ozs/system/domain/SysLogininfor.java
  4. 41 74
      base-system/src/main/java/com/ozs/system/domain/SysNotice.java
  5. 62 190
      base-system/src/main/java/com/ozs/system/domain/SysOperLog.java
  6. 46 86
      base-system/src/main/java/com/ozs/system/domain/SysPost.java
  7. 19 28
      base-system/src/main/java/com/ozs/system/domain/SysRoleDept.java
  8. 19 28
      base-system/src/main/java/com/ozs/system/domain/SysRoleMenu.java
  9. 34 89
      base-system/src/main/java/com/ozs/system/domain/SysUserOnline.java
  10. 19 27
      base-system/src/main/java/com/ozs/system/domain/SysUserPost.java
  11. 19 28
      base-system/src/main/java/com/ozs/system/domain/SysUserRole.java
  12. 15 48
      base-system/src/main/java/com/ozs/system/domain/vo/MetaVo.java
  13. 8 91
      base-system/src/main/java/com/ozs/system/domain/vo/RouterVo.java
  14. 7 3
      base-system/src/main/java/com/ozs/system/mapper/SysDictDataMapper.java
  15. 6 2
      base-system/src/main/java/com/ozs/system/mapper/SysDictTypeMapper.java
  16. 6 2
      base-system/src/main/java/com/ozs/system/mapper/SysLogininforMapper.java
  17. 6 3
      base-system/src/main/java/com/ozs/system/mapper/SysMenuMapper.java
  18. 5 2
      base-system/src/main/java/com/ozs/system/mapper/SysNoticeMapper.java
  19. 5 2
      base-system/src/main/java/com/ozs/system/mapper/SysOperLogMapper.java
  20. 5 2
      base-system/src/main/java/com/ozs/system/mapper/SysPostMapper.java
  21. 5 2
      base-system/src/main/java/com/ozs/system/mapper/SysRoleDeptMapper.java
  22. 5 2
      base-system/src/main/java/com/ozs/system/mapper/SysRoleMapper.java
  23. 6 2
      base-system/src/main/java/com/ozs/system/mapper/SysRoleMenuMapper.java
  24. 6 3
      base-system/src/main/java/com/ozs/system/mapper/SysUserMapper.java
  25. 5 2
      base-system/src/main/java/com/ozs/system/mapper/SysUserPostMapper.java
  26. 6 3
      base-system/src/main/java/com/ozs/system/mapper/SysUserRoleMapper.java
  27. 5 3
      base-system/src/main/java/com/ozs/system/service/ISysDictDataService.java
  28. 3 2
      base-system/src/main/java/com/ozs/system/service/ISysDictTypeService.java
  29. 4 2
      base-system/src/main/java/com/ozs/system/service/ISysLogininforService.java
  30. 4 3
      base-system/src/main/java/com/ozs/system/service/ISysMenuService.java
  31. 4 2
      base-system/src/main/java/com/ozs/system/service/ISysNoticeService.java
  32. 4 2
      base-system/src/main/java/com/ozs/system/service/ISysOperLogService.java
  33. 3 2
      base-system/src/main/java/com/ozs/system/service/ISysPostService.java
  34. 5 4
      base-system/src/main/java/com/ozs/system/service/ISysRoleService.java
  35. 5 6
      base-system/src/main/java/com/ozs/system/service/ISysUserOnlineService.java
  36. 5 4
      base-system/src/main/java/com/ozs/system/service/ISysUserService.java
  37. 16 21
      base-system/src/main/java/com/ozs/system/service/impl/SysDictDataServiceImpl.java
  38. 24 44
      base-system/src/main/java/com/ozs/system/service/impl/SysDictTypeServiceImpl.java
  39. 9 10
      base-system/src/main/java/com/ozs/system/service/impl/SysLogininforServiceImpl.java
  40. 63 124
      base-system/src/main/java/com/ozs/system/service/impl/SysMenuServiceImpl.java
  41. 3 2
      base-system/src/main/java/com/ozs/system/service/impl/SysNoticeServiceImpl.java
  42. 8 12
      base-system/src/main/java/com/ozs/system/service/impl/SysOperLogServiceImpl.java
  43. 18 32
      base-system/src/main/java/com/ozs/system/service/impl/SysPostServiceImpl.java
  44. 44 82
      base-system/src/main/java/com/ozs/system/service/impl/SysRoleServiceImpl.java
  45. 14 24
      base-system/src/main/java/com/ozs/system/service/impl/SysUserOnlineServiceImpl.java
  46. 2 1
      base-system/src/main/java/com/ozs/system/service/impl/SysUserServiceImpl.java

+ 23 - 52
base-system/src/main/java/com/ozs/system/domain/SysCache.java

@@ -1,81 +1,52 @@
 package com.ozs.system.domain;
 
 import com.ozs.common.utils.StringUtils;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * 缓存信息
  *
  * @author hx
  */
-public class SysCache
-{
-    /** 缓存名称 */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class SysCache {
+    /**
+     * 缓存名称
+     */
     private String cacheName = "";
 
-    /** 缓存键名 */
+    /**
+     * 缓存键名
+     */
     private String cacheKey = "";
 
-    /** 缓存内容 */
+    /**
+     * 缓存内容
+     */
     private String cacheValue = "";
 
-    /** 备注 */
+    /**
+     * 备注
+     */
     private String remark = "";
 
-    public SysCache()
-    {
 
-    }
-
-    public SysCache(String cacheName, String remark)
-    {
+    public SysCache(String cacheName, String remark) {
         this.cacheName = cacheName;
         this.remark = remark;
     }
 
-    public SysCache(String cacheName, String cacheKey, String cacheValue)
-    {
+    public SysCache(String cacheName, String cacheKey, String cacheValue) {
         this.cacheName = StringUtils.replace(cacheName, ":", "");
         this.cacheKey = StringUtils.replace(cacheKey, cacheName, "");
         this.cacheValue = cacheValue;
     }
 
-    public String getCacheName()
-    {
-        return cacheName;
-    }
-
-    public void setCacheName(String cacheName)
-    {
-        this.cacheName = cacheName;
-    }
-
-    public String getCacheKey()
-    {
-        return cacheKey;
-    }
-
-    public void setCacheKey(String cacheKey)
-    {
-        this.cacheKey = cacheKey;
-    }
 
-    public String getCacheValue()
-    {
-        return cacheValue;
-    }
-
-    public void setCacheValue(String cacheValue)
-    {
-        this.cacheValue = cacheValue;
-    }
-
-    public String getRemark()
-    {
-        return remark;
-    }
-
-    public void setRemark(String remark)
-    {
-        this.remark = remark;
-    }
 }

+ 2 - 0
base-system/src/main/java/com/ozs/system/domain/SysConfig.java

@@ -4,6 +4,7 @@ import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.Size;
 
 import lombok.AllArgsConstructor;
+import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -20,6 +21,7 @@ import com.ozs.common.core.domain.BaseEntity;
 @Data
 @AllArgsConstructor
 @NoArgsConstructor
+@Builder
 public class SysConfig extends BaseEntity {
 
     /**

+ 38 - 102
base-system/src/main/java/com/ozs/system/domain/SysLogininfor.java

@@ -1,144 +1,80 @@
 package com.ozs.system.domain;
 
 import java.util.Date;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ozs.common.annotation.Excel;
 import com.ozs.common.annotation.Excel.ColumnType;
 import com.ozs.common.core.domain.BaseEntity;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * 系统访问记录表 sys_logininfor
  *
  * @author hx
  */
-public class SysLogininfor extends BaseEntity
-{
-    private static final long serialVersionUID = 1L;
-
-    /** ID */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class SysLogininfor extends BaseEntity {
+
+    /**
+     * ID
+     */
     @Excel(name = "序号", cellType = ColumnType.NUMERIC)
     private Long infoId;
 
-    /** 用户账号 */
+    /**
+     * 用户账号
+     */
     @Excel(name = "用户账号")
     private String userName;
 
-    /** 登录状态 0成功 1失败 */
+    /**
+     * 登录状态 0成功 1失败
+     */
     @Excel(name = "登录状态", readConverterExp = "0=成功,1=失败")
     private String status;
 
-    /** 登录IP地址 */
+    /**
+     * 登录IP地址
+     */
     @Excel(name = "登录地址")
     private String ipaddr;
 
-    /** 登录地点 */
+    /**
+     * 登录地点
+     */
     @Excel(name = "登录地点")
     private String loginLocation;
 
-    /** 浏览器类型 */
+    /**
+     * 浏览器类型
+     */
     @Excel(name = "浏览器")
     private String browser;
 
-    /** 操作系统 */
+    /**
+     * 操作系统
+     */
     @Excel(name = "操作系统")
     private String os;
 
-    /** 提示消息 */
+    /**
+     * 提示消息
+     */
     @Excel(name = "提示消息")
     private String msg;
 
-    /** 访问时间 */
+    /**
+     * 访问时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date loginTime;
 
-    public Long getInfoId()
-    {
-        return infoId;
-    }
-
-    public void setInfoId(Long infoId)
-    {
-        this.infoId = infoId;
-    }
-
-    public String getUserName()
-    {
-        return userName;
-    }
-
-    public void setUserName(String userName)
-    {
-        this.userName = userName;
-    }
-
-    public String getStatus()
-    {
-        return status;
-    }
-
-    public void setStatus(String status)
-    {
-        this.status = status;
-    }
-
-    public String getIpaddr()
-    {
-        return ipaddr;
-    }
-
-    public void setIpaddr(String ipaddr)
-    {
-        this.ipaddr = ipaddr;
-    }
-
-    public String getLoginLocation()
-    {
-        return loginLocation;
-    }
-
-    public void setLoginLocation(String loginLocation)
-    {
-        this.loginLocation = loginLocation;
-    }
-
-    public String getBrowser()
-    {
-        return browser;
-    }
-
-    public void setBrowser(String browser)
-    {
-        this.browser = browser;
-    }
-
-    public String getOs()
-    {
-        return os;
-    }
-
-    public void setOs(String os)
-    {
-        this.os = os;
-    }
-
-    public String getMsg()
-    {
-        return msg;
-    }
-
-    public void setMsg(String msg)
-    {
-        this.msg = msg;
-    }
-
-    public Date getLoginTime()
-    {
-        return loginTime;
-    }
-
-    public void setLoginTime(Date loginTime)
-    {
-        this.loginTime = loginTime;
-    }
 }

+ 41 - 74
base-system/src/main/java/com/ozs/system/domain/SysNotice.java

@@ -2,6 +2,11 @@ package com.ozs.system.domain;
 
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.Size;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ozs.common.core.domain.BaseEntity;
@@ -12,91 +17,53 @@ import com.ozs.common.xss.Xss;
  *
  * @author hx
  */
-public class SysNotice extends BaseEntity
-{
-    private static final long serialVersionUID = 1L;
-
-    /** 公告ID */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class SysNotice extends BaseEntity {
+
+    /**
+     * 公告ID
+     */
     private Long noticeId;
 
-    /** 公告标题 */
+    /**
+     * 公告标题
+     */
+    @Xss(message = "公告标题不能包含脚本字符")
+    @NotBlank(message = "公告标题不能为空")
+    @Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
     private String noticeTitle;
 
-    /** 公告类型(1通知 2公告) */
+    /**
+     * 公告类型(1通知 2公告)
+     */
     private String noticeType;
 
-    /** 公告内容 */
+    /**
+     * 公告内容
+     */
     private String noticeContent;
 
-    /** 公告状态(0正常 1关闭) */
+    /**
+     * 公告状态(0正常 1关闭)
+     */
     private String status;
 
-    public Long getNoticeId()
-    {
-        return noticeId;
-    }
-
-    public void setNoticeId(Long noticeId)
-    {
-        this.noticeId = noticeId;
-    }
-
-    public void setNoticeTitle(String noticeTitle)
-    {
-        this.noticeTitle = noticeTitle;
-    }
-
-    @Xss(message = "公告标题不能包含脚本字符")
-    @NotBlank(message = "公告标题不能为空")
-    @Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
-    public String getNoticeTitle()
-    {
-        return noticeTitle;
-    }
-
-    public void setNoticeType(String noticeType)
-    {
-        this.noticeType = noticeType;
-    }
-
-    public String getNoticeType()
-    {
-        return noticeType;
-    }
-
-    public void setNoticeContent(String noticeContent)
-    {
-        this.noticeContent = noticeContent;
-    }
-
-    public String getNoticeContent()
-    {
-        return noticeContent;
-    }
-
-    public void setStatus(String status)
-    {
-        this.status = status;
-    }
-
-    public String getStatus()
-    {
-        return status;
-    }
-
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("noticeId", getNoticeId())
-            .append("noticeTitle", getNoticeTitle())
-            .append("noticeType", getNoticeType())
-            .append("noticeContent", getNoticeContent())
-            .append("status", getStatus())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("noticeId", getNoticeId())
+                .append("noticeTitle", getNoticeTitle())
+                .append("noticeType", getNoticeType())
+                .append("noticeContent", getNoticeContent())
+                .append("status", getStatus())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
     }
 }

+ 62 - 190
base-system/src/main/java/com/ozs/system/domain/SysOperLog.java

@@ -1,255 +1,127 @@
 package com.ozs.system.domain;
 
 import java.util.Date;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ozs.common.annotation.Excel;
 import com.ozs.common.annotation.Excel.ColumnType;
 import com.ozs.common.core.domain.BaseEntity;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * 操作日志记录表 oper_log
  *
  * @author hx
  */
-public class SysOperLog extends BaseEntity
-{
-    private static final long serialVersionUID = 1L;
-
-    /** 日志主键 */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class SysOperLog extends BaseEntity {
+
+    /**
+     * 日志主键
+     */
     @Excel(name = "操作序号", cellType = ColumnType.NUMERIC)
     private Long operId;
 
-    /** 操作模块 */
+    /**
+     * 操作模块
+     */
     @Excel(name = "操作模块")
     private String title;
 
-    /** 业务类型(0其它 1新增 2修改 3删除) */
+    /**
+     * 业务类型(0其它 1新增 2修改 3删除)
+     */
     @Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据")
     private Integer businessType;
 
-    /** 业务类型数组 */
+    /**
+     * 业务类型数组
+     */
     private Integer[] businessTypes;
 
-    /** 请求方法 */
+    /**
+     * 请求方法
+     */
     @Excel(name = "请求方法")
     private String method;
 
-    /** 请求方式 */
+    /**
+     * 请求方式
+     */
     @Excel(name = "请求方式")
     private String requestMethod;
 
-    /** 操作类别(0其它 1后台用户 2手机端用户) */
+    /**
+     * 操作类别(0其它 1后台用户 2手机端用户)
+     */
     @Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
     private Integer operatorType;
 
-    /** 操作人员 */
+    /**
+     * 操作人员
+     */
     @Excel(name = "操作人员")
     private String operName;
 
-    /** 部门名称 */
+    /**
+     * 部门名称
+     */
     @Excel(name = "部门名称")
     private String deptName;
 
-    /** 请求url */
+    /**
+     * 请求url
+     */
     @Excel(name = "请求地址")
     private String operUrl;
 
-    /** 操作地址 */
+    /**
+     * 操作地址
+     */
     @Excel(name = "操作地址")
     private String operIp;
 
-    /** 操作地点 */
+    /**
+     * 操作地点
+     */
     @Excel(name = "操作地点")
     private String operLocation;
 
-    /** 请求参数 */
+    /**
+     * 请求参数
+     */
     @Excel(name = "请求参数")
     private String operParam;
 
-    /** 返回参数 */
+    /**
+     * 返回参数
+     */
     @Excel(name = "返回参数")
     private String jsonResult;
 
-    /** 操作状态(0正常 1异常) */
+    /**
+     * 操作状态(0正常 1异常)
+     */
     @Excel(name = "状态", readConverterExp = "0=正常,1=异常")
     private Integer status;
 
-    /** 错误消息 */
+    /**
+     * 错误消息
+     */
     @Excel(name = "错误消息")
     private String errorMsg;
 
-    /** 操作时间 */
+    /**
+     * 操作时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date operTime;
 
-    public Long getOperId()
-    {
-        return operId;
-    }
-
-    public void setOperId(Long operId)
-    {
-        this.operId = operId;
-    }
-
-    public String getTitle()
-    {
-        return title;
-    }
-
-    public void setTitle(String title)
-    {
-        this.title = title;
-    }
-
-    public Integer getBusinessType()
-    {
-        return businessType;
-    }
-
-    public void setBusinessType(Integer businessType)
-    {
-        this.businessType = businessType;
-    }
-
-    public Integer[] getBusinessTypes()
-    {
-        return businessTypes;
-    }
-
-    public void setBusinessTypes(Integer[] businessTypes)
-    {
-        this.businessTypes = businessTypes;
-    }
-
-    public String getMethod()
-    {
-        return method;
-    }
-
-    public void setMethod(String method)
-    {
-        this.method = method;
-    }
-
-    public String getRequestMethod()
-    {
-        return requestMethod;
-    }
-
-    public void setRequestMethod(String requestMethod)
-    {
-        this.requestMethod = requestMethod;
-    }
-
-    public Integer getOperatorType()
-    {
-        return operatorType;
-    }
-
-    public void setOperatorType(Integer operatorType)
-    {
-        this.operatorType = operatorType;
-    }
-
-    public String getOperName()
-    {
-        return operName;
-    }
-
-    public void setOperName(String operName)
-    {
-        this.operName = operName;
-    }
-
-    public String getDeptName()
-    {
-        return deptName;
-    }
-
-    public void setDeptName(String deptName)
-    {
-        this.deptName = deptName;
-    }
-
-    public String getOperUrl()
-    {
-        return operUrl;
-    }
-
-    public void setOperUrl(String operUrl)
-    {
-        this.operUrl = operUrl;
-    }
-
-    public String getOperIp()
-    {
-        return operIp;
-    }
-
-    public void setOperIp(String operIp)
-    {
-        this.operIp = operIp;
-    }
-
-    public String getOperLocation()
-    {
-        return operLocation;
-    }
-
-    public void setOperLocation(String operLocation)
-    {
-        this.operLocation = operLocation;
-    }
-
-    public String getOperParam()
-    {
-        return operParam;
-    }
-
-    public void setOperParam(String operParam)
-    {
-        this.operParam = operParam;
-    }
-
-    public String getJsonResult()
-    {
-        return jsonResult;
-    }
-
-    public void setJsonResult(String jsonResult)
-    {
-        this.jsonResult = jsonResult;
-    }
-
-    public Integer getStatus()
-    {
-        return status;
-    }
-
-    public void setStatus(Integer status)
-    {
-        this.status = status;
-    }
-
-    public String getErrorMsg()
-    {
-        return errorMsg;
-    }
-
-    public void setErrorMsg(String errorMsg)
-    {
-        this.errorMsg = errorMsg;
-    }
-
-    public Date getOperTime()
-    {
-        return operTime;
-    }
-
-    public void setOperTime(Date operTime)
-    {
-        this.operTime = operTime;
-    }
 }

+ 46 - 86
base-system/src/main/java/com/ozs/system/domain/SysPost.java

@@ -3,6 +3,11 @@ package com.ozs.system.domain;
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ozs.common.annotation.Excel;
@@ -14,111 +19,66 @@ import com.ozs.common.core.domain.BaseEntity;
  *
  * @author hx
  */
-public class SysPost extends BaseEntity
-{
-    private static final long serialVersionUID = 1L;
-
-    /** 岗位序号 */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class SysPost extends BaseEntity {
+
+    /**
+     * 岗位序号
+     */
     @Excel(name = "岗位序号", cellType = ColumnType.NUMERIC)
     private Long postId;
 
-    /** 岗位编码 */
+    /**
+     * 岗位编码
+     */
     @Excel(name = "岗位编码")
+    @NotBlank(message = "岗位编码不能为空")
+    @Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符")
     private String postCode;
 
-    /** 岗位名称 */
+    /**
+     * 岗位名称
+     */
     @Excel(name = "岗位名称")
+    @NotBlank(message = "岗位名称不能为空")
+    @Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符")
     private String postName;
 
-    /** 岗位排序 */
+    /**
+     * 岗位排序
+     */
     @Excel(name = "岗位排序")
+    @NotNull(message = "显示顺序不能为空")
     private Integer postSort;
 
-    /** 状态(0正常 1停用) */
+    /**
+     * 状态(0正常 1停用)
+     */
     @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
     private String status;
 
-    /** 用户是否存在此岗位标识 默认不存在 */
+    /**
+     * 用户是否存在此岗位标识 默认不存在
+     */
     private boolean flag = false;
 
-    public Long getPostId()
-    {
-        return postId;
-    }
-
-    public void setPostId(Long postId)
-    {
-        this.postId = postId;
-    }
-
-    @NotBlank(message = "岗位编码不能为空")
-    @Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符")
-    public String getPostCode()
-    {
-        return postCode;
-    }
-
-    public void setPostCode(String postCode)
-    {
-        this.postCode = postCode;
-    }
-
-    @NotBlank(message = "岗位名称不能为空")
-    @Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符")
-    public String getPostName()
-    {
-        return postName;
-    }
-
-    public void setPostName(String postName)
-    {
-        this.postName = postName;
-    }
-
-    @NotNull(message = "显示顺序不能为空")
-    public Integer getPostSort()
-    {
-        return postSort;
-    }
-
-    public void setPostSort(Integer postSort)
-    {
-        this.postSort = postSort;
-    }
-
-    public String getStatus()
-    {
-        return status;
-    }
-
-    public void setStatus(String status)
-    {
-        this.status = status;
-    }
-
-    public boolean isFlag()
-    {
-        return flag;
-    }
-
-    public void setFlag(boolean flag)
-    {
-        this.flag = flag;
-    }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("postId", getPostId())
-            .append("postCode", getPostCode())
-            .append("postName", getPostName())
-            .append("postSort", getPostSort())
-            .append("status", getStatus())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("postId", getPostId())
+                .append("postCode", getPostCode())
+                .append("postName", getPostName())
+                .append("postSort", getPostSort())
+                .append("status", getStatus())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
     }
 }

+ 19 - 28
base-system/src/main/java/com/ozs/system/domain/SysRoleDept.java

@@ -1,5 +1,9 @@
 package com.ozs.system.domain;
 
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
@@ -8,39 +12,26 @@ import org.apache.commons.lang3.builder.ToStringStyle;
  *
  * @author hx
  */
-public class SysRoleDept
-{
-    /** 角色ID */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class SysRoleDept {
+    /**
+     * 角色ID
+     */
     private Long roleId;
 
-    /** 部门ID */
+    /**
+     * 部门ID
+     */
     private Long deptId;
 
-    public Long getRoleId()
-    {
-        return roleId;
-    }
-
-    public void setRoleId(Long roleId)
-    {
-        this.roleId = roleId;
-    }
-
-    public Long getDeptId()
-    {
-        return deptId;
-    }
-
-    public void setDeptId(Long deptId)
-    {
-        this.deptId = deptId;
-    }
-
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("roleId", getRoleId())
-            .append("deptId", getDeptId())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("roleId", getRoleId())
+                .append("deptId", getDeptId())
+                .toString();
     }
 }

+ 19 - 28
base-system/src/main/java/com/ozs/system/domain/SysRoleMenu.java

@@ -1,5 +1,9 @@
 package com.ozs.system.domain;
 
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
@@ -8,39 +12,26 @@ import org.apache.commons.lang3.builder.ToStringStyle;
  *
  * @author hx
  */
-public class SysRoleMenu
-{
-    /** 角色ID */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class SysRoleMenu {
+    /**
+     * 角色ID
+     */
     private Long roleId;
 
-    /** 菜单ID */
+    /**
+     * 菜单ID
+     */
     private Long menuId;
 
-    public Long getRoleId()
-    {
-        return roleId;
-    }
-
-    public void setRoleId(Long roleId)
-    {
-        this.roleId = roleId;
-    }
-
-    public Long getMenuId()
-    {
-        return menuId;
-    }
-
-    public void setMenuId(Long menuId)
-    {
-        this.menuId = menuId;
-    }
-
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("roleId", getRoleId())
-            .append("menuId", getMenuId())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("roleId", getRoleId())
+                .append("menuId", getMenuId())
+                .toString();
     }
 }

+ 34 - 89
base-system/src/main/java/com/ozs/system/domain/SysUserOnline.java

@@ -1,113 +1,58 @@
 package com.ozs.system.domain;
 
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
 /**
  * 当前在线会话
  *
  * @author hx
  */
-public class SysUserOnline
-{
-    /** 会话编号 */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class SysUserOnline {
+    /**
+     * 会话编号
+     */
     private String tokenId;
 
-    /** 部门名称 */
+    /**
+     * 部门名称
+     */
     private String deptName;
 
-    /** 用户名称 */
+    /**
+     * 用户名称
+     */
     private String userName;
 
-    /** 登录IP地址 */
+    /**
+     * 登录IP地址
+     */
     private String ipaddr;
 
-    /** 登录地址 */
+    /**
+     * 登录地址
+     */
     private String loginLocation;
 
-    /** 浏览器类型 */
+    /**
+     * 浏览器类型
+     */
     private String browser;
 
-    /** 操作系统 */
+    /**
+     * 操作系统
+     */
     private String os;
 
-    /** 登录时间 */
+    /**
+     * 登录时间
+     */
     private Long loginTime;
 
-    public String getTokenId()
-    {
-        return tokenId;
-    }
-
-    public void setTokenId(String tokenId)
-    {
-        this.tokenId = tokenId;
-    }
-
-    public String getDeptName()
-    {
-        return deptName;
-    }
-
-    public void setDeptName(String deptName)
-    {
-        this.deptName = deptName;
-    }
-
-    public String getUserName()
-    {
-        return userName;
-    }
-
-    public void setUserName(String userName)
-    {
-        this.userName = userName;
-    }
-
-    public String getIpaddr()
-    {
-        return ipaddr;
-    }
-
-    public void setIpaddr(String ipaddr)
-    {
-        this.ipaddr = ipaddr;
-    }
-
-    public String getLoginLocation()
-    {
-        return loginLocation;
-    }
-
-    public void setLoginLocation(String loginLocation)
-    {
-        this.loginLocation = loginLocation;
-    }
-
-    public String getBrowser()
-    {
-        return browser;
-    }
-
-    public void setBrowser(String browser)
-    {
-        this.browser = browser;
-    }
-
-    public String getOs()
-    {
-        return os;
-    }
-
-    public void setOs(String os)
-    {
-        this.os = os;
-    }
-
-    public Long getLoginTime()
-    {
-        return loginTime;
-    }
-
-    public void setLoginTime(Long loginTime)
-    {
-        this.loginTime = loginTime;
-    }
 }

+ 19 - 27
base-system/src/main/java/com/ozs/system/domain/SysUserPost.java

@@ -1,5 +1,9 @@
 package com.ozs.system.domain;
 
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
@@ -8,39 +12,27 @@ import org.apache.commons.lang3.builder.ToStringStyle;
  *
  * @author hx
  */
-public class SysUserPost
-{
-    /** 用户ID */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class SysUserPost {
+    /**
+     * 用户ID
+     */
     private Long userId;
 
-    /** 岗位ID */
+    /**
+     * 岗位ID
+     */
     private Long postId;
 
-    public Long getUserId()
-    {
-        return userId;
-    }
-
-    public void setUserId(Long userId)
-    {
-        this.userId = userId;
-    }
-
-    public Long getPostId()
-    {
-        return postId;
-    }
-
-    public void setPostId(Long postId)
-    {
-        this.postId = postId;
-    }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("userId", getUserId())
-            .append("postId", getPostId())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("userId", getUserId())
+                .append("postId", getPostId())
+                .toString();
     }
 }

+ 19 - 28
base-system/src/main/java/com/ozs/system/domain/SysUserRole.java

@@ -1,5 +1,9 @@
 package com.ozs.system.domain;
 
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
@@ -8,39 +12,26 @@ import org.apache.commons.lang3.builder.ToStringStyle;
  *
  * @author hx
  */
-public class SysUserRole
-{
-    /** 用户ID */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class SysUserRole {
+    /**
+     * 用户ID
+     */
     private Long userId;
 
-    /** 角色ID */
+    /**
+     * 角色ID
+     */
     private Long roleId;
 
-    public Long getUserId()
-    {
-        return userId;
-    }
-
-    public void setUserId(Long userId)
-    {
-        this.userId = userId;
-    }
-
-    public Long getRoleId()
-    {
-        return roleId;
-    }
-
-    public void setRoleId(Long roleId)
-    {
-        this.roleId = roleId;
-    }
-
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("userId", getUserId())
-            .append("roleId", getRoleId())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("userId", getUserId())
+                .append("roleId", getRoleId())
+                .toString();
     }
 }

+ 15 - 48
base-system/src/main/java/com/ozs/system/domain/vo/MetaVo.java

@@ -1,14 +1,20 @@
 package com.ozs.system.domain.vo;
 
 import com.ozs.common.utils.StringUtils;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * 路由显示信息
  *
  * @author hx
  */
-public class MetaVo
-{
+@Data
+@NoArgsConstructor
+@Builder
+public class MetaVo {
     /**
      * 设置该路由在侧边栏和面包屑中展示的名字
      */
@@ -29,78 +35,39 @@ public class MetaVo
      */
     private String link;
 
-    public MetaVo()
-    {
-    }
 
-    public MetaVo(String title, String icon)
-    {
+    public MetaVo(String title, String icon) {
         this.title = title;
         this.icon = icon;
     }
 
-    public MetaVo(String title, String icon, boolean noCache)
-    {
+    public MetaVo(String title, String icon, boolean noCache) {
         this.title = title;
         this.icon = icon;
         this.noCache = noCache;
     }
 
-    public MetaVo(String title, String icon, String link)
-    {
+    public MetaVo(String title, String icon, String link) {
         this.title = title;
         this.icon = icon;
         this.link = link;
     }
 
-    public MetaVo(String title, String icon, boolean noCache, String link)
-    {
+    public MetaVo(String title, String icon, boolean noCache, String link) {
         this.title = title;
         this.icon = icon;
         this.noCache = noCache;
-        if (StringUtils.ishttp(link))
-        {
+        if (StringUtils.ishttp(link)) {
             this.link = link;
         }
     }
 
-    public boolean isNoCache()
-    {
+    public boolean isNoCache() {
         return noCache;
     }
 
-    public void setNoCache(boolean noCache)
-    {
+    public void setNoCache(boolean noCache) {
         this.noCache = noCache;
     }
 
-    public String getTitle()
-    {
-        return title;
-    }
-
-    public void setTitle(String title)
-    {
-        this.title = title;
-    }
-
-    public String getIcon()
-    {
-        return icon;
-    }
-
-    public void setIcon(String icon)
-    {
-        this.icon = icon;
-    }
-
-    public String getLink()
-    {
-        return link;
-    }
-
-    public void setLink(String link)
-    {
-        this.link = link;
-    }
 }

+ 8 - 91
base-system/src/main/java/com/ozs/system/domain/vo/RouterVo.java

@@ -1,6 +1,10 @@
 package com.ozs.system.domain.vo;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
 import java.util.List;
 
 /**
@@ -8,9 +12,11 @@ import java.util.List;
  *
  * @author hx
  */
+@Data
+@NoArgsConstructor
+@Builder
 @JsonInclude(JsonInclude.Include.NON_EMPTY)
-public class RouterVo
-{
+public class RouterVo {
     /**
      * 路由名字
      */
@@ -56,93 +62,4 @@ public class RouterVo
      */
     private List<RouterVo> children;
 
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String name)
-    {
-        this.name = name;
-    }
-
-    public String getPath()
-    {
-        return path;
-    }
-
-    public void setPath(String path)
-    {
-        this.path = path;
-    }
-
-    public boolean getHidden()
-    {
-        return hidden;
-    }
-
-    public void setHidden(boolean hidden)
-    {
-        this.hidden = hidden;
-    }
-
-    public String getRedirect()
-    {
-        return redirect;
-    }
-
-    public void setRedirect(String redirect)
-    {
-        this.redirect = redirect;
-    }
-
-    public String getComponent()
-    {
-        return component;
-    }
-
-    public void setComponent(String component)
-    {
-        this.component = component;
-    }
-
-    public String getQuery()
-    {
-        return query;
-    }
-
-    public void setQuery(String query)
-    {
-        this.query = query;
-    }
-
-    public Boolean getAlwaysShow()
-    {
-        return alwaysShow;
-    }
-
-    public void setAlwaysShow(Boolean alwaysShow)
-    {
-        this.alwaysShow = alwaysShow;
-    }
-
-    public MetaVo getMeta()
-    {
-        return meta;
-    }
-
-    public void setMeta(MetaVo meta)
-    {
-        this.meta = meta;
-    }
-
-    public List<RouterVo> getChildren()
-    {
-        return children;
-    }
-
-    public void setChildren(List<RouterVo> children)
-    {
-        this.children = children;
-    }
 }

+ 7 - 3
base-system/src/main/java/com/ozs/system/mapper/SysDictDataMapper.java

@@ -1,6 +1,10 @@
 package com.ozs.system.mapper;
 
 import java.util.List;
+
+import com.ozs.common.core.domain.entity.SysDept;
+import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import com.ozs.common.core.domain.entity.SysDictData;
 
@@ -9,8 +13,8 @@ import com.ozs.common.core.domain.entity.SysDictData;
  *
  * @author hx
  */
-public interface SysDictDataMapper
-{
+@Mapper
+public interface SysDictDataMapper extends JoinBaseMapper<SysDictData> {
     /**
      * 根据条件分页查询字典数据
      *
@@ -30,7 +34,7 @@ public interface SysDictDataMapper
     /**
      * 根据字典类型和字典键值查询字典数据信息
      *
-     * @param dictType 字典类型
+     * @param dictType  字典类型
      * @param dictValue 字典键值
      * @return 字典标签
      */

+ 6 - 2
base-system/src/main/java/com/ozs/system/mapper/SysDictTypeMapper.java

@@ -1,15 +1,19 @@
 package com.ozs.system.mapper;
 
 import java.util.List;
+
+import com.ozs.common.core.domain.entity.SysDictData;
 import com.ozs.common.core.domain.entity.SysDictType;
+import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 字典表 数据层
  *
  * @author hx
  */
-public interface SysDictTypeMapper
-{
+@Mapper
+public interface SysDictTypeMapper extends JoinBaseMapper<SysDictType> {
     /**
      * 根据条件分页查询字典类型
      *

+ 6 - 2
base-system/src/main/java/com/ozs/system/mapper/SysLogininforMapper.java

@@ -1,15 +1,19 @@
 package com.ozs.system.mapper;
 
 import java.util.List;
+
+import com.ozs.common.core.domain.entity.SysDictType;
 import com.ozs.system.domain.SysLogininfor;
+import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 系统访问日志情况信息 数据层
  *
  * @author hx
  */
-public interface SysLogininforMapper
-{
+@Mapper
+public interface SysLogininforMapper extends JoinBaseMapper<SysLogininfor> {
     /**
      * 新增系统登录日志
      *

+ 6 - 3
base-system/src/main/java/com/ozs/system/mapper/SysMenuMapper.java

@@ -1,6 +1,9 @@
 package com.ozs.system.mapper;
 
 import java.util.List;
+
+import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import com.ozs.common.core.domain.entity.SysMenu;
 
@@ -9,8 +12,8 @@ import com.ozs.common.core.domain.entity.SysMenu;
  *
  * @author hx
  */
-public interface SysMenuMapper
-{
+@Mapper
+public interface SysMenuMapper extends JoinBaseMapper<SysMenu> {
     /**
      * 查询系统菜单列表
      *
@@ -68,7 +71,7 @@ public interface SysMenuMapper
     /**
      * 根据角色ID查询菜单树信息
      *
-     * @param roleId 角色ID
+     * @param roleId            角色ID
      * @param menuCheckStrictly 菜单树选择项是否关联显示
      * @return 选中菜单列表
      */

+ 5 - 2
base-system/src/main/java/com/ozs/system/mapper/SysNoticeMapper.java

@@ -1,15 +1,18 @@
 package com.ozs.system.mapper;
 
 import java.util.List;
+
 import com.ozs.system.domain.SysNotice;
+import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 通知公告表 数据层
  *
  * @author hx
  */
-public interface SysNoticeMapper
-{
+@Mapper
+public interface SysNoticeMapper extends JoinBaseMapper<SysNotice> {
     /**
      * 查询公告信息
      *

+ 5 - 2
base-system/src/main/java/com/ozs/system/mapper/SysOperLogMapper.java

@@ -1,15 +1,18 @@
 package com.ozs.system.mapper;
 
 import java.util.List;
+
 import com.ozs.system.domain.SysOperLog;
+import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 操作日志 数据层
  *
  * @author hx
  */
-public interface SysOperLogMapper
-{
+@Mapper
+public interface SysOperLogMapper extends JoinBaseMapper<SysOperLog> {
     /**
      * 新增操作日志
      *

+ 5 - 2
base-system/src/main/java/com/ozs/system/mapper/SysPostMapper.java

@@ -1,15 +1,18 @@
 package com.ozs.system.mapper;
 
 import java.util.List;
+
 import com.ozs.system.domain.SysPost;
+import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 岗位信息 数据层
  *
  * @author hx
  */
-public interface SysPostMapper
-{
+@Mapper
+public interface SysPostMapper extends JoinBaseMapper<SysPost> {
     /**
      * 查询岗位数据集合
      *

+ 5 - 2
base-system/src/main/java/com/ozs/system/mapper/SysRoleDeptMapper.java

@@ -1,15 +1,18 @@
 package com.ozs.system.mapper;
 
 import java.util.List;
+
 import com.ozs.system.domain.SysRoleDept;
+import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 角色与部门关联表 数据层
  *
  * @author hx
  */
-public interface SysRoleDeptMapper
-{
+@Mapper
+public interface SysRoleDeptMapper extends JoinBaseMapper<SysRoleDept> {
     /**
      * 通过角色ID删除角色和部门关联
      *

+ 5 - 2
base-system/src/main/java/com/ozs/system/mapper/SysRoleMapper.java

@@ -1,15 +1,18 @@
 package com.ozs.system.mapper;
 
 import java.util.List;
+
 import com.ozs.common.core.domain.entity.SysRole;
+import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 角色表 数据层
  *
  * @author hx
  */
-public interface SysRoleMapper
-{
+@Mapper
+public interface SysRoleMapper extends JoinBaseMapper<SysRole> {
     /**
      * 根据条件分页查询角色数据
      *

+ 6 - 2
base-system/src/main/java/com/ozs/system/mapper/SysRoleMenuMapper.java

@@ -1,15 +1,19 @@
 package com.ozs.system.mapper;
 
 import java.util.List;
+
+import com.ozs.system.domain.SysRoleDept;
 import com.ozs.system.domain.SysRoleMenu;
+import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 角色与菜单关联表 数据层
  *
  * @author hx
  */
-public interface SysRoleMenuMapper
-{
+@Mapper
+public interface SysRoleMenuMapper extends JoinBaseMapper<SysRoleMenu> {
     /**
      * 查询菜单使用数量
      *

+ 6 - 3
base-system/src/main/java/com/ozs/system/mapper/SysUserMapper.java

@@ -1,6 +1,9 @@
 package com.ozs.system.mapper;
 
 import java.util.List;
+
+import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import com.ozs.common.core.domain.entity.SysUser;
 
@@ -9,8 +12,8 @@ import com.ozs.common.core.domain.entity.SysUser;
  *
  * @author hx
  */
-public interface SysUserMapper
-{
+@Mapper
+public interface SysUserMapper extends JoinBaseMapper<SysUser> {
     /**
      * 根据条件分页查询用户列表
      *
@@ -71,7 +74,7 @@ public interface SysUserMapper
      * 修改用户头像
      *
      * @param userName 用户名
-     * @param avatar 头像地址
+     * @param avatar   头像地址
      * @return 结果
      */
     public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar);

+ 5 - 2
base-system/src/main/java/com/ozs/system/mapper/SysUserPostMapper.java

@@ -1,15 +1,18 @@
 package com.ozs.system.mapper;
 
 import java.util.List;
+
 import com.ozs.system.domain.SysUserPost;
+import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 用户与岗位关联表 数据层
  *
  * @author hx
  */
-public interface SysUserPostMapper
-{
+@Mapper
+public interface SysUserPostMapper extends JoinBaseMapper<SysUserPost> {
     /**
      * 通过用户ID删除用户和岗位关联
      *

+ 6 - 3
base-system/src/main/java/com/ozs/system/mapper/SysUserRoleMapper.java

@@ -1,6 +1,9 @@
 package com.ozs.system.mapper;
 
 import java.util.List;
+
+import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import com.ozs.system.domain.SysUserRole;
 
@@ -9,8 +12,8 @@ import com.ozs.system.domain.SysUserRole;
  *
  * @author hx
  */
-public interface SysUserRoleMapper
-{
+@Mapper
+public interface SysUserRoleMapper extends JoinBaseMapper<SysUserRole> {
     /**
      * 通过用户ID删除用户和角色关联
      *
@@ -54,7 +57,7 @@ public interface SysUserRoleMapper
     /**
      * 批量取消授权用户角色
      *
-     * @param roleId 角色ID
+     * @param roleId  角色ID
      * @param userIds 需要删除的用户数据ID
      * @return 结果
      */

+ 5 - 3
base-system/src/main/java/com/ozs/system/service/ISysDictDataService.java

@@ -1,15 +1,17 @@
 package com.ozs.system.service;
 
 import java.util.List;
+
+import com.ozs.common.core.domain.entity.SysDept;
 import com.ozs.common.core.domain.entity.SysDictData;
+import icu.mhb.mybatisplus.plugln.base.service.JoinIService;
 
 /**
  * 字典 业务层
  *
  * @author hx
  */
-public interface ISysDictDataService
-{
+public interface ISysDictDataService extends JoinIService<SysDictData> {
     /**
      * 根据条件分页查询字典数据
      *
@@ -21,7 +23,7 @@ public interface ISysDictDataService
     /**
      * 根据字典类型和字典键值查询字典数据信息
      *
-     * @param dictType 字典类型
+     * @param dictType  字典类型
      * @param dictValue 字典键值
      * @return 字典标签
      */

+ 3 - 2
base-system/src/main/java/com/ozs/system/service/ISysDictTypeService.java

@@ -1,16 +1,17 @@
 package com.ozs.system.service;
 
 import java.util.List;
+
 import com.ozs.common.core.domain.entity.SysDictData;
 import com.ozs.common.core.domain.entity.SysDictType;
+import icu.mhb.mybatisplus.plugln.base.service.JoinIService;
 
 /**
  * 字典 业务层
  *
  * @author hx
  */
-public interface ISysDictTypeService
-{
+public interface ISysDictTypeService extends JoinIService<SysDictType> {
     /**
      * 根据条件分页查询字典类型
      *

+ 4 - 2
base-system/src/main/java/com/ozs/system/service/ISysLogininforService.java

@@ -1,15 +1,17 @@
 package com.ozs.system.service;
 
 import java.util.List;
+
+import com.ozs.common.core.domain.entity.SysDictType;
 import com.ozs.system.domain.SysLogininfor;
+import icu.mhb.mybatisplus.plugln.base.service.JoinIService;
 
 /**
  * 系统访问日志情况信息 服务层
  *
  * @author hx
  */
-public interface ISysLogininforService
-{
+public interface ISysLogininforService extends JoinIService<SysLogininfor> {
     /**
      * 新增系统登录日志
      *

+ 4 - 3
base-system/src/main/java/com/ozs/system/service/ISysMenuService.java

@@ -2,17 +2,18 @@ package com.ozs.system.service;
 
 import java.util.List;
 import java.util.Set;
+
 import com.ozs.common.core.domain.TreeSelect;
 import com.ozs.common.core.domain.entity.SysMenu;
 import com.ozs.system.domain.vo.RouterVo;
+import icu.mhb.mybatisplus.plugln.base.service.JoinIService;
 
 /**
  * 菜单 业务层
  *
  * @author hx
  */
-public interface ISysMenuService
-{
+public interface ISysMenuService extends JoinIService<SysMenu> {
     /**
      * 根据用户查询系统菜单列表
      *
@@ -24,7 +25,7 @@ public interface ISysMenuService
     /**
      * 根据用户查询系统菜单列表
      *
-     * @param menu 菜单信息
+     * @param menu   菜单信息
      * @param userId 用户ID
      * @return 菜单列表
      */

+ 4 - 2
base-system/src/main/java/com/ozs/system/service/ISysNoticeService.java

@@ -1,15 +1,17 @@
 package com.ozs.system.service;
 
 import java.util.List;
+
+import com.ozs.common.core.domain.entity.SysMenu;
 import com.ozs.system.domain.SysNotice;
+import icu.mhb.mybatisplus.plugln.base.service.JoinIService;
 
 /**
  * 公告 服务层
  *
  * @author hx
  */
-public interface ISysNoticeService
-{
+public interface ISysNoticeService extends JoinIService<SysNotice> {
     /**
      * 查询公告信息
      *

+ 4 - 2
base-system/src/main/java/com/ozs/system/service/ISysOperLogService.java

@@ -1,15 +1,17 @@
 package com.ozs.system.service;
 
 import java.util.List;
+
+import com.ozs.system.domain.SysNotice;
 import com.ozs.system.domain.SysOperLog;
+import icu.mhb.mybatisplus.plugln.base.service.JoinIService;
 
 /**
  * 操作日志 服务层
  *
  * @author hx
  */
-public interface ISysOperLogService
-{
+public interface ISysOperLogService extends JoinIService<SysOperLog> {
     /**
      * 新增操作日志
      *

+ 3 - 2
base-system/src/main/java/com/ozs/system/service/ISysPostService.java

@@ -1,15 +1,16 @@
 package com.ozs.system.service;
 
 import java.util.List;
+
 import com.ozs.system.domain.SysPost;
+import icu.mhb.mybatisplus.plugln.base.service.JoinIService;
 
 /**
  * 岗位信息 服务层
  *
  * @author hx
  */
-public interface ISysPostService
-{
+public interface ISysPostService extends JoinIService<SysPost> {
     /**
      * 查询岗位信息集合
      *

+ 5 - 4
base-system/src/main/java/com/ozs/system/service/ISysRoleService.java

@@ -2,16 +2,17 @@ package com.ozs.system.service;
 
 import java.util.List;
 import java.util.Set;
+
 import com.ozs.common.core.domain.entity.SysRole;
 import com.ozs.system.domain.SysUserRole;
+import icu.mhb.mybatisplus.plugln.base.service.JoinIService;
 
 /**
  * 角色业务层
  *
  * @author hx
  */
-public interface ISysRoleService
-{
+public interface ISysRoleService extends JoinIService<SysRole> {
     /**
      * 根据条件分页查询角色数据
      *
@@ -156,7 +157,7 @@ public interface ISysRoleService
     /**
      * 批量取消授权用户角色
      *
-     * @param roleId 角色ID
+     * @param roleId  角色ID
      * @param userIds 需要取消授权的用户数据ID
      * @return 结果
      */
@@ -165,7 +166,7 @@ public interface ISysRoleService
     /**
      * 批量选择授权用户角色
      *
-     * @param roleId 角色ID
+     * @param roleId  角色ID
      * @param userIds 需要删除的用户数据ID
      * @return 结果
      */

+ 5 - 6
base-system/src/main/java/com/ozs/system/service/ISysUserOnlineService.java

@@ -8,13 +8,12 @@ import com.ozs.system.domain.SysUserOnline;
  *
  * @author hx
  */
-public interface ISysUserOnlineService
-{
+public interface ISysUserOnlineService {
     /**
      * 通过登录地址查询信息
      *
      * @param ipaddr 登录地址
-     * @param user 用户信息
+     * @param user   用户信息
      * @return 在线用户信息
      */
     public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user);
@@ -23,7 +22,7 @@ public interface ISysUserOnlineService
      * 通过用户名称查询信息
      *
      * @param userName 用户名称
-     * @param user 用户信息
+     * @param user     用户信息
      * @return 在线用户信息
      */
     public SysUserOnline selectOnlineByUserName(String userName, LoginUser user);
@@ -31,9 +30,9 @@ public interface ISysUserOnlineService
     /**
      * 通过登录地址/用户名称查询信息
      *
-     * @param ipaddr 登录地址
+     * @param ipaddr   登录地址
      * @param userName 用户名称
-     * @param user 用户信息
+     * @param user     用户信息
      * @return 在线用户信息
      */
     public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user);

+ 5 - 4
base-system/src/main/java/com/ozs/system/service/ISysUserService.java

@@ -1,15 +1,16 @@
 package com.ozs.system.service;
 
 import java.util.List;
+
 import com.ozs.common.core.domain.entity.SysUser;
+import icu.mhb.mybatisplus.plugln.base.service.JoinIService;
 
 /**
  * 用户 业务层
  *
  * @author hx
  */
-public interface ISysUserService
-{
+public interface ISysUserService extends JoinIService<SysUser> {
     /**
      * 根据条件分页查询用户列表
      *
@@ -131,7 +132,7 @@ public interface ISysUserService
     /**
      * 用户授权角色
      *
-     * @param userId 用户ID
+     * @param userId  用户ID
      * @param roleIds 角色组
      */
     public void insertUserAuth(Long userId, Long[] roleIds);
@@ -156,7 +157,7 @@ public interface ISysUserService
      * 修改用户头像
      *
      * @param userName 用户名
-     * @param avatar 头像地址
+     * @param avatar   头像地址
      * @return 结果
      */
     public boolean updateUserAvatar(String userName, String avatar);

+ 16 - 21
base-system/src/main/java/com/ozs/system/service/impl/SysDictDataServiceImpl.java

@@ -1,6 +1,11 @@
 package com.ozs.system.service.impl;
 
 import java.util.List;
+
+import com.ozs.common.core.domain.entity.SysDept;
+import com.ozs.system.mapper.SysDeptMapper;
+import com.ozs.system.service.ISysDeptService;
+import icu.mhb.mybatisplus.plugln.base.service.impl.JoinServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ozs.common.core.domain.entity.SysDictData;
@@ -14,8 +19,7 @@ import com.ozs.system.service.ISysDictDataService;
  * @author hx
  */
 @Service
-public class SysDictDataServiceImpl implements ISysDictDataService
-{
+public class SysDictDataServiceImpl extends JoinServiceImpl<SysDictDataMapper, SysDictData> implements ISysDictDataService {
     @Autowired
     private SysDictDataMapper dictDataMapper;
 
@@ -26,21 +30,19 @@ public class SysDictDataServiceImpl implements ISysDictDataService
      * @return 字典数据集合信息
      */
     @Override
-    public List<SysDictData> selectDictDataList(SysDictData dictData)
-    {
+    public List<SysDictData> selectDictDataList(SysDictData dictData) {
         return dictDataMapper.selectDictDataList(dictData);
     }
 
     /**
      * 根据字典类型和字典键值查询字典数据信息
      *
-     * @param dictType 字典类型
+     * @param dictType  字典类型
      * @param dictValue 字典键值
      * @return 字典标签
      */
     @Override
-    public String selectDictLabel(String dictType, String dictValue)
-    {
+    public String selectDictLabel(String dictType, String dictValue) {
         return dictDataMapper.selectDictLabel(dictType, dictValue);
     }
 
@@ -51,8 +53,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
      * @return 字典数据
      */
     @Override
-    public SysDictData selectDictDataById(Long dictCode)
-    {
+    public SysDictData selectDictDataById(Long dictCode) {
         return dictDataMapper.selectDictDataById(dictCode);
     }
 
@@ -62,10 +63,8 @@ public class SysDictDataServiceImpl implements ISysDictDataService
      * @param dictCodes 需要删除的字典数据ID
      */
     @Override
-    public void deleteDictDataByIds(Long[] dictCodes)
-    {
-        for (Long dictCode : dictCodes)
-        {
+    public void deleteDictDataByIds(Long[] dictCodes) {
+        for (Long dictCode : dictCodes) {
             SysDictData data = selectDictDataById(dictCode);
             dictDataMapper.deleteDictDataById(dictCode);
             List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
@@ -80,11 +79,9 @@ public class SysDictDataServiceImpl implements ISysDictDataService
      * @return 结果
      */
     @Override
-    public int insertDictData(SysDictData data)
-    {
+    public int insertDictData(SysDictData data) {
         int row = dictDataMapper.insertDictData(data);
-        if (row > 0)
-        {
+        if (row > 0) {
             List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
             DictUtils.setDictCache(data.getDictType(), dictDatas);
         }
@@ -98,11 +95,9 @@ public class SysDictDataServiceImpl implements ISysDictDataService
      * @return 结果
      */
     @Override
-    public int updateDictData(SysDictData data)
-    {
+    public int updateDictData(SysDictData data) {
         int row = dictDataMapper.updateDictData(data);
-        if (row > 0)
-        {
+        if (row > 0) {
             List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
             DictUtils.setDictCache(data.getDictType(), dictDatas);
         }

+ 24 - 44
base-system/src/main/java/com/ozs/system/service/impl/SysDictTypeServiceImpl.java

@@ -5,6 +5,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 import javax.annotation.PostConstruct;
+
+import icu.mhb.mybatisplus.plugln.base.service.impl.JoinServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -24,8 +26,7 @@ import com.ozs.system.service.ISysDictTypeService;
  * @author hx
  */
 @Service
-public class SysDictTypeServiceImpl implements ISysDictTypeService
-{
+public class SysDictTypeServiceImpl extends JoinServiceImpl<SysDictTypeMapper, SysDictType> implements ISysDictTypeService {
     @Autowired
     private SysDictTypeMapper dictTypeMapper;
 
@@ -36,8 +37,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
      * 项目启动时,初始化字典到缓存
      */
     @PostConstruct
-    public void init()
-    {
+    public void init() {
         loadingDictCache();
     }
 
@@ -48,8 +48,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
      * @return 字典类型集合信息
      */
     @Override
-    public List<SysDictType> selectDictTypeList(SysDictType dictType)
-    {
+    public List<SysDictType> selectDictTypeList(SysDictType dictType) {
         return dictTypeMapper.selectDictTypeList(dictType);
     }
 
@@ -59,8 +58,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
      * @return 字典类型集合信息
      */
     @Override
-    public List<SysDictType> selectDictTypeAll()
-    {
+    public List<SysDictType> selectDictTypeAll() {
         return dictTypeMapper.selectDictTypeAll();
     }
 
@@ -71,16 +69,13 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
      * @return 字典数据集合信息
      */
     @Override
-    public List<SysDictData> selectDictDataByType(String dictType)
-    {
+    public List<SysDictData> selectDictDataByType(String dictType) {
         List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
-        if (StringUtils.isNotEmpty(dictDatas))
-        {
+        if (StringUtils.isNotEmpty(dictDatas)) {
             return dictDatas;
         }
         dictDatas = dictDataMapper.selectDictDataByType(dictType);
-        if (StringUtils.isNotEmpty(dictDatas))
-        {
+        if (StringUtils.isNotEmpty(dictDatas)) {
             DictUtils.setDictCache(dictType, dictDatas);
             return dictDatas;
         }
@@ -94,8 +89,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
      * @return 字典类型
      */
     @Override
-    public SysDictType selectDictTypeById(Long dictId)
-    {
+    public SysDictType selectDictTypeById(Long dictId) {
         return dictTypeMapper.selectDictTypeById(dictId);
     }
 
@@ -106,8 +100,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
      * @return 字典类型
      */
     @Override
-    public SysDictType selectDictTypeByType(String dictType)
-    {
+    public SysDictType selectDictTypeByType(String dictType) {
         return dictTypeMapper.selectDictTypeByType(dictType);
     }
 
@@ -117,13 +110,10 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
      * @param dictIds 需要删除的字典ID
      */
     @Override
-    public void deleteDictTypeByIds(Long[] dictIds)
-    {
-        for (Long dictId : dictIds)
-        {
+    public void deleteDictTypeByIds(Long[] dictIds) {
+        for (Long dictId : dictIds) {
             SysDictType dictType = selectDictTypeById(dictId);
-            if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0)
-            {
+            if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) {
                 throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
             }
             dictTypeMapper.deleteDictTypeById(dictId);
@@ -135,13 +125,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
      * 加载字典缓存数据
      */
     @Override
-    public void loadingDictCache()
-    {
+    public void loadingDictCache() {
         SysDictData dictData = new SysDictData();
         dictData.setStatus("0");
         Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType));
-        for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet())
-        {
+        for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet()) {
             DictUtils.setDictCache(entry.getKey(), entry.getValue().stream().sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList()));
         }
     }
@@ -150,8 +138,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
      * 清空字典缓存数据
      */
     @Override
-    public void clearDictCache()
-    {
+    public void clearDictCache() {
         DictUtils.clearDictCache();
     }
 
@@ -159,8 +146,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
      * 重置字典缓存数据
      */
     @Override
-    public void resetDictCache()
-    {
+    public void resetDictCache() {
         clearDictCache();
         loadingDictCache();
     }
@@ -172,11 +158,9 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
      * @return 结果
      */
     @Override
-    public int insertDictType(SysDictType dict)
-    {
+    public int insertDictType(SysDictType dict) {
         int row = dictTypeMapper.insertDictType(dict);
-        if (row > 0)
-        {
+        if (row > 0) {
             DictUtils.setDictCache(dict.getDictType(), null);
         }
         return row;
@@ -190,13 +174,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
      */
     @Override
     @Transactional
-    public int updateDictType(SysDictType dict)
-    {
+    public int updateDictType(SysDictType dict) {
         SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId());
         dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType());
         int row = dictTypeMapper.updateDictType(dict);
-        if (row > 0)
-        {
+        if (row > 0) {
             List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType());
             DictUtils.setDictCache(dict.getDictType(), dictDatas);
         }
@@ -210,12 +192,10 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
      * @return 结果
      */
     @Override
-    public String checkDictTypeUnique(SysDictType dict)
-    {
+    public String checkDictTypeUnique(SysDictType dict) {
         Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
         SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
-        if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue())
-        {
+        if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;

+ 9 - 10
base-system/src/main/java/com/ozs/system/service/impl/SysLogininforServiceImpl.java

@@ -1,6 +1,10 @@
 package com.ozs.system.service.impl;
 
 import java.util.List;
+
+import com.ozs.common.core.domain.entity.SysDictType;
+import com.ozs.system.mapper.SysDictTypeMapper;
+import icu.mhb.mybatisplus.plugln.base.service.impl.JoinServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ozs.system.domain.SysLogininfor;
@@ -13,8 +17,7 @@ import com.ozs.system.service.ISysLogininforService;
  * @author hx
  */
 @Service
-public class SysLogininforServiceImpl implements ISysLogininforService
-{
+public class SysLogininforServiceImpl extends JoinServiceImpl<SysLogininforMapper, SysLogininfor> implements ISysLogininforService {
 
     @Autowired
     private SysLogininforMapper logininforMapper;
@@ -25,8 +28,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService
      * @param logininfor 访问日志对象
      */
     @Override
-    public void insertLogininfor(SysLogininfor logininfor)
-    {
+    public void insertLogininfor(SysLogininfor logininfor) {
         logininforMapper.insertLogininfor(logininfor);
     }
 
@@ -37,8 +39,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService
      * @return 登录记录集合
      */
     @Override
-    public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor)
-    {
+    public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) {
         return logininforMapper.selectLogininforList(logininfor);
     }
 
@@ -49,8 +50,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService
      * @return 结果
      */
     @Override
-    public int deleteLogininforByIds(Long[] infoIds)
-    {
+    public int deleteLogininforByIds(Long[] infoIds) {
         return logininforMapper.deleteLogininforByIds(infoIds);
     }
 
@@ -58,8 +58,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService
      * 清空系统登录日志
      */
     @Override
-    public void cleanLogininfor()
-    {
+    public void cleanLogininfor() {
         logininforMapper.cleanLogininfor();
     }
 }

+ 63 - 124
base-system/src/main/java/com/ozs/system/service/impl/SysMenuServiceImpl.java

@@ -8,6 +8,8 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
 import java.util.stream.Collectors;
+
+import icu.mhb.mybatisplus.plugln.base.service.impl.JoinServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ozs.common.constant.Constants;
@@ -31,8 +33,7 @@ import com.ozs.system.service.ISysMenuService;
  * @author hx
  */
 @Service
-public class SysMenuServiceImpl implements ISysMenuService
-{
+public class SysMenuServiceImpl extends JoinServiceImpl<SysMenuMapper, SysMenu> implements ISysMenuService {
     public static final String PREMISSION_STRING = "perms[\"{0}\"]";
 
     @Autowired
@@ -51,8 +52,7 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 菜单列表
      */
     @Override
-    public List<SysMenu> selectMenuList(Long userId)
-    {
+    public List<SysMenu> selectMenuList(Long userId) {
         return selectMenuList(new SysMenu(), userId);
     }
 
@@ -63,16 +63,12 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 菜单列表
      */
     @Override
-    public List<SysMenu> selectMenuList(SysMenu menu, Long userId)
-    {
+    public List<SysMenu> selectMenuList(SysMenu menu, Long userId) {
         List<SysMenu> menuList = null;
         // 管理员显示所有菜单信息
-        if (SysUser.isAdmin(userId))
-        {
+        if (SysUser.isAdmin(userId)) {
             menuList = menuMapper.selectMenuList(menu);
-        }
-        else
-        {
+        } else {
             menu.getParams().put("userId", userId);
             menuList = menuMapper.selectMenuListByUserId(menu);
         }
@@ -86,14 +82,11 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 权限列表
      */
     @Override
-    public Set<String> selectMenuPermsByUserId(Long userId)
-    {
+    public Set<String> selectMenuPermsByUserId(Long userId) {
         List<String> perms = menuMapper.selectMenuPermsByUserId(userId);
         Set<String> permsSet = new HashSet<>();
-        for (String perm : perms)
-        {
-            if (StringUtils.isNotEmpty(perm))
-            {
+        for (String perm : perms) {
+            if (StringUtils.isNotEmpty(perm)) {
                 permsSet.addAll(Arrays.asList(perm.trim().split(",")));
             }
         }
@@ -107,14 +100,11 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 权限列表
      */
     @Override
-    public Set<String> selectMenuPermsByRoleId(Long roleId)
-    {
+    public Set<String> selectMenuPermsByRoleId(Long roleId) {
         List<String> perms = menuMapper.selectMenuPermsByRoleId(roleId);
         Set<String> permsSet = new HashSet<>();
-        for (String perm : perms)
-        {
-            if (StringUtils.isNotEmpty(perm))
-            {
+        for (String perm : perms) {
+            if (StringUtils.isNotEmpty(perm)) {
                 permsSet.addAll(Arrays.asList(perm.trim().split(",")));
             }
         }
@@ -128,15 +118,11 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 菜单列表
      */
     @Override
-    public List<SysMenu> selectMenuTreeByUserId(Long userId)
-    {
+    public List<SysMenu> selectMenuTreeByUserId(Long userId) {
         List<SysMenu> menus = null;
-        if (SecurityUtils.isAdmin(userId))
-        {
+        if (SecurityUtils.isAdmin(userId)) {
             menus = menuMapper.selectMenuTreeAll();
-        }
-        else
-        {
+        } else {
             menus = menuMapper.selectMenuTreeByUserId(userId);
         }
         return getChildPerms(menus, 0);
@@ -149,8 +135,7 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 选中菜单列表
      */
     @Override
-    public List<Long> selectMenuListByRoleId(Long roleId)
-    {
+    public List<Long> selectMenuListByRoleId(Long roleId) {
         SysRole role = roleMapper.selectRoleById(roleId);
         return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly());
     }
@@ -162,11 +147,9 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 路由列表
      */
     @Override
-    public List<RouterVo> buildMenus(List<SysMenu> menus)
-    {
+    public List<RouterVo> buildMenus(List<SysMenu> menus) {
         List<RouterVo> routers = new LinkedList<RouterVo>();
-        for (SysMenu menu : menus)
-        {
+        for (SysMenu menu : menus) {
             RouterVo router = new RouterVo();
             router.setHidden("1".equals(menu.getVisible()));
             router.setName(getRouteName(menu));
@@ -175,14 +158,11 @@ public class SysMenuServiceImpl implements ISysMenuService
             router.setQuery(menu.getQuery());
             router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
             List<SysMenu> cMenus = menu.getChildren();
-            if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()))
-            {
+            if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
                 router.setAlwaysShow(true);
                 router.setRedirect("noRedirect");
                 router.setChildren(buildMenus(cMenus));
-            }
-            else if (isMenuFrame(menu))
-            {
+            } else if (isMenuFrame(menu)) {
                 router.setMeta(null);
                 List<RouterVo> childrenList = new ArrayList<RouterVo>();
                 RouterVo children = new RouterVo();
@@ -193,9 +173,7 @@ public class SysMenuServiceImpl implements ISysMenuService
                 children.setQuery(menu.getQuery());
                 childrenList.add(children);
                 router.setChildren(childrenList);
-            }
-            else if (menu.getParentId().intValue() == 0 && isInnerLink(menu))
-            {
+            } else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) {
                 router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon()));
                 router.setPath("/");
                 List<RouterVo> childrenList = new ArrayList<RouterVo>();
@@ -220,22 +198,18 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 树结构列表
      */
     @Override
-    public List<SysMenu> buildMenuTree(List<SysMenu> menus)
-    {
+    public List<SysMenu> buildMenuTree(List<SysMenu> menus) {
         List<SysMenu> returnList = new ArrayList<SysMenu>();
         List<Long> tempList = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList());
-        for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext();)
-        {
+        for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext(); ) {
             SysMenu menu = (SysMenu) iterator.next();
             // 如果是顶级节点, 遍历该父节点的所有子节点
-            if (!tempList.contains(menu.getParentId()))
-            {
+            if (!tempList.contains(menu.getParentId())) {
                 recursionFn(menus, menu);
                 returnList.add(menu);
             }
         }
-        if (returnList.isEmpty())
-        {
+        if (returnList.isEmpty()) {
             returnList = menus;
         }
         return returnList;
@@ -248,8 +222,7 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 下拉树结构列表
      */
     @Override
-    public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus)
-    {
+    public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus) {
         List<SysMenu> menuTrees = buildMenuTree(menus);
         return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
     }
@@ -261,8 +234,7 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 菜单信息
      */
     @Override
-    public SysMenu selectMenuById(Long menuId)
-    {
+    public SysMenu selectMenuById(Long menuId) {
         return menuMapper.selectMenuById(menuId);
     }
 
@@ -273,8 +245,7 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 结果
      */
     @Override
-    public boolean hasChildByMenuId(Long menuId)
-    {
+    public boolean hasChildByMenuId(Long menuId) {
         int result = menuMapper.hasChildByMenuId(menuId);
         return result > 0;
     }
@@ -286,8 +257,7 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 结果
      */
     @Override
-    public boolean checkMenuExistRole(Long menuId)
-    {
+    public boolean checkMenuExistRole(Long menuId) {
         int result = roleMenuMapper.checkMenuExistRole(menuId);
         return result > 0;
     }
@@ -299,8 +269,7 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 结果
      */
     @Override
-    public int insertMenu(SysMenu menu)
-    {
+    public int insertMenu(SysMenu menu) {
         return menuMapper.insertMenu(menu);
     }
 
@@ -311,8 +280,7 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 结果
      */
     @Override
-    public int updateMenu(SysMenu menu)
-    {
+    public int updateMenu(SysMenu menu) {
         return menuMapper.updateMenu(menu);
     }
 
@@ -323,8 +291,7 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 结果
      */
     @Override
-    public int deleteMenuById(Long menuId)
-    {
+    public int deleteMenuById(Long menuId) {
         return menuMapper.deleteMenuById(menuId);
     }
 
@@ -335,12 +302,10 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 结果
      */
     @Override
-    public String checkMenuNameUnique(SysMenu menu)
-    {
+    public String checkMenuNameUnique(SysMenu menu) {
         Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId();
         SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId());
-        if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue())
-        {
+        if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -352,12 +317,10 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @param menu 菜单信息
      * @return 路由名称
      */
-    public String getRouteName(SysMenu menu)
-    {
+    public String getRouteName(SysMenu menu) {
         String routerName = StringUtils.capitalize(menu.getPath());
         // 非外链并且是一级目录(类型为目录)
-        if (isMenuFrame(menu))
-        {
+        if (isMenuFrame(menu)) {
             routerName = StringUtils.EMPTY;
         }
         return routerName;
@@ -369,23 +332,19 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @param menu 菜单信息
      * @return 路由地址
      */
-    public String getRouterPath(SysMenu menu)
-    {
+    public String getRouterPath(SysMenu menu) {
         String routerPath = menu.getPath();
         // 内链打开外网方式
-        if (menu.getParentId().intValue() != 0 && isInnerLink(menu))
-        {
+        if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) {
             routerPath = innerLinkReplaceEach(routerPath);
         }
         // 非外链并且是一级目录(类型为目录)
         if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType())
-                && UserConstants.NO_FRAME.equals(menu.getIsFrame()))
-        {
+                && UserConstants.NO_FRAME.equals(menu.getIsFrame())) {
             routerPath = "/" + menu.getPath();
         }
         // 非外链并且是一级目录(类型为菜单)
-        else if (isMenuFrame(menu))
-        {
+        else if (isMenuFrame(menu)) {
             routerPath = "/";
         }
         return routerPath;
@@ -397,19 +356,13 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @param menu 菜单信息
      * @return 组件信息
      */
-    public String getComponent(SysMenu menu)
-    {
+    public String getComponent(SysMenu menu) {
         String component = UserConstants.LAYOUT;
-        if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu))
-        {
+        if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) {
             component = menu.getComponent();
-        }
-        else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu))
-        {
+        } else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) {
             component = UserConstants.INNER_LINK;
-        }
-        else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu))
-        {
+        } else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) {
             component = UserConstants.PARENT_VIEW;
         }
         return component;
@@ -421,8 +374,7 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @param menu 菜单信息
      * @return 结果
      */
-    public boolean isMenuFrame(SysMenu menu)
-    {
+    public boolean isMenuFrame(SysMenu menu) {
         return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType())
                 && menu.getIsFrame().equals(UserConstants.NO_FRAME);
     }
@@ -433,8 +385,7 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @param menu 菜单信息
      * @return 结果
      */
-    public boolean isInnerLink(SysMenu menu)
-    {
+    public boolean isInnerLink(SysMenu menu) {
         return menu.getIsFrame().equals(UserConstants.NO_FRAME) && StringUtils.ishttp(menu.getPath());
     }
 
@@ -444,27 +395,23 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @param menu 菜单信息
      * @return 结果
      */
-    public boolean isParentView(SysMenu menu)
-    {
+    public boolean isParentView(SysMenu menu) {
         return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType());
     }
 
     /**
      * 根据父节点的ID获取所有子节点
      *
-     * @param list 分类表
+     * @param list     分类表
      * @param parentId 传入的父节点ID
      * @return String
      */
-    public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId)
-    {
+    public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) {
         List<SysMenu> returnList = new ArrayList<SysMenu>();
-        for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext();)
-        {
+        for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext(); ) {
             SysMenu t = (SysMenu) iterator.next();
             // 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
-            if (t.getParentId() == parentId)
-            {
+            if (t.getParentId() == parentId) {
                 recursionFn(list, t);
                 returnList.add(t);
             }
@@ -476,17 +423,14 @@ public class SysMenuServiceImpl implements ISysMenuService
      * 递归列表
      *
      * @param list 分类表
-     * @param t 子节点
+     * @param t    子节点
      */
-    private void recursionFn(List<SysMenu> list, SysMenu t)
-    {
+    private void recursionFn(List<SysMenu> list, SysMenu t) {
         // 得到子节点列表
         List<SysMenu> childList = getChildList(list, t);
         t.setChildren(childList);
-        for (SysMenu tChild : childList)
-        {
-            if (hasChild(list, tChild))
-            {
+        for (SysMenu tChild : childList) {
+            if (hasChild(list, tChild)) {
                 recursionFn(list, tChild);
             }
         }
@@ -495,15 +439,12 @@ public class SysMenuServiceImpl implements ISysMenuService
     /**
      * 得到子节点列表
      */
-    private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t)
-    {
+    private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) {
         List<SysMenu> tlist = new ArrayList<SysMenu>();
         Iterator<SysMenu> it = list.iterator();
-        while (it.hasNext())
-        {
+        while (it.hasNext()) {
             SysMenu n = (SysMenu) it.next();
-            if (n.getParentId().longValue() == t.getMenuId().longValue())
-            {
+            if (n.getParentId().longValue() == t.getMenuId().longValue()) {
                 tlist.add(n);
             }
         }
@@ -513,8 +454,7 @@ public class SysMenuServiceImpl implements ISysMenuService
     /**
      * 判断是否有子节点
      */
-    private boolean hasChild(List<SysMenu> list, SysMenu t)
-    {
+    private boolean hasChild(List<SysMenu> list, SysMenu t) {
         return getChildList(list, t).size() > 0;
     }
 
@@ -523,9 +463,8 @@ public class SysMenuServiceImpl implements ISysMenuService
      *
      * @return 替换后的内链域名
      */
-    public String innerLinkReplaceEach(String path)
-    {
-        return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, "." },
-                new String[] { "", "", "", "/" });
+    public String innerLinkReplaceEach(String path) {
+        return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS, Constants.WWW, "."},
+                new String[]{"", "", "", "/"});
     }
 }

+ 3 - 2
base-system/src/main/java/com/ozs/system/service/impl/SysNoticeServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ozs.system.service.impl;
 
 import java.util.List;
+
+import icu.mhb.mybatisplus.plugln.base.service.impl.JoinServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ozs.system.domain.SysNotice;
@@ -13,8 +15,7 @@ import com.ozs.system.service.ISysNoticeService;
  * @author hx
  */
 @Service
-public class SysNoticeServiceImpl implements ISysNoticeService
-{
+public class SysNoticeServiceImpl extends JoinServiceImpl<SysNoticeMapper, SysNotice> implements ISysNoticeService {
     @Autowired
     private SysNoticeMapper noticeMapper;
 

+ 8 - 12
base-system/src/main/java/com/ozs/system/service/impl/SysOperLogServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ozs.system.service.impl;
 
 import java.util.List;
+
+import icu.mhb.mybatisplus.plugln.base.service.impl.JoinServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ozs.system.domain.SysOperLog;
@@ -13,8 +15,7 @@ import com.ozs.system.service.ISysOperLogService;
  * @author hx
  */
 @Service
-public class SysOperLogServiceImpl implements ISysOperLogService
-{
+public class SysOperLogServiceImpl extends JoinServiceImpl<SysOperLogMapper, SysOperLog> implements ISysOperLogService {
     @Autowired
     private SysOperLogMapper operLogMapper;
 
@@ -24,8 +25,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService
      * @param operLog 操作日志对象
      */
     @Override
-    public void insertOperlog(SysOperLog operLog)
-    {
+    public void insertOperlog(SysOperLog operLog) {
         operLogMapper.insertOperlog(operLog);
     }
 
@@ -36,8 +36,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService
      * @return 操作日志集合
      */
     @Override
-    public List<SysOperLog> selectOperLogList(SysOperLog operLog)
-    {
+    public List<SysOperLog> selectOperLogList(SysOperLog operLog) {
         return operLogMapper.selectOperLogList(operLog);
     }
 
@@ -48,8 +47,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService
      * @return 结果
      */
     @Override
-    public int deleteOperLogByIds(Long[] operIds)
-    {
+    public int deleteOperLogByIds(Long[] operIds) {
         return operLogMapper.deleteOperLogByIds(operIds);
     }
 
@@ -60,8 +58,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService
      * @return 操作日志对象
      */
     @Override
-    public SysOperLog selectOperLogById(Long operId)
-    {
+    public SysOperLog selectOperLogById(Long operId) {
         return operLogMapper.selectOperLogById(operId);
     }
 
@@ -69,8 +66,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService
      * 清空操作日志
      */
     @Override
-    public void cleanOperLog()
-    {
+    public void cleanOperLog() {
         operLogMapper.cleanOperLog();
     }
 }

+ 18 - 32
base-system/src/main/java/com/ozs/system/service/impl/SysPostServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ozs.system.service.impl;
 
 import java.util.List;
+
+import icu.mhb.mybatisplus.plugln.base.service.impl.JoinServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ozs.common.constant.UserConstants;
@@ -17,8 +19,7 @@ import com.ozs.system.service.ISysPostService;
  * @author hx
  */
 @Service
-public class SysPostServiceImpl implements ISysPostService
-{
+public class SysPostServiceImpl extends JoinServiceImpl<SysPostMapper, SysPost> implements ISysPostService {
     @Autowired
     private SysPostMapper postMapper;
 
@@ -32,8 +33,7 @@ public class SysPostServiceImpl implements ISysPostService
      * @return 岗位信息集合
      */
     @Override
-    public List<SysPost> selectPostList(SysPost post)
-    {
+    public List<SysPost> selectPostList(SysPost post) {
         return postMapper.selectPostList(post);
     }
 
@@ -43,8 +43,7 @@ public class SysPostServiceImpl implements ISysPostService
      * @return 岗位列表
      */
     @Override
-    public List<SysPost> selectPostAll()
-    {
+    public List<SysPost> selectPostAll() {
         return postMapper.selectPostAll();
     }
 
@@ -55,8 +54,7 @@ public class SysPostServiceImpl implements ISysPostService
      * @return 角色对象信息
      */
     @Override
-    public SysPost selectPostById(Long postId)
-    {
+    public SysPost selectPostById(Long postId) {
         return postMapper.selectPostById(postId);
     }
 
@@ -67,8 +65,7 @@ public class SysPostServiceImpl implements ISysPostService
      * @return 选中岗位ID列表
      */
     @Override
-    public List<Long> selectPostListByUserId(Long userId)
-    {
+    public List<Long> selectPostListByUserId(Long userId) {
         return postMapper.selectPostListByUserId(userId);
     }
 
@@ -79,12 +76,10 @@ public class SysPostServiceImpl implements ISysPostService
      * @return 结果
      */
     @Override
-    public String checkPostNameUnique(SysPost post)
-    {
+    public String checkPostNameUnique(SysPost post) {
         Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
         SysPost info = postMapper.checkPostNameUnique(post.getPostName());
-        if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
-        {
+        if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -97,12 +92,10 @@ public class SysPostServiceImpl implements ISysPostService
      * @return 结果
      */
     @Override
-    public String checkPostCodeUnique(SysPost post)
-    {
+    public String checkPostCodeUnique(SysPost post) {
         Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
         SysPost info = postMapper.checkPostCodeUnique(post.getPostCode());
-        if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
-        {
+        if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -115,8 +108,7 @@ public class SysPostServiceImpl implements ISysPostService
      * @return 结果
      */
     @Override
-    public int countUserPostById(Long postId)
-    {
+    public int countUserPostById(Long postId) {
         return userPostMapper.countUserPostById(postId);
     }
 
@@ -127,8 +119,7 @@ public class SysPostServiceImpl implements ISysPostService
      * @return 结果
      */
     @Override
-    public int deletePostById(Long postId)
-    {
+    public int deletePostById(Long postId) {
         return postMapper.deletePostById(postId);
     }
 
@@ -139,13 +130,10 @@ public class SysPostServiceImpl implements ISysPostService
      * @return 结果
      */
     @Override
-    public int deletePostByIds(Long[] postIds)
-    {
-        for (Long postId : postIds)
-        {
+    public int deletePostByIds(Long[] postIds) {
+        for (Long postId : postIds) {
             SysPost post = selectPostById(postId);
-            if (countUserPostById(postId) > 0)
-            {
+            if (countUserPostById(postId) > 0) {
                 throw new ServiceException(String.format("%1$s已分配,不能删除", post.getPostName()));
             }
         }
@@ -159,8 +147,7 @@ public class SysPostServiceImpl implements ISysPostService
      * @return 结果
      */
     @Override
-    public int insertPost(SysPost post)
-    {
+    public int insertPost(SysPost post) {
         return postMapper.insertPost(post);
     }
 
@@ -171,8 +158,7 @@ public class SysPostServiceImpl implements ISysPostService
      * @return 结果
      */
     @Override
-    public int updatePost(SysPost post)
-    {
+    public int updatePost(SysPost post) {
         return postMapper.updatePost(post);
     }
 }

+ 44 - 82
base-system/src/main/java/com/ozs/system/service/impl/SysRoleServiceImpl.java

@@ -5,6 +5,8 @@ import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+
+import icu.mhb.mybatisplus.plugln.base.service.impl.JoinServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -31,8 +33,7 @@ import com.ozs.system.service.ISysRoleService;
  * @author hx
  */
 @Service
-public class SysRoleServiceImpl implements ISysRoleService
-{
+public class SysRoleServiceImpl extends JoinServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {
     @Autowired
     private SysRoleMapper roleMapper;
 
@@ -53,8 +54,7 @@ public class SysRoleServiceImpl implements ISysRoleService
      */
     @Override
     @DataScope(deptAlias = "d")
-    public List<SysRole> selectRoleList(SysRole role)
-    {
+    public List<SysRole> selectRoleList(SysRole role) {
         return roleMapper.selectRoleList(role);
     }
 
@@ -65,16 +65,12 @@ public class SysRoleServiceImpl implements ISysRoleService
      * @return 角色列表
      */
     @Override
-    public List<SysRole> selectRolesByUserId(Long userId)
-    {
+    public List<SysRole> selectRolesByUserId(Long userId) {
         List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId);
         List<SysRole> roles = selectRoleAll();
-        for (SysRole role : roles)
-        {
-            for (SysRole userRole : userRoles)
-            {
-                if (role.getRoleId().longValue() == userRole.getRoleId().longValue())
-                {
+        for (SysRole role : roles) {
+            for (SysRole userRole : userRoles) {
+                if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) {
                     role.setFlag(true);
                     break;
                 }
@@ -90,14 +86,11 @@ public class SysRoleServiceImpl implements ISysRoleService
      * @return 权限列表
      */
     @Override
-    public Set<String> selectRolePermissionByUserId(Long userId)
-    {
+    public Set<String> selectRolePermissionByUserId(Long userId) {
         List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId);
         Set<String> permsSet = new HashSet<>();
-        for (SysRole perm : perms)
-        {
-            if (StringUtils.isNotNull(perm))
-            {
+        for (SysRole perm : perms) {
+            if (StringUtils.isNotNull(perm)) {
                 permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
             }
         }
@@ -110,8 +103,7 @@ public class SysRoleServiceImpl implements ISysRoleService
      * @return 角色列表
      */
     @Override
-    public List<SysRole> selectRoleAll()
-    {
+    public List<SysRole> selectRoleAll() {
         return SpringUtils.getAopProxy(this).selectRoleList(new SysRole());
     }
 
@@ -122,8 +114,7 @@ public class SysRoleServiceImpl implements ISysRoleService
      * @return 选中角色ID列表
      */
     @Override
-    public List<Long> selectRoleListByUserId(Long userId)
-    {
+    public List<Long> selectRoleListByUserId(Long userId) {
         return roleMapper.selectRoleListByUserId(userId);
     }
 
@@ -134,8 +125,7 @@ public class SysRoleServiceImpl implements ISysRoleService
      * @return 角色对象信息
      */
     @Override
-    public SysRole selectRoleById(Long roleId)
-    {
+    public SysRole selectRoleById(Long roleId) {
         return roleMapper.selectRoleById(roleId);
     }
 
@@ -146,12 +136,10 @@ public class SysRoleServiceImpl implements ISysRoleService
      * @return 结果
      */
     @Override
-    public String checkRoleNameUnique(SysRole role)
-    {
+    public String checkRoleNameUnique(SysRole role) {
         Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
         SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
-        if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
-        {
+        if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -164,12 +152,10 @@ public class SysRoleServiceImpl implements ISysRoleService
      * @return 结果
      */
     @Override
-    public String checkRoleKeyUnique(SysRole role)
-    {
+    public String checkRoleKeyUnique(SysRole role) {
         Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
         SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
-        if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
-        {
+        if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -181,10 +167,8 @@ public class SysRoleServiceImpl implements ISysRoleService
      * @param role 角色信息
      */
     @Override
-    public void checkRoleAllowed(SysRole role)
-    {
-        if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin())
-        {
+    public void checkRoleAllowed(SysRole role) {
+        if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) {
             throw new ServiceException("不允许操作超级管理员角色");
         }
     }
@@ -195,15 +179,12 @@ public class SysRoleServiceImpl implements ISysRoleService
      * @param roleId 角色id
      */
     @Override
-    public void checkRoleDataScope(Long roleId)
-    {
-        if (!SysUser.isAdmin(SecurityUtils.getUserId()))
-        {
+    public void checkRoleDataScope(Long roleId) {
+        if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
             SysRole role = new SysRole();
             role.setRoleId(roleId);
             List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role);
-            if (StringUtils.isEmpty(roles))
-            {
+            if (StringUtils.isEmpty(roles)) {
                 throw new ServiceException("没有权限访问角色数据!");
             }
         }
@@ -216,8 +197,7 @@ public class SysRoleServiceImpl implements ISysRoleService
      * @return 结果
      */
     @Override
-    public int countUserRoleByRoleId(Long roleId)
-    {
+    public int countUserRoleByRoleId(Long roleId) {
         return userRoleMapper.countUserRoleByRoleId(roleId);
     }
 
@@ -229,8 +209,7 @@ public class SysRoleServiceImpl implements ISysRoleService
      */
     @Override
     @Transactional
-    public int insertRole(SysRole role)
-    {
+    public int insertRole(SysRole role) {
         // 新增角色信息
         roleMapper.insertRole(role);
         return insertRoleMenu(role);
@@ -244,8 +223,7 @@ public class SysRoleServiceImpl implements ISysRoleService
      */
     @Override
     @Transactional
-    public int updateRole(SysRole role)
-    {
+    public int updateRole(SysRole role) {
         // 修改角色信息
         roleMapper.updateRole(role);
         // 删除角色与菜单关联
@@ -260,8 +238,7 @@ public class SysRoleServiceImpl implements ISysRoleService
      * @return 结果
      */
     @Override
-    public int updateRoleStatus(SysRole role)
-    {
+    public int updateRoleStatus(SysRole role) {
         return roleMapper.updateRole(role);
     }
 
@@ -273,8 +250,7 @@ public class SysRoleServiceImpl implements ISysRoleService
      */
     @Override
     @Transactional
-    public int authDataScope(SysRole role)
-    {
+    public int authDataScope(SysRole role) {
         // 修改角色信息
         roleMapper.updateRole(role);
         // 删除角色与部门关联
@@ -288,20 +264,17 @@ public class SysRoleServiceImpl implements ISysRoleService
      *
      * @param role 角色对象
      */
-    public int insertRoleMenu(SysRole role)
-    {
+    public int insertRoleMenu(SysRole role) {
         int rows = 1;
         // 新增用户与角色管理
         List<SysRoleMenu> list = new ArrayList<SysRoleMenu>();
-        for (Long menuId : role.getMenuIds())
-        {
+        for (Long menuId : role.getMenuIds()) {
             SysRoleMenu rm = new SysRoleMenu();
             rm.setRoleId(role.getRoleId());
             rm.setMenuId(menuId);
             list.add(rm);
         }
-        if (list.size() > 0)
-        {
+        if (list.size() > 0) {
             rows = roleMenuMapper.batchRoleMenu(list);
         }
         return rows;
@@ -312,20 +285,17 @@ public class SysRoleServiceImpl implements ISysRoleService
      *
      * @param role 角色对象
      */
-    public int insertRoleDept(SysRole role)
-    {
+    public int insertRoleDept(SysRole role) {
         int rows = 1;
         // 新增角色与部门(数据权限)管理
         List<SysRoleDept> list = new ArrayList<SysRoleDept>();
-        for (Long deptId : role.getDeptIds())
-        {
+        for (Long deptId : role.getDeptIds()) {
             SysRoleDept rd = new SysRoleDept();
             rd.setRoleId(role.getRoleId());
             rd.setDeptId(deptId);
             list.add(rd);
         }
-        if (list.size() > 0)
-        {
+        if (list.size() > 0) {
             rows = roleDeptMapper.batchRoleDept(list);
         }
         return rows;
@@ -339,8 +309,7 @@ public class SysRoleServiceImpl implements ISysRoleService
      */
     @Override
     @Transactional
-    public int deleteRoleById(Long roleId)
-    {
+    public int deleteRoleById(Long roleId) {
         // 删除角色与菜单关联
         roleMenuMapper.deleteRoleMenuByRoleId(roleId);
         // 删除角色与部门关联
@@ -356,15 +325,12 @@ public class SysRoleServiceImpl implements ISysRoleService
      */
     @Override
     @Transactional
-    public int deleteRoleByIds(Long[] roleIds)
-    {
-        for (Long roleId : roleIds)
-        {
+    public int deleteRoleByIds(Long[] roleIds) {
+        for (Long roleId : roleIds) {
             checkRoleAllowed(new SysRole(roleId));
             checkRoleDataScope(roleId);
             SysRole role = selectRoleById(roleId);
-            if (countUserRoleByRoleId(roleId) > 0)
-            {
+            if (countUserRoleByRoleId(roleId) > 0) {
                 throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
             }
         }
@@ -382,38 +348,34 @@ public class SysRoleServiceImpl implements ISysRoleService
      * @return 结果
      */
     @Override
-    public int deleteAuthUser(SysUserRole userRole)
-    {
+    public int deleteAuthUser(SysUserRole userRole) {
         return userRoleMapper.deleteUserRoleInfo(userRole);
     }
 
     /**
      * 批量取消授权用户角色
      *
-     * @param roleId 角色ID
+     * @param roleId  角色ID
      * @param userIds 需要取消授权的用户数据ID
      * @return 结果
      */
     @Override
-    public int deleteAuthUsers(Long roleId, Long[] userIds)
-    {
+    public int deleteAuthUsers(Long roleId, Long[] userIds) {
         return userRoleMapper.deleteUserRoleInfos(roleId, userIds);
     }
 
     /**
      * 批量选择授权用户角色
      *
-     * @param roleId 角色ID
+     * @param roleId  角色ID
      * @param userIds 需要授权的用户数据ID
      * @return 结果
      */
     @Override
-    public int insertAuthUsers(Long roleId, Long[] userIds)
-    {
+    public int insertAuthUsers(Long roleId, Long[] userIds) {
         // 新增用户与角色管理
         List<SysUserRole> list = new ArrayList<SysUserRole>();
-        for (Long userId : userIds)
-        {
+        for (Long userId : userIds) {
             SysUserRole ur = new SysUserRole();
             ur.setUserId(userId);
             ur.setRoleId(roleId);

+ 14 - 24
base-system/src/main/java/com/ozs/system/service/impl/SysUserOnlineServiceImpl.java

@@ -12,20 +12,17 @@ import com.ozs.system.service.ISysUserOnlineService;
  * @author hx
  */
 @Service
-public class SysUserOnlineServiceImpl implements ISysUserOnlineService
-{
+public class SysUserOnlineServiceImpl implements ISysUserOnlineService {
     /**
      * 通过登录地址查询信息
      *
      * @param ipaddr 登录地址
-     * @param user 用户信息
+     * @param user   用户信息
      * @return 在线用户信息
      */
     @Override
-    public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user)
-    {
-        if (StringUtils.equals(ipaddr, user.getIpaddr()))
-        {
+    public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) {
+        if (StringUtils.equals(ipaddr, user.getIpaddr())) {
             return loginUserToUserOnline(user);
         }
         return null;
@@ -35,14 +32,12 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService
      * 通过用户名称查询信息
      *
      * @param userName 用户名称
-     * @param user 用户信息
+     * @param user     用户信息
      * @return 在线用户信息
      */
     @Override
-    public SysUserOnline selectOnlineByUserName(String userName, LoginUser user)
-    {
-        if (StringUtils.equals(userName, user.getUsername()))
-        {
+    public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) {
+        if (StringUtils.equals(userName, user.getUsername())) {
             return loginUserToUserOnline(user);
         }
         return null;
@@ -51,16 +46,14 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService
     /**
      * 通过登录地址/用户名称查询信息
      *
-     * @param ipaddr 登录地址
+     * @param ipaddr   登录地址
      * @param userName 用户名称
-     * @param user 用户信息
+     * @param user     用户信息
      * @return 在线用户信息
      */
     @Override
-    public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user)
-    {
-        if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername()))
-        {
+    public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) {
+        if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) {
             return loginUserToUserOnline(user);
         }
         return null;
@@ -73,10 +66,8 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService
      * @return 在线用户
      */
     @Override
-    public SysUserOnline loginUserToUserOnline(LoginUser user)
-    {
-        if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser()))
-        {
+    public SysUserOnline loginUserToUserOnline(LoginUser user) {
+        if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser())) {
             return null;
         }
         SysUserOnline sysUserOnline = new SysUserOnline();
@@ -87,8 +78,7 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService
         sysUserOnline.setBrowser(user.getBrowser());
         sysUserOnline.setOs(user.getOs());
         sysUserOnline.setLoginTime(user.getLoginTime());
-        if (StringUtils.isNotNull(user.getUser().getDept()))
-        {
+        if (StringUtils.isNotNull(user.getUser().getDept())) {
             sysUserOnline.setDeptName(user.getUser().getDept().getDeptName());
         }
         return sysUserOnline;

+ 2 - 1
base-system/src/main/java/com/ozs/system/service/impl/SysUserServiceImpl.java

@@ -5,6 +5,7 @@ import java.util.List;
 import java.util.stream.Collectors;
 import javax.validation.Validator;
 
+import icu.mhb.mybatisplus.plugln.base.service.impl.JoinServiceImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -37,7 +38,7 @@ import com.ozs.system.service.ISysUserService;
  * @author hx
  */
 @Service
-public class SysUserServiceImpl implements ISysUserService {
+public class SysUserServiceImpl extends JoinServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
     private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
 
     @Autowired