需求通知
This commit is contained in:
parent
fb771ae29c
commit
384287db5c
|
|
@ -0,0 +1,399 @@
|
|||
package com.bonus.common.biz.domain;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门表 sys_dept
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
public class SysDept extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 父部门ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String leader;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 部门状态:0正常,1停用
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 父部门名称
|
||||
*/
|
||||
private String parentName;
|
||||
|
||||
//权限模版ID
|
||||
private Long menuTemplateId;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 县
|
||||
*/
|
||||
private String district;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 公司简称
|
||||
*/
|
||||
private String deptAbbreviation;
|
||||
|
||||
/**
|
||||
* 公司概述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* logo
|
||||
*/
|
||||
private String logo;
|
||||
|
||||
//公司管理员用户ID
|
||||
private Long adminUserId;
|
||||
|
||||
/**
|
||||
* 公司用户初始密码
|
||||
*/
|
||||
private String initPassword;
|
||||
|
||||
private SysUser sysUser;
|
||||
|
||||
/**
|
||||
* 所属公司ID
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
private Long userCount;
|
||||
|
||||
/**
|
||||
*角色名称
|
||||
*/
|
||||
private String roleName;
|
||||
|
||||
private String keyWord;
|
||||
|
||||
public Long getMenuTemplateId() {
|
||||
return menuTemplateId;
|
||||
}
|
||||
|
||||
public void setMenuTemplateId(Long menuTemplateId) {
|
||||
this.menuTemplateId = menuTemplateId;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
|
||||
public void setDistrict(String district) {
|
||||
this.district = district;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
||||
public void setProvince(String province) {
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getDeptAbbreviation() {
|
||||
return deptAbbreviation;
|
||||
}
|
||||
|
||||
public void setDeptAbbreviation(String deptAbbreviation) {
|
||||
this.deptAbbreviation = deptAbbreviation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getLogo() {
|
||||
return logo;
|
||||
}
|
||||
|
||||
public void setLogo(String logo) {
|
||||
this.logo = logo;
|
||||
}
|
||||
|
||||
public Long getAdminUserId() {
|
||||
return adminUserId;
|
||||
}
|
||||
|
||||
public void setAdminUserId(Long adminUserId) {
|
||||
this.adminUserId = adminUserId;
|
||||
}
|
||||
|
||||
public String getInitPassword() {
|
||||
return initPassword;
|
||||
}
|
||||
|
||||
public void setInitPassword(String initPassword) {
|
||||
this.initPassword = initPassword;
|
||||
}
|
||||
|
||||
public SysUser getSysUser() {
|
||||
return sysUser;
|
||||
}
|
||||
|
||||
public void setSysUser(SysUser sysUser) {
|
||||
this.sysUser = sysUser;
|
||||
}
|
||||
|
||||
public Long getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(Long companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public Long getUserCount() {
|
||||
return userCount;
|
||||
}
|
||||
|
||||
public void setUserCount(Long userCount) {
|
||||
this.userCount = userCount;
|
||||
}
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName;
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
public String getKeyWord() {
|
||||
return keyWord;
|
||||
}
|
||||
|
||||
public void setKeyWord(String keyWord) {
|
||||
this.keyWord = keyWord;
|
||||
}
|
||||
|
||||
/**
|
||||
* 子部门
|
||||
*/
|
||||
private List<SysDept> children = new ArrayList<SysDept>();
|
||||
|
||||
private Integer level;
|
||||
|
||||
public Integer getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(Integer level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getOrderNum() {
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(Integer 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())
|
||||
.append("level", getLevel())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,270 @@
|
|||
package com.bonus.common.biz.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.annotation.Excel.ColumnType;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 角色表 sys_role
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
public class SysRole extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//用于excel导出的序号一列,不需要业务逻辑处理
|
||||
@Excel(name = "序号", isSequence = true, type = Excel.Type.EXPORT)
|
||||
int sequence;
|
||||
|
||||
/** 角色ID */
|
||||
@Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
|
||||
private Long roleId;
|
||||
|
||||
/** 角色名称 */
|
||||
@Excel(name = "角色名称")
|
||||
private String roleName;
|
||||
|
||||
/** 角色权限 */
|
||||
@Excel(name = "角色权限")
|
||||
private String roleKey;
|
||||
|
||||
/** 角色排序 */
|
||||
@Excel(name = "角色排序")
|
||||
private Integer roleSort;
|
||||
|
||||
/** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */
|
||||
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
|
||||
private String dataScope;
|
||||
|
||||
/** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */
|
||||
private boolean menuCheckStrictly;
|
||||
|
||||
/** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */
|
||||
private boolean deptCheckStrictly;
|
||||
|
||||
/** 角色状态(0正常 1停用) */
|
||||
@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 用户是否存在此角色标识 默认不存在 */
|
||||
private boolean flag = false;
|
||||
|
||||
/** 菜单组 */
|
||||
private Long[] menuIds;
|
||||
|
||||
/** 部门组(数据权限) */
|
||||
private Long[] deptIds;
|
||||
|
||||
/**
|
||||
* 所属公司ID
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/** 角色菜单权限 */
|
||||
private Set<String> permissions;
|
||||
|
||||
/**是否内置,0内置,1非内置*/
|
||||
private String isBuiltIn;
|
||||
|
||||
public SysRole()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SysRole(Long roleId)
|
||||
{
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public Long getRoleId()
|
||||
{
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId)
|
||||
{
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public boolean isAdmin()
|
||||
{
|
||||
return isAdmin(this.roleId);
|
||||
}
|
||||
|
||||
public static boolean isAdmin(Long 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;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getRoleSort()
|
||||
{
|
||||
return roleSort;
|
||||
}
|
||||
|
||||
public void setRoleSort(Integer 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;
|
||||
}
|
||||
|
||||
public Long getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(Long companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public Set<String> getPermissions()
|
||||
{
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(Set<String> permissions)
|
||||
{
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
public String getIsBuiltIn() {
|
||||
return isBuiltIn;
|
||||
}
|
||||
|
||||
public void setIsBuiltIn(String isBuiltIn) {
|
||||
this.isBuiltIn = isBuiltIn;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,390 @@
|
|||
package com.bonus.common.biz.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.annotation.Excel.ColumnType;
|
||||
import com.bonus.common.core.annotation.Excel.Type;
|
||||
import com.bonus.common.core.annotation.Excels;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.bonus.common.core.xss.Xss;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户对象 sys_user
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
public class SysUser extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//用于excel导出的序号一列,不需要业务逻辑处理
|
||||
@Excel(name = "序号", isSequence = true, type = Type.EXPORT)
|
||||
int sequence;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Excel(name = "用户序号", type = Type.EXPORT, cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@Excel(name = "部门编号", type = Type.IMPORT)
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 公司ID
|
||||
*/
|
||||
@Excel(name = "公司编号", type = Type.IMPORT)
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@Excel(name = "登录名称")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@Excel(name = "用户名称")
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
@Excel(name = "用户邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@Excel(name = "手机号码", cellType = ColumnType.TEXT)
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 用户性别
|
||||
*/
|
||||
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 帐号状态(0正常 1停用)
|
||||
*/
|
||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
@Excel(name = "最后登录IP", type = Type.EXPORT)
|
||||
private String loginIp;
|
||||
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||
private Date loginDate;
|
||||
|
||||
/**
|
||||
* 部门对象
|
||||
*/
|
||||
@Excels({
|
||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
|
||||
})
|
||||
private SysDept dept;
|
||||
|
||||
/**
|
||||
* 角色对象
|
||||
*/
|
||||
private List<SysRole> roles;
|
||||
|
||||
/**
|
||||
* 角色组
|
||||
*/
|
||||
private Long[] roleIds;
|
||||
|
||||
/**
|
||||
* 岗位组
|
||||
*/
|
||||
private Long[] postIds;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 登录权限
|
||||
*/
|
||||
private String loginType;
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
private String approvalStatus;
|
||||
/**
|
||||
* 长期和临时用户标识
|
||||
*/
|
||||
private String isPermanent;
|
||||
|
||||
/**是否内置,0内置,1非内置*/
|
||||
private String isBuiltIn = "1";
|
||||
|
||||
public SysUser() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public SysUser(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public boolean isAdmin() {
|
||||
return isAdmin(this.userId);
|
||||
}
|
||||
|
||||
public static boolean isAdmin(Long userId) {
|
||||
return userId != null && 1L == userId;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(Long companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
@Xss(message = "用户昵称不能包含脚本字符")
|
||||
@Size(min = 0, max = 20, message = "用户昵称长度不能超过20个字符")
|
||||
public String getNickName() {
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName) {
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
@Xss(message = "用户账号不能包含脚本字符")
|
||||
@NotBlank(message = "用户账号不能为空")
|
||||
@Size(min = 0, max = 20, message = "用户账号长度不能超过20个字符")
|
||||
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;
|
||||
}
|
||||
|
||||
@Pattern(regexp = "^\\d{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;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public String getLoginType() {
|
||||
return loginType;
|
||||
}
|
||||
|
||||
public void setLoginType(String loginType) {
|
||||
this.loginType = loginType;
|
||||
}
|
||||
|
||||
public String getApprovalStatus() {
|
||||
return approvalStatus;
|
||||
}
|
||||
|
||||
public void setApprovalStatus(String approvalStatus) {
|
||||
this.approvalStatus = approvalStatus;
|
||||
}
|
||||
|
||||
public String getIsPermanent() {
|
||||
return isPermanent;
|
||||
}
|
||||
|
||||
public void setIsPermanent(String isPermanent) {
|
||||
this.isPermanent = isPermanent;
|
||||
}
|
||||
|
||||
@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("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())
|
||||
.append("loginType", getLoginType())
|
||||
.toString();
|
||||
}
|
||||
|
||||
public String getIsBuiltIn() {
|
||||
return isBuiltIn;
|
||||
}
|
||||
|
||||
public void setIsBuiltIn(String isBuiltIn) {
|
||||
this.isBuiltIn = isBuiltIn;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* TreeSelect树结构实体类
|
||||
|
|
@ -33,6 +34,8 @@ public class TreeSelect implements Serializable {
|
|||
/** 仓库id */
|
||||
private Long houseId;
|
||||
|
||||
private String status;
|
||||
|
||||
/** 子节点集合 */
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<TreeSelect> children;
|
||||
|
|
@ -57,4 +60,13 @@ public class TreeSelect implements Serializable {
|
|||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public TreeSelect(SysDept dept) {
|
||||
this.id = dept.getDeptId();
|
||||
this.parentId = dept.getParentId();
|
||||
this.status = dept.getStatus();
|
||||
this.label = dept.getDeptName();
|
||||
this.level = dept.getLevel();
|
||||
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,5 +158,21 @@ public class MaLeaseInfo extends BaseEntity implements Serializable {
|
|||
private List<MaLeaseDetails> detailsList;
|
||||
|
||||
private Integer leaseCount;
|
||||
|
||||
/**
|
||||
* 是否短信通知(0 是,1 否)
|
||||
*/
|
||||
private String isSms;
|
||||
|
||||
/**
|
||||
* 组织id
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,11 +9,13 @@ import com.bonus.common.biz.domain.BmFileInfo;
|
|||
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||
import com.bonus.common.biz.enums.LeaseInfoEnum;
|
||||
import com.bonus.common.biz.enums.MessageTypeEnum;
|
||||
import com.bonus.common.biz.enums.NoticeSmsEnum;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.SpringUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.utils.sms.SmsUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
|
|
@ -24,6 +26,8 @@ import com.bonus.material.lease.domain.*;
|
|||
import com.bonus.material.lease.domain.vo.MaLeaseVo;
|
||||
import com.bonus.material.lease.mapper.MaLeaseInfoMapper;
|
||||
import com.bonus.material.lease.service.MaLeaseInfoService;
|
||||
import com.bonus.material.notice.entity.Notice;
|
||||
import com.bonus.material.notice.mapper.NoticeMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -52,6 +56,9 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
@Resource
|
||||
private BmMessageMapper bmMessageMapper;
|
||||
|
||||
@Resource
|
||||
private NoticeMapper noticeMapper;
|
||||
|
||||
/**
|
||||
* 发布租赁需求
|
||||
*
|
||||
|
|
@ -89,6 +96,36 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
}
|
||||
}
|
||||
}
|
||||
//发送短信通知
|
||||
if (NoticeSmsEnum.SENDSMS_ENABLED.getCode().equals(maLeaseInfo.getIsSms())) {
|
||||
Notice notice = new Notice();
|
||||
notice.setDeptId(maLeaseInfo.getDeptId());
|
||||
notice.setRoleId(maLeaseInfo.getRoleId());
|
||||
List<Notice> smsList = noticeMapper.getSmsList(notice);
|
||||
if (org.springframework.util.CollectionUtils.isEmpty(smsList)) {
|
||||
return AjaxResult.error("所选组织机构及角色下属人员信息为空,无法进行发送短信通知公告服务");
|
||||
}
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(smsList)) {
|
||||
for (Notice info : smsList) {
|
||||
if (StringUtils.isBlank(info.getPhoneNumber())) {
|
||||
continue;
|
||||
}
|
||||
String phoneNumber = info.getPhoneNumber();
|
||||
if (Objects.nonNull(info.getPhoneNumber()) && info.getPhoneNumber().length() > 11) {
|
||||
phoneNumber = Sm4Utils.decrypt(info.getPhoneNumber());
|
||||
}
|
||||
// 根据电话号码数量发送短信
|
||||
//JSONObject sendResult = SmsTool.sendSms(new SmsParam(phoneNumber, notice.getNoticeContent()), BmConfigItems.ANHUI_COMPANY_SMS_KEY);
|
||||
String sendResult = SmsUtils.smsToken(phoneNumber, maLeaseInfo.getLeaseName(), "");
|
||||
if (StringUtils.isBlank(sendResult)) {
|
||||
return AjaxResult.error("短信发送失败");
|
||||
} else {
|
||||
System.out.println("短信发送成功:" + sendResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 5. 返回成功结果
|
||||
return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,26 @@
|
|||
package com.bonus.material.user.controller;
|
||||
|
||||
import com.bonus.common.biz.domain.SysDept;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.user.entity.UserDto;
|
||||
import com.bonus.material.user.service.UserService;
|
||||
import com.bonus.system.api.domain.SysRole;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
|
|
@ -22,6 +33,7 @@ public class UserController extends BaseController {
|
|||
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@ApiOperation(value = "个人信息")
|
||||
@GetMapping("/userInfo")
|
||||
public AjaxResult getUserInfo() {
|
||||
|
|
@ -39,4 +51,30 @@ public class UserController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门树列表
|
||||
*/
|
||||
@GetMapping("/getDeptTree")
|
||||
public AjaxResult deptTree(SysDept dept) {
|
||||
try {
|
||||
return success(userService.selectDeptTreeList(dept));
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
@GetMapping("/roleList")
|
||||
@SysLog(title = "角色管理", businessType = OperaType.QUERY,logType = 0,module = "系统管理->角色管理",details = "查询角色列表")
|
||||
public TableDataInfo list(SysRole role) {
|
||||
try{
|
||||
startPage();
|
||||
List<SysRole> list = userService.selectRoleList(role);
|
||||
return getDataTable(list);
|
||||
}catch (Exception e){
|
||||
logger.error(e.toString(),e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package com.bonus.material.user.mapper;
|
||||
|
||||
import com.bonus.material.user.entity.UserDto;
|
||||
import com.bonus.common.biz.domain.SysDept;
|
||||
import com.bonus.system.api.domain.SysRole;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
|
|
@ -10,4 +14,8 @@ public interface UserMapper {
|
|||
UserDto getUserById(Long userId);
|
||||
|
||||
Integer editUser(UserDto userDto);
|
||||
|
||||
List<SysDept> selectDeptList(SysDept dept);
|
||||
|
||||
List<SysRole> selectRoleList(SysRole role);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
package com.bonus.material.user.service;
|
||||
|
||||
import com.bonus.common.biz.domain.TreeSelect;
|
||||
import com.bonus.material.user.entity.UserDto;
|
||||
import com.bonus.common.biz.domain.SysDept;
|
||||
import com.bonus.system.api.domain.SysRole;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
|
|
@ -11,4 +16,8 @@ public interface UserService {
|
|||
UserDto getUserById(Long userId);
|
||||
|
||||
Integer editUser(UserDto userDto);
|
||||
|
||||
List<TreeSelect> selectDeptTreeList(SysDept dept);
|
||||
|
||||
List<SysRole> selectRoleList(SysRole role);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,29 @@
|
|||
package com.bonus.material.user.service.impl;
|
||||
|
||||
import com.bonus.common.biz.domain.SysDept;
|
||||
import com.bonus.common.biz.domain.TreeSelect;
|
||||
import com.bonus.common.core.utils.SpringUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.bonus.common.datascope.annotation.DataScope;
|
||||
import com.bonus.common.datascope.utils.CommonDataPermissionInfo;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.user.entity.UserDto;
|
||||
import com.bonus.material.user.mapper.UserMapper;
|
||||
import com.bonus.material.user.service.UserService;
|
||||
|
||||
|
||||
import com.bonus.system.api.domain.SysRole;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
|
|
@ -16,6 +33,7 @@ import javax.annotation.Resource;
|
|||
public class UserServiceImpl implements UserService {
|
||||
@Resource
|
||||
private UserMapper userMapper;
|
||||
|
||||
@Override
|
||||
public UserDto getUserById(Long userId) {
|
||||
UserDto user = userMapper.getUserById(userId);
|
||||
|
|
@ -28,4 +46,116 @@ public class UserServiceImpl implements UserService {
|
|||
public Integer editUser(UserDto userDto) {
|
||||
return userMapper.editUser(userDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreeSelect> selectDeptTreeList(SysDept dept) {
|
||||
List<SysDept> depts = selectDeptList(dept);
|
||||
return buildDeptTreeSelect(depts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysRole> selectRoleList(SysRole role) {
|
||||
{
|
||||
|
||||
if (role.getRoleName() != null) {
|
||||
String str = role.getRoleName().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||
role.setRoleName(str);
|
||||
}
|
||||
if (role.getRoleKey() != null) {
|
||||
String str = role.getRoleKey().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||
role.setRoleKey(str);
|
||||
}
|
||||
// role.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
return userMapper.selectRoleList(role);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
public List<SysDept> selectDeptList(SysDept dept)
|
||||
{
|
||||
return userMapper.selectDeptList(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建前端所需要下拉树结构
|
||||
*
|
||||
* @param depts 部门列表
|
||||
* @return 下拉树结构列表
|
||||
*/
|
||||
public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts)
|
||||
{
|
||||
List<SysDept> deptTrees = buildDeptTree(depts);
|
||||
return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
/**
|
||||
* 构建前端所需要树结构
|
||||
*
|
||||
* @param depts 部门列表
|
||||
* @return 树结构列表
|
||||
*/
|
||||
public List<SysDept> buildDeptTree(List<SysDept> depts)
|
||||
{
|
||||
List<SysDept> returnList = new ArrayList<SysDept>();
|
||||
List<Long> tempList = depts.stream().map(SysDept::getDeptId).collect(Collectors.toList());
|
||||
for (SysDept dept : depts)
|
||||
{
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
if (!tempList.contains(dept.getParentId()))
|
||||
{
|
||||
recursionFn(depts, dept);
|
||||
returnList.add(dept);
|
||||
}
|
||||
}
|
||||
if (returnList.isEmpty())
|
||||
{
|
||||
returnList = depts;
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归列表
|
||||
*/
|
||||
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))
|
||||
{
|
||||
recursionFn(list, tChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 得到子节点列表
|
||||
*/
|
||||
private List<SysDept> getChildList(List<SysDept> list, SysDept t)
|
||||
{
|
||||
List<SysDept> tlist = new ArrayList<SysDept>();
|
||||
Iterator<SysDept> it = list.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
SysDept n = (SysDept) it.next();
|
||||
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue())
|
||||
{
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
return tlist;
|
||||
}
|
||||
/**
|
||||
* 判断是否有子节点
|
||||
*/
|
||||
private boolean hasChild(List<SysDept> list, SysDept t)
|
||||
{
|
||||
return getChildList(list, t).size() > 0 ? true : false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,4 +24,67 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
su.user_id =#{userId}
|
||||
</select>
|
||||
<select id="selectDeptList" resultType="com.bonus.common.biz.domain.SysDept">
|
||||
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
|
||||
where d.del_flag = '0'
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND (find_in_set(#{companyId}, ancestors) or dept_id = #{companyId})
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="parentId != null and parentId != 0">
|
||||
AND parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND dept_name like concat('%', #{deptName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
<select id="selectRoleList" resultType="com.bonus.system.api.domain.SysRole">
|
||||
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.company_id, r.status, r.del_flag, r.create_time, r.remark, r.is_built_in
|
||||
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
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
where r.del_flag = '0'
|
||||
<if test="roleId != null and roleId != 0">
|
||||
AND r.role_id = #{roleId}
|
||||
</if>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
AND r.role_name like concat('%', #{roleName}, '%')
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
AND r.company_id = #{companyId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND r.status = #{status}
|
||||
</if>
|
||||
<if test="roleKey != null and roleKey != ''">
|
||||
AND r.role_key like concat('%', #{roleKey}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(r.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
order by r.role_sort
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue