update ruoyi原生改为 MP lombok 格式
update SysConfig 模块代码
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.Email; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 部门表 sys_dept |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysDept extends BaseEntity |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_dept") |
| | | public class SysDept |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 部门ID */ |
| | | @TableId(value = "dept_id",type = IdType.AUTO) |
| | | private Long deptId; |
| | | |
| | | /** 父部门ID */ |
| | |
| | | private String ancestors; |
| | | |
| | | /** 部门名称 */ |
| | | @NotBlank(message = "部门名称不能为空") |
| | | @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符") |
| | | private String deptName; |
| | | |
| | | /** 显示顺序 */ |
| | | @NotBlank(message = "显示顺序不能为空") |
| | | private String orderNum; |
| | | |
| | | /** 负责人 */ |
| | | private String leader; |
| | | |
| | | /** 联系电话 */ |
| | | @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符") |
| | | private String phone; |
| | | |
| | | /** 邮箱 */ |
| | | @Email(message = "邮箱格式不正确") |
| | | @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") |
| | | private String email; |
| | | |
| | | /** 部门状态:0正常,1停用 */ |
| | | private String status; |
| | | |
| | | /** 删除标志(0代表存在 2代表删除) */ |
| | | @TableLogic |
| | | private String delFlag; |
| | | |
| | | /** 父部门名称 */ |
| | | private String parentName; |
| | | |
| | | /** 创建者 */ |
| | | private String createBy; |
| | | |
| | | /** 创建时间 */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** 更新者 */ |
| | | private String updateBy; |
| | | |
| | | /** 更新时间 */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** 子部门 */ |
| | | @TableField(exist = false) |
| | | private List<SysDept> children = new ArrayList<SysDept>(); |
| | | |
| | | public Long getDeptId() |
| | | { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) |
| | | { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public Long getParentId() |
| | | { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) |
| | | { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public String getAncestors() |
| | | { |
| | | return ancestors; |
| | | } |
| | | |
| | | public void setAncestors(String ancestors) |
| | | { |
| | | this.ancestors = ancestors; |
| | | } |
| | | |
| | | @NotBlank(message = "部门名称不能为空") |
| | | @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符") |
| | | public String getDeptName() |
| | | { |
| | | return deptName; |
| | | } |
| | | |
| | | public void setDeptName(String deptName) |
| | | { |
| | | this.deptName = deptName; |
| | | } |
| | | |
| | | @NotBlank(message = "显示顺序不能为空") |
| | | public String getOrderNum() |
| | | { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(String orderNum) |
| | | { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public String getLeader() |
| | | { |
| | | return leader; |
| | | } |
| | | |
| | | public void setLeader(String leader) |
| | | { |
| | | this.leader = leader; |
| | | } |
| | | |
| | | @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符") |
| | | public String getPhone() |
| | | { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) |
| | | { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | @Email(message = "邮箱格式不正确") |
| | | @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") |
| | | public String getEmail() |
| | | { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) |
| | | { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getParentName() |
| | | { |
| | | return parentName; |
| | | } |
| | | |
| | | public void setParentName(String parentName) |
| | | { |
| | | this.parentName = parentName; |
| | | } |
| | | |
| | | public List<SysDept> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<SysDept> children) |
| | | { |
| | | this.children = children; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("deptId", getDeptId()) |
| | | .append("parentId", getParentId()) |
| | | .append("ancestors", getAncestors()) |
| | | .append("deptName", getDeptName()) |
| | | .append("orderNum", getOrderNum()) |
| | | .append("leader", getLeader()) |
| | | .append("phone", getPhone()) |
| | | .append("email", getEmail()) |
| | | .append("status", getStatus()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 字典数据表 sys_dict_data |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysDictData extends BaseEntity |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_dict_data") |
| | | public class SysDictData |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 字典编码 */ |
| | | @Excel(name = "字典编码", cellType = ColumnType.NUMERIC) |
| | | @TableId(value = "dept_code",type = IdType.AUTO) |
| | | private Long dictCode; |
| | | |
| | | /** 字典排序 */ |
| | |
| | | |
| | | /** 字典标签 */ |
| | | @Excel(name = "字典标签") |
| | | @NotBlank(message = "字典标签不能为空") |
| | | @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符") |
| | | private String dictLabel; |
| | | |
| | | /** 字典键值 */ |
| | | @Excel(name = "字典键值") |
| | | @NotBlank(message = "字典键值不能为空") |
| | | @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符") |
| | | private String dictValue; |
| | | |
| | | /** 字典类型 */ |
| | | @Excel(name = "字典类型") |
| | | @NotBlank(message = "字典类型不能为空") |
| | | @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符") |
| | | private String dictType; |
| | | |
| | | /** 样式属性(其他样式扩展) */ |
| | | @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符") |
| | | private String cssClass; |
| | | |
| | | /** 表格字典样式 */ |
| | |
| | | @Excel(name = "状态", readConverterExp = "0=正常,1=停用") |
| | | private String status; |
| | | |
| | | public Long getDictCode() |
| | | { |
| | | return dictCode; |
| | | } |
| | | /** 创建者 */ |
| | | private String createBy; |
| | | |
| | | public void setDictCode(Long dictCode) |
| | | { |
| | | this.dictCode = dictCode; |
| | | } |
| | | /** 创建时间 */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | public Long getDictSort() |
| | | { |
| | | return dictSort; |
| | | } |
| | | /** 更新者 */ |
| | | private String updateBy; |
| | | |
| | | public void setDictSort(Long dictSort) |
| | | { |
| | | this.dictSort = dictSort; |
| | | } |
| | | /** 更新时间 */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | @NotBlank(message = "字典标签不能为空") |
| | | @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符") |
| | | public String getDictLabel() |
| | | { |
| | | return dictLabel; |
| | | } |
| | | |
| | | public void setDictLabel(String dictLabel) |
| | | { |
| | | this.dictLabel = dictLabel; |
| | | } |
| | | |
| | | @NotBlank(message = "字典键值不能为空") |
| | | @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符") |
| | | public String getDictValue() |
| | | { |
| | | return dictValue; |
| | | } |
| | | |
| | | public void setDictValue(String dictValue) |
| | | { |
| | | this.dictValue = dictValue; |
| | | } |
| | | |
| | | @NotBlank(message = "字典类型不能为空") |
| | | @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符") |
| | | public String getDictType() |
| | | { |
| | | return dictType; |
| | | } |
| | | |
| | | public void setDictType(String dictType) |
| | | { |
| | | this.dictType = dictType; |
| | | } |
| | | |
| | | @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符") |
| | | public String getCssClass() |
| | | { |
| | | return cssClass; |
| | | } |
| | | |
| | | public void setCssClass(String cssClass) |
| | | { |
| | | this.cssClass = cssClass; |
| | | } |
| | | |
| | | public String getListClass() |
| | | { |
| | | return listClass; |
| | | } |
| | | |
| | | public void setListClass(String listClass) |
| | | { |
| | | this.listClass = listClass; |
| | | } |
| | | /** 备注 */ |
| | | private String remark; |
| | | |
| | | public boolean getDefault() |
| | | { |
| | | return UserConstants.YES.equals(this.isDefault) ? true : false; |
| | | } |
| | | |
| | | public String getIsDefault() |
| | | { |
| | | return isDefault; |
| | | } |
| | | |
| | | public void setIsDefault(String isDefault) |
| | | { |
| | | this.isDefault = isDefault; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("dictCode", getDictCode()) |
| | | .append("dictSort", getDictSort()) |
| | | .append("dictLabel", getDictLabel()) |
| | | .append("dictValue", getDictValue()) |
| | | .append("dictType", getDictType()) |
| | | .append("cssClass", getCssClass()) |
| | | .append("listClass", getListClass()) |
| | | .append("isDefault", getIsDefault()) |
| | | .append("status", getStatus()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 字典类型表 sys_dict_type |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysDictType extends BaseEntity |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_config") |
| | | public class SysDictType |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 字典主键 */ |
| | | @Excel(name = "字典主键", cellType = ColumnType.NUMERIC) |
| | | @TableId(value = "dict_id",type = IdType.AUTO) |
| | | private Long dictId; |
| | | |
| | | /** 字典名称 */ |
| | | @Excel(name = "字典名称") |
| | | @NotBlank(message = "字典名称不能为空") |
| | | @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符") |
| | | private String dictName; |
| | | |
| | | /** 字典类型 */ |
| | | @Excel(name = "字典类型") |
| | | @NotBlank(message = "字典类型不能为空") |
| | | @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符") |
| | | private String dictType; |
| | | |
| | | /** 状态(0正常 1停用) */ |
| | | @Excel(name = "状态", readConverterExp = "0=正常,1=停用") |
| | | private String status; |
| | | |
| | | public Long getDictId() |
| | | { |
| | | return dictId; |
| | | } |
| | | /** 创建者 */ |
| | | private String createBy; |
| | | |
| | | public void setDictId(Long dictId) |
| | | { |
| | | this.dictId = dictId; |
| | | } |
| | | /** 创建时间 */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | @NotBlank(message = "字典名称不能为空") |
| | | @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符") |
| | | public String getDictName() |
| | | { |
| | | return dictName; |
| | | } |
| | | /** 更新者 */ |
| | | private String updateBy; |
| | | |
| | | public void setDictName(String dictName) |
| | | { |
| | | this.dictName = dictName; |
| | | } |
| | | /** 更新时间 */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | @NotBlank(message = "字典类型不能为空") |
| | | @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符") |
| | | public String getDictType() |
| | | { |
| | | return dictType; |
| | | } |
| | | /** 备注 */ |
| | | private String remark; |
| | | |
| | | public void setDictType(String dictType) |
| | | { |
| | | this.dictType = dictType; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("dictId", getDictId()) |
| | | .append("dictName", getDictName()) |
| | | .append("dictType", getDictType()) |
| | | .append("status", getStatus()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 菜单权限表 sys_menu |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysMenu extends BaseEntity |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_menu") |
| | | public class SysMenu |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 菜单ID */ |
| | | @TableId(value = "menu_id",type = IdType.AUTO) |
| | | private Long menuId; |
| | | |
| | | /** 菜单名称 */ |
| | | @NotBlank(message = "菜单名称不能为空") |
| | | @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符") |
| | | private String menuName; |
| | | |
| | | /** 父菜单名称 */ |
| | |
| | | private Long parentId; |
| | | |
| | | /** 显示顺序 */ |
| | | @NotBlank(message = "显示顺序不能为空") |
| | | private String orderNum; |
| | | |
| | | /** 路由地址 */ |
| | | @Size(min = 0, max = 200, message = "路由地址不能超过200个字符") |
| | | private String path; |
| | | |
| | | /** 组件路径 */ |
| | | @Size(min = 0, max = 200, message = "组件路径不能超过255个字符") |
| | | private String component; |
| | | |
| | | /** 是否为外链(0是 1否) */ |
| | |
| | | private String isCache; |
| | | |
| | | /** 类型(M目录 C菜单 F按钮) */ |
| | | @NotBlank(message = "菜单类型不能为空") |
| | | private String menuType; |
| | | |
| | | /** 显示状态(0显示 1隐藏) */ |
| | |
| | | private String status; |
| | | |
| | | /** 权限字符串 */ |
| | | @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符") |
| | | private String perms; |
| | | |
| | | /** 菜单图标 */ |
| | | private String icon; |
| | | |
| | | /** 创建者 */ |
| | | private String createBy; |
| | | |
| | | /** 创建时间 */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** 更新者 */ |
| | | private String updateBy; |
| | | |
| | | /** 更新时间 */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** 备注 */ |
| | | private String remark; |
| | | |
| | | /** 请求参数 */ |
| | | @TableField(exist = false) |
| | | private Map<String, Object> params = new HashMap<>(); |
| | | |
| | | /** 子菜单 */ |
| | | @TableField(exist = false) |
| | | private List<SysMenu> children = new ArrayList<SysMenu>(); |
| | | |
| | | public Long getMenuId() |
| | | { |
| | | return menuId; |
| | | } |
| | | |
| | | public void setMenuId(Long menuId) |
| | | { |
| | | this.menuId = menuId; |
| | | } |
| | | |
| | | @NotBlank(message = "菜单名称不能为空") |
| | | @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符") |
| | | public String getMenuName() |
| | | { |
| | | return menuName; |
| | | } |
| | | |
| | | public void setMenuName(String menuName) |
| | | { |
| | | this.menuName = menuName; |
| | | } |
| | | |
| | | public String getParentName() |
| | | { |
| | | return parentName; |
| | | } |
| | | |
| | | public void setParentName(String parentName) |
| | | { |
| | | this.parentName = parentName; |
| | | } |
| | | |
| | | public Long getParentId() |
| | | { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) |
| | | { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | @NotBlank(message = "显示顺序不能为空") |
| | | public String getOrderNum() |
| | | { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(String orderNum) |
| | | { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | @Size(min = 0, max = 200, message = "路由地址不能超过200个字符") |
| | | public String getPath() |
| | | { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) |
| | | { |
| | | this.path = path; |
| | | } |
| | | |
| | | @Size(min = 0, max = 200, message = "组件路径不能超过255个字符") |
| | | public String getComponent() |
| | | { |
| | | return component; |
| | | } |
| | | |
| | | public void setComponent(String component) |
| | | { |
| | | this.component = component; |
| | | } |
| | | |
| | | public String getIsFrame() |
| | | { |
| | | return isFrame; |
| | | } |
| | | |
| | | public void setIsFrame(String isFrame) |
| | | { |
| | | this.isFrame = isFrame; |
| | | } |
| | | |
| | | public String getIsCache() |
| | | { |
| | | return isCache; |
| | | } |
| | | |
| | | public void setIsCache(String isCache) |
| | | { |
| | | this.isCache = isCache; |
| | | } |
| | | |
| | | @NotBlank(message = "菜单类型不能为空") |
| | | public String getMenuType() |
| | | { |
| | | return menuType; |
| | | } |
| | | |
| | | public void setMenuType(String menuType) |
| | | { |
| | | this.menuType = menuType; |
| | | } |
| | | |
| | | public String getVisible() |
| | | { |
| | | return visible; |
| | | } |
| | | |
| | | public void setVisible(String visible) |
| | | { |
| | | this.visible = visible; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符") |
| | | public String getPerms() |
| | | { |
| | | return perms; |
| | | } |
| | | |
| | | public void setPerms(String perms) |
| | | { |
| | | this.perms = perms; |
| | | } |
| | | |
| | | public String getIcon() |
| | | { |
| | | return icon; |
| | | } |
| | | |
| | | public void setIcon(String icon) |
| | | { |
| | | this.icon = icon; |
| | | } |
| | | |
| | | public List<SysMenu> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<SysMenu> children) |
| | | { |
| | | this.children = children; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("menuId", getMenuId()) |
| | | .append("menuName", getMenuName()) |
| | | .append("parentId", getParentId()) |
| | | .append("orderNum", getOrderNum()) |
| | | .append("path", getPath()) |
| | | .append("component", getComponent()) |
| | | .append("isFrame", getIsFrame()) |
| | | .append("IsCache", getIsCache()) |
| | | .append("menuType", getMenuType()) |
| | | .append("visible", getVisible()) |
| | | .append("status ", getStatus()) |
| | | .append("perms", getPerms()) |
| | | .append("icon", getIcon()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 角色表 sys_role |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysRole extends BaseEntity |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_role") |
| | | public class SysRole |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 角色ID */ |
| | | @Excel(name = "角色序号", cellType = ColumnType.NUMERIC) |
| | | @TableId(value = "role_id",type = IdType.AUTO) |
| | | private Long roleId; |
| | | |
| | | /** 角色名称 */ |
| | | @Excel(name = "角色名称") |
| | | @NotBlank(message = "角色名称不能为空") |
| | | @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符") |
| | | private String roleName; |
| | | |
| | | /** 角色权限 */ |
| | | @Excel(name = "角色权限") |
| | | @NotBlank(message = "权限字符不能为空") |
| | | @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符") |
| | | private String roleKey; |
| | | |
| | | /** 角色排序 */ |
| | | @Excel(name = "角色排序") |
| | | @NotBlank(message = "显示顺序不能为空") |
| | | private String roleSort; |
| | | |
| | | /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限) */ |
| | |
| | | private String status; |
| | | |
| | | /** 删除标志(0代表存在 2代表删除) */ |
| | | @TableLogic |
| | | private String delFlag; |
| | | |
| | | /** 创建者 */ |
| | | private String createBy; |
| | | |
| | | /** 创建时间 */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** 更新者 */ |
| | | private String updateBy; |
| | | |
| | | /** 更新时间 */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** 备注 */ |
| | | private String remark; |
| | | |
| | | /** 用户是否存在此角色标识 默认不存在 */ |
| | | @TableField(exist = false) |
| | | private boolean flag = false; |
| | | |
| | | /** 菜单组 */ |
| | | @TableField(exist = false) |
| | | private Long[] menuIds; |
| | | |
| | | /** 部门组(数据权限) */ |
| | | @TableField(exist = false) |
| | | private Long[] deptIds; |
| | | |
| | | public SysRole() |
| | | { |
| | | |
| | | } |
| | | |
| | | public SysRole(Long roleId) |
| | | { |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | public Long getRoleId() |
| | | { |
| | | return roleId; |
| | | } |
| | | |
| | | public void setRoleId(Long roleId) |
| | | { |
| | | this.roleId = roleId; |
| | | } |
| | |
| | | return roleId != null && 1L == roleId; |
| | | } |
| | | |
| | | @NotBlank(message = "角色名称不能为空") |
| | | @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符") |
| | | public String getRoleName() |
| | | { |
| | | return roleName; |
| | | } |
| | | |
| | | public void setRoleName(String roleName) |
| | | { |
| | | this.roleName = roleName; |
| | | } |
| | | |
| | | @NotBlank(message = "权限字符不能为空") |
| | | @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符") |
| | | public String getRoleKey() |
| | | { |
| | | return roleKey; |
| | | } |
| | | |
| | | public void setRoleKey(String roleKey) |
| | | { |
| | | this.roleKey = roleKey; |
| | | } |
| | | |
| | | @NotBlank(message = "显示顺序不能为空") |
| | | public String getRoleSort() |
| | | { |
| | | return roleSort; |
| | | } |
| | | |
| | | public void setRoleSort(String roleSort) |
| | | { |
| | | this.roleSort = roleSort; |
| | | } |
| | | |
| | | public String getDataScope() |
| | | { |
| | | return dataScope; |
| | | } |
| | | |
| | | public void setDataScope(String dataScope) |
| | | { |
| | | this.dataScope = dataScope; |
| | | } |
| | | |
| | | public boolean isMenuCheckStrictly() |
| | | { |
| | | return menuCheckStrictly; |
| | | } |
| | | |
| | | public void setMenuCheckStrictly(boolean menuCheckStrictly) |
| | | { |
| | | this.menuCheckStrictly = menuCheckStrictly; |
| | | } |
| | | |
| | | public boolean isDeptCheckStrictly() |
| | | { |
| | | return deptCheckStrictly; |
| | | } |
| | | |
| | | public void setDeptCheckStrictly(boolean deptCheckStrictly) |
| | | { |
| | | this.deptCheckStrictly = deptCheckStrictly; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public boolean isFlag() |
| | | { |
| | | return flag; |
| | | } |
| | | |
| | | public void setFlag(boolean flag) |
| | | { |
| | | this.flag = flag; |
| | | } |
| | | |
| | | public Long[] getMenuIds() |
| | | { |
| | | return menuIds; |
| | | } |
| | | |
| | | public void setMenuIds(Long[] menuIds) |
| | | { |
| | | this.menuIds = menuIds; |
| | | } |
| | | |
| | | public Long[] getDeptIds() |
| | | { |
| | | return deptIds; |
| | | } |
| | | |
| | | public void setDeptIds(Long[] deptIds) |
| | | { |
| | | this.deptIds = deptIds; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("roleId", getRoleId()) |
| | | .append("roleName", getRoleName()) |
| | | .append("roleKey", getRoleKey()) |
| | | .append("roleSort", getRoleSort()) |
| | | .append("dataScope", getDataScope()) |
| | | .append("menuCheckStrictly", isMenuCheckStrictly()) |
| | | .append("deptCheckStrictly", isDeptCheckStrictly()) |
| | | .append("status", getStatus()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import javax.validation.constraints.Email; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.annotation.Excel.Type; |
| | | import com.ruoyi.common.annotation.Excels; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.Email; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户对象 sys_user |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysUser extends BaseEntity |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_user") |
| | | public class SysUser |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 用户ID */ |
| | | @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号") |
| | | @TableId(value = "user_id",type = IdType.AUTO) |
| | | private Long userId; |
| | | |
| | | /** 部门ID */ |
| | |
| | | private Long deptId; |
| | | |
| | | /** 用户账号 */ |
| | | @NotBlank(message = "用户账号不能为空") |
| | | @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") |
| | | @Excel(name = "登录名称") |
| | | private String userName; |
| | | |
| | | /** 用户昵称 */ |
| | | @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") |
| | | @Excel(name = "用户名称") |
| | | private String nickName; |
| | | |
| | | /** 用户邮箱 */ |
| | | @Email(message = "邮箱格式不正确") |
| | | @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") |
| | | @Excel(name = "用户邮箱") |
| | | private String email; |
| | | |
| | | /** 手机号码 */ |
| | | @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") |
| | | @Excel(name = "手机号码") |
| | | private String phonenumber; |
| | | |
| | |
| | | private String avatar; |
| | | |
| | | /** 密码 */ |
| | | @JsonIgnore |
| | | @JsonProperty |
| | | private String password; |
| | | |
| | | /** 盐加密 */ |
| | |
| | | private String status; |
| | | |
| | | /** 删除标志(0代表存在 2代表删除) */ |
| | | @TableLogic |
| | | private String delFlag; |
| | | |
| | | /** 最后登录IP */ |
| | |
| | | @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) |
| | | private Date loginDate; |
| | | |
| | | /** 创建者 */ |
| | | private String createBy; |
| | | |
| | | /** 创建时间 */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** 更新者 */ |
| | | private String updateBy; |
| | | |
| | | /** 更新时间 */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** 备注 */ |
| | | private String remark; |
| | | |
| | | /** 部门对象 */ |
| | | @Excels({ |
| | | @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), |
| | | @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT) |
| | | }) |
| | | @TableField(exist = false) |
| | | private SysDept dept; |
| | | |
| | | /** 角色对象 */ |
| | | @TableField(exist = false) |
| | | private List<SysRole> roles; |
| | | |
| | | /** 角色组 */ |
| | | @TableField(exist = false) |
| | | private Long[] roleIds; |
| | | |
| | | /** 岗位组 */ |
| | | @TableField(exist = false) |
| | | private Long[] postIds; |
| | | |
| | | public SysUser() |
| | | { |
| | | |
| | | } |
| | | |
| | | public SysUser(Long userId) |
| | | { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Long getUserId() |
| | | { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Long userId) |
| | | { |
| | | this.userId = userId; |
| | | } |
| | |
| | | return userId != null && 1L == userId; |
| | | } |
| | | |
| | | public Long getDeptId() |
| | | { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) |
| | | { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") |
| | | public String getNickName() |
| | | { |
| | | return nickName; |
| | | } |
| | | |
| | | public void setNickName(String nickName) |
| | | { |
| | | this.nickName = nickName; |
| | | } |
| | | |
| | | @NotBlank(message = "用户账号不能为空") |
| | | @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") |
| | | public String getUserName() |
| | | { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) |
| | | { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | @Email(message = "邮箱格式不正确") |
| | | @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") |
| | | public String getEmail() |
| | | { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) |
| | | { |
| | | this.email = email; |
| | | } |
| | | |
| | | @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") |
| | | public String getPhonenumber() |
| | | { |
| | | return phonenumber; |
| | | } |
| | | |
| | | public void setPhonenumber(String phonenumber) |
| | | { |
| | | this.phonenumber = phonenumber; |
| | | } |
| | | |
| | | public String getSex() |
| | | { |
| | | return sex; |
| | | } |
| | | |
| | | public void setSex(String sex) |
| | | { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public String getAvatar() |
| | | { |
| | | return avatar; |
| | | } |
| | | |
| | | public void setAvatar(String avatar) |
| | | { |
| | | this.avatar = avatar; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | @JsonProperty |
| | | public String getPassword() |
| | | { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) |
| | | { |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getSalt() |
| | | { |
| | | return salt; |
| | | } |
| | | |
| | | public void setSalt(String salt) |
| | | { |
| | | this.salt = salt; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getLoginIp() |
| | | { |
| | | return loginIp; |
| | | } |
| | | |
| | | public void setLoginIp(String loginIp) |
| | | { |
| | | this.loginIp = loginIp; |
| | | } |
| | | |
| | | public Date getLoginDate() |
| | | { |
| | | return loginDate; |
| | | } |
| | | |
| | | public void setLoginDate(Date loginDate) |
| | | { |
| | | this.loginDate = loginDate; |
| | | } |
| | | |
| | | public SysDept getDept() |
| | | { |
| | | return dept; |
| | | } |
| | | |
| | | public void setDept(SysDept dept) |
| | | { |
| | | this.dept = dept; |
| | | } |
| | | |
| | | public List<SysRole> getRoles() |
| | | { |
| | | return roles; |
| | | } |
| | | |
| | | public void setRoles(List<SysRole> roles) |
| | | { |
| | | this.roles = roles; |
| | | } |
| | | |
| | | public Long[] getRoleIds() |
| | | { |
| | | return roleIds; |
| | | } |
| | | |
| | | public void setRoleIds(Long[] roleIds) |
| | | { |
| | | this.roleIds = roleIds; |
| | | } |
| | | |
| | | public Long[] getPostIds() |
| | | { |
| | | return postIds; |
| | | } |
| | | |
| | | public void setPostIds(Long[] postIds) |
| | | { |
| | | this.postIds = postIds; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("userId", getUserId()) |
| | | .append("deptId", getDeptId()) |
| | | .append("userName", getUserName()) |
| | | .append("nickName", getNickName()) |
| | | .append("email", getEmail()) |
| | | .append("phonenumber", getPhonenumber()) |
| | | .append("sex", getSex()) |
| | | .append("avatar", getAvatar()) |
| | | .append("password", getPassword()) |
| | | .append("salt", getSalt()) |
| | | .append("status", getStatus()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("loginIp", getLoginIp()) |
| | | .append("loginDate", getLoginDate()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .append("dept", getDept()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 参数配置表 sys_config |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysConfig extends BaseEntity |
| | | { |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_config") |
| | | public class SysConfig { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 参数主键 */ |
| | | /** |
| | | * 参数主键 |
| | | */ |
| | | @Excel(name = "参数主键", cellType = ColumnType.NUMERIC) |
| | | @TableId(value = "config_id", type = IdType.AUTO) |
| | | private Long configId; |
| | | |
| | | /** 参数名称 */ |
| | | /** |
| | | * 参数名称 |
| | | */ |
| | | @Excel(name = "参数名称") |
| | | @NotBlank(message = "参数名称不能为空") |
| | | @Size(min = 0, max = 100, message = "参数名称不能超过100个字符") |
| | | private String configName; |
| | | |
| | | /** 参数键名 */ |
| | | /** |
| | | * 参数键名 |
| | | */ |
| | | @Excel(name = "参数键名") |
| | | @NotBlank(message = "参数键名长度不能为空") |
| | | @Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符") |
| | | private String configKey; |
| | | |
| | | /** 参数键值 */ |
| | | /** |
| | | * 参数键值 |
| | | */ |
| | | @Excel(name = "参数键值") |
| | | @NotBlank(message = "参数键值不能为空") |
| | | @Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符") |
| | | private String configValue; |
| | | |
| | | /** 系统内置(Y是 N否) */ |
| | | /** |
| | | * 系统内置(Y是 N否) |
| | | */ |
| | | @Excel(name = "系统内置", readConverterExp = "Y=是,N=否") |
| | | private String configType; |
| | | |
| | | public Long getConfigId() |
| | | { |
| | | return configId; |
| | | } |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | private String createBy; |
| | | |
| | | public void setConfigId(Long configId) |
| | | { |
| | | this.configId = configId; |
| | | } |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | @NotBlank(message = "参数名称不能为空") |
| | | @Size(min = 0, max = 100, message = "参数名称不能超过100个字符") |
| | | public String getConfigName() |
| | | { |
| | | return configName; |
| | | } |
| | | /** |
| | | * 更新者 |
| | | */ |
| | | private String updateBy; |
| | | |
| | | public void setConfigName(String configName) |
| | | { |
| | | this.configName = configName; |
| | | } |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | @NotBlank(message = "参数键名长度不能为空") |
| | | @Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符") |
| | | public String getConfigKey() |
| | | { |
| | | return configKey; |
| | | } |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | public void setConfigKey(String configKey) |
| | | { |
| | | this.configKey = configKey; |
| | | } |
| | | /** |
| | | * 请求参数 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Map<String, Object> params = new HashMap<>(); |
| | | |
| | | @NotBlank(message = "参数键值不能为空") |
| | | @Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符") |
| | | public String getConfigValue() |
| | | { |
| | | return configValue; |
| | | } |
| | | |
| | | public void setConfigValue(String configValue) |
| | | { |
| | | this.configValue = configValue; |
| | | } |
| | | |
| | | public String getConfigType() |
| | | { |
| | | return configType; |
| | | } |
| | | |
| | | public void setConfigType(String configType) |
| | | { |
| | | this.configType = configType; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("configId", getConfigId()) |
| | | .append("configName", getConfigName()) |
| | | .append("configKey", getConfigKey()) |
| | | .append("configValue", getConfigValue()) |
| | | .append("configType", getConfigType()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 系统访问记录表 sys_logininfor |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysLogininfor extends BaseEntity |
| | | { |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_logininfor") |
| | | public class SysLogininfor { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ID */ |
| | | /** |
| | | * ID |
| | | */ |
| | | @Excel(name = "序号", cellType = ColumnType.NUMERIC) |
| | | @TableId(value = "info_id", type = IdType.AUTO) |
| | | 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; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 通知公告表 sys_notice |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysNotice extends BaseEntity |
| | | { |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_notice") |
| | | public class SysNotice { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 公告ID */ |
| | | /** |
| | | * 公告ID |
| | | */ |
| | | @TableId(value = "notice_id", type = IdType.AUTO) |
| | | private Long noticeId; |
| | | |
| | | /** 公告标题 */ |
| | | private String noticeTitle; |
| | | |
| | | /** 公告类型(1通知 2公告) */ |
| | | private String noticeType; |
| | | |
| | | /** 公告内容 */ |
| | | private String noticeContent; |
| | | |
| | | /** 公告状态(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; |
| | | } |
| | | |
| | | /** |
| | | * 公告标题 |
| | | */ |
| | | @NotBlank(message = "公告标题不能为空") |
| | | @Size(min = 0, max = 50, message = "公告标题不能超过50个字符") |
| | | public String getNoticeTitle() |
| | | { |
| | | return noticeTitle; |
| | | } |
| | | private String noticeTitle; |
| | | |
| | | public void setNoticeType(String noticeType) |
| | | { |
| | | this.noticeType = noticeType; |
| | | } |
| | | /** |
| | | * 公告类型(1通知 2公告) |
| | | */ |
| | | private String noticeType; |
| | | |
| | | public String getNoticeType() |
| | | { |
| | | return noticeType; |
| | | } |
| | | /** |
| | | * 公告内容 |
| | | */ |
| | | private String noticeContent; |
| | | |
| | | public void setNoticeContent(String noticeContent) |
| | | { |
| | | this.noticeContent = noticeContent; |
| | | } |
| | | /** |
| | | * 公告状态(0正常 1关闭) |
| | | */ |
| | | private String status; |
| | | |
| | | public String getNoticeContent() |
| | | { |
| | | return noticeContent; |
| | | } |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | private String createBy; |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | /** |
| | | * 更新者 |
| | | */ |
| | | private String updateBy; |
| | | |
| | | @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(); |
| | | } |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 操作日志记录表 oper_log |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysOperLog extends BaseEntity |
| | | { |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_oper_log") |
| | | public class SysOperLog { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 日志主键 */ |
| | | /** |
| | | * 日志主键 |
| | | */ |
| | | @Excel(name = "操作序号", cellType = ColumnType.NUMERIC) |
| | | @TableId(value = "oper_id", type = IdType.AUTO) |
| | | 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; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 岗位表 sys_post |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysPost extends BaseEntity |
| | | { |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_post") |
| | | public class SysPost { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 岗位序号 */ |
| | | /** |
| | | * 岗位序号 |
| | | */ |
| | | @Excel(name = "岗位序号", cellType = ColumnType.NUMERIC) |
| | | @TableId(value = "post_id", type = IdType.AUTO) |
| | | 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 = "岗位排序") |
| | | @NotBlank(message = "显示顺序不能为空") |
| | | private String postSort; |
| | | |
| | | /** 状态(0正常 1停用) */ |
| | | /** |
| | | * 状态(0正常 1停用) |
| | | */ |
| | | @Excel(name = "状态", readConverterExp = "0=正常,1=停用") |
| | | private String status; |
| | | |
| | | /** 用户是否存在此岗位标识 默认不存在 */ |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | private String createBy; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新者 |
| | | */ |
| | | private String updateBy; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 用户是否存在此岗位标识 默认不存在 |
| | | */ |
| | | @TableField(exist = false) |
| | | 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; |
| | | } |
| | | |
| | | @NotBlank(message = "显示顺序不能为空") |
| | | public String getPostSort() |
| | | { |
| | | return postSort; |
| | | } |
| | | |
| | | public void setPostSort(String 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(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 角色和部门关联 sys_role_dept |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysRoleDept |
| | | { |
| | | /** 角色ID */ |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_role_dept") |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 角色和菜单关联 sys_role_menu |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysRoleMenu |
| | | { |
| | | /** 角色ID */ |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_role_menu") |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 当前在线会话 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysUserOnline |
| | | { |
| | | /** 会话编号 */ |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | 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; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 用户和岗位关联 sys_user_post |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysUserPost |
| | | { |
| | | /** 用户ID */ |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_config") |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 用户和角色关联 sys_user_role |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysUserRole |
| | | { |
| | | /** 用户ID */ |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_config") |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * 路由显示信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class MetaVo |
| | | { |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | public class MetaVo { |
| | | /** |
| | | * 设置该路由在侧边栏和面包屑中展示的名字 |
| | | */ |
| | |
| | | */ |
| | | private boolean noCache; |
| | | |
| | | 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 boolean isNoCache() |
| | | { |
| | | return 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; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @JsonInclude(JsonInclude.Include.NON_EMPTY) |
| | | public class RouterVo |
| | | { |
| | | 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 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; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | |
| | | /** |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysConfigMapper |
| | | { |
| | | /** |
| | | * 查询参数配置信息 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 参数配置信息 |
| | | */ |
| | | public SysConfig selectConfig(SysConfig config); |
| | | public interface SysConfigMapper extends BaseMapper<SysConfig> { |
| | | |
| | | /** |
| | | * 查询参数配置列表 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 参数配置集合 |
| | | */ |
| | | public List<SysConfig> selectConfigList(SysConfig config); |
| | | |
| | | /** |
| | | * 根据键名查询参数配置信息 |
| | | * |
| | | * @param configKey 参数键名 |
| | | * @return 参数配置信息 |
| | | */ |
| | | public SysConfig checkConfigKeyUnique(String configKey); |
| | | |
| | | /** |
| | | * 新增参数配置 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertConfig(SysConfig config); |
| | | |
| | | /** |
| | | * 修改参数配置 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateConfig(SysConfig config); |
| | | |
| | | /** |
| | | * 删除参数配置 |
| | | * |
| | | * @param configId 参数ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteConfigById(Long configId); |
| | | |
| | | /** |
| | | * 批量删除参数信息 |
| | | * |
| | | * @param configIds 需要删除的参数ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteConfigByIds(Long[] configIds); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 部门管理 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysDeptMapper |
| | | { |
| | | public interface SysDeptMapper extends BaseMapper<SysDept> { |
| | | /** |
| | | * 查询部门管理数据 |
| | | * |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 字典表 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysDictDataMapper |
| | | { |
| | | public interface SysDictDataMapper extends BaseMapper<SysDictData> { |
| | | /** |
| | | * 根据条件分页查询字典数据 |
| | | * |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.domain.entity.SysDictType; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 字典表 数据层 |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Mapper |
| | | public interface SysDictTypeMapper |
| | | { |
| | | public interface SysDictTypeMapper extends BaseMapper<SysDictType> { |
| | | /** |
| | | * 根据条件分页查询字典类型 |
| | | * |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysLogininfor; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 系统访问日志情况信息 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysLogininforMapper |
| | | { |
| | | public interface SysLogininforMapper extends BaseMapper<SysLogininfor> { |
| | | /** |
| | | * 新增系统登录日志 |
| | | * |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 菜单表 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysMenuMapper |
| | | { |
| | | public interface SysMenuMapper extends BaseMapper<SysMenu> { |
| | | /** |
| | | * 查询系统菜单列表 |
| | | * |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 通知公告表 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysNoticeMapper |
| | | { |
| | | public interface SysNoticeMapper extends BaseMapper<SysNotice> { |
| | | /** |
| | | * 查询公告信息 |
| | | * |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysOperLog; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 操作日志 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysOperLogMapper |
| | | { |
| | | public interface SysOperLogMapper extends BaseMapper<SysOperLog> { |
| | | /** |
| | | * 新增操作日志 |
| | | * |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 岗位信息 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysPostMapper |
| | | { |
| | | public interface SysPostMapper extends BaseMapper<SysPost> { |
| | | /** |
| | | * 查询岗位数据集合 |
| | | * |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysRoleDept; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 角色与部门关联表 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysRoleDeptMapper |
| | | { |
| | | public interface SysRoleDeptMapper extends BaseMapper<SysRoleDept> { |
| | | /** |
| | | * 通过角色ID删除角色和部门关联 |
| | | * |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 角色表 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysRoleMapper |
| | | { |
| | | public interface SysRoleMapper extends BaseMapper<SysRole> { |
| | | /** |
| | | * 根据条件分页查询角色数据 |
| | | * |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysRoleMenu; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 角色与菜单关联表 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysRoleMenuMapper |
| | | { |
| | | public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> { |
| | | /** |
| | | * 查询菜单使用数量 |
| | | * |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户表 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysUserMapper |
| | | { |
| | | public interface SysUserMapper extends BaseMapper<SysUser> { |
| | | /** |
| | | * 根据条件分页查询用户列表 |
| | | * |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysUserPost; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户与岗位关联表 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysUserPostMapper |
| | | { |
| | | public interface SysUserPostMapper extends BaseMapper<SysUserPost> { |
| | | /** |
| | | * 通过用户ID删除用户和岗位关联 |
| | | * |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户与角色关联表 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysUserRoleMapper |
| | | { |
| | | public interface SysUserRoleMapper extends BaseMapper<SysUserRole> { |
| | | /** |
| | | * 通过用户ID删除用户和角色关联 |
| | | * |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 参数配置 服务层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysConfigService |
| | | { |
| | | public interface ISysConfigService extends IService<SysConfig> { |
| | | /** |
| | | * 查询参数配置信息 |
| | | * |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.TreeSelect; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 部门管理 服务层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysDeptService |
| | | { |
| | | public interface ISysDeptService extends IService<SysDept> { |
| | | /** |
| | | * 查询部门管理数据 |
| | | * |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 字典 业务层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysDictDataService |
| | | { |
| | | public interface ISysDictDataService extends IService<SysDictData> { |
| | | /** |
| | | * 根据条件分页查询字典数据 |
| | | * |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.core.domain.entity.SysDictType; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 字典 业务层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysDictTypeService |
| | | { |
| | | public interface ISysDictTypeService extends IService<SysDictType> { |
| | | /** |
| | | * 根据条件分页查询字典类型 |
| | | * |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.domain.SysLogininfor; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 系统访问日志情况信息 服务层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysLogininforService |
| | | { |
| | | public interface ISysLogininforService extends IService<SysLogininfor> { |
| | | /** |
| | | * 新增系统登录日志 |
| | | * |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.TreeSelect; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.system.domain.vo.RouterVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 菜单 业务层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysMenuService |
| | | { |
| | | public interface ISysMenuService extends IService<SysMenu> { |
| | | /** |
| | | * 根据用户查询系统菜单列表 |
| | | * |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 公告 服务层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysNoticeService |
| | | { |
| | | public interface ISysNoticeService extends IService<SysNotice> { |
| | | /** |
| | | * 查询公告信息 |
| | | * |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.domain.SysOperLog; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 操作日志 服务层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysOperLogService |
| | | { |
| | | public interface ISysOperLogService extends IService<SysOperLog> { |
| | | /** |
| | | * 新增操作日志 |
| | | * |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 岗位信息 服务层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysPostService |
| | | { |
| | | public interface ISysPostService extends IService<SysPost> { |
| | | /** |
| | | * 查询岗位信息集合 |
| | | * |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | |
| | | /** |
| | | * 角色业务层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysRoleService |
| | | { |
| | | public interface ISysRoleService extends IService<SysRole> { |
| | | /** |
| | | * 根据条件分页查询角色数据 |
| | | * |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysUserOnlineService |
| | | { |
| | | public interface ISysUserOnlineService { |
| | | /** |
| | | * 通过登录地址查询信息 |
| | | * |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户 业务层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysUserService |
| | | { |
| | | public interface ISysUserService extends IService<SysUser> { |
| | | /** |
| | | * 根据条件分页查询用户列表 |
| | | * |
| | |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.lang.Validator; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.annotation.DataSource; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Arrays; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 参数配置 服务层实现 |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysConfigServiceImpl implements ISysConfigService |
| | | { |
| | | @Autowired |
| | | private SysConfigMapper configMapper; |
| | | public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements ISysConfigService { |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | |
| | | * 项目启动时,初始化参数到缓存 |
| | | */ |
| | | @PostConstruct |
| | | public void init() |
| | | { |
| | | List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig()); |
| | | for (SysConfig config : configsList) |
| | | { |
| | | public void init() { |
| | | List<SysConfig> configsList = baseMapper.selectList(new LambdaQueryWrapper<>()); |
| | | for (SysConfig config : configsList) { |
| | | redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | @DataSource(DataSourceType.MASTER) |
| | | public SysConfig selectConfigById(Long configId) |
| | | { |
| | | SysConfig config = new SysConfig(); |
| | | config.setConfigId(configId); |
| | | return configMapper.selectConfig(config); |
| | | public SysConfig selectConfigById(Long configId) { |
| | | return baseMapper.selectById(configId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 参数键值 |
| | | */ |
| | | @Override |
| | | public String selectConfigByKey(String configKey) |
| | | { |
| | | public String selectConfigByKey(String configKey) { |
| | | String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(configKey))); |
| | | if (Validator.isNotEmpty(configValue)) |
| | | { |
| | | if (Validator.isNotEmpty(configValue)) { |
| | | return configValue; |
| | | } |
| | | SysConfig config = new SysConfig(); |
| | | config.setConfigKey(configKey); |
| | | SysConfig retConfig = configMapper.selectConfig(config); |
| | | if (Validator.isNotNull(retConfig)) |
| | | { |
| | | SysConfig retConfig = baseMapper.selectOne(new LambdaQueryWrapper<SysConfig>() |
| | | .eq(SysConfig::getConfigKey, configKey)); |
| | | if (Validator.isNotNull(retConfig)) { |
| | | redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue()); |
| | | return retConfig.getConfigValue(); |
| | | } |
| | |
| | | * @return 参数配置集合 |
| | | */ |
| | | @Override |
| | | public List<SysConfig> selectConfigList(SysConfig config) |
| | | { |
| | | return configMapper.selectConfigList(config); |
| | | public List<SysConfig> selectConfigList(SysConfig config) { |
| | | LambdaQueryWrapper<SysConfig> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.like(StrUtil.isNotBlank(config.getConfigName()), SysConfig::getConfigName, config.getConfigName()); |
| | | lqw.eq(StrUtil.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType()); |
| | | lqw.like(StrUtil.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey()); |
| | | Map<String, Object> params = config.getParams(); |
| | | lqw.between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysConfig::getCreateTime, params.get("beginTime"), params.get("endTime")); |
| | | return baseMapper.selectList(lqw); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertConfig(SysConfig config) |
| | | { |
| | | int row = configMapper.insertConfig(config); |
| | | if (row > 0) |
| | | { |
| | | public int insertConfig(SysConfig config) { |
| | | int row = baseMapper.insert(config); |
| | | if (row > 0) { |
| | | redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); |
| | | } |
| | | return row; |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateConfig(SysConfig config) |
| | | { |
| | | int row = configMapper.updateConfig(config); |
| | | if (row > 0) |
| | | { |
| | | public int updateConfig(SysConfig config) { |
| | | int row = baseMapper.updateById(config); |
| | | if (row > 0) { |
| | | redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); |
| | | } |
| | | return row; |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteConfigByIds(Long[] configIds) |
| | | { |
| | | for (Long configId : configIds) |
| | | { |
| | | public int deleteConfigByIds(Long[] configIds) { |
| | | for (Long configId : configIds) { |
| | | SysConfig config = selectConfigById(configId); |
| | | if (StrUtil.equals(UserConstants.YES, config.getConfigType())) |
| | | { |
| | | if (StrUtil.equals(UserConstants.YES, config.getConfigType())) { |
| | | throw new CustomException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey())); |
| | | } |
| | | } |
| | | int count = configMapper.deleteConfigByIds(configIds); |
| | | if (count > 0) |
| | | { |
| | | int count = baseMapper.deleteBatchIds(Arrays.asList(configIds)); |
| | | if (count > 0) { |
| | | Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); |
| | | redisCache.deleteObject(keys); |
| | | } |
| | |
| | | * 清空缓存数据 |
| | | */ |
| | | @Override |
| | | public void clearCache() |
| | | { |
| | | public void clearCache() { |
| | | Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); |
| | | redisCache.deleteObject(keys); |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String checkConfigKeyUnique(SysConfig config) |
| | | { |
| | | public String checkConfigKeyUnique(SysConfig config) { |
| | | Long configId = Validator.isNull(config.getConfigId()) ? -1L : config.getConfigId(); |
| | | SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey()); |
| | | if (Validator.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) |
| | | { |
| | | SysConfig info = baseMapper.selectOne(new LambdaQueryWrapper<SysConfig>().eq(SysConfig::getConfigKey, config.getConfigKey())); |
| | | if (Validator.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | |
| | | * @param configKey 参数键 |
| | | * @return 缓存键key |
| | | */ |
| | | private String getCacheKey(String configKey) |
| | | { |
| | | private String getCacheKey(String configKey) { |
| | | return Constants.SYS_CONFIG_KEY + configKey; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.lang.Validator; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.annotation.DataScope; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.TreeSelect; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysDeptServiceImpl implements ISysDeptService |
| | | { |
| | | public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements ISysDeptService { |
| | | @Autowired |
| | | private SysDeptMapper deptMapper; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d") |
| | | public List<SysDept> selectDeptList(SysDept dept) |
| | | { |
| | | public List<SysDept> selectDeptList(SysDept dept) { |
| | | return deptMapper.selectDeptList(dept); |
| | | } |
| | | |
| | |
| | | * @return 树结构列表 |
| | | */ |
| | | @Override |
| | | public List<SysDept> buildDeptTree(List<SysDept> depts) |
| | | { |
| | | public List<SysDept> buildDeptTree(List<SysDept> depts) { |
| | | List<SysDept> returnList = new ArrayList<SysDept>(); |
| | | List<Long> tempList = new ArrayList<Long>(); |
| | | for (SysDept dept : depts) |
| | | { |
| | | for (SysDept dept : depts) { |
| | | tempList.add(dept.getDeptId()); |
| | | } |
| | | for (Iterator<SysDept> iterator = depts.iterator(); iterator.hasNext();) |
| | | { |
| | | for (Iterator<SysDept> iterator = depts.iterator(); iterator.hasNext(); ) { |
| | | SysDept dept = (SysDept) iterator.next(); |
| | | // 如果是顶级节点, 遍历该父节点的所有子节点 |
| | | if (!tempList.contains(dept.getParentId())) |
| | | { |
| | | if (!tempList.contains(dept.getParentId())) { |
| | | recursionFn(depts, dept); |
| | | returnList.add(dept); |
| | | } |
| | | } |
| | | if (returnList.isEmpty()) |
| | | { |
| | | if (returnList.isEmpty()) { |
| | | returnList = depts; |
| | | } |
| | | return returnList; |
| | |
| | | * @return 下拉树结构列表 |
| | | */ |
| | | @Override |
| | | public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts) |
| | | { |
| | | public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts) { |
| | | List<SysDept> deptTrees = buildDeptTree(depts); |
| | | return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); |
| | | } |
| | |
| | | * @return 选中部门列表 |
| | | */ |
| | | @Override |
| | | public List<Integer> selectDeptListByRoleId(Long roleId) |
| | | { |
| | | public List<Integer> selectDeptListByRoleId(Long roleId) { |
| | | SysRole role = roleMapper.selectRoleById(roleId); |
| | | return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly()); |
| | | } |
| | |
| | | * @return 部门信息 |
| | | */ |
| | | @Override |
| | | public SysDept selectDeptById(Long deptId) |
| | | { |
| | | public SysDept selectDeptById(Long deptId) { |
| | | return deptMapper.selectDeptById(deptId); |
| | | } |
| | | |
| | |
| | | * @return 子部门数 |
| | | */ |
| | | @Override |
| | | public int selectNormalChildrenDeptById(Long deptId) |
| | | { |
| | | public int selectNormalChildrenDeptById(Long deptId) { |
| | | return deptMapper.selectNormalChildrenDeptById(deptId); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean hasChildByDeptId(Long deptId) |
| | | { |
| | | public boolean hasChildByDeptId(Long deptId) { |
| | | int result = deptMapper.hasChildByDeptId(deptId); |
| | | return result > 0 ? true : false; |
| | | } |
| | |
| | | * @return 结果 true 存在 false 不存在 |
| | | */ |
| | | @Override |
| | | public boolean checkDeptExistUser(Long deptId) |
| | | { |
| | | public boolean checkDeptExistUser(Long deptId) { |
| | | int result = deptMapper.checkDeptExistUser(deptId); |
| | | return result > 0 ? true : false; |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String checkDeptNameUnique(SysDept dept) |
| | | { |
| | | public String checkDeptNameUnique(SysDept dept) { |
| | | Long deptId = Validator.isNull(dept.getDeptId()) ? -1L : dept.getDeptId(); |
| | | SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId()); |
| | | if (Validator.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) |
| | | { |
| | | if (Validator.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertDept(SysDept dept) |
| | | { |
| | | public int insertDept(SysDept dept) { |
| | | SysDept info = deptMapper.selectDeptById(dept.getParentId()); |
| | | // 如果父节点不为正常状态,则不允许新增子节点 |
| | | if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) |
| | | { |
| | | if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) { |
| | | throw new CustomException("部门停用,不允许新增"); |
| | | } |
| | | dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateDept(SysDept dept) |
| | | { |
| | | public int updateDept(SysDept dept) { |
| | | SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId()); |
| | | SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId()); |
| | | if (Validator.isNotNull(newParentDept) && Validator.isNotNull(oldDept)) |
| | | { |
| | | if (Validator.isNotNull(newParentDept) && Validator.isNotNull(oldDept)) { |
| | | String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId(); |
| | | String oldAncestors = oldDept.getAncestors(); |
| | | dept.setAncestors(newAncestors); |
| | | updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); |
| | | } |
| | | int result = deptMapper.updateDept(dept); |
| | | if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) |
| | | { |
| | | if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) { |
| | | // 如果该部门是启用状态,则启用该部门的所有上级部门 |
| | | updateParentDeptStatus(dept); |
| | | } |
| | |
| | | * |
| | | * @param dept 当前部门 |
| | | */ |
| | | private void updateParentDeptStatus(SysDept dept) |
| | | { |
| | | private void updateParentDeptStatus(SysDept dept) { |
| | | String updateBy = dept.getUpdateBy(); |
| | | dept = deptMapper.selectDeptById(dept.getDeptId()); |
| | | dept.setUpdateBy(updateBy); |
| | |
| | | * @param newAncestors 新的父ID集合 |
| | | * @param oldAncestors 旧的父ID集合 |
| | | */ |
| | | public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) |
| | | { |
| | | public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) { |
| | | List<SysDept> children = deptMapper.selectChildrenDeptById(deptId); |
| | | for (SysDept child : children) |
| | | { |
| | | for (SysDept child : children) { |
| | | child.setAncestors(child.getAncestors().replace(oldAncestors, newAncestors)); |
| | | } |
| | | if (children.size() > 0) |
| | | { |
| | | if (children.size() > 0) { |
| | | deptMapper.updateDeptChildren(children); |
| | | } |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteDeptById(Long deptId) |
| | | { |
| | | public int deleteDeptById(Long deptId) { |
| | | return deptMapper.deleteDeptById(deptId); |
| | | } |
| | | |
| | | /** |
| | | * 递归列表 |
| | | */ |
| | | private void recursionFn(List<SysDept> list, SysDept t) |
| | | { |
| | | private void recursionFn(List<SysDept> list, SysDept t) { |
| | | // 得到子节点列表 |
| | | List<SysDept> childList = getChildList(list, t); |
| | | t.setChildren(childList); |
| | | for (SysDept tChild : childList) |
| | | { |
| | | if (hasChild(list, tChild)) |
| | | { |
| | | for (SysDept tChild : childList) { |
| | | if (hasChild(list, tChild)) { |
| | | recursionFn(list, tChild); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 得到子节点列表 |
| | | */ |
| | | private List<SysDept> getChildList(List<SysDept> list, SysDept t) |
| | | { |
| | | private List<SysDept> getChildList(List<SysDept> list, SysDept t) { |
| | | List<SysDept> tlist = new ArrayList<SysDept>(); |
| | | Iterator<SysDept> it = list.iterator(); |
| | | while (it.hasNext()) |
| | | { |
| | | while (it.hasNext()) { |
| | | SysDept n = (SysDept) it.next(); |
| | | if (Validator.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) |
| | | { |
| | | if (Validator.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) { |
| | | tlist.add(n); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 判断是否有子节点 |
| | | */ |
| | | private boolean hasChild(List<SysDept> list, SysDept t) |
| | | { |
| | | private boolean hasChild(List<SysDept> list, SysDept t) { |
| | | return getChildList(list, t).size() > 0 ? true : false; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.system.mapper.SysDictDataMapper; |
| | | import com.ruoyi.system.service.ISysDictDataService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 字典 业务层处理 |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysDictDataServiceImpl implements ISysDictDataService |
| | | { |
| | | public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements ISysDictDataService { |
| | | @Autowired |
| | | private SysDictDataMapper dictDataMapper; |
| | | |
| | |
| | | * @return 字典数据集合信息 |
| | | */ |
| | | @Override |
| | | public List<SysDictData> selectDictDataList(SysDictData dictData) |
| | | { |
| | | public List<SysDictData> selectDictDataList(SysDictData dictData) { |
| | | return dictDataMapper.selectDictDataList(dictData); |
| | | } |
| | | |
| | |
| | | * @return 字典标签 |
| | | */ |
| | | @Override |
| | | public String selectDictLabel(String dictType, String dictValue) |
| | | { |
| | | public String selectDictLabel(String dictType, String dictValue) { |
| | | return dictDataMapper.selectDictLabel(dictType, dictValue); |
| | | } |
| | | |
| | |
| | | * @return 字典数据 |
| | | */ |
| | | @Override |
| | | public SysDictData selectDictDataById(Long dictCode) |
| | | { |
| | | public SysDictData selectDictDataById(Long dictCode) { |
| | | return dictDataMapper.selectDictDataById(dictCode); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteDictDataByIds(Long[] dictCodes) |
| | | { |
| | | public int deleteDictDataByIds(Long[] dictCodes) { |
| | | int row = dictDataMapper.deleteDictDataByIds(dictCodes); |
| | | if (row > 0) |
| | | { |
| | | if (row > 0) { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | return row; |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertDictData(SysDictData dictData) |
| | | { |
| | | public int insertDictData(SysDictData dictData) { |
| | | int row = dictDataMapper.insertDictData(dictData); |
| | | if (row > 0) |
| | | { |
| | | if (row > 0) { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | return row; |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateDictData(SysDictData dictData) |
| | | { |
| | | public int updateDictData(SysDictData dictData) { |
| | | int row = dictDataMapper.updateDictData(dictData); |
| | | if (row > 0) |
| | | { |
| | | if (row > 0) { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | return row; |
| | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.lang.Validator; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.core.domain.entity.SysDictType; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysDictTypeServiceImpl implements ISysDictTypeService |
| | | { |
| | | public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements ISysDictTypeService { |
| | | @Autowired |
| | | private SysDictTypeMapper dictTypeMapper; |
| | | |
| | |
| | | * 项目启动时,初始化字典到缓存 |
| | | */ |
| | | @PostConstruct |
| | | public void init() |
| | | { |
| | | public void init() { |
| | | List<SysDictType> dictTypeList = dictTypeMapper.selectDictTypeAll(); |
| | | for (SysDictType dictType : dictTypeList) |
| | | { |
| | | for (SysDictType dictType : dictTypeList) { |
| | | List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType()); |
| | | DictUtils.setDictCache(dictType.getDictType(), dictDatas); |
| | | } |
| | |
| | | * @return 字典类型集合信息 |
| | | */ |
| | | @Override |
| | | public List<SysDictType> selectDictTypeList(SysDictType dictType) |
| | | { |
| | | public List<SysDictType> selectDictTypeList(SysDictType dictType) { |
| | | return dictTypeMapper.selectDictTypeList(dictType); |
| | | } |
| | | |
| | |
| | | * @return 字典类型集合信息 |
| | | */ |
| | | @Override |
| | | public List<SysDictType> selectDictTypeAll() |
| | | { |
| | | public List<SysDictType> selectDictTypeAll() { |
| | | return dictTypeMapper.selectDictTypeAll(); |
| | | } |
| | | |
| | |
| | | * @return 字典数据集合信息 |
| | | */ |
| | | @Override |
| | | public List<SysDictData> selectDictDataByType(String dictType) |
| | | { |
| | | public List<SysDictData> selectDictDataByType(String dictType) { |
| | | List<SysDictData> dictDatas = DictUtils.getDictCache(dictType); |
| | | if (CollUtil.isNotEmpty(dictDatas)) |
| | | { |
| | | if (CollUtil.isNotEmpty(dictDatas)) { |
| | | return dictDatas; |
| | | } |
| | | dictDatas = dictDataMapper.selectDictDataByType(dictType); |
| | | if (CollUtil.isNotEmpty(dictDatas)) |
| | | { |
| | | if (CollUtil.isNotEmpty(dictDatas)) { |
| | | DictUtils.setDictCache(dictType, dictDatas); |
| | | return dictDatas; |
| | | } |
| | |
| | | * @return 字典类型 |
| | | */ |
| | | @Override |
| | | public SysDictType selectDictTypeById(Long dictId) |
| | | { |
| | | public SysDictType selectDictTypeById(Long dictId) { |
| | | return dictTypeMapper.selectDictTypeById(dictId); |
| | | } |
| | | |
| | |
| | | * @return 字典类型 |
| | | */ |
| | | @Override |
| | | public SysDictType selectDictTypeByType(String dictType) |
| | | { |
| | | public SysDictType selectDictTypeByType(String dictType) { |
| | | return dictTypeMapper.selectDictTypeByType(dictType); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteDictTypeByIds(Long[] dictIds) |
| | | { |
| | | for (Long dictId : dictIds) |
| | | { |
| | | public int 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 CustomException(String.format("%1$s已分配,不能删除", dictType.getDictName())); |
| | | } |
| | | } |
| | | int count = dictTypeMapper.deleteDictTypeByIds(dictIds); |
| | | if (count > 0) |
| | | { |
| | | if (count > 0) { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | return count; |
| | |
| | | * 清空缓存数据 |
| | | */ |
| | | @Override |
| | | public void clearCache() |
| | | { |
| | | public void clearCache() { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertDictType(SysDictType dictType) |
| | | { |
| | | public int insertDictType(SysDictType dictType) { |
| | | int row = dictTypeMapper.insertDictType(dictType); |
| | | if (row > 0) |
| | | { |
| | | if (row > 0) { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | return row; |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int updateDictType(SysDictType dictType) |
| | | { |
| | | public int updateDictType(SysDictType dictType) { |
| | | SysDictType oldDict = dictTypeMapper.selectDictTypeById(dictType.getDictId()); |
| | | dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType()); |
| | | int row = dictTypeMapper.updateDictType(dictType); |
| | | if (row > 0) |
| | | { |
| | | if (row > 0) { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | return row; |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String checkDictTypeUnique(SysDictType dict) |
| | | { |
| | | public String checkDictTypeUnique(SysDictType dict) { |
| | | Long dictId = Validator.isNull(dict.getDictId()) ? -1L : dict.getDictId(); |
| | | SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); |
| | | if (Validator.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) |
| | | { |
| | | if (Validator.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.domain.SysLogininfor; |
| | | import com.ruoyi.system.mapper.SysLogininforMapper; |
| | | import com.ruoyi.system.service.ISysLogininforService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 系统访问日志情况信息 服务层处理 |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysLogininforServiceImpl implements ISysLogininforService |
| | | { |
| | | public class SysLogininforServiceImpl extends ServiceImpl<SysLogininforMapper, SysLogininfor> implements ISysLogininforService { |
| | | |
| | | @Autowired |
| | | private SysLogininforMapper logininforMapper; |
| | |
| | | * @param logininfor 访问日志对象 |
| | | */ |
| | | @Override |
| | | public void insertLogininfor(SysLogininfor logininfor) |
| | | { |
| | | public void insertLogininfor(SysLogininfor logininfor) { |
| | | logininforMapper.insertLogininfor(logininfor); |
| | | } |
| | | |
| | |
| | | * @return 登录记录集合 |
| | | */ |
| | | @Override |
| | | public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) |
| | | { |
| | | public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) { |
| | | return logininforMapper.selectLogininforList(logininfor); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int deleteLogininforByIds(Long[] infoIds) |
| | | { |
| | | public int deleteLogininforByIds(Long[] infoIds) { |
| | | return logininforMapper.deleteLogininforByIds(infoIds); |
| | | } |
| | | |
| | |
| | | * 清空系统登录日志 |
| | | */ |
| | | @Override |
| | | public void cleanLogininfor() |
| | | { |
| | | public void cleanLogininfor() { |
| | | logininforMapper.cleanLogininfor(); |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.lang.Validator; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.TreeSelect; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysMenuServiceImpl implements ISysMenuService |
| | | { |
| | | public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements ISysMenuService { |
| | | public static final String PREMISSION_STRING = "perms[\"{0}\"]"; |
| | | |
| | | @Autowired |
| | |
| | | * @return 菜单列表 |
| | | */ |
| | | @Override |
| | | public List<SysMenu> selectMenuList(Long userId) |
| | | { |
| | | public List<SysMenu> selectMenuList(Long userId) { |
| | | return selectMenuList(new SysMenu(), userId); |
| | | } |
| | | |
| | |
| | | * @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); |
| | | } |
| | |
| | | * @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 (Validator.isNotEmpty(perm)) |
| | | { |
| | | for (String perm : perms) { |
| | | if (Validator.isNotEmpty(perm)) { |
| | | permsSet.addAll(Arrays.asList(perm.trim().split(","))); |
| | | } |
| | | } |
| | |
| | | * @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); |
| | |
| | | * @return 选中菜单列表 |
| | | */ |
| | | @Override |
| | | public List<Integer> selectMenuListByRoleId(Long roleId) |
| | | { |
| | | public List<Integer> selectMenuListByRoleId(Long roleId) { |
| | | SysRole role = roleMapper.selectRoleById(roleId); |
| | | return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly()); |
| | | } |
| | |
| | | * @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)); |
| | |
| | | router.setComponent(getComponent(menu)); |
| | | router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StrUtil.equals("1", menu.getIsCache()))); |
| | | 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)) { |
| | | List<RouterVo> childrenList = new ArrayList<RouterVo>(); |
| | | RouterVo children = new RouterVo(); |
| | | children.setPath(menu.getPath()); |
| | |
| | | * @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 = new ArrayList<Long>(); |
| | | for (SysMenu dept : menus) |
| | | { |
| | | for (SysMenu dept : menus) { |
| | | tempList.add(dept.getMenuId()); |
| | | } |
| | | 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; |
| | |
| | | * @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()); |
| | | } |
| | |
| | | * @return 菜单信息 |
| | | */ |
| | | @Override |
| | | public SysMenu selectMenuById(Long menuId) |
| | | { |
| | | public SysMenu selectMenuById(Long menuId) { |
| | | return menuMapper.selectMenuById(menuId); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean hasChildByMenuId(Long menuId) |
| | | { |
| | | public boolean hasChildByMenuId(Long menuId) { |
| | | int result = menuMapper.hasChildByMenuId(menuId); |
| | | return result > 0 ? true : false; |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean checkMenuExistRole(Long menuId) |
| | | { |
| | | public boolean checkMenuExistRole(Long menuId) { |
| | | int result = roleMenuMapper.checkMenuExistRole(menuId); |
| | | return result > 0 ? true : false; |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertMenu(SysMenu menu) |
| | | { |
| | | public int insertMenu(SysMenu menu) { |
| | | return menuMapper.insertMenu(menu); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateMenu(SysMenu menu) |
| | | { |
| | | public int updateMenu(SysMenu menu) { |
| | | return menuMapper.updateMenu(menu); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteMenuById(Long menuId) |
| | | { |
| | | public int deleteMenuById(Long menuId) { |
| | | return menuMapper.deleteMenuById(menuId); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String checkMenuNameUnique(SysMenu menu) |
| | | { |
| | | public String checkMenuNameUnique(SysMenu menu) { |
| | | Long menuId = Validator.isNull(menu.getMenuId()) ? -1L : menu.getMenuId(); |
| | | SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId()); |
| | | if (Validator.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) |
| | | { |
| | | if (Validator.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | |
| | | * @param menu 菜单信息 |
| | | * @return 路由名称 |
| | | */ |
| | | public String getRouteName(SysMenu menu) |
| | | { |
| | | public String getRouteName(SysMenu menu) { |
| | | String routerName = StrUtil.upperFirst(menu.getPath()); |
| | | // 非外链并且是一级目录(类型为目录) |
| | | if (isMenuFrame(menu)) |
| | | { |
| | | if (isMenuFrame(menu)) { |
| | | routerName = StrUtil.EMPTY; |
| | | } |
| | | return routerName; |
| | |
| | | * @param menu 菜单信息 |
| | | * @return 路由地址 |
| | | */ |
| | | public String getRouterPath(SysMenu menu) |
| | | { |
| | | public String getRouterPath(SysMenu menu) { |
| | | String routerPath = menu.getPath(); |
| | | // 非外链并且是一级目录(类型为目录) |
| | | 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; |
| | |
| | | * @param menu 菜单信息 |
| | | * @return 组件信息 |
| | | */ |
| | | public String getComponent(SysMenu menu) |
| | | { |
| | | public String getComponent(SysMenu menu) { |
| | | String component = UserConstants.LAYOUT; |
| | | if (StrUtil.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) |
| | | { |
| | | if (StrUtil.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) { |
| | | component = menu.getComponent(); |
| | | } |
| | | else if (StrUtil.isEmpty(menu.getComponent()) && isParentView(menu)) |
| | | { |
| | | } else if (StrUtil.isEmpty(menu.getComponent()) && isParentView(menu)) { |
| | | component = UserConstants.PARENT_VIEW; |
| | | } |
| | | return component; |
| | |
| | | * @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); |
| | | } |
| | |
| | | * @param menu 菜单信息 |
| | | * @return 结果 |
| | | */ |
| | | public boolean isParentView(SysMenu menu) |
| | | { |
| | | public boolean isParentView(SysMenu menu) { |
| | | return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()); |
| | | } |
| | | |
| | |
| | | * @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); |
| | | } |
| | |
| | | * @param list |
| | | * @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); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 得到子节点列表 |
| | | */ |
| | | 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); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 判断是否有子节点 |
| | | */ |
| | | private boolean hasChild(List<SysMenu> list, SysMenu t) |
| | | { |
| | | private boolean hasChild(List<SysMenu> list, SysMenu t) { |
| | | return getChildList(list, t).size() > 0 ? true : false; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysNoticeServiceImpl implements ISysNoticeService |
| | | { |
| | | public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements ISysNoticeService { |
| | | @Autowired |
| | | private SysNoticeMapper noticeMapper; |
| | | |
| | |
| | | * @return 公告信息 |
| | | */ |
| | | @Override |
| | | public SysNotice selectNoticeById(Long noticeId) |
| | | { |
| | | public SysNotice selectNoticeById(Long noticeId) { |
| | | return noticeMapper.selectNoticeById(noticeId); |
| | | } |
| | | |
| | |
| | | * @return 公告集合 |
| | | */ |
| | | @Override |
| | | public List<SysNotice> selectNoticeList(SysNotice notice) |
| | | { |
| | | public List<SysNotice> selectNoticeList(SysNotice notice) { |
| | | return noticeMapper.selectNoticeList(notice); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertNotice(SysNotice notice) |
| | | { |
| | | public int insertNotice(SysNotice notice) { |
| | | return noticeMapper.insertNotice(notice); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateNotice(SysNotice notice) |
| | | { |
| | | public int updateNotice(SysNotice notice) { |
| | | return noticeMapper.updateNotice(notice); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteNoticeById(Long noticeId) |
| | | { |
| | | public int deleteNoticeById(Long noticeId) { |
| | | return noticeMapper.deleteNoticeById(noticeId); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteNoticeByIds(Long[] noticeIds) |
| | | { |
| | | public int deleteNoticeByIds(Long[] noticeIds) { |
| | | return noticeMapper.deleteNoticeByIds(noticeIds); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.system.domain.SysOperLog; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysOperLogServiceImpl implements ISysOperLogService |
| | | { |
| | | public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOperLog> implements ISysOperLogService { |
| | | @Autowired |
| | | private SysOperLogMapper operLogMapper; |
| | | |
| | |
| | | * @param operLog 操作日志对象 |
| | | */ |
| | | @Override |
| | | public void insertOperlog(SysOperLog operLog) |
| | | { |
| | | public void insertOperlog(SysOperLog operLog) { |
| | | operLogMapper.insertOperlog(operLog); |
| | | } |
| | | |
| | |
| | | * @return 操作日志集合 |
| | | */ |
| | | @Override |
| | | public List<SysOperLog> selectOperLogList(SysOperLog operLog) |
| | | { |
| | | public List<SysOperLog> selectOperLogList(SysOperLog operLog) { |
| | | return operLogMapper.selectOperLogList(operLog); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteOperLogByIds(Long[] operIds) |
| | | { |
| | | public int deleteOperLogByIds(Long[] operIds) { |
| | | return operLogMapper.deleteOperLogByIds(operIds); |
| | | } |
| | | |
| | |
| | | * @return 操作日志对象 |
| | | */ |
| | | @Override |
| | | public SysOperLog selectOperLogById(Long operId) |
| | | { |
| | | public SysOperLog selectOperLogById(Long operId) { |
| | | return operLogMapper.selectOperLogById(operId); |
| | | } |
| | | |
| | |
| | | * 清空操作日志 |
| | | */ |
| | | @Override |
| | | public void cleanOperLog() |
| | | { |
| | | public void cleanOperLog() { |
| | | operLogMapper.cleanOperLog(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.lang.Validator; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.exception.CustomException; |
| | | import com.ruoyi.system.domain.SysPost; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysPostServiceImpl implements ISysPostService |
| | | { |
| | | public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> implements ISysPostService { |
| | | @Autowired |
| | | private SysPostMapper postMapper; |
| | | |
| | |
| | | * @return 岗位信息集合 |
| | | */ |
| | | @Override |
| | | public List<SysPost> selectPostList(SysPost post) |
| | | { |
| | | public List<SysPost> selectPostList(SysPost post) { |
| | | return postMapper.selectPostList(post); |
| | | } |
| | | |
| | |
| | | * @return 岗位列表 |
| | | */ |
| | | @Override |
| | | public List<SysPost> selectPostAll() |
| | | { |
| | | public List<SysPost> selectPostAll() { |
| | | return postMapper.selectPostAll(); |
| | | } |
| | | |
| | |
| | | * @return 角色对象信息 |
| | | */ |
| | | @Override |
| | | public SysPost selectPostById(Long postId) |
| | | { |
| | | public SysPost selectPostById(Long postId) { |
| | | return postMapper.selectPostById(postId); |
| | | } |
| | | |
| | |
| | | * @return 选中岗位ID列表 |
| | | */ |
| | | @Override |
| | | public List<Integer> selectPostListByUserId(Long userId) |
| | | { |
| | | public List<Integer> selectPostListByUserId(Long userId) { |
| | | return postMapper.selectPostListByUserId(userId); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String checkPostNameUnique(SysPost post) |
| | | { |
| | | public String checkPostNameUnique(SysPost post) { |
| | | Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId(); |
| | | SysPost info = postMapper.checkPostNameUnique(post.getPostName()); |
| | | if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) |
| | | { |
| | | if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String checkPostCodeUnique(SysPost post) |
| | | { |
| | | public String checkPostCodeUnique(SysPost post) { |
| | | Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId(); |
| | | SysPost info = postMapper.checkPostCodeUnique(post.getPostCode()); |
| | | if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) |
| | | { |
| | | if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int countUserPostById(Long postId) |
| | | { |
| | | public int countUserPostById(Long postId) { |
| | | return userPostMapper.countUserPostById(postId); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deletePostById(Long postId) |
| | | { |
| | | public int deletePostById(Long postId) { |
| | | return postMapper.deletePostById(postId); |
| | | } |
| | | |
| | |
| | | * @throws Exception 异常 |
| | | */ |
| | | @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 CustomException(String.format("%1$s已分配,不能删除", post.getPostName())); |
| | | } |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertPost(SysPost post) |
| | | { |
| | | public int insertPost(SysPost post) { |
| | | return postMapper.insertPost(post); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updatePost(SysPost post) |
| | | { |
| | | public int updatePost(SysPost post) { |
| | | return postMapper.updatePost(post); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.lang.Validator; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.annotation.DataScope; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysRoleServiceImpl implements ISysRoleService |
| | | { |
| | | public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService { |
| | | @Autowired |
| | | private SysRoleMapper roleMapper; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d") |
| | | public List<SysRole> selectRoleList(SysRole role) |
| | | { |
| | | public List<SysRole> selectRoleList(SysRole role) { |
| | | return roleMapper.selectRoleList(role); |
| | | } |
| | | |
| | |
| | | * @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 (Validator.isNotNull(perm)) |
| | | { |
| | | for (SysRole perm : perms) { |
| | | if (Validator.isNotNull(perm)) { |
| | | permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(","))); |
| | | } |
| | | } |
| | |
| | | * @return 角色列表 |
| | | */ |
| | | @Override |
| | | public List<SysRole> selectRoleAll() |
| | | { |
| | | public List<SysRole> selectRoleAll() { |
| | | return SpringUtils.getAopProxy(this).selectRoleList(new SysRole()); |
| | | } |
| | | |
| | |
| | | * @return 选中角色ID列表 |
| | | */ |
| | | @Override |
| | | public List<Integer> selectRoleListByUserId(Long userId) |
| | | { |
| | | public List<Integer> selectRoleListByUserId(Long userId) { |
| | | return roleMapper.selectRoleListByUserId(userId); |
| | | } |
| | | |
| | |
| | | * @return 角色对象信息 |
| | | */ |
| | | @Override |
| | | public SysRole selectRoleById(Long roleId) |
| | | { |
| | | public SysRole selectRoleById(Long roleId) { |
| | | return roleMapper.selectRoleById(roleId); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String checkRoleNameUnique(SysRole role) |
| | | { |
| | | public String checkRoleNameUnique(SysRole role) { |
| | | Long roleId = Validator.isNull(role.getRoleId()) ? -1L : role.getRoleId(); |
| | | SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName()); |
| | | if (Validator.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) |
| | | { |
| | | if (Validator.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String checkRoleKeyUnique(SysRole role) |
| | | { |
| | | public String checkRoleKeyUnique(SysRole role) { |
| | | Long roleId = Validator.isNull(role.getRoleId()) ? -1L : role.getRoleId(); |
| | | SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey()); |
| | | if (Validator.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) |
| | | { |
| | | if (Validator.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | |
| | | * @param role 角色信息 |
| | | */ |
| | | @Override |
| | | public void checkRoleAllowed(SysRole role) |
| | | { |
| | | if (Validator.isNotNull(role.getRoleId()) && role.isAdmin()) |
| | | { |
| | | public void checkRoleAllowed(SysRole role) { |
| | | if (Validator.isNotNull(role.getRoleId()) && role.isAdmin()) { |
| | | throw new CustomException("不允许操作超级管理员角色"); |
| | | } |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int countUserRoleByRoleId(Long roleId) |
| | | { |
| | | public int countUserRoleByRoleId(Long roleId) { |
| | | return userRoleMapper.countUserRoleByRoleId(roleId); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int insertRole(SysRole role) |
| | | { |
| | | public int insertRole(SysRole role) { |
| | | // 新增角色信息 |
| | | roleMapper.insertRole(role); |
| | | return insertRoleMenu(role); |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int updateRole(SysRole role) |
| | | { |
| | | public int updateRole(SysRole role) { |
| | | // 修改角色信息 |
| | | roleMapper.updateRole(role); |
| | | // 删除角色与菜单关联 |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateRoleStatus(SysRole role) |
| | | { |
| | | public int updateRoleStatus(SysRole role) { |
| | | return roleMapper.updateRole(role); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int authDataScope(SysRole role) |
| | | { |
| | | public int authDataScope(SysRole role) { |
| | | // 修改角色信息 |
| | | roleMapper.updateRole(role); |
| | | // 删除角色与部门关联 |
| | |
| | | * |
| | | * @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; |
| | |
| | | * |
| | | * @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; |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int deleteRoleById(Long roleId) |
| | | { |
| | | public int deleteRoleById(Long roleId) { |
| | | // 删除角色与菜单关联 |
| | | roleMenuMapper.deleteRoleMenuByRoleId(roleId); |
| | | // 删除角色与部门关联 |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int deleteRoleByIds(Long[] roleIds) |
| | | { |
| | | for (Long roleId : roleIds) |
| | | { |
| | | public int deleteRoleByIds(Long[] roleIds) { |
| | | for (Long roleId : roleIds) { |
| | | checkRoleAllowed(new SysRole(roleId)); |
| | | SysRole role = selectRoleById(roleId); |
| | | if (countUserRoleByRoleId(roleId) > 0) |
| | | { |
| | | if (countUserRoleByRoleId(roleId) > 0) { |
| | | throw new CustomException(String.format("%1$s已分配,不能删除", role.getRoleName())); |
| | | } |
| | | } |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysUserOnlineServiceImpl implements ISysUserOnlineService |
| | | { |
| | | public class SysUserOnlineServiceImpl implements ISysUserOnlineService { |
| | | /** |
| | | * 通过登录地址查询信息 |
| | | * |
| | |
| | | * @return 在线用户信息 |
| | | */ |
| | | @Override |
| | | public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) |
| | | { |
| | | if (StrUtil.equals(ipaddr, user.getIpaddr())) |
| | | { |
| | | public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) { |
| | | if (StrUtil.equals(ipaddr, user.getIpaddr())) { |
| | | return loginUserToUserOnline(user); |
| | | } |
| | | return null; |
| | |
| | | * @return 在线用户信息 |
| | | */ |
| | | @Override |
| | | public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) |
| | | { |
| | | if (StrUtil.equals(userName, user.getUsername())) |
| | | { |
| | | public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) { |
| | | if (StrUtil.equals(userName, user.getUsername())) { |
| | | return loginUserToUserOnline(user); |
| | | } |
| | | return null; |
| | |
| | | * @return 在线用户信息 |
| | | */ |
| | | @Override |
| | | public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) |
| | | { |
| | | if (StrUtil.equals(ipaddr, user.getIpaddr()) && StrUtil.equals(userName, user.getUsername())) |
| | | { |
| | | public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) { |
| | | if (StrUtil.equals(ipaddr, user.getIpaddr()) && StrUtil.equals(userName, user.getUsername())) { |
| | | return loginUserToUserOnline(user); |
| | | } |
| | | return null; |
| | |
| | | * @return 在线用户 |
| | | */ |
| | | @Override |
| | | public SysUserOnline loginUserToUserOnline(LoginUser user) |
| | | { |
| | | if (Validator.isNull(user) || Validator.isNull(user.getUser())) |
| | | { |
| | | public SysUserOnline loginUserToUserOnline(LoginUser user) { |
| | | if (Validator.isNull(user) || Validator.isNull(user.getUser())) { |
| | | return null; |
| | | } |
| | | SysUserOnline sysUserOnline = new SysUserOnline(); |
| | |
| | | sysUserOnline.setBrowser(user.getBrowser()); |
| | | sysUserOnline.setOs(user.getOs()); |
| | | sysUserOnline.setLoginTime(user.getLoginTime()); |
| | | if (Validator.isNotNull(user.getUser().getDept())) |
| | | { |
| | | if (Validator.isNotNull(user.getUser().getDept())) { |
| | | sysUserOnline.setDeptName(user.getUser().getDept().getDeptName()); |
| | | } |
| | | return sysUserOnline; |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.lang.Validator; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.annotation.DataScope; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysUserServiceImpl implements ISysUserService |
| | | { |
| | | public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService { |
| | | private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class); |
| | | |
| | | @Autowired |
| | |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d", userAlias = "u") |
| | | public List<SysUser> selectUserList(SysUser user) |
| | | { |
| | | public List<SysUser> selectUserList(SysUser user) { |
| | | return userMapper.selectUserList(user); |
| | | } |
| | | |
| | |
| | | * @return 用户对象信息 |
| | | */ |
| | | @Override |
| | | public SysUser selectUserByUserName(String userName) |
| | | { |
| | | public SysUser selectUserByUserName(String userName) { |
| | | return userMapper.selectUserByUserName(userName); |
| | | } |
| | | |
| | |
| | | * @return 用户对象信息 |
| | | */ |
| | | @Override |
| | | public SysUser selectUserById(Long userId) |
| | | { |
| | | public SysUser selectUserById(Long userId) { |
| | | return userMapper.selectUserById(userId); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String selectUserRoleGroup(String userName) |
| | | { |
| | | public String selectUserRoleGroup(String userName) { |
| | | List<SysRole> list = roleMapper.selectRolesByUserName(userName); |
| | | StringBuffer idsStr = new StringBuffer(); |
| | | for (SysRole role : list) |
| | | { |
| | | for (SysRole role : list) { |
| | | idsStr.append(role.getRoleName()).append(","); |
| | | } |
| | | if (Validator.isNotEmpty(idsStr.toString())) |
| | | { |
| | | if (Validator.isNotEmpty(idsStr.toString())) { |
| | | return idsStr.substring(0, idsStr.length() - 1); |
| | | } |
| | | return idsStr.toString(); |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String selectUserPostGroup(String userName) |
| | | { |
| | | public String selectUserPostGroup(String userName) { |
| | | List<SysPost> list = postMapper.selectPostsByUserName(userName); |
| | | StringBuffer idsStr = new StringBuffer(); |
| | | for (SysPost post : list) |
| | | { |
| | | for (SysPost post : list) { |
| | | idsStr.append(post.getPostName()).append(","); |
| | | } |
| | | if (Validator.isNotEmpty(idsStr.toString())) |
| | | { |
| | | if (Validator.isNotEmpty(idsStr.toString())) { |
| | | return idsStr.substring(0, idsStr.length() - 1); |
| | | } |
| | | return idsStr.toString(); |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String checkUserNameUnique(String userName) |
| | | { |
| | | public String checkUserNameUnique(String userName) { |
| | | int count = userMapper.checkUserNameUnique(userName); |
| | | if (count > 0) |
| | | { |
| | | if (count > 0) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String checkPhoneUnique(SysUser user) |
| | | { |
| | | public String checkPhoneUnique(SysUser user) { |
| | | Long userId = Validator.isNull(user.getUserId()) ? -1L : user.getUserId(); |
| | | SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber()); |
| | | if (Validator.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) |
| | | { |
| | | if (Validator.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String checkEmailUnique(SysUser user) |
| | | { |
| | | public String checkEmailUnique(SysUser user) { |
| | | Long userId = Validator.isNull(user.getUserId()) ? -1L : user.getUserId(); |
| | | SysUser info = userMapper.checkEmailUnique(user.getEmail()); |
| | | if (Validator.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) |
| | | { |
| | | if (Validator.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | |
| | | * @param user 用户信息 |
| | | */ |
| | | @Override |
| | | public void checkUserAllowed(SysUser user) |
| | | { |
| | | if (Validator.isNotNull(user.getUserId()) && user.isAdmin()) |
| | | { |
| | | public void checkUserAllowed(SysUser user) { |
| | | if (Validator.isNotNull(user.getUserId()) && user.isAdmin()) { |
| | | throw new CustomException("不允许操作超级管理员用户"); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int insertUser(SysUser user) |
| | | { |
| | | public int insertUser(SysUser user) { |
| | | // 新增用户信息 |
| | | int rows = userMapper.insertUser(user); |
| | | // 新增用户岗位关联 |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int updateUser(SysUser user) |
| | | { |
| | | public int updateUser(SysUser user) { |
| | | Long userId = user.getUserId(); |
| | | // 删除用户与角色关联 |
| | | userRoleMapper.deleteUserRoleByUserId(userId); |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateUserStatus(SysUser user) |
| | | { |
| | | public int updateUserStatus(SysUser user) { |
| | | return userMapper.updateUser(user); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateUserProfile(SysUser user) |
| | | { |
| | | public int updateUserProfile(SysUser user) { |
| | | return userMapper.updateUser(user); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean updateUserAvatar(String userName, String avatar) |
| | | { |
| | | public boolean updateUserAvatar(String userName, String avatar) { |
| | | return userMapper.updateUserAvatar(userName, avatar) > 0; |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int resetPwd(SysUser user) |
| | | { |
| | | public int resetPwd(SysUser user) { |
| | | return userMapper.updateUser(user); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int resetUserPwd(String userName, String password) |
| | | { |
| | | public int resetUserPwd(String userName, String password) { |
| | | return userMapper.resetUserPwd(userName, password); |
| | | } |
| | | |
| | |
| | | * |
| | | * @param user 用户对象 |
| | | */ |
| | | public void insertUserRole(SysUser user) |
| | | { |
| | | public void insertUserRole(SysUser user) { |
| | | Long[] roles = user.getRoleIds(); |
| | | if (Validator.isNotNull(roles)) |
| | | { |
| | | if (Validator.isNotNull(roles)) { |
| | | // 新增用户与角色管理 |
| | | List<SysUserRole> list = new ArrayList<SysUserRole>(); |
| | | for (Long roleId : roles) |
| | | { |
| | | for (Long roleId : roles) { |
| | | SysUserRole ur = new SysUserRole(); |
| | | ur.setUserId(user.getUserId()); |
| | | ur.setRoleId(roleId); |
| | | list.add(ur); |
| | | } |
| | | if (list.size() > 0) |
| | | { |
| | | if (list.size() > 0) { |
| | | userRoleMapper.batchUserRole(list); |
| | | } |
| | | } |
| | |
| | | * |
| | | * @param user 用户对象 |
| | | */ |
| | | public void insertUserPost(SysUser user) |
| | | { |
| | | public void insertUserPost(SysUser user) { |
| | | Long[] posts = user.getPostIds(); |
| | | if (Validator.isNotNull(posts)) |
| | | { |
| | | if (Validator.isNotNull(posts)) { |
| | | // 新增用户与岗位管理 |
| | | List<SysUserPost> list = new ArrayList<SysUserPost>(); |
| | | for (Long postId : posts) |
| | | { |
| | | for (Long postId : posts) { |
| | | SysUserPost up = new SysUserPost(); |
| | | up.setUserId(user.getUserId()); |
| | | up.setPostId(postId); |
| | | list.add(up); |
| | | } |
| | | if (list.size() > 0) |
| | | { |
| | | if (list.size() > 0) { |
| | | userPostMapper.batchUserPost(list); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int deleteUserById(Long userId) |
| | | { |
| | | public int deleteUserById(Long userId) { |
| | | // 删除用户与角色关联 |
| | | userRoleMapper.deleteUserRoleByUserId(userId); |
| | | // 删除用户与岗位表 |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int deleteUserByIds(Long[] userIds) |
| | | { |
| | | for (Long userId : userIds) |
| | | { |
| | | public int deleteUserByIds(Long[] userIds) { |
| | | for (Long userId : userIds) { |
| | | checkUserAllowed(new SysUser(userId)); |
| | | } |
| | | // 删除用户与角色关联 |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName) |
| | | { |
| | | if (Validator.isNull(userList) || userList.size() == 0) |
| | | { |
| | | public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName) { |
| | | if (Validator.isNull(userList) || userList.size() == 0) { |
| | | throw new CustomException("导入用户数据不能为空!"); |
| | | } |
| | | int successNum = 0; |
| | |
| | | StringBuilder successMsg = new StringBuilder(); |
| | | StringBuilder failureMsg = new StringBuilder(); |
| | | String password = configService.selectConfigByKey("sys.user.initPassword"); |
| | | for (SysUser user : userList) |
| | | { |
| | | try |
| | | { |
| | | for (SysUser user : userList) { |
| | | try { |
| | | // 验证是否存在这个用户 |
| | | SysUser u = userMapper.selectUserByUserName(user.getUserName()); |
| | | if (Validator.isNull(u)) |
| | | { |
| | | if (Validator.isNull(u)) { |
| | | user.setPassword(SecurityUtils.encryptPassword(password)); |
| | | user.setCreateBy(operName); |
| | | this.insertUser(user); |
| | | successNum++; |
| | | successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功"); |
| | | } |
| | | else if (isUpdateSupport) |
| | | { |
| | | } else if (isUpdateSupport) { |
| | | user.setUpdateBy(operName); |
| | | this.updateUser(user); |
| | | successNum++; |
| | | successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功"); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | failureNum++; |
| | | failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在"); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | } catch (Exception e) { |
| | | failureNum++; |
| | | String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:"; |
| | | failureMsg.append(msg + e.getMessage()); |
| | | log.error(msg, e); |
| | | } |
| | | } |
| | | if (failureNum > 0) |
| | | { |
| | | if (failureNum > 0) { |
| | | failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); |
| | | throw new CustomException(failureMsg.toString()); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); |
| | | } |
| | | return successMsg.toString(); |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectConfigVo"> |
| | | select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark |
| | | from sys_config |
| | | </sql> |
| | | |
| | | <!-- 查询条件 --> |
| | | <sql id="sqlwhereSearch"> |
| | | <where> |
| | | <if test="configId !=null"> |
| | | and config_id = #{configId} |
| | | </if> |
| | | <if test="configKey !=null and configKey != ''"> |
| | | and config_key = #{configKey} |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | |
| | | <select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult"> |
| | | <include refid="selectConfigVo"/> |
| | | <include refid="sqlwhereSearch"/> |
| | | </select> |
| | | |
| | | <select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult"> |
| | | <include refid="selectConfigVo"/> |
| | | <where> |
| | | <if test="configName != null and configName != ''"> |
| | | AND config_name like concat('%', #{configName}, '%') |
| | | </if> |
| | | <if test="configType != null and configType != ''"> |
| | | AND config_type = #{configType} |
| | | </if> |
| | | <if test="configKey != null and configKey != ''"> |
| | | AND config_key like concat('%', #{configKey}, '%') |
| | | </if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
| | | and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') |
| | | </if> |
| | | <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> |
| | | and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult"> |
| | | <include refid="selectConfigVo"/> |
| | | where config_key = #{configKey} limit 1 |
| | | </select> |
| | | |
| | | <insert id="insertConfig" parameterType="SysConfig"> |
| | | insert into sys_config ( |
| | | <if test="configName != null and configName != '' ">config_name,</if> |
| | | <if test="configKey != null and configKey != '' ">config_key,</if> |
| | | <if test="configValue != null and configValue != '' ">config_value,</if> |
| | | <if test="configType != null and configType != '' ">config_type,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | create_time |
| | | )values( |
| | | <if test="configName != null and configName != ''">#{configName},</if> |
| | | <if test="configKey != null and configKey != ''">#{configKey},</if> |
| | | <if test="configValue != null and configValue != ''">#{configValue},</if> |
| | | <if test="configType != null and configType != ''">#{configType},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateConfig" parameterType="SysConfig"> |
| | | update sys_config |
| | | <set> |
| | | <if test="configName != null and configName != ''">config_name = #{configName},</if> |
| | | <if test="configKey != null and configKey != ''">config_key = #{configKey},</if> |
| | | <if test="configValue != null and configValue != ''">config_value = #{configValue},</if> |
| | | <if test="configType != null and configType != ''">config_type = #{configType},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where config_id = #{configId} |
| | | </update> |
| | | |
| | | <delete id="deleteConfigById" parameterType="Long"> |
| | | delete from sys_config where config_id = #{configId} |
| | | </delete> |
| | | |
| | | <delete id="deleteConfigByIds" parameterType="Long"> |
| | | delete from sys_config where config_id in |
| | | <foreach item="configId" collection="array" open="(" separator="," close=")"> |
| | | #{configId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectDeptVo"> |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time |
| | | select d.dept_id, |
| | | d.parent_id, |
| | | d.ancestors, |
| | | d.dept_name, |
| | | d.order_num, |
| | | d.leader, |
| | | d.phone, |
| | | d.email, |
| | | d.status, |
| | | d.del_flag, |
| | | d.create_by, |
| | | d.create_time |
| | | from sys_dept d |
| | | </sql> |
| | | |
| | |
| | | left join sys_role_dept rd on d.dept_id = rd.dept_id |
| | | where rd.role_id = #{roleId} |
| | | <if test="deptCheckStrictly"> |
| | | and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId}) |
| | | and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = |
| | | rd.dept_id and rd.role_id = #{roleId}) |
| | | </if> |
| | | order by d.parent_id, d.order_num |
| | | </select> |
| | |
| | | </select> |
| | | |
| | | <select id="checkDeptExistUser" parameterType="Long" resultType="int"> |
| | | select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0' |
| | | select count(1) |
| | | from sys_user |
| | | where dept_id = #{deptId} |
| | | and del_flag = '0' |
| | | </select> |
| | | |
| | | <select id="hasChildByDeptId" parameterType="Long" resultType="int"> |
| | | select count(1) from sys_dept |
| | | where del_flag = '0' and parent_id = #{deptId} limit 1 |
| | | select count(1) |
| | | from sys_dept |
| | | where del_flag = '0' |
| | | and parent_id = #{deptId} limit 1 |
| | | </select> |
| | | |
| | | <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult"> |
| | | select * from sys_dept where find_in_set(#{deptId}, ancestors) |
| | | select * |
| | | from sys_dept |
| | | where find_in_set(#{deptId}, ancestors) |
| | | </select> |
| | | |
| | | <select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int"> |
| | | select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors) |
| | | select count(*) |
| | | from sys_dept |
| | | where status = 0 |
| | | and del_flag = '0' |
| | | and find_in_set(#{deptId}, ancestors) |
| | | </select> |
| | | |
| | | <select id="checkDeptNameUnique" resultMap="SysDeptResult"> |
| | |
| | | </update> |
| | | |
| | | <delete id="deleteDeptById" parameterType="Long"> |
| | | update sys_dept set del_flag = '2' where dept_id = #{deptId} |
| | | update sys_dept |
| | | set del_flag = '2' |
| | | where dept_id = #{deptId} |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectDictDataVo"> |
| | | select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark |
| | | select dict_code, |
| | | dict_sort, |
| | | dict_label, |
| | | dict_value, |
| | | dict_type, |
| | | css_class, |
| | | list_class, |
| | | is_default, |
| | | status, |
| | | create_by, |
| | | create_time, |
| | | remark |
| | | from sys_dict_data |
| | | </sql> |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="selectDictLabel" resultType="String"> |
| | | select dict_label from sys_dict_data |
| | | where dict_type = #{dictType} and dict_value = #{dictValue} |
| | | select dict_label |
| | | from sys_dict_data |
| | | where dict_type = #{dictType} |
| | | and dict_value = #{dictValue} |
| | | </select> |
| | | |
| | | <select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult"> |
| | |
| | | </select> |
| | | |
| | | <select id="countDictDataByType" resultType="Integer"> |
| | | select count(1) from sys_dict_data where dict_type=#{dictType} |
| | | select count(1) |
| | | from sys_dict_data |
| | | where dict_type = #{dictType} |
| | | </select> |
| | | |
| | | <delete id="deleteDictDataById" parameterType="Long"> |
| | | delete from sys_dict_data where dict_code = #{dictCode} |
| | | delete |
| | | from sys_dict_data |
| | | where dict_code = #{dictCode} |
| | | </delete> |
| | | |
| | | <delete id="deleteDictDataByIds" parameterType="Long"> |
| | |
| | | </update> |
| | | |
| | | <update id="updateDictDataType" parameterType="String"> |
| | | update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} |
| | | update sys_dict_data |
| | | set dict_type = #{newDictType} |
| | | where dict_type = #{oldDictType} |
| | | </update> |
| | | |
| | | <insert id="insertDictData" parameterType="SysDictData"> |
| | |
| | | </select> |
| | | |
| | | <delete id="deleteDictTypeById" parameterType="Long"> |
| | | delete from sys_dict_type where dict_id = #{dictId} |
| | | delete |
| | | from sys_dict_type |
| | | where dict_id = #{dictId} |
| | | </delete> |
| | | |
| | | <delete id="deleteDictTypeByIds" parameterType="Long"> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectMenuVo"> |
| | | select menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time |
| | | select menu_id, |
| | | menu_name, |
| | | parent_id, |
| | | order_num, |
| | | path, |
| | | component, |
| | | is_frame, |
| | | is_cache, |
| | | menu_type, |
| | | visible, |
| | | status, |
| | | ifnull(perms, '') as perms, |
| | | icon, |
| | | create_time |
| | | from sys_menu |
| | | </sql> |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="selectMenuTreeAll" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 |
| | | select distinct m.menu_id, |
| | | m.parent_id, |
| | | m.menu_name, |
| | | m.path, |
| | | m.component, |
| | | m.visible, |
| | | m.status, |
| | | ifnull(m.perms, '') as perms, |
| | | m.is_frame, |
| | | m.is_cache, |
| | | m.menu_type, |
| | | m.icon, |
| | | m.order_num, |
| | | m.create_time |
| | | from sys_menu m |
| | | where m.menu_type in ('M', 'C') |
| | | and m.status = 0 |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | <select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, |
| | | ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | from sys_menu m |
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id |
| | | left join sys_user_role ur on rm.role_id = ur.role_id |
| | |
| | | </select> |
| | | |
| | | <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | select distinct m.menu_id, |
| | | m.parent_id, |
| | | m.menu_name, |
| | | m.path, |
| | | m.component, |
| | | m.visible, |
| | | m.status, |
| | | ifnull(m.perms, '') as perms, |
| | | m.is_frame, |
| | | m.is_cache, |
| | | m.menu_type, |
| | | m.icon, |
| | | m.order_num, |
| | | m.create_time |
| | | from sys_menu m |
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id |
| | | left join sys_user_role ur on rm.role_id = ur.role_id |
| | | left join sys_role ro on ur.role_id = ro.role_id |
| | | left join sys_user u on ur.user_id = u.user_id |
| | | where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0 |
| | | where u.user_id = #{userId} |
| | | and m.menu_type in ('M', 'C') |
| | | and m.status = 0 |
| | | AND ro.status = 0 |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | |
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id |
| | | where rm.role_id = #{roleId} |
| | | <if test="menuCheckStrictly"> |
| | | and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId}) |
| | | and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = |
| | | rm.menu_id and rm.role_id = #{roleId}) |
| | | </if> |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | |
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id |
| | | left join sys_user_role ur on rm.role_id = ur.role_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | where m.status = '0' and r.status = '0' and ur.user_id = #{userId} |
| | | where m.status = '0' |
| | | and r.status = '0' |
| | | and ur.user_id = #{userId} |
| | | </select> |
| | | |
| | | <select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult"> |
| | |
| | | </select> |
| | | |
| | | <select id="hasChildByMenuId" resultType="Integer"> |
| | | select count(1) from sys_menu where parent_id = #{menuId} |
| | | select count(1) |
| | | from sys_menu |
| | | where parent_id = #{menuId} |
| | | </select> |
| | | |
| | | <select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult"> |
| | |
| | | </insert> |
| | | |
| | | <delete id="deleteMenuById" parameterType="Long"> |
| | | delete from sys_menu where menu_id = #{menuId} |
| | | delete |
| | | from sys_menu |
| | | where menu_id = #{menuId} |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectNoticeVo"> |
| | | select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark |
| | | select notice_id, |
| | | notice_title, |
| | | notice_type, |
| | | cast(notice_content as char) as notice_content, |
| | | status, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time, |
| | | remark |
| | | from sys_notice |
| | | </sql> |
| | | |
| | |
| | | </update> |
| | | |
| | | <delete id="deleteNoticeById" parameterType="Long"> |
| | | delete from sys_notice where notice_id = #{noticeId} |
| | | delete |
| | | from sys_notice |
| | | where notice_id = #{noticeId} |
| | | </delete> |
| | | |
| | | <delete id="deleteNoticeByIds" parameterType="Long"> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectOperLogVo"> |
| | | select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time |
| | | select oper_id, |
| | | title, |
| | | business_type, |
| | | method, |
| | | request_method, |
| | | operator_type, |
| | | oper_name, |
| | | dept_name, |
| | | oper_url, |
| | | oper_ip, |
| | | oper_location, |
| | | oper_param, |
| | | json_result, |
| | | status, |
| | | error_msg, |
| | | oper_time |
| | | from sys_oper_log |
| | | </sql> |
| | | |
| | | <insert id="insertOperlog" parameterType="SysOperLog"> |
| | | insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time) |
| | | values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate()) |
| | | insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, |
| | | oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, |
| | | oper_time) |
| | | values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, |
| | | #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate()) |
| | | </insert> |
| | | |
| | | <select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult"> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectPostVo"> |
| | | select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark |
| | | select post_id, |
| | | post_code, |
| | | post_name, |
| | | post_sort, |
| | | status, |
| | | create_by, |
| | | create_time, |
| | | remark |
| | | from sys_post |
| | | </sql> |
| | | |
| | |
| | | </insert> |
| | | |
| | | <delete id="deletePostById" parameterType="Long"> |
| | | delete from sys_post where post_id = #{postId} |
| | | delete |
| | | from sys_post |
| | | where post_id = #{postId} |
| | | </delete> |
| | | |
| | | <delete id="deletePostByIds" parameterType="Long"> |
| | |
| | | </resultMap> |
| | | |
| | | <delete id="deleteRoleDeptByRoleId" parameterType="Long"> |
| | | delete from sys_role_dept where role_id=#{roleId} |
| | | delete |
| | | from sys_role_dept |
| | | where role_id = #{roleId} |
| | | </delete> |
| | | |
| | | <select id="selectCountRoleDeptByDeptId" resultType="Integer"> |
| | | select count(1) from sys_role_dept where dept_id=#{deptId} |
| | | select count(1) |
| | | from sys_role_dept |
| | | where dept_id = #{deptId} |
| | | </select> |
| | | |
| | | <delete id="deleteRoleDept" parameterType="Long"> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectRoleVo"> |
| | | select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, |
| | | r.status, r.del_flag, r.create_time, r.remark |
| | | select distinct r.role_id, |
| | | r.role_name, |
| | | r.role_key, |
| | | r.role_sort, |
| | | r.data_scope, |
| | | r.menu_check_strictly, |
| | | r.dept_check_strictly, |
| | | r.status, |
| | | r.del_flag, |
| | | r.create_time, |
| | | r.remark |
| | | from sys_role r |
| | | left join sys_user_role ur on ur.role_id = r.role_id |
| | | left join sys_user u on u.user_id = ur.user_id |
| | |
| | | </update> |
| | | |
| | | <delete id="deleteRoleById" parameterType="Long"> |
| | | update sys_role set del_flag = '2' where role_id = #{roleId} |
| | | update sys_role |
| | | set del_flag = '2' |
| | | where role_id = #{roleId} |
| | | </delete> |
| | | |
| | | <delete id="deleteRoleByIds" parameterType="Long"> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="checkMenuExistRole" resultType="Integer"> |
| | | select count(1) from sys_role_menu where menu_id = #{menuId} |
| | | select count(1) |
| | | from sys_role_menu |
| | | where menu_id = #{menuId} |
| | | </select> |
| | | |
| | | <delete id="deleteRoleMenuByRoleId" parameterType="Long"> |
| | | delete from sys_role_menu where role_id=#{roleId} |
| | | delete |
| | | from sys_role_menu |
| | | where role_id = #{roleId} |
| | | </delete> |
| | | |
| | | <delete id="deleteRoleMenu" parameterType="Long"> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status |
| | | select u.user_id, |
| | | u.dept_id, |
| | | u.user_name, |
| | | u.nick_name, |
| | | u.email, |
| | | u.avatar, |
| | | u.phonenumber, |
| | | u.password, |
| | | u.sex, |
| | | u.status, |
| | | u.del_flag, |
| | | u.login_ip, |
| | | u.login_date, |
| | | u.create_by, |
| | | u.create_time, |
| | | u.remark, |
| | | d.dept_id, |
| | | d.parent_id, |
| | | d.dept_name, |
| | | d.order_num, |
| | | d.leader, |
| | | d.status as dept_status, |
| | | r.role_id, |
| | | r.role_name, |
| | | r.role_key, |
| | | r.role_sort, |
| | | r.data_scope, |
| | | r.status as role_status |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | |
| | | </sql> |
| | | |
| | | <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u |
| | | select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, |
| | | u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from |
| | | sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | where u.del_flag = '0' |
| | | <if test="userName != null and userName != ''"> |
| | |
| | | AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') |
| | | </if> |
| | | <if test="deptId != null and deptId != 0"> |
| | | AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) )) |
| | | AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, |
| | | ancestors) )) |
| | | </if> |
| | | <!-- 数据范围过滤 --> |
| | | ${params.dataScope} |
| | |
| | | </select> |
| | | |
| | | <select id="checkUserNameUnique" parameterType="String" resultType="int"> |
| | | select count(1) from sys_user where user_name = #{userName} limit 1 |
| | | select count(1) |
| | | from sys_user |
| | | where user_name = #{userName} limit 1 |
| | | </select> |
| | | |
| | | <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} limit 1 |
| | | select user_id, phonenumber |
| | | from sys_user |
| | | where phonenumber = #{phonenumber} limit 1 |
| | | </select> |
| | | |
| | | <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, email from sys_user where email = #{email} limit 1 |
| | | select user_id, email |
| | | from sys_user |
| | | where email = #{email} limit 1 |
| | | </select> |
| | | |
| | | <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | |
| | | </update> |
| | | |
| | | <update id="updateUserStatus" parameterType="SysUser"> |
| | | update sys_user set status = #{status} where user_id = #{userId} |
| | | update sys_user |
| | | set status = #{status} |
| | | where user_id = #{userId} |
| | | </update> |
| | | |
| | | <update id="updateUserAvatar" parameterType="SysUser"> |
| | | update sys_user set avatar = #{avatar} where user_name = #{userName} |
| | | update sys_user |
| | | set avatar = #{avatar} |
| | | where user_name = #{userName} |
| | | </update> |
| | | |
| | | <update id="resetUserPwd" parameterType="SysUser"> |
| | | update sys_user set password = #{password} where user_name = #{userName} |
| | | update sys_user |
| | | set password = #{password} |
| | | where user_name = #{userName} |
| | | </update> |
| | | |
| | | <delete id="deleteUserById" parameterType="Long"> |
| | | update sys_user set del_flag = '2' where user_id = #{userId} |
| | | update sys_user |
| | | set del_flag = '2' |
| | | where user_id = #{userId} |
| | | </delete> |
| | | |
| | | <delete id="deleteUserByIds" parameterType="Long"> |
| | |
| | | </resultMap> |
| | | |
| | | <delete id="deleteUserPostByUserId" parameterType="Long"> |
| | | delete from sys_user_post where user_id=#{userId} |
| | | delete |
| | | from sys_user_post |
| | | where user_id = #{userId} |
| | | </delete> |
| | | |
| | | <select id="countUserPostById" resultType="Integer"> |
| | | select count(1) from sys_user_post where post_id=#{postId} |
| | | select count(1) |
| | | from sys_user_post |
| | | where post_id = #{postId} |
| | | </select> |
| | | |
| | | <delete id="deleteUserPost" parameterType="Long"> |
| | |
| | | </resultMap> |
| | | |
| | | <delete id="deleteUserRoleByUserId" parameterType="Long"> |
| | | delete from sys_user_role where user_id=#{userId} |
| | | delete |
| | | from sys_user_role |
| | | where user_id = #{userId} |
| | | </delete> |
| | | |
| | | <select id="countUserRoleByRoleId" resultType="Integer"> |
| | | select count(1) from sys_user_role where role_id=#{roleId} |
| | | select count(1) |
| | | from sys_user_role |
| | | where role_id = #{roleId} |
| | | </select> |
| | | |
| | | <delete id="deleteUserRole" parameterType="Long"> |
| | |
| | | </insert> |
| | | |
| | | <delete id="deleteUserRoleInfo" parameterType="SysUserRole"> |
| | | delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} |
| | | delete |
| | | from sys_user_role |
| | | where user_id = #{userId} |
| | | and role_id = #{roleId} |
| | | </delete> |
| | | |
| | | <delete id="deleteUserRoleInfos"> |