Merge remote-tracking branch 'origin/master'
# Conflicts: # base-system-common/pom.xml # base-system-server/src/main/java/com/health/system/server/service/ISysUserService.java # base-system-server/src/main/java/com/health/system/server/service/impl/SysUserServiceImpl.java # base-system-server/src/main/resources/logback.xml # base-system-server/src/main/resources/mapper/system/SysConfigMapper.xml # base-system-server/src/main/resources/mapper/system/SysDeptMapper.xml # base-system-server/src/main/resources/mapper/system/SysDictDataMapper.xml # base-system-server/src/main/resources/mapper/system/SysDictTypeMapper.xml # base-system-server/src/main/resources/mapper/system/SysLogininforMapper.xml # base-system-server/src/main/resources/mapper/system/SysMenuMapper.xml # base-system-server/src/main/resources/mapper/system/SysNoticeMapper.xml # base-system-server/src/main/resources/mapper/system/SysOperLogMapper.xml # base-system-server/src/main/resources/mapper/system/SysPostMapper.xml # base-system-server/src/main/resources/mapper/system/SysRoleDeptMapper.xml # base-system-server/src/main/resources/mapper/system/SysRoleMapper.xml # base-system-server/src/main/resources/mapper/system/SysRoleMenuMapper.xml # base-system-server/src/main/resources/mapper/system/SysUserMapper.xml # base-system-server/src/main/resources/mapper/system/SysUserPostMapper.xml # base-system-server/src/main/resources/mapper/system/SysUserRoleMapper.xmlmaster
commit
5de5a716ac
|
@ -22,14 +22,7 @@
|
|||
<artifactId>health-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>4.5.16</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -14,99 +14,98 @@ import javax.validation.constraints.Size;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysConfig extends BaseEntity
|
||||
{
|
||||
public class SysConfig extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 参数主键 */
|
||||
/**
|
||||
* 参数主键
|
||||
*/
|
||||
@Excel(name = "参数主键", cellType = ColumnType.NUMERIC)
|
||||
private Long configId;
|
||||
|
||||
/** 参数名称 */
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
@Excel(name = "参数名称")
|
||||
private String configName;
|
||||
|
||||
/** 参数键名 */
|
||||
/**
|
||||
* 参数键名
|
||||
*/
|
||||
@Excel(name = "参数键名")
|
||||
private String configKey;
|
||||
|
||||
/** 参数键值 */
|
||||
/**
|
||||
* 参数键值
|
||||
*/
|
||||
@Excel(name = "参数键值")
|
||||
private String configValue;
|
||||
|
||||
/** 系统内置(Y是 N否) */
|
||||
/**
|
||||
* 系统内置(Y是 N否)
|
||||
*/
|
||||
@Excel(name = "系统内置", readConverterExp = "Y=是,N=否")
|
||||
private String configType;
|
||||
|
||||
public Long getConfigId()
|
||||
{
|
||||
public Long getConfigId() {
|
||||
return configId;
|
||||
}
|
||||
|
||||
public void setConfigId(Long configId)
|
||||
{
|
||||
public void setConfigId(Long configId) {
|
||||
this.configId = configId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "参数名称不能为空")
|
||||
@Size(min = 0, max = 100, message = "参数名称不能超过100个字符")
|
||||
public String getConfigName()
|
||||
{
|
||||
public String getConfigName() {
|
||||
return configName;
|
||||
}
|
||||
|
||||
public void setConfigName(String configName)
|
||||
{
|
||||
public void setConfigName(String configName) {
|
||||
this.configName = configName;
|
||||
}
|
||||
|
||||
@NotBlank(message = "参数键名长度不能为空")
|
||||
@Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符")
|
||||
public String getConfigKey()
|
||||
{
|
||||
public String getConfigKey() {
|
||||
return configKey;
|
||||
}
|
||||
|
||||
public void setConfigKey(String configKey)
|
||||
{
|
||||
public void setConfigKey(String configKey) {
|
||||
this.configKey = configKey;
|
||||
}
|
||||
|
||||
@NotBlank(message = "参数键值不能为空")
|
||||
@Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符")
|
||||
public String getConfigValue()
|
||||
{
|
||||
public String getConfigValue() {
|
||||
return configValue;
|
||||
}
|
||||
|
||||
public void setConfigValue(String configValue)
|
||||
{
|
||||
public void setConfigValue(String configValue) {
|
||||
this.configValue = configValue;
|
||||
}
|
||||
|
||||
public String getConfigType()
|
||||
{
|
||||
public String getConfigType() {
|
||||
return configType;
|
||||
}
|
||||
|
||||
public void setConfigType(String 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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,203 +1,203 @@
|
|||
package com.health.system.common.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.health.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 org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.health.common.core.web.domain.BaseEntity;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门表 sys_dept
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysDept extends BaseEntity
|
||||
{
|
||||
public class SysDept extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 部门ID */
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/** 父部门ID */
|
||||
/**
|
||||
* 父部门ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/** 祖级列表 */
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
private String ancestors;
|
||||
|
||||
/** 部门名称 */
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/** 显示顺序 */
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/** 负责人 */
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String leader;
|
||||
|
||||
/** 联系电话 */
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/** 邮箱 */
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/** 部门状态:0正常,1停用 */
|
||||
/**
|
||||
* 部门状态:0正常,1停用
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/** 父部门名称 */
|
||||
/**
|
||||
* 父部门名称
|
||||
*/
|
||||
private String parentName;
|
||||
|
||||
/** 子部门 */
|
||||
/**
|
||||
* 子部门
|
||||
*/
|
||||
private List<SysDept> children = new ArrayList<SysDept>();
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getParentId()
|
||||
{
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId)
|
||||
{
|
||||
public void setParentId(Long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getAncestors()
|
||||
{
|
||||
public String getAncestors() {
|
||||
return ancestors;
|
||||
}
|
||||
|
||||
public void setAncestors(String ancestors)
|
||||
{
|
||||
public void setAncestors(String ancestors) {
|
||||
this.ancestors = ancestors;
|
||||
}
|
||||
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
@Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
|
||||
public String getDeptName()
|
||||
{
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName)
|
||||
{
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getOrderNum()
|
||||
{
|
||||
public Integer getOrderNum() {
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(Integer orderNum)
|
||||
{
|
||||
public void setOrderNum(Integer orderNum) {
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public String getLeader()
|
||||
{
|
||||
public String getLeader() {
|
||||
return leader;
|
||||
}
|
||||
|
||||
public void setLeader(String leader)
|
||||
{
|
||||
public void setLeader(String leader) {
|
||||
this.leader = leader;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
|
||||
public String getPhone()
|
||||
{
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone)
|
||||
{
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
@Email(message = "邮箱格式不正确")
|
||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||
public String getEmail()
|
||||
{
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email)
|
||||
{
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getParentName()
|
||||
{
|
||||
public String getParentName() {
|
||||
return parentName;
|
||||
}
|
||||
|
||||
public void setParentName(String parentName)
|
||||
{
|
||||
public void setParentName(String parentName) {
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
public List<SysDept> getChildren()
|
||||
{
|
||||
public List<SysDept> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<SysDept> 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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,176 +1,175 @@
|
|||
package com.health.system.common.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.health.common.core.annotation.Excel;
|
||||
import com.health.common.core.annotation.Excel.ColumnType;
|
||||
import com.health.common.core.constant.UserConstants;
|
||||
import com.health.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.Size;
|
||||
|
||||
/**
|
||||
* 字典数据表 sys_dict_data
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysDictData extends BaseEntity
|
||||
{
|
||||
public class SysDictData extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 字典编码 */
|
||||
/**
|
||||
* 字典编码
|
||||
*/
|
||||
@Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
|
||||
private Long dictCode;
|
||||
|
||||
/** 字典排序 */
|
||||
/**
|
||||
* 字典排序
|
||||
*/
|
||||
@Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
|
||||
private Long dictSort;
|
||||
|
||||
/** 字典标签 */
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
@Excel(name = "字典标签")
|
||||
private String dictLabel;
|
||||
|
||||
/** 字典键值 */
|
||||
/**
|
||||
* 字典键值
|
||||
*/
|
||||
@Excel(name = "字典键值")
|
||||
private String dictValue;
|
||||
|
||||
/** 字典类型 */
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
@Excel(name = "字典类型")
|
||||
private String dictType;
|
||||
|
||||
/** 样式属性(其他样式扩展) */
|
||||
/**
|
||||
* 样式属性(其他样式扩展)
|
||||
*/
|
||||
private String cssClass;
|
||||
|
||||
/** 表格字典样式 */
|
||||
/**
|
||||
* 表格字典样式
|
||||
*/
|
||||
private String listClass;
|
||||
|
||||
/** 是否默认(Y是 N否) */
|
||||
/**
|
||||
* 是否默认(Y是 N否)
|
||||
*/
|
||||
@Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
|
||||
private String isDefault;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
public Long getDictCode()
|
||||
{
|
||||
public Long getDictCode() {
|
||||
return dictCode;
|
||||
}
|
||||
|
||||
public void setDictCode(Long dictCode)
|
||||
{
|
||||
public void setDictCode(Long dictCode) {
|
||||
this.dictCode = dictCode;
|
||||
}
|
||||
|
||||
public Long getDictSort()
|
||||
{
|
||||
public Long getDictSort() {
|
||||
return dictSort;
|
||||
}
|
||||
|
||||
public void setDictSort(Long dictSort)
|
||||
{
|
||||
public void setDictSort(Long dictSort) {
|
||||
this.dictSort = dictSort;
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典标签不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
|
||||
public String getDictLabel()
|
||||
{
|
||||
public String getDictLabel() {
|
||||
return dictLabel;
|
||||
}
|
||||
|
||||
public void setDictLabel(String dictLabel)
|
||||
{
|
||||
public void setDictLabel(String dictLabel) {
|
||||
this.dictLabel = dictLabel;
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典键值不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
|
||||
public String getDictValue()
|
||||
{
|
||||
public String getDictValue() {
|
||||
return dictValue;
|
||||
}
|
||||
|
||||
public void setDictValue(String dictValue)
|
||||
{
|
||||
public void setDictValue(String dictValue) {
|
||||
this.dictValue = dictValue;
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典类型不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
|
||||
public String getDictType()
|
||||
{
|
||||
public String getDictType() {
|
||||
return dictType;
|
||||
}
|
||||
|
||||
public void setDictType(String dictType)
|
||||
{
|
||||
public void setDictType(String dictType) {
|
||||
this.dictType = dictType;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
|
||||
public String getCssClass()
|
||||
{
|
||||
public String getCssClass() {
|
||||
return cssClass;
|
||||
}
|
||||
|
||||
public void setCssClass(String cssClass)
|
||||
{
|
||||
public void setCssClass(String cssClass) {
|
||||
this.cssClass = cssClass;
|
||||
}
|
||||
|
||||
public String getListClass()
|
||||
{
|
||||
public String getListClass() {
|
||||
return listClass;
|
||||
}
|
||||
|
||||
public void setListClass(String listClass)
|
||||
{
|
||||
public void setListClass(String listClass) {
|
||||
this.listClass = listClass;
|
||||
}
|
||||
|
||||
public boolean getDefault()
|
||||
{
|
||||
public boolean getDefault() {
|
||||
return UserConstants.YES.equals(this.isDefault);
|
||||
}
|
||||
|
||||
public String getIsDefault()
|
||||
{
|
||||
public String getIsDefault() {
|
||||
return isDefault;
|
||||
}
|
||||
|
||||
public void setIsDefault(String isDefault)
|
||||
{
|
||||
public void setIsDefault(String isDefault) {
|
||||
this.isDefault = isDefault;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String 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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,96 +1,96 @@
|
|||
package com.health.system.common.domain;
|
||||
|
||||
import com.health.common.core.annotation.Excel;
|
||||
import com.health.common.core.annotation.Excel.ColumnType;
|
||||
import com.health.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.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.health.common.core.annotation.Excel;
|
||||
import com.health.common.core.annotation.Excel.ColumnType;
|
||||
import com.health.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 字典类型表 sys_dict_type
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysDictType extends BaseEntity
|
||||
{
|
||||
public class SysDictType extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 字典主键 */
|
||||
/**
|
||||
* 字典主键
|
||||
*/
|
||||
@Excel(name = "字典主键", cellType = ColumnType.NUMERIC)
|
||||
private Long dictId;
|
||||
|
||||
/** 字典名称 */
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
@Excel(name = "字典名称")
|
||||
private String dictName;
|
||||
|
||||
/** 字典类型 */
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
@Excel(name = "字典类型")
|
||||
private String dictType;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
public Long getDictId()
|
||||
{
|
||||
public Long getDictId() {
|
||||
return dictId;
|
||||
}
|
||||
|
||||
public void setDictId(Long dictId)
|
||||
{
|
||||
public void setDictId(Long dictId) {
|
||||
this.dictId = dictId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典名称不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
|
||||
public String getDictName()
|
||||
{
|
||||
public String getDictName() {
|
||||
return dictName;
|
||||
}
|
||||
|
||||
public void setDictName(String dictName)
|
||||
{
|
||||
public void setDictName(String dictName) {
|
||||
this.dictName = dictName;
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典类型不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
|
||||
@Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)")
|
||||
public String getDictType()
|
||||
{
|
||||
public String getDictType() {
|
||||
return dictType;
|
||||
}
|
||||
|
||||
public void setDictType(String dictType)
|
||||
{
|
||||
public void setDictType(String dictType) {
|
||||
this.dictType = dictType;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String 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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,102 +1,102 @@
|
|||
package com.health.system.common.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.health.common.core.annotation.Excel;
|
||||
import com.health.common.core.annotation.Excel.ColumnType;
|
||||
import com.health.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 系统访问记录表 sys_logininfor
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysLogininfor extends BaseEntity
|
||||
{
|
||||
public class SysLogininfor extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Excel(name = "序号", cellType = ColumnType.NUMERIC)
|
||||
private Long infoId;
|
||||
|
||||
/** 用户账号 */
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@Excel(name = "用户账号")
|
||||
private String userName;
|
||||
|
||||
/** 状态 0成功 1失败 */
|
||||
/**
|
||||
* 状态 0成功 1失败
|
||||
*/
|
||||
@Excel(name = "状态", readConverterExp = "0=成功,1=失败")
|
||||
private String status;
|
||||
|
||||
/** 地址 */
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@Excel(name = "地址")
|
||||
private String ipaddr;
|
||||
|
||||
/** 描述 */
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@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 accessTime;
|
||||
|
||||
public Long getInfoId()
|
||||
{
|
||||
public Long getInfoId() {
|
||||
return infoId;
|
||||
}
|
||||
|
||||
public void setInfoId(Long infoId)
|
||||
{
|
||||
public void setInfoId(Long infoId) {
|
||||
this.infoId = infoId;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getIpaddr()
|
||||
{
|
||||
public String getIpaddr() {
|
||||
return ipaddr;
|
||||
}
|
||||
|
||||
public void setIpaddr(String ipaddr)
|
||||
{
|
||||
public void setIpaddr(String ipaddr) {
|
||||
this.ipaddr = ipaddr;
|
||||
}
|
||||
|
||||
public String getMsg()
|
||||
{
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg)
|
||||
{
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public Date getAccessTime()
|
||||
{
|
||||
public Date getAccessTime() {
|
||||
return accessTime;
|
||||
}
|
||||
|
||||
public void setAccessTime(Date accessTime)
|
||||
{
|
||||
public void setAccessTime(Date accessTime) {
|
||||
this.accessTime = accessTime;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,259 +1,259 @@
|
|||
package com.health.system.common.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.health.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 org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.health.common.core.web.domain.BaseEntity;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜单权限表 sys_menu
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysMenu extends BaseEntity
|
||||
{
|
||||
public class SysMenu extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 菜单ID */
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
private Long menuId;
|
||||
|
||||
/** 菜单名称 */
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
private String menuName;
|
||||
|
||||
/** 父菜单名称 */
|
||||
/**
|
||||
* 父菜单名称
|
||||
*/
|
||||
private String parentName;
|
||||
|
||||
/** 父菜单ID */
|
||||
/**
|
||||
* 父菜单ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/** 显示顺序 */
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/** 路由地址 */
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/** 组件路径 */
|
||||
/**
|
||||
* 组件路径
|
||||
*/
|
||||
private String component;
|
||||
|
||||
/** 路由参数 */
|
||||
/**
|
||||
* 路由参数
|
||||
*/
|
||||
private String query;
|
||||
|
||||
/** 是否为外链(0是 1否) */
|
||||
/**
|
||||
* 是否为外链(0是 1否)
|
||||
*/
|
||||
private String isFrame;
|
||||
|
||||
/** 是否缓存(0缓存 1不缓存) */
|
||||
/**
|
||||
* 是否缓存(0缓存 1不缓存)
|
||||
*/
|
||||
private String isCache;
|
||||
|
||||
/** 类型(M目录 C菜单 F按钮) */
|
||||
/**
|
||||
* 类型(M目录 C菜单 F按钮)
|
||||
*/
|
||||
private String menuType;
|
||||
|
||||
/** 显示状态(0显示 1隐藏) */
|
||||
/**
|
||||
* 显示状态(0显示 1隐藏)
|
||||
*/
|
||||
private String visible;
|
||||
|
||||
/** 菜单状态(0正常 1停用) */
|
||||
/**
|
||||
* 菜单状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/** 权限字符串 */
|
||||
/**
|
||||
* 权限字符串
|
||||
*/
|
||||
private String perms;
|
||||
|
||||
/** 菜单图标 */
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/** 子菜单 */
|
||||
/**
|
||||
* 子菜单
|
||||
*/
|
||||
private List<SysMenu> children = new ArrayList<SysMenu>();
|
||||
|
||||
public Long getMenuId()
|
||||
{
|
||||
public Long getMenuId() {
|
||||
return menuId;
|
||||
}
|
||||
|
||||
public void setMenuId(Long menuId)
|
||||
{
|
||||
public void setMenuId(Long menuId) {
|
||||
this.menuId = menuId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "菜单名称不能为空")
|
||||
@Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符")
|
||||
public String getMenuName()
|
||||
{
|
||||
public String getMenuName() {
|
||||
return menuName;
|
||||
}
|
||||
|
||||
public void setMenuName(String menuName)
|
||||
{
|
||||
public void setMenuName(String menuName) {
|
||||
this.menuName = menuName;
|
||||
}
|
||||
|
||||
public String getParentName()
|
||||
{
|
||||
public String getParentName() {
|
||||
return parentName;
|
||||
}
|
||||
|
||||
public void setParentName(String parentName)
|
||||
{
|
||||
public void setParentName(String parentName) {
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
public Long getParentId()
|
||||
{
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId)
|
||||
{
|
||||
public void setParentId(Long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getOrderNum()
|
||||
{
|
||||
public Integer getOrderNum() {
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(Integer orderNum)
|
||||
{
|
||||
public void setOrderNum(Integer orderNum) {
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 200, message = "路由地址不能超过200个字符")
|
||||
public String getPath()
|
||||
{
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path)
|
||||
{
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 200, message = "组件路径不能超过255个字符")
|
||||
public String getComponent()
|
||||
{
|
||||
public String getComponent() {
|
||||
return component;
|
||||
}
|
||||
|
||||
public void setComponent(String component)
|
||||
{
|
||||
public void setComponent(String component) {
|
||||
this.component = component;
|
||||
}
|
||||
|
||||
public String getQuery()
|
||||
{
|
||||
public String getQuery() {
|
||||
return query;
|
||||
}
|
||||
|
||||
public void setQuery(String query)
|
||||
{
|
||||
public void setQuery(String query) {
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
public String getIsFrame()
|
||||
{
|
||||
public String getIsFrame() {
|
||||
return isFrame;
|
||||
}
|
||||
|
||||
public void setIsFrame(String isFrame)
|
||||
{
|
||||
public void setIsFrame(String isFrame) {
|
||||
this.isFrame = isFrame;
|
||||
}
|
||||
|
||||
public String getIsCache()
|
||||
{
|
||||
public String getIsCache() {
|
||||
return isCache;
|
||||
}
|
||||
|
||||
public void setIsCache(String isCache)
|
||||
{
|
||||
public void setIsCache(String isCache) {
|
||||
this.isCache = isCache;
|
||||
}
|
||||
|
||||
@NotBlank(message = "菜单类型不能为空")
|
||||
public String getMenuType()
|
||||
{
|
||||
public String getMenuType() {
|
||||
return menuType;
|
||||
}
|
||||
|
||||
public void setMenuType(String menuType)
|
||||
{
|
||||
public void setMenuType(String menuType) {
|
||||
this.menuType = menuType;
|
||||
}
|
||||
|
||||
public String getVisible()
|
||||
{
|
||||
public String getVisible() {
|
||||
return visible;
|
||||
}
|
||||
|
||||
public void setVisible(String visible)
|
||||
{
|
||||
public void setVisible(String visible) {
|
||||
this.visible = visible;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符")
|
||||
public String getPerms()
|
||||
{
|
||||
public String getPerms() {
|
||||
return perms;
|
||||
}
|
||||
|
||||
public void setPerms(String perms)
|
||||
{
|
||||
public void setPerms(String perms) {
|
||||
this.perms = perms;
|
||||
}
|
||||
|
||||
public String getIcon()
|
||||
{
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon)
|
||||
{
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public List<SysMenu> getChildren()
|
||||
{
|
||||
public List<SysMenu> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<SysMenu> 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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,102 +1,102 @@
|
|||
package com.health.system.common.domain;
|
||||
|
||||
import com.health.common.core.web.domain.BaseEntity;
|
||||
import com.health.common.core.xss.Xss;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
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.health.common.core.web.domain.BaseEntity;
|
||||
import com.health.common.core.xss.Xss;
|
||||
|
||||
/**
|
||||
* 通知公告表 sys_notice
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysNotice extends BaseEntity
|
||||
{
|
||||
public class SysNotice extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 公告ID */
|
||||
/**
|
||||
* 公告ID
|
||||
*/
|
||||
private Long noticeId;
|
||||
|
||||
/** 公告标题 */
|
||||
/**
|
||||
* 公告标题
|
||||
*/
|
||||
private String noticeTitle;
|
||||
|
||||
/** 公告类型(1通知 2公告) */
|
||||
/**
|
||||
* 公告类型(1通知 2公告)
|
||||
*/
|
||||
private String noticeType;
|
||||
|
||||
/** 公告内容 */
|
||||
/**
|
||||
* 公告内容
|
||||
*/
|
||||
private String noticeContent;
|
||||
|
||||
/** 公告状态(0正常 1关闭) */
|
||||
/**
|
||||
* 公告状态(0正常 1关闭)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
public Long getNoticeId()
|
||||
{
|
||||
public Long getNoticeId() {
|
||||
return noticeId;
|
||||
}
|
||||
|
||||
public void setNoticeId(Long noticeId)
|
||||
{
|
||||
public void setNoticeId(Long noticeId) {
|
||||
this.noticeId = noticeId;
|
||||
}
|
||||
|
||||
public void setNoticeTitle(String noticeTitle)
|
||||
{
|
||||
this.noticeTitle = noticeTitle;
|
||||
}
|
||||
|
||||
@Xss(message = "公告标题不能包含脚本字符")
|
||||
@NotBlank(message = "公告标题不能为空")
|
||||
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
|
||||
public String getNoticeTitle()
|
||||
{
|
||||
public String getNoticeTitle() {
|
||||
return noticeTitle;
|
||||
}
|
||||
|
||||
public void setNoticeType(String noticeType)
|
||||
{
|
||||
this.noticeType = noticeType;
|
||||
public void setNoticeTitle(String noticeTitle) {
|
||||
this.noticeTitle = noticeTitle;
|
||||
}
|
||||
|
||||
public String getNoticeType()
|
||||
{
|
||||
public String getNoticeType() {
|
||||
return noticeType;
|
||||
}
|
||||
|
||||
public void setNoticeContent(String noticeContent)
|
||||
{
|
||||
this.noticeContent = noticeContent;
|
||||
public void setNoticeType(String noticeType) {
|
||||
this.noticeType = noticeType;
|
||||
}
|
||||
|
||||
public String getNoticeContent()
|
||||
{
|
||||
public String getNoticeContent() {
|
||||
return noticeContent;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
public void setNoticeContent(String noticeContent) {
|
||||
this.noticeContent = noticeContent;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
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("noticeId", getNoticeId())
|
||||
.append("noticeTitle", getNoticeTitle())
|
||||
.append("noticeType", getNoticeType())
|
||||
.append("noticeContent", getNoticeContent())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("noticeId", getNoticeId())
|
||||
.append("noticeTitle", getNoticeTitle())
|
||||
.append("noticeType", getNoticeType())
|
||||
.append("noticeContent", getNoticeContent())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,255 +1,255 @@
|
|||
package com.health.system.common.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.health.common.core.annotation.Excel;
|
||||
import com.health.common.core.annotation.Excel.ColumnType;
|
||||
import com.health.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 操作日志记录表 oper_log
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysOperLog extends BaseEntity
|
||||
{
|
||||
public class SysOperLog extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 日志主键 */
|
||||
/**
|
||||
* 日志主键
|
||||
*/
|
||||
@Excel(name = "操作序号", cellType = ColumnType.NUMERIC)
|
||||
private Long operId;
|
||||
|
||||
/** 操作模块 */
|
||||
/**
|
||||
* 操作模块
|
||||
*/
|
||||
@Excel(name = "操作模块")
|
||||
private String title;
|
||||
|
||||
/** 业务类型(0其它 1新增 2修改 3删除) */
|
||||
/**
|
||||
* 业务类型(0其它 1新增 2修改 3删除)
|
||||
*/
|
||||
@Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据")
|
||||
private Integer businessType;
|
||||
|
||||
/** 业务类型数组 */
|
||||
/**
|
||||
* 业务类型数组
|
||||
*/
|
||||
private Integer[] businessTypes;
|
||||
|
||||
/** 请求方法 */
|
||||
/**
|
||||
* 请求方法
|
||||
*/
|
||||
@Excel(name = "请求方法")
|
||||
private String method;
|
||||
|
||||
/** 请求方式 */
|
||||
/**
|
||||
* 请求方式
|
||||
*/
|
||||
@Excel(name = "请求方式")
|
||||
private String requestMethod;
|
||||
|
||||
/** 操作类别(0其它 1后台用户 2手机端用户) */
|
||||
/**
|
||||
* 操作类别(0其它 1后台用户 2手机端用户)
|
||||
*/
|
||||
@Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
|
||||
private Integer operatorType;
|
||||
|
||||
/** 操作人员 */
|
||||
/**
|
||||
* 操作人员
|
||||
*/
|
||||
@Excel(name = "操作人员")
|
||||
private String operName;
|
||||
|
||||
/** 部门名称 */
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@Excel(name = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
/** 请求url */
|
||||
/**
|
||||
* 请求url
|
||||
*/
|
||||
@Excel(name = "请求地址")
|
||||
private String operUrl;
|
||||
|
||||
/** 操作地址 */
|
||||
/**
|
||||
* 操作地址
|
||||
*/
|
||||
@Excel(name = "操作地址")
|
||||
private String operIp;
|
||||
|
||||
/** 请求参数 */
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@Excel(name = "请求参数")
|
||||
private String 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;
|
||||
|
||||
/** 消耗时间 */
|
||||
/**
|
||||
* 消耗时间
|
||||
*/
|
||||
@Excel(name = "消耗时间", suffix = "毫秒")
|
||||
private Long costTime;
|
||||
|
||||
public Long getOperId()
|
||||
{
|
||||
public Long getOperId() {
|
||||
return operId;
|
||||
}
|
||||
|
||||
public void setOperId(Long operId)
|
||||
{
|
||||
public void setOperId(Long operId) {
|
||||
this.operId = operId;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title)
|
||||
{
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Integer getBusinessType()
|
||||
{
|
||||
public Integer getBusinessType() {
|
||||
return businessType;
|
||||
}
|
||||
|
||||
public void setBusinessType(Integer businessType)
|
||||
{
|
||||
public void setBusinessType(Integer businessType) {
|
||||
this.businessType = businessType;
|
||||
}
|
||||
|
||||
public Integer[] getBusinessTypes()
|
||||
{
|
||||
public Integer[] getBusinessTypes() {
|
||||
return businessTypes;
|
||||
}
|
||||
|
||||
public void setBusinessTypes(Integer[] businessTypes)
|
||||
{
|
||||
public void setBusinessTypes(Integer[] businessTypes) {
|
||||
this.businessTypes = businessTypes;
|
||||
}
|
||||
|
||||
public String getMethod()
|
||||
{
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public void setMethod(String method)
|
||||
{
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
public String getRequestMethod()
|
||||
{
|
||||
public String getRequestMethod() {
|
||||
return requestMethod;
|
||||
}
|
||||
|
||||
public void setRequestMethod(String requestMethod)
|
||||
{
|
||||
public void setRequestMethod(String requestMethod) {
|
||||
this.requestMethod = requestMethod;
|
||||
}
|
||||
|
||||
public Integer getOperatorType()
|
||||
{
|
||||
public Integer getOperatorType() {
|
||||
return operatorType;
|
||||
}
|
||||
|
||||
public void setOperatorType(Integer operatorType)
|
||||
{
|
||||
public void setOperatorType(Integer operatorType) {
|
||||
this.operatorType = operatorType;
|
||||
}
|
||||
|
||||
public String getOperName()
|
||||
{
|
||||
public String getOperName() {
|
||||
return operName;
|
||||
}
|
||||
|
||||
public void setOperName(String operName)
|
||||
{
|
||||
public void setOperName(String operName) {
|
||||
this.operName = operName;
|
||||
}
|
||||
|
||||
public String getDeptName()
|
||||
{
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName)
|
||||
{
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getOperUrl()
|
||||
{
|
||||
public String getOperUrl() {
|
||||
return operUrl;
|
||||
}
|
||||
|
||||
public void setOperUrl(String operUrl)
|
||||
{
|
||||
public void setOperUrl(String operUrl) {
|
||||
this.operUrl = operUrl;
|
||||
}
|
||||
|
||||
public String getOperIp()
|
||||
{
|
||||
public String getOperIp() {
|
||||
return operIp;
|
||||
}
|
||||
|
||||
public void setOperIp(String operIp)
|
||||
{
|
||||
public void setOperIp(String operIp) {
|
||||
this.operIp = operIp;
|
||||
}
|
||||
|
||||
public String getOperParam()
|
||||
{
|
||||
public String getOperParam() {
|
||||
return operParam;
|
||||
}
|
||||
|
||||
public void setOperParam(String operParam)
|
||||
{
|
||||
public void setOperParam(String operParam) {
|
||||
this.operParam = operParam;
|
||||
}
|
||||
|
||||
public String getJsonResult()
|
||||
{
|
||||
public String getJsonResult() {
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
public void setJsonResult(String jsonResult)
|
||||
{
|
||||
public void setJsonResult(String jsonResult) {
|
||||
this.jsonResult = jsonResult;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
{
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getErrorMsg()
|
||||
{
|
||||
public String getErrorMsg() {
|
||||
return errorMsg;
|
||||
}
|
||||
|
||||
public void setErrorMsg(String errorMsg)
|
||||
{
|
||||
public void setErrorMsg(String errorMsg) {
|
||||
this.errorMsg = errorMsg;
|
||||
}
|
||||
|
||||
public Date getOperTime()
|
||||
{
|
||||
public Date getOperTime() {
|
||||
return operTime;
|
||||
}
|
||||
|
||||
public void setOperTime(Date operTime)
|
||||
{
|
||||
public void setOperTime(Date operTime) {
|
||||
this.operTime = operTime;
|
||||
}
|
||||
|
||||
public Long getCostTime()
|
||||
{
|
||||
public Long getCostTime() {
|
||||
return costTime;
|
||||
}
|
||||
|
||||
public void setCostTime(Long costTime)
|
||||
{
|
||||
public void setCostTime(Long costTime) {
|
||||
this.costTime = costTime;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,124 +1,124 @@
|
|||
package com.health.system.common.domain;
|
||||
|
||||
import com.health.common.core.annotation.Excel;
|
||||
import com.health.common.core.annotation.Excel.ColumnType;
|
||||
import com.health.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 org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.health.common.core.annotation.Excel;
|
||||
import com.health.common.core.annotation.Excel.ColumnType;
|
||||
import com.health.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 岗位表 sys_post
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysPost extends BaseEntity
|
||||
{
|
||||
public class SysPost extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 岗位序号 */
|
||||
/**
|
||||
* 岗位序号
|
||||
*/
|
||||
@Excel(name = "岗位序号", cellType = ColumnType.NUMERIC)
|
||||
private Long postId;
|
||||
|
||||
/** 岗位编码 */
|
||||
/**
|
||||
* 岗位编码
|
||||
*/
|
||||
@Excel(name = "岗位编码")
|
||||
private String postCode;
|
||||
|
||||
/** 岗位名称 */
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
@Excel(name = "岗位名称")
|
||||
private String postName;
|
||||
|
||||
/** 岗位排序 */
|
||||
/**
|
||||
* 岗位排序
|
||||
*/
|
||||
@Excel(name = "岗位排序")
|
||||
private Integer postSort;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 用户是否存在此岗位标识 默认不存在 */
|
||||
/**
|
||||
* 用户是否存在此岗位标识 默认不存在
|
||||
*/
|
||||
private boolean flag = false;
|
||||
|
||||
public Long getPostId()
|
||||
{
|
||||
public Long getPostId() {
|
||||
return postId;
|
||||
}
|
||||
|
||||
public void setPostId(Long postId)
|
||||
{
|
||||
public void setPostId(Long postId) {
|
||||
this.postId = postId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "岗位编码不能为空")
|
||||
@Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符")
|
||||
public String getPostCode()
|
||||
{
|
||||
public String getPostCode() {
|
||||
return postCode;
|
||||
}
|
||||
|
||||
public void setPostCode(String postCode)
|
||||
{
|
||||
public void setPostCode(String postCode) {
|
||||
this.postCode = postCode;
|
||||
}
|
||||
|
||||
@NotBlank(message = "岗位名称不能为空")
|
||||
@Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符")
|
||||
public String getPostName()
|
||||
{
|
||||
public String getPostName() {
|
||||
return postName;
|
||||
}
|
||||
|
||||
public void setPostName(String postName)
|
||||
{
|
||||
public void setPostName(String postName) {
|
||||
this.postName = postName;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getPostSort()
|
||||
{
|
||||
public Integer getPostSort() {
|
||||
return postSort;
|
||||
}
|
||||
|
||||
public void setPostSort(Integer postSort)
|
||||
{
|
||||
public void setPostSort(Integer postSort) {
|
||||
this.postSort = postSort;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public boolean isFlag()
|
||||
{
|
||||
public boolean isFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(boolean flag)
|
||||
{
|
||||
public void setFlag(boolean flag) {
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("postId", getPostId())
|
||||
.append("postCode", getPostCode())
|
||||
.append("postName", getPostName())
|
||||
.append("postSort", getPostSort())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("postId", getPostId())
|
||||
.append("postCode", getPostCode())
|
||||
.append("postName", getPostName())
|
||||
.append("postSort", getPostSort())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,241 +1,237 @@
|
|||
package com.health.system.common.domain;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.health.common.core.annotation.Excel;
|
||||
import com.health.common.core.annotation.Excel.ColumnType;
|
||||
import com.health.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 health
|
||||
*/
|
||||
public class SysRole extends BaseEntity
|
||||
{
|
||||
public class SysRole extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 角色ID */
|
||||
/**
|
||||
* 角色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:仅本人数据权限) */
|
||||
/**
|
||||
* 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限)
|
||||
*/
|
||||
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
|
||||
private String dataScope;
|
||||
|
||||
/** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */
|
||||
/**
|
||||
* 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示)
|
||||
*/
|
||||
private boolean menuCheckStrictly;
|
||||
|
||||
/** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */
|
||||
/**
|
||||
* 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 )
|
||||
*/
|
||||
private boolean deptCheckStrictly;
|
||||
|
||||
/** 角色状态(0正常 1停用) */
|
||||
/**
|
||||
* 角色状态(0正常 1停用)
|
||||
*/
|
||||
@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/** 用户是否存在此角色标识 默认不存在 */
|
||||
/**
|
||||
* 用户是否存在此角色标识 默认不存在
|
||||
*/
|
||||
private boolean flag = false;
|
||||
|
||||
/** 菜单组 */
|
||||
/**
|
||||
* 菜单组
|
||||
*/
|
||||
private Long[] menuIds;
|
||||
|
||||
/** 部门组(数据权限) */
|
||||
/**
|
||||
* 部门组(数据权限)
|
||||
*/
|
||||
private Long[] deptIds;
|
||||
|
||||
/** 角色菜单权限 */
|
||||
/**
|
||||
* 角色菜单权限
|
||||
*/
|
||||
private Set<String> permissions;
|
||||
|
||||
public SysRole()
|
||||
{
|
||||
public SysRole() {
|
||||
|
||||
}
|
||||
|
||||
public SysRole(Long roleId)
|
||||
{
|
||||
public SysRole(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public Long getRoleId()
|
||||
{
|
||||
public static boolean isAdmin(Long roleId) {
|
||||
return roleId != null && 1L == roleId;
|
||||
}
|
||||
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId)
|
||||
{
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public boolean isAdmin()
|
||||
{
|
||||
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()
|
||||
{
|
||||
public String getRoleName() {
|
||||
return roleName;
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName)
|
||||
{
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
@NotBlank(message = "权限字符不能为空")
|
||||
@Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
|
||||
public String getRoleKey()
|
||||
{
|
||||
public String getRoleKey() {
|
||||
return roleKey;
|
||||
}
|
||||
|
||||
public void setRoleKey(String roleKey)
|
||||
{
|
||||
public void setRoleKey(String roleKey) {
|
||||
this.roleKey = roleKey;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getRoleSort()
|
||||
{
|
||||
public Integer getRoleSort() {
|
||||
return roleSort;
|
||||
}
|
||||
|
||||
public void setRoleSort(Integer roleSort)
|
||||
{
|
||||
public void setRoleSort(Integer roleSort) {
|
||||
this.roleSort = roleSort;
|
||||
}
|
||||
|
||||
public String getDataScope()
|
||||
{
|
||||
public String getDataScope() {
|
||||
return dataScope;
|
||||
}
|
||||
|
||||
public void setDataScope(String dataScope)
|
||||
{
|
||||
public void setDataScope(String dataScope) {
|
||||
this.dataScope = dataScope;
|
||||
}
|
||||
|
||||
public boolean isMenuCheckStrictly()
|
||||
{
|
||||
public boolean isMenuCheckStrictly() {
|
||||
return menuCheckStrictly;
|
||||
}
|
||||
|
||||
public void setMenuCheckStrictly(boolean menuCheckStrictly)
|
||||
{
|
||||
public void setMenuCheckStrictly(boolean menuCheckStrictly) {
|
||||
this.menuCheckStrictly = menuCheckStrictly;
|
||||
}
|
||||
|
||||
public boolean isDeptCheckStrictly()
|
||||
{
|
||||
public boolean isDeptCheckStrictly() {
|
||||
return deptCheckStrictly;
|
||||
}
|
||||
|
||||
public void setDeptCheckStrictly(boolean deptCheckStrictly)
|
||||
{
|
||||
public void setDeptCheckStrictly(boolean deptCheckStrictly) {
|
||||
this.deptCheckStrictly = deptCheckStrictly;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public boolean isFlag()
|
||||
{
|
||||
public boolean isFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(boolean flag)
|
||||
{
|
||||
public void setFlag(boolean flag) {
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public Long[] getMenuIds()
|
||||
{
|
||||
public Long[] getMenuIds() {
|
||||
return menuIds;
|
||||
}
|
||||
|
||||
public void setMenuIds(Long[] menuIds)
|
||||
{
|
||||
public void setMenuIds(Long[] menuIds) {
|
||||
this.menuIds = menuIds;
|
||||
}
|
||||
|
||||
public Long[] getDeptIds()
|
||||
{
|
||||
public Long[] getDeptIds() {
|
||||
return deptIds;
|
||||
}
|
||||
|
||||
public void setDeptIds(Long[] deptIds)
|
||||
{
|
||||
public void setDeptIds(Long[] deptIds) {
|
||||
this.deptIds = deptIds;
|
||||
}
|
||||
|
||||
public Set<String> getPermissions()
|
||||
{
|
||||
public Set<String> getPermissions() {
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(Set<String> 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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,39 +8,38 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysRoleDept
|
||||
{
|
||||
/** 角色ID */
|
||||
public class SysRoleDept {
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/** 部门ID */
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
public Long getRoleId()
|
||||
{
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId)
|
||||
{
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("roleId", getRoleId())
|
||||
.append("deptId", getDeptId())
|
||||
.toString();
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("roleId", getRoleId())
|
||||
.append("deptId", getDeptId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,39 +8,38 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysRoleMenu
|
||||
{
|
||||
/** 角色ID */
|
||||
public class SysRoleMenu {
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/** 菜单ID */
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
private Long menuId;
|
||||
|
||||
public Long getRoleId()
|
||||
{
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId)
|
||||
{
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public Long getMenuId()
|
||||
{
|
||||
public Long getMenuId() {
|
||||
return menuId;
|
||||
}
|
||||
|
||||
public void setMenuId(Long menuId)
|
||||
{
|
||||
public void setMenuId(Long menuId) {
|
||||
this.menuId = menuId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("roleId", getRoleId())
|
||||
.append("menuId", getMenuId())
|
||||
.toString();
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("roleId", getRoleId())
|
||||
.append("menuId", getMenuId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,323 +1,322 @@
|
|||
package com.health.system.common.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.health.common.core.annotation.Excel;
|
||||
import com.health.common.core.annotation.Excel.ColumnType;
|
||||
import com.health.common.core.annotation.Excel.Type;
|
||||
import com.health.common.core.annotation.Excels;
|
||||
import com.health.common.core.web.domain.BaseEntity;
|
||||
import com.health.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.Size;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户对象 sys_user
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysUser extends BaseEntity
|
||||
{
|
||||
public class SysUser extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 用户ID */
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
||||
private Long userId;
|
||||
|
||||
/** 部门ID */
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@Excel(name = "部门编号", type = Type.IMPORT)
|
||||
private Long deptId;
|
||||
|
||||
/** 用户账号 */
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@Excel(name = "登录名称")
|
||||
private String userName;
|
||||
|
||||
/** 用户昵称 */
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@Excel(name = "用户名称")
|
||||
private String nickName;
|
||||
|
||||
/** 用户邮箱 */
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
@Excel(name = "用户邮箱")
|
||||
private String email;
|
||||
|
||||
/** 手机号码 */
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@Excel(name = "手机号码")
|
||||
private String phonenumber;
|
||||
|
||||
/** 用户性别 */
|
||||
/**
|
||||
* 用户性别
|
||||
*/
|
||||
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
||||
private String sex;
|
||||
|
||||
/** 用户头像 */
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/** 密码 */
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/** 帐号状态(0正常 1停用) */
|
||||
/**
|
||||
* 帐号状态(0正常 1停用)
|
||||
*/
|
||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/** 最后登录IP */
|
||||
/**
|
||||
* 最后登录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)
|
||||
@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 */
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
public SysUser()
|
||||
{
|
||||
public SysUser() {
|
||||
|
||||
}
|
||||
|
||||
public SysUser(Long userId)
|
||||
{
|
||||
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)
|
||||
{
|
||||
public static boolean isAdmin(Long userId) {
|
||||
return userId != null && 1L == userId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public boolean isAdmin() {
|
||||
return isAdmin(this.userId);
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
@Xss(message = "用户昵称不能包含脚本字符")
|
||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||
public String getNickName()
|
||||
{
|
||||
public String getNickName() {
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName)
|
||||
{
|
||||
public void setNickName(String nickName) {
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
@Xss(message = "用户账号不能包含脚本字符")
|
||||
@NotBlank(message = "用户账号不能为空")
|
||||
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
||||
public String getUserName()
|
||||
{
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
@Email(message = "邮箱格式不正确")
|
||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||
public String getEmail()
|
||||
{
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email)
|
||||
{
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
||||
public String getPhonenumber()
|
||||
{
|
||||
public String getPhonenumber() {
|
||||
return phonenumber;
|
||||
}
|
||||
|
||||
public void setPhonenumber(String phonenumber)
|
||||
{
|
||||
public void setPhonenumber(String phonenumber) {
|
||||
this.phonenumber = phonenumber;
|
||||
}
|
||||
|
||||
public String getSex()
|
||||
{
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex)
|
||||
{
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getAvatar()
|
||||
{
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar)
|
||||
{
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getPassword()
|
||||
{
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password)
|
||||
{
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getLoginIp()
|
||||
{
|
||||
public String getLoginIp() {
|
||||
return loginIp;
|
||||
}
|
||||
|
||||
public void setLoginIp(String loginIp)
|
||||
{
|
||||
public void setLoginIp(String loginIp) {
|
||||
this.loginIp = loginIp;
|
||||
}
|
||||
|
||||
public Date getLoginDate()
|
||||
{
|
||||
public Date getLoginDate() {
|
||||
return loginDate;
|
||||
}
|
||||
|
||||
public void setLoginDate(Date loginDate)
|
||||
{
|
||||
public void setLoginDate(Date loginDate) {
|
||||
this.loginDate = loginDate;
|
||||
}
|
||||
|
||||
public SysDept getDept()
|
||||
{
|
||||
public SysDept getDept() {
|
||||
return dept;
|
||||
}
|
||||
|
||||
public void setDept(SysDept dept)
|
||||
{
|
||||
public void setDept(SysDept dept) {
|
||||
this.dept = dept;
|
||||
}
|
||||
|
||||
public List<SysRole> getRoles()
|
||||
{
|
||||
public List<SysRole> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(List<SysRole> roles)
|
||||
{
|
||||
public void setRoles(List<SysRole> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public Long[] getRoleIds()
|
||||
{
|
||||
public Long[] getRoleIds() {
|
||||
return roleIds;
|
||||
}
|
||||
|
||||
public void setRoleIds(Long[] roleIds)
|
||||
{
|
||||
public void setRoleIds(Long[] roleIds) {
|
||||
this.roleIds = roleIds;
|
||||
}
|
||||
|
||||
public Long[] getPostIds()
|
||||
{
|
||||
public Long[] getPostIds() {
|
||||
return postIds;
|
||||
}
|
||||
|
||||
public void setPostIds(Long[] postIds)
|
||||
{
|
||||
public void setPostIds(Long[] postIds) {
|
||||
this.postIds = postIds;
|
||||
}
|
||||
|
||||
public Long getRoleId()
|
||||
{
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long 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("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())
|
||||
.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())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,96 +5,95 @@ package com.health.system.common.domain;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysUserOnline
|
||||
{
|
||||
/** 会话编号 */
|
||||
public class SysUserOnline {
|
||||
/**
|
||||
* 会话编号
|
||||
*/
|
||||
private String tokenId;
|
||||
|
||||
/** 用户名称 */
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/** 登录IP地址 */
|
||||
/**
|
||||
* 登录IP地址
|
||||
*/
|
||||
private String ipaddr;
|
||||
|
||||
/** 登录地址 */
|
||||
/**
|
||||
* 登录地址
|
||||
*/
|
||||
private String loginLocation;
|
||||
|
||||
/** 浏览器类型 */
|
||||
/**
|
||||
* 浏览器类型
|
||||
*/
|
||||
private String browser;
|
||||
|
||||
/** 操作系统 */
|
||||
/**
|
||||
* 操作系统
|
||||
*/
|
||||
private String os;
|
||||
|
||||
/** 登录时间 */
|
||||
/**
|
||||
* 登录时间
|
||||
*/
|
||||
private Long loginTime;
|
||||
|
||||
public String getTokenId()
|
||||
{
|
||||
public String getTokenId() {
|
||||
return tokenId;
|
||||
}
|
||||
|
||||
public void setTokenId(String tokenId)
|
||||
{
|
||||
public void setTokenId(String tokenId) {
|
||||
this.tokenId = tokenId;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getIpaddr()
|
||||
{
|
||||
public String getIpaddr() {
|
||||
return ipaddr;
|
||||
}
|
||||
|
||||
public void setIpaddr(String ipaddr)
|
||||
{
|
||||
public void setIpaddr(String ipaddr) {
|
||||
this.ipaddr = ipaddr;
|
||||
}
|
||||
|
||||
public String getLoginLocation()
|
||||
{
|
||||
public String getLoginLocation() {
|
||||
return loginLocation;
|
||||
}
|
||||
|
||||
public void setLoginLocation(String loginLocation)
|
||||
{
|
||||
public void setLoginLocation(String loginLocation) {
|
||||
this.loginLocation = loginLocation;
|
||||
}
|
||||
|
||||
public String getBrowser()
|
||||
{
|
||||
public String getBrowser() {
|
||||
return browser;
|
||||
}
|
||||
|
||||
public void setBrowser(String browser)
|
||||
{
|
||||
public void setBrowser(String browser) {
|
||||
this.browser = browser;
|
||||
}
|
||||
|
||||
public String getOs()
|
||||
{
|
||||
public String getOs() {
|
||||
return os;
|
||||
}
|
||||
|
||||
public void setOs(String os)
|
||||
{
|
||||
public void setOs(String os) {
|
||||
this.os = os;
|
||||
}
|
||||
|
||||
public Long getLoginTime()
|
||||
{
|
||||
public Long getLoginTime() {
|
||||
return loginTime;
|
||||
}
|
||||
|
||||
public void setLoginTime(Long loginTime)
|
||||
{
|
||||
public void setLoginTime(Long loginTime) {
|
||||
this.loginTime = loginTime;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,39 +8,38 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysUserPost
|
||||
{
|
||||
/** 用户ID */
|
||||
public class SysUserPost {
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/** 岗位ID */
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
private Long postId;
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getPostId()
|
||||
{
|
||||
public Long getPostId() {
|
||||
return postId;
|
||||
}
|
||||
|
||||
public void setPostId(Long postId)
|
||||
{
|
||||
public void setPostId(Long postId) {
|
||||
this.postId = postId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("userId", getUserId())
|
||||
.append("postId", getPostId())
|
||||
.toString();
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("userId", getUserId())
|
||||
.append("postId", getPostId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,39 +8,38 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public class SysUserRole
|
||||
{
|
||||
/** 用户ID */
|
||||
public class SysUserRole {
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/** 角色ID */
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getRoleId()
|
||||
{
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId)
|
||||
{
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("userId", getUserId())
|
||||
.append("roleId", getRoleId())
|
||||
.toString();
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("userId", getUserId())
|
||||
.append("roleId", getRoleId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,7 @@ import java.util.Set;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public class LoginUser implements Serializable
|
||||
{
|
||||
public class LoginUser implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
@ -59,93 +58,75 @@ public class LoginUser implements Serializable
|
|||
*/
|
||||
private SysUser sysUser;
|
||||
|
||||
public String getToken()
|
||||
{
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token)
|
||||
{
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public Long getUserid()
|
||||
{
|
||||
public Long getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setUserid(Long userid)
|
||||
{
|
||||
public void setUserid(Long userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
|
||||
public String getUsername()
|
||||
{
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username)
|
||||
{
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public Long getLoginTime()
|
||||
{
|
||||
public Long getLoginTime() {
|
||||
return loginTime;
|
||||
}
|
||||
|
||||
public void setLoginTime(Long loginTime)
|
||||
{
|
||||
public void setLoginTime(Long loginTime) {
|
||||
this.loginTime = loginTime;
|
||||
}
|
||||
|
||||
public Long getExpireTime()
|
||||
{
|
||||
public Long getExpireTime() {
|
||||
return expireTime;
|
||||
}
|
||||
|
||||
public void setExpireTime(Long expireTime)
|
||||
{
|
||||
public void setExpireTime(Long expireTime) {
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
|
||||
public String getIpaddr()
|
||||
{
|
||||
public String getIpaddr() {
|
||||
return ipaddr;
|
||||
}
|
||||
|
||||
public void setIpaddr(String ipaddr)
|
||||
{
|
||||
public void setIpaddr(String ipaddr) {
|
||||
this.ipaddr = ipaddr;
|
||||
}
|
||||
|
||||
public Set<String> getPermissions()
|
||||
{
|
||||
public Set<String> getPermissions() {
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(Set<String> permissions)
|
||||
{
|
||||
public void setPermissions(Set<String> permissions) {
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
public Set<String> getRoles()
|
||||
{
|
||||
public Set<String> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(Set<String> roles)
|
||||
{
|
||||
public void setRoles(Set<String> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public SysUser getSysUser()
|
||||
{
|
||||
public SysUser getSysUser() {
|
||||
return sysUser;
|
||||
}
|
||||
|
||||
public void setSysUser(SysUser sysUser)
|
||||
{
|
||||
public void setSysUser(SysUser sysUser) {
|
||||
this.sysUser = sysUser;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ import com.health.common.core.utils.StringUtils;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public class MetaVo
|
||||
{
|
||||
public class MetaVo {
|
||||
/**
|
||||
* 设置该路由在侧边栏和面包屑中展示的名字
|
||||
*/
|
||||
|
@ -29,78 +28,64 @@ public class MetaVo
|
|||
*/
|
||||
private String link;
|
||||
|
||||
public MetaVo()
|
||||
{
|
||||
public MetaVo() {
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon)
|
||||
{
|
||||
public MetaVo(String title, String icon) {
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon, boolean noCache)
|
||||
{
|
||||
public MetaVo(String title, String icon, boolean noCache) {
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
this.noCache = noCache;
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon, String link)
|
||||
{
|
||||
public MetaVo(String title, String icon, String link) {
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
this.link = link;
|
||||
}
|
||||
|
||||
public MetaVo(String title, String icon, boolean noCache, String link)
|
||||
{
|
||||
public MetaVo(String title, String icon, boolean noCache, String link) {
|
||||
this.title = title;
|
||||
this.icon = icon;
|
||||
this.noCache = noCache;
|
||||
if (StringUtils.ishttp(link))
|
||||
{
|
||||
if (StringUtils.ishttp(link)) {
|
||||
this.link = link;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isNoCache()
|
||||
{
|
||||
public boolean isNoCache() {
|
||||
return noCache;
|
||||
}
|
||||
|
||||
public void setNoCache(boolean noCache)
|
||||
{
|
||||
public void setNoCache(boolean noCache) {
|
||||
this.noCache = noCache;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title)
|
||||
{
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getIcon()
|
||||
{
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon)
|
||||
{
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getLink()
|
||||
{
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
public void setLink(String link)
|
||||
{
|
||||
public void setLink(String link) {
|
||||
this.link = link;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.health.system.common.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -9,8 +10,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
public class RouterVo
|
||||
{
|
||||
public class RouterVo {
|
||||
/**
|
||||
* 路由名字
|
||||
*/
|
||||
|
@ -56,93 +56,75 @@ public class RouterVo
|
|||
*/
|
||||
private List<RouterVo> children;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPath()
|
||||
{
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path)
|
||||
{
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public boolean getHidden()
|
||||
{
|
||||
public boolean getHidden() {
|
||||
return hidden;
|
||||
}
|
||||
|
||||
public void setHidden(boolean hidden)
|
||||
{
|
||||
public void setHidden(boolean hidden) {
|
||||
this.hidden = hidden;
|
||||
}
|
||||
|
||||
public String getRedirect()
|
||||
{
|
||||
public String getRedirect() {
|
||||
return redirect;
|
||||
}
|
||||
|
||||
public void setRedirect(String redirect)
|
||||
{
|
||||
public void setRedirect(String redirect) {
|
||||
this.redirect = redirect;
|
||||
}
|
||||
|
||||
public String getComponent()
|
||||
{
|
||||
public String getComponent() {
|
||||
return component;
|
||||
}
|
||||
|
||||
public void setComponent(String component)
|
||||
{
|
||||
public void setComponent(String component) {
|
||||
this.component = component;
|
||||
}
|
||||
|
||||
public String getQuery()
|
||||
{
|
||||
public String getQuery() {
|
||||
return query;
|
||||
}
|
||||
|
||||
public void setQuery(String query)
|
||||
{
|
||||
public void setQuery(String query) {
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
public Boolean getAlwaysShow()
|
||||
{
|
||||
public Boolean getAlwaysShow() {
|
||||
return alwaysShow;
|
||||
}
|
||||
|
||||
public void setAlwaysShow(Boolean alwaysShow)
|
||||
{
|
||||
public void setAlwaysShow(Boolean alwaysShow) {
|
||||
this.alwaysShow = alwaysShow;
|
||||
}
|
||||
|
||||
public MetaVo getMeta()
|
||||
{
|
||||
public MetaVo getMeta() {
|
||||
return meta;
|
||||
}
|
||||
|
||||
public void setMeta(MetaVo meta)
|
||||
{
|
||||
public void setMeta(MetaVo meta) {
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
public List<RouterVo> getChildren()
|
||||
{
|
||||
public List<RouterVo> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<RouterVo> children)
|
||||
{
|
||||
public void setChildren(List<RouterVo> children) {
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,77 +1,74 @@
|
|||
package com.health.system.common.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.health.system.common.domain.SysDept;
|
||||
import com.health.system.common.domain.SysMenu;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.health.system.common.domain.SysDept;
|
||||
import com.health.system.common.domain.SysMenu;
|
||||
|
||||
/**
|
||||
* Treeselect树结构实体类
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public class TreeSelect implements Serializable
|
||||
{
|
||||
public class TreeSelect implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 节点ID */
|
||||
/**
|
||||
* 节点ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/** 节点名称 */
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String label;
|
||||
|
||||
/** 子节点 */
|
||||
/**
|
||||
* 子节点
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<TreeSelect> children;
|
||||
|
||||
public TreeSelect()
|
||||
{
|
||||
public TreeSelect() {
|
||||
|
||||
}
|
||||
|
||||
public TreeSelect(SysDept dept)
|
||||
{
|
||||
public TreeSelect(SysDept dept) {
|
||||
this.id = dept.getDeptId();
|
||||
this.label = dept.getDeptName();
|
||||
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public TreeSelect(SysMenu menu)
|
||||
{
|
||||
public TreeSelect(SysMenu menu) {
|
||||
this.id = menu.getMenuId();
|
||||
this.label = menu.getMenuName();
|
||||
this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getLabel()
|
||||
{
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label)
|
||||
{
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public List<TreeSelect> getChildren()
|
||||
{
|
||||
public List<TreeSelect> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<TreeSelect> children)
|
||||
{
|
||||
public void setChildren(List<TreeSelect> children) {
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
|
|
@ -17,13 +17,12 @@ import org.springframework.web.bind.annotation.RequestHeader;
|
|||
* @author health
|
||||
*/
|
||||
@FeignClient(contextId = "remoteLogService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteLogFallbackFactory.class)
|
||||
public interface RemoteLogService
|
||||
{
|
||||
public interface RemoteLogService {
|
||||
/**
|
||||
* 保存系统日志
|
||||
*
|
||||
* @param sysOperLog 日志实体
|
||||
* @param source 请求来源
|
||||
* @param source 请求来源
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/operlog")
|
||||
|
@ -33,7 +32,7 @@ public interface RemoteLogService
|
|||
* 保存访问记录
|
||||
*
|
||||
* @param sysLogininfor 访问实体
|
||||
* @param source 请求来源
|
||||
* @param source 请求来源
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/logininfor")
|
||||
|
|
|
@ -16,13 +16,12 @@ import org.springframework.web.bind.annotation.*;
|
|||
* @author health
|
||||
*/
|
||||
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
|
||||
public interface RemoteUserService
|
||||
{
|
||||
public interface RemoteUserService {
|
||||
/**
|
||||
* 通过用户名查询用户信息
|
||||
*
|
||||
* @param username 用户名
|
||||
* @param source 请求来源
|
||||
* @param source 请求来源
|
||||
* @return 结果
|
||||
*/
|
||||
@GetMapping("/user/info/{username}")
|
||||
|
@ -32,7 +31,7 @@ public interface RemoteUserService
|
|||
* 注册用户信息
|
||||
*
|
||||
* @param sysUser 用户信息
|
||||
* @param source 请求来源
|
||||
* @param source 请求来源
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/user/register")
|
||||
|
|
|
@ -16,25 +16,20 @@ import org.springframework.stereotype.Component;
|
|||
* @author health
|
||||
*/
|
||||
@Component
|
||||
public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogService>
|
||||
{
|
||||
public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogService> {
|
||||
private static final Logger log = LoggerFactory.getLogger(RemoteLogFallbackFactory.class);
|
||||
|
||||
@Override
|
||||
public RemoteLogService create(Throwable throwable)
|
||||
{
|
||||
public RemoteLogService create(Throwable throwable) {
|
||||
log.error("日志服务调用失败:{}", throwable.getMessage());
|
||||
return new RemoteLogService()
|
||||
{
|
||||
return new RemoteLogService() {
|
||||
@Override
|
||||
public Result<Boolean> saveLog(SysOperLog sysOperLog, String source)
|
||||
{
|
||||
public Result<Boolean> saveLog(SysOperLog sysOperLog, String source) {
|
||||
return Result.error("保存操作日志失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Boolean> saveLogininfor(SysLogininfor sysLogininfor, String source)
|
||||
{
|
||||
public Result<Boolean> saveLogininfor(SysLogininfor sysLogininfor, String source) {
|
||||
return Result.error("保存登录日志失败:" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
|
|
|
@ -16,25 +16,20 @@ import org.springframework.stereotype.Component;
|
|||
* @author health
|
||||
*/
|
||||
@Component
|
||||
public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserService>
|
||||
{
|
||||
public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserService> {
|
||||
private static final Logger log = LoggerFactory.getLogger(RemoteUserFallbackFactory.class);
|
||||
|
||||
@Override
|
||||
public RemoteUserService create(Throwable throwable)
|
||||
{
|
||||
public RemoteUserService create(Throwable throwable) {
|
||||
log.error("用户服务调用失败:{}", throwable.getMessage());
|
||||
return new RemoteUserService()
|
||||
{
|
||||
return new RemoteUserService() {
|
||||
@Override
|
||||
public Result<LoginUser> getUserInfo(String username, String source)
|
||||
{
|
||||
public Result<LoginUser> getUserInfo(String username, String source) {
|
||||
return Result.error("获取用户失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Boolean> registerUserInfo(SysUser sysUser, String source)
|
||||
{
|
||||
public Result<Boolean> registerUserInfo(SysUser sysUser, String source) {
|
||||
return Result.error("注册用户失败:" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
@ -100,11 +100,7 @@
|
|||
<artifactId>health-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.health</groupId>
|
||||
<artifactId>health-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package com.health.system.server;
|
||||
|
||||
import com.health.common.security.annotation.EnableCustomConfig;
|
||||
import com.health.common.security.annotation.EnableRyFeignClients;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import com.health.common.security.annotation.EnableCustomConfig;
|
||||
import com.health.common.security.annotation.EnableRyFeignClients;
|
||||
import com.health.common.swagger.annotation.EnableCustomSwagger2;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
|
@ -13,14 +12,12 @@ import com.health.common.swagger.annotation.EnableCustomSwagger2;
|
|||
* @author health
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan(value ="com.health.system.server.mapper" )
|
||||
public class HealthSystemApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
@MapperScan(value = "com.health.system.server.mapper")
|
||||
public class HealthSystemApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(HealthSystemApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 系统模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
|
|
|
@ -26,8 +26,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/config")
|
||||
public class SysConfigController extends BaseController
|
||||
{
|
||||
public class SysConfigController extends BaseController {
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
|
@ -36,8 +35,7 @@ public class SysConfigController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:config:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(SysConfig config)
|
||||
{
|
||||
public Result<TableDataInfo> list(SysConfig config) {
|
||||
startPage();
|
||||
List<SysConfig> list = configService.selectConfigList(config);
|
||||
return getDataTable(list);
|
||||
|
@ -46,8 +44,7 @@ public class SysConfigController extends BaseController
|
|||
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:config:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysConfig config)
|
||||
{
|
||||
public void export(HttpServletResponse response, SysConfig config) {
|
||||
List<SysConfig> list = configService.selectConfigList(config);
|
||||
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
|
||||
util.exportExcel(response, list, "参数数据");
|
||||
|
@ -57,8 +54,7 @@ public class SysConfigController extends BaseController
|
|||
* 根据参数编号获取详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{configId}")
|
||||
public Result getInfo(@PathVariable Long configId)
|
||||
{
|
||||
public Result getInfo(@PathVariable Long configId) {
|
||||
return success(configService.selectConfigById(configId));
|
||||
}
|
||||
|
||||
|
@ -66,8 +62,7 @@ public class SysConfigController extends BaseController
|
|||
* 根据参数键名查询参数值
|
||||
*/
|
||||
@GetMapping(value = "/configKey/{configKey}")
|
||||
public Result getConfigKey(@PathVariable String configKey)
|
||||
{
|
||||
public Result getConfigKey(@PathVariable String configKey) {
|
||||
return success(configService.selectConfigByKey(configKey));
|
||||
}
|
||||
|
||||
|
@ -77,10 +72,8 @@ public class SysConfigController extends BaseController
|
|||
@RequiresPermissions("system:config:add")
|
||||
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@Validated @RequestBody SysConfig config)
|
||||
{
|
||||
if (!configService.checkConfigKeyUnique(config))
|
||||
{
|
||||
public Result add(@Validated @RequestBody SysConfig config) {
|
||||
if (!configService.checkConfigKeyUnique(config)) {
|
||||
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||
}
|
||||
config.setCreateBy(SecurityUtils.getUsername());
|
||||
|
@ -93,10 +86,8 @@ public class SysConfigController extends BaseController
|
|||
@RequiresPermissions("system:config:edit")
|
||||
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@Validated @RequestBody SysConfig config)
|
||||
{
|
||||
if (!configService.checkConfigKeyUnique(config))
|
||||
{
|
||||
public Result edit(@Validated @RequestBody SysConfig config) {
|
||||
if (!configService.checkConfigKeyUnique(config)) {
|
||||
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||
}
|
||||
config.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
@ -109,8 +100,7 @@ public class SysConfigController extends BaseController
|
|||
@RequiresPermissions("system:config:remove")
|
||||
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{configIds}")
|
||||
public Result remove(@PathVariable Long[] configIds)
|
||||
{
|
||||
public Result remove(@PathVariable Long[] configIds) {
|
||||
configService.deleteConfigByIds(configIds);
|
||||
return success();
|
||||
}
|
||||
|
@ -121,8 +111,7 @@ public class SysConfigController extends BaseController
|
|||
@RequiresPermissions("system:config:remove")
|
||||
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/refreshCache")
|
||||
public Result refreshCache()
|
||||
{
|
||||
public Result refreshCache() {
|
||||
configService.resetConfigCache();
|
||||
return success();
|
||||
}
|
||||
|
|
|
@ -25,8 +25,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dept")
|
||||
public class SysDeptController extends BaseController
|
||||
{
|
||||
public class SysDeptController extends BaseController {
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
|
@ -35,8 +34,7 @@ public class SysDeptController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:dept:list")
|
||||
@GetMapping("/list")
|
||||
public Result list(SysDept dept)
|
||||
{
|
||||
public Result list(SysDept dept) {
|
||||
List<SysDept> depts = deptService.selectDeptList(dept);
|
||||
return success(depts);
|
||||
}
|
||||
|
@ -46,8 +44,7 @@ public class SysDeptController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:dept:list")
|
||||
@GetMapping("/list/exclude/{deptId}")
|
||||
public Result excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
|
||||
{
|
||||
public Result excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) {
|
||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
||||
depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
|
||||
return success(depts);
|
||||
|
@ -58,8 +55,7 @@ public class SysDeptController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:dept:query")
|
||||
@GetMapping(value = "/{deptId}")
|
||||
public Result getInfo(@PathVariable Long deptId)
|
||||
{
|
||||
public Result getInfo(@PathVariable Long deptId) {
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
return success(deptService.selectDeptById(deptId));
|
||||
}
|
||||
|
@ -70,10 +66,8 @@ public class SysDeptController extends BaseController
|
|||
@RequiresPermissions("system:dept:add")
|
||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@Validated @RequestBody SysDept dept)
|
||||
{
|
||||
if (!deptService.checkDeptNameUnique(dept))
|
||||
{
|
||||
public Result add(@Validated @RequestBody SysDept dept) {
|
||||
if (!deptService.checkDeptNameUnique(dept)) {
|
||||
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
}
|
||||
dept.setCreateBy(SecurityUtils.getUsername());
|
||||
|
@ -86,20 +80,14 @@ public class SysDeptController extends BaseController
|
|||
@RequiresPermissions("system:dept:edit")
|
||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@Validated @RequestBody SysDept dept)
|
||||
{
|
||||
public Result edit(@Validated @RequestBody SysDept dept) {
|
||||
Long deptId = dept.getDeptId();
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
if (!deptService.checkDeptNameUnique(dept))
|
||||
{
|
||||
if (!deptService.checkDeptNameUnique(dept)) {
|
||||
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
}
|
||||
else if (dept.getParentId().equals(deptId))
|
||||
{
|
||||
} else if (dept.getParentId().equals(deptId)) {
|
||||
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
||||
}
|
||||
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
|
||||
{
|
||||
} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) {
|
||||
return error("该部门包含未停用的子部门!");
|
||||
}
|
||||
dept.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
@ -112,14 +100,11 @@ public class SysDeptController extends BaseController
|
|||
@RequiresPermissions("system:dept:remove")
|
||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{deptId}")
|
||||
public Result remove(@PathVariable Long deptId)
|
||||
{
|
||||
if (deptService.hasChildByDeptId(deptId))
|
||||
{
|
||||
public Result remove(@PathVariable Long deptId) {
|
||||
if (deptService.hasChildByDeptId(deptId)) {
|
||||
return warn("存在下级部门,不允许删除");
|
||||
}
|
||||
if (deptService.checkDeptExistUser(deptId))
|
||||
{
|
||||
if (deptService.checkDeptExistUser(deptId)) {
|
||||
return warn("部门存在用户,不允许删除");
|
||||
}
|
||||
deptService.checkDeptDataScope(deptId);
|
||||
|
|
|
@ -28,8 +28,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dict/data")
|
||||
public class SysDictDataController extends BaseController
|
||||
{
|
||||
public class SysDictDataController extends BaseController {
|
||||
@Autowired
|
||||
private ISysDictDataService dictDataService;
|
||||
|
||||
|
@ -38,8 +37,7 @@ public class SysDictDataController extends BaseController
|
|||
|
||||
@RequiresPermissions("system:dict:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(SysDictData dictData)
|
||||
{
|
||||
public Result<TableDataInfo> list(SysDictData dictData) {
|
||||
startPage();
|
||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
||||
return getDataTable(list);
|
||||
|
@ -48,8 +46,7 @@ public class SysDictDataController extends BaseController
|
|||
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:dict:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDictData dictData)
|
||||
{
|
||||
public void export(HttpServletResponse response, SysDictData dictData) {
|
||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
||||
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
|
||||
util.exportExcel(response, list, "字典数据");
|
||||
|
@ -60,8 +57,7 @@ public class SysDictDataController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:dict:query")
|
||||
@GetMapping(value = "/{dictCode}")
|
||||
public Result getInfo(@PathVariable Long dictCode)
|
||||
{
|
||||
public Result getInfo(@PathVariable Long dictCode) {
|
||||
return success(dictDataService.selectDictDataById(dictCode));
|
||||
}
|
||||
|
||||
|
@ -69,11 +65,9 @@ public class SysDictDataController extends BaseController
|
|||
* 根据字典类型查询字典数据信息
|
||||
*/
|
||||
@GetMapping(value = "/type/{dictType}")
|
||||
public Result dictType(@PathVariable String dictType)
|
||||
{
|
||||
public Result dictType(@PathVariable String dictType) {
|
||||
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
||||
if (StringUtils.isNull(data))
|
||||
{
|
||||
if (StringUtils.isNull(data)) {
|
||||
data = new ArrayList<SysDictData>();
|
||||
}
|
||||
return success(data);
|
||||
|
@ -85,8 +79,7 @@ public class SysDictDataController extends BaseController
|
|||
@RequiresPermissions("system:dict:add")
|
||||
@Log(title = "字典数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@Validated @RequestBody SysDictData dict)
|
||||
{
|
||||
public Result add(@Validated @RequestBody SysDictData dict) {
|
||||
dict.setCreateBy(SecurityUtils.getUsername());
|
||||
return toAjax(dictDataService.insertDictData(dict));
|
||||
}
|
||||
|
@ -97,8 +90,7 @@ public class SysDictDataController extends BaseController
|
|||
@RequiresPermissions("system:dict:edit")
|
||||
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@Validated @RequestBody SysDictData dict)
|
||||
{
|
||||
public Result edit(@Validated @RequestBody SysDictData dict) {
|
||||
dict.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(dictDataService.updateDictData(dict));
|
||||
}
|
||||
|
@ -109,8 +101,7 @@ public class SysDictDataController extends BaseController
|
|||
@RequiresPermissions("system:dict:remove")
|
||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictCodes}")
|
||||
public Result remove(@PathVariable Long[] dictCodes)
|
||||
{
|
||||
public Result remove(@PathVariable Long[] dictCodes) {
|
||||
dictDataService.deleteDictDataByIds(dictCodes);
|
||||
return success();
|
||||
}
|
||||
|
|
|
@ -24,15 +24,13 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dict/type")
|
||||
public class SysDictTypeController extends BaseController
|
||||
{
|
||||
public class SysDictTypeController extends BaseController {
|
||||
@Autowired
|
||||
private ISysDictTypeService dictTypeService;
|
||||
|
||||
@RequiresPermissions("system:dict:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(SysDictType dictType)
|
||||
{
|
||||
public Result<TableDataInfo> list(SysDictType dictType) {
|
||||
startPage();
|
||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||
return getDataTable(list);
|
||||
|
@ -41,8 +39,7 @@ public class SysDictTypeController extends BaseController
|
|||
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:dict:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDictType dictType)
|
||||
{
|
||||
public void export(HttpServletResponse response, SysDictType dictType) {
|
||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
|
||||
util.exportExcel(response, list, "字典类型");
|
||||
|
@ -53,8 +50,7 @@ public class SysDictTypeController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:dict:query")
|
||||
@GetMapping(value = "/{dictId}")
|
||||
public Result getInfo(@PathVariable Long dictId)
|
||||
{
|
||||
public Result getInfo(@PathVariable Long dictId) {
|
||||
return success(dictTypeService.selectDictTypeById(dictId));
|
||||
}
|
||||
|
||||
|
@ -64,10 +60,8 @@ public class SysDictTypeController extends BaseController
|
|||
@RequiresPermissions("system:dict:add")
|
||||
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@Validated @RequestBody SysDictType dict)
|
||||
{
|
||||
if (!dictTypeService.checkDictTypeUnique(dict))
|
||||
{
|
||||
public Result add(@Validated @RequestBody SysDictType dict) {
|
||||
if (!dictTypeService.checkDictTypeUnique(dict)) {
|
||||
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||
}
|
||||
dict.setCreateBy(SecurityUtils.getUsername());
|
||||
|
@ -80,10 +74,8 @@ public class SysDictTypeController extends BaseController
|
|||
@RequiresPermissions("system:dict:edit")
|
||||
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@Validated @RequestBody SysDictType dict)
|
||||
{
|
||||
if (!dictTypeService.checkDictTypeUnique(dict))
|
||||
{
|
||||
public Result edit(@Validated @RequestBody SysDictType dict) {
|
||||
if (!dictTypeService.checkDictTypeUnique(dict)) {
|
||||
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||
}
|
||||
dict.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
@ -96,8 +88,7 @@ public class SysDictTypeController extends BaseController
|
|||
@RequiresPermissions("system:dict:remove")
|
||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictIds}")
|
||||
public Result remove(@PathVariable Long[] dictIds)
|
||||
{
|
||||
public Result remove(@PathVariable Long[] dictIds) {
|
||||
dictTypeService.deleteDictTypeByIds(dictIds);
|
||||
return success();
|
||||
}
|
||||
|
@ -108,8 +99,7 @@ public class SysDictTypeController extends BaseController
|
|||
@RequiresPermissions("system:dict:remove")
|
||||
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/refreshCache")
|
||||
public Result refreshCache()
|
||||
{
|
||||
public Result refreshCache() {
|
||||
dictTypeService.resetDictCache();
|
||||
return success();
|
||||
}
|
||||
|
@ -118,8 +108,7 @@ public class SysDictTypeController extends BaseController
|
|||
* 获取字典选择框列表
|
||||
*/
|
||||
@GetMapping("/optionselect")
|
||||
public Result optionselect()
|
||||
{
|
||||
public Result optionselect() {
|
||||
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
|
||||
return success(dictTypes);
|
||||
}
|
||||
|
|
|
@ -26,8 +26,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/logininfor")
|
||||
public class SysLogininforController extends BaseController
|
||||
{
|
||||
public class SysLogininforController extends BaseController {
|
||||
@Autowired
|
||||
private ISysLogininforService logininforService;
|
||||
|
||||
|
@ -36,8 +35,7 @@ public class SysLogininforController extends BaseController
|
|||
|
||||
@RequiresPermissions("system:logininfor:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(SysLogininfor logininfor)
|
||||
{
|
||||
public Result<TableDataInfo> list(SysLogininfor logininfor) {
|
||||
startPage();
|
||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||
return getDataTable(list);
|
||||
|
@ -46,8 +44,7 @@ public class SysLogininforController extends BaseController
|
|||
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:logininfor:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysLogininfor logininfor)
|
||||
{
|
||||
public void export(HttpServletResponse response, SysLogininfor logininfor) {
|
||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
||||
util.exportExcel(response, list, "登录日志");
|
||||
|
@ -56,16 +53,14 @@ public class SysLogininforController extends BaseController
|
|||
@RequiresPermissions("system:logininfor:remove")
|
||||
@Log(title = "登录日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{infoIds}")
|
||||
public Result remove(@PathVariable Long[] infoIds)
|
||||
{
|
||||
public Result remove(@PathVariable Long[] infoIds) {
|
||||
return toAjax(logininforService.deleteLogininforByIds(infoIds));
|
||||
}
|
||||
|
||||
@RequiresPermissions("system:logininfor:remove")
|
||||
@Log(title = "登录日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/clean")
|
||||
public Result clean()
|
||||
{
|
||||
public Result clean() {
|
||||
logininforService.cleanLogininfor();
|
||||
return success();
|
||||
}
|
||||
|
@ -73,16 +68,14 @@ public class SysLogininforController extends BaseController
|
|||
@RequiresPermissions("system:logininfor:unlock")
|
||||
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
|
||||
@GetMapping("/unlock/{userName}")
|
||||
public Result unlock(@PathVariable("userName") String userName)
|
||||
{
|
||||
public Result unlock(@PathVariable("userName") String userName) {
|
||||
redisService.deleteObject(CacheConstants.PWD_ERR_CNT_KEY + userName);
|
||||
return success();
|
||||
}
|
||||
|
||||
@InnerAuth
|
||||
@PostMapping
|
||||
public Result add(@RequestBody SysLogininfor logininfor)
|
||||
{
|
||||
public Result add(@RequestBody SysLogininfor logininfor) {
|
||||
return toAjax(logininforService.insertLogininfor(logininfor));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,8 +26,7 @@ import java.util.Map;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/menu")
|
||||
public class SysMenuController extends BaseController
|
||||
{
|
||||
public class SysMenuController extends BaseController {
|
||||
@Autowired
|
||||
private ISysMenuService menuService;
|
||||
|
||||
|
@ -36,8 +35,7 @@ public class SysMenuController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:menu:list")
|
||||
@GetMapping("/list")
|
||||
public Result list(SysMenu menu)
|
||||
{
|
||||
public Result list(SysMenu menu) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuList(menu, userId);
|
||||
return success(menus);
|
||||
|
@ -48,8 +46,7 @@ public class SysMenuController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:menu:query")
|
||||
@GetMapping(value = "/{menuId}")
|
||||
public Result getInfo(@PathVariable Long menuId)
|
||||
{
|
||||
public Result getInfo(@PathVariable Long menuId) {
|
||||
return success(menuService.selectMenuById(menuId));
|
||||
}
|
||||
|
||||
|
@ -57,8 +54,7 @@ public class SysMenuController extends BaseController
|
|||
* 获取菜单下拉树列表
|
||||
*/
|
||||
@GetMapping("/treeselect")
|
||||
public Result treeselect(SysMenu menu)
|
||||
{
|
||||
public Result treeselect(SysMenu menu) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuList(menu, userId);
|
||||
return success(menuService.buildMenuTreeSelect(menus));
|
||||
|
@ -68,8 +64,7 @@ public class SysMenuController extends BaseController
|
|||
* 加载对应角色菜单列表树
|
||||
*/
|
||||
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
||||
public Result roleMenuTreeselect(@PathVariable("roleId") Long roleId)
|
||||
{
|
||||
public Result roleMenuTreeselect(@PathVariable("roleId") Long roleId) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuList(userId);
|
||||
Result result = Result.success();
|
||||
|
@ -86,14 +81,10 @@ public class SysMenuController extends BaseController
|
|||
@RequiresPermissions("system:menu:add")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@Validated @RequestBody SysMenu menu)
|
||||
{
|
||||
if (!menuService.checkMenuNameUnique(menu))
|
||||
{
|
||||
public Result add(@Validated @RequestBody SysMenu menu) {
|
||||
if (!menuService.checkMenuNameUnique(menu)) {
|
||||
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||
}
|
||||
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
||||
{
|
||||
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) {
|
||||
return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||
}
|
||||
menu.setCreateBy(SecurityUtils.getUsername());
|
||||
|
@ -106,18 +97,12 @@ public class SysMenuController extends BaseController
|
|||
@RequiresPermissions("system:menu:edit")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@Validated @RequestBody SysMenu menu)
|
||||
{
|
||||
if (!menuService.checkMenuNameUnique(menu))
|
||||
{
|
||||
public Result edit(@Validated @RequestBody SysMenu menu) {
|
||||
if (!menuService.checkMenuNameUnique(menu)) {
|
||||
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||
}
|
||||
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
||||
{
|
||||
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) {
|
||||
return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||
}
|
||||
else if (menu.getMenuId().equals(menu.getParentId()))
|
||||
{
|
||||
} else if (menu.getMenuId().equals(menu.getParentId())) {
|
||||
return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
|
||||
}
|
||||
menu.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
@ -130,14 +115,11 @@ public class SysMenuController extends BaseController
|
|||
@RequiresPermissions("system:menu:remove")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{menuId}")
|
||||
public Result remove(@PathVariable("menuId") Long menuId)
|
||||
{
|
||||
if (menuService.hasChildByMenuId(menuId))
|
||||
{
|
||||
public Result remove(@PathVariable("menuId") Long menuId) {
|
||||
if (menuService.hasChildByMenuId(menuId)) {
|
||||
return warn("存在子菜单,不允许删除");
|
||||
}
|
||||
if (menuService.checkMenuExistRole(menuId))
|
||||
{
|
||||
if (menuService.checkMenuExistRole(menuId)) {
|
||||
return warn("菜单已分配,不允许删除");
|
||||
}
|
||||
return toAjax(menuService.deleteMenuById(menuId));
|
||||
|
@ -149,8 +131,7 @@ public class SysMenuController extends BaseController
|
|||
* @return 路由信息
|
||||
*/
|
||||
@GetMapping("getRouters")
|
||||
public Result getRouters()
|
||||
{
|
||||
public Result getRouters() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
||||
return success(menuService.buildMenus(menus));
|
||||
|
|
|
@ -23,8 +23,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/notice")
|
||||
public class SysNoticeController extends BaseController
|
||||
{
|
||||
public class SysNoticeController extends BaseController {
|
||||
@Autowired
|
||||
private ISysNoticeService noticeService;
|
||||
|
||||
|
@ -33,8 +32,7 @@ public class SysNoticeController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:notice:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(SysNotice notice)
|
||||
{
|
||||
public Result<TableDataInfo> list(SysNotice notice) {
|
||||
startPage();
|
||||
List<SysNotice> list = noticeService.selectNoticeList(notice);
|
||||
return getDataTable(list);
|
||||
|
@ -45,8 +43,7 @@ public class SysNoticeController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:notice:query")
|
||||
@GetMapping(value = "/{noticeId}")
|
||||
public Result getInfo(@PathVariable Long noticeId)
|
||||
{
|
||||
public Result getInfo(@PathVariable Long noticeId) {
|
||||
return success(noticeService.selectNoticeById(noticeId));
|
||||
}
|
||||
|
||||
|
@ -56,8 +53,7 @@ public class SysNoticeController extends BaseController
|
|||
@RequiresPermissions("system:notice:add")
|
||||
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@Validated @RequestBody SysNotice notice)
|
||||
{
|
||||
public Result add(@Validated @RequestBody SysNotice notice) {
|
||||
notice.setCreateBy(SecurityUtils.getUsername());
|
||||
return toAjax(noticeService.insertNotice(notice));
|
||||
}
|
||||
|
@ -68,8 +64,7 @@ public class SysNoticeController extends BaseController
|
|||
@RequiresPermissions("system:notice:edit")
|
||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@Validated @RequestBody SysNotice notice)
|
||||
{
|
||||
public Result edit(@Validated @RequestBody SysNotice notice) {
|
||||
notice.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(noticeService.updateNotice(notice));
|
||||
}
|
||||
|
@ -80,8 +75,7 @@ public class SysNoticeController extends BaseController
|
|||
@RequiresPermissions("system:notice:remove")
|
||||
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{noticeIds}")
|
||||
public Result remove(@PathVariable Long[] noticeIds)
|
||||
{
|
||||
public Result remove(@PathVariable Long[] noticeIds) {
|
||||
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,15 +24,13 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/operlog")
|
||||
public class SysOperlogController extends BaseController
|
||||
{
|
||||
public class SysOperlogController extends BaseController {
|
||||
@Autowired
|
||||
private ISysOperLogService operLogService;
|
||||
|
||||
@RequiresPermissions("system:operlog:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(SysOperLog operLog)
|
||||
{
|
||||
public Result<TableDataInfo> list(SysOperLog operLog) {
|
||||
startPage();
|
||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||
return getDataTable(list);
|
||||
|
@ -41,8 +39,7 @@ public class SysOperlogController extends BaseController
|
|||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:operlog:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysOperLog operLog)
|
||||
{
|
||||
public void export(HttpServletResponse response, SysOperLog operLog) {
|
||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
||||
util.exportExcel(response, list, "操作日志");
|
||||
|
@ -51,24 +48,21 @@ public class SysOperlogController extends BaseController
|
|||
@Log(title = "操作日志", businessType = BusinessType.DELETE)
|
||||
@RequiresPermissions("system:operlog:remove")
|
||||
@DeleteMapping("/{operIds}")
|
||||
public Result remove(@PathVariable Long[] operIds)
|
||||
{
|
||||
public Result remove(@PathVariable Long[] operIds) {
|
||||
return toAjax(operLogService.deleteOperLogByIds(operIds));
|
||||
}
|
||||
|
||||
@RequiresPermissions("system:operlog:remove")
|
||||
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/clean")
|
||||
public Result clean()
|
||||
{
|
||||
public Result clean() {
|
||||
operLogService.cleanOperLog();
|
||||
return success();
|
||||
}
|
||||
|
||||
@InnerAuth
|
||||
@PostMapping
|
||||
public Result add(@RequestBody SysOperLog operLog)
|
||||
{
|
||||
public Result add(@RequestBody SysOperLog operLog) {
|
||||
return toAjax(operLogService.insertOperlog(operLog));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,8 +25,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/post")
|
||||
public class SysPostController extends BaseController
|
||||
{
|
||||
public class SysPostController extends BaseController {
|
||||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
|
@ -35,8 +34,7 @@ public class SysPostController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:post:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(SysPost post)
|
||||
{
|
||||
public Result<TableDataInfo> list(SysPost post) {
|
||||
startPage();
|
||||
List<SysPost> list = postService.selectPostList(post);
|
||||
return getDataTable(list);
|
||||
|
@ -45,8 +43,7 @@ public class SysPostController extends BaseController
|
|||
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:post:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysPost post)
|
||||
{
|
||||
public void export(HttpServletResponse response, SysPost post) {
|
||||
List<SysPost> list = postService.selectPostList(post);
|
||||
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
|
||||
util.exportExcel(response, list, "岗位数据");
|
||||
|
@ -57,8 +54,7 @@ public class SysPostController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:post:query")
|
||||
@GetMapping(value = "/{postId}")
|
||||
public Result getInfo(@PathVariable Long postId)
|
||||
{
|
||||
public Result getInfo(@PathVariable Long postId) {
|
||||
return success(postService.selectPostById(postId));
|
||||
}
|
||||
|
||||
|
@ -68,14 +64,10 @@ public class SysPostController extends BaseController
|
|||
@RequiresPermissions("system:post:add")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@Validated @RequestBody SysPost post)
|
||||
{
|
||||
if (!postService.checkPostNameUnique(post))
|
||||
{
|
||||
public Result add(@Validated @RequestBody SysPost post) {
|
||||
if (!postService.checkPostNameUnique(post)) {
|
||||
return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||
}
|
||||
else if (!postService.checkPostCodeUnique(post))
|
||||
{
|
||||
} else if (!postService.checkPostCodeUnique(post)) {
|
||||
return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||
}
|
||||
post.setCreateBy(SecurityUtils.getUsername());
|
||||
|
@ -88,14 +80,10 @@ public class SysPostController extends BaseController
|
|||
@RequiresPermissions("system:post:edit")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@Validated @RequestBody SysPost post)
|
||||
{
|
||||
if (!postService.checkPostNameUnique(post))
|
||||
{
|
||||
public Result edit(@Validated @RequestBody SysPost post) {
|
||||
if (!postService.checkPostNameUnique(post)) {
|
||||
return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||
}
|
||||
else if (!postService.checkPostCodeUnique(post))
|
||||
{
|
||||
} else if (!postService.checkPostCodeUnique(post)) {
|
||||
return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||
}
|
||||
post.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
@ -108,8 +96,7 @@ public class SysPostController extends BaseController
|
|||
@RequiresPermissions("system:post:remove")
|
||||
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{postIds}")
|
||||
public Result remove(@PathVariable Long[] postIds)
|
||||
{
|
||||
public Result remove(@PathVariable Long[] postIds) {
|
||||
return toAjax(postService.deletePostByIds(postIds));
|
||||
}
|
||||
|
||||
|
@ -117,8 +104,7 @@ public class SysPostController extends BaseController
|
|||
* 获取岗位选择框列表
|
||||
*/
|
||||
@GetMapping("/optionselect")
|
||||
public Result optionselect()
|
||||
{
|
||||
public Result optionselect() {
|
||||
List<SysPost> posts = postService.selectPostAll();
|
||||
return success(posts);
|
||||
}
|
||||
|
|
|
@ -29,8 +29,7 @@ import java.util.Map;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/profile")
|
||||
public class SysProfileController extends BaseController
|
||||
{
|
||||
public class SysProfileController extends BaseController {
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
|
@ -44,15 +43,14 @@ public class SysProfileController extends BaseController
|
|||
* 个人信息
|
||||
*/
|
||||
@GetMapping
|
||||
public Result profile()
|
||||
{
|
||||
public Result profile() {
|
||||
String username = SecurityUtils.getUsername();
|
||||
SysUser user = userService.selectUserByUserName(username);
|
||||
Result result = Result.success();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("roleGroup", userService.selectUserRoleGroup(username));
|
||||
map.put("postGroup", userService.selectUserPostGroup(username));
|
||||
map.put("user",user);
|
||||
map.put("user", user);
|
||||
result.setData(map);
|
||||
return result;
|
||||
}
|
||||
|
@ -62,24 +60,20 @@ public class SysProfileController extends BaseController
|
|||
*/
|
||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result updateProfile(@RequestBody SysUser user)
|
||||
{
|
||||
public Result updateProfile(@RequestBody SysUser user) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
SysUser currentUser = loginUser.getSysUser();
|
||||
currentUser.setNickName(user.getNickName());
|
||||
currentUser.setEmail(user.getEmail());
|
||||
currentUser.setPhonenumber(user.getPhonenumber());
|
||||
currentUser.setSex(user.getSex());
|
||||
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
|
||||
{
|
||||
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) {
|
||||
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser))
|
||||
{
|
||||
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) {
|
||||
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
if (userService.updateUserProfile(currentUser) > 0)
|
||||
{
|
||||
if (userService.updateUserProfile(currentUser) > 0) {
|
||||
// 更新缓存用户信息
|
||||
tokenService.setLoginUser(loginUser);
|
||||
return success();
|
||||
|
@ -92,21 +86,17 @@ public class SysProfileController extends BaseController
|
|||
*/
|
||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/updatePwd")
|
||||
public Result updatePwd(String oldPassword, String newPassword)
|
||||
{
|
||||
public Result updatePwd(String oldPassword, String newPassword) {
|
||||
String username = SecurityUtils.getUsername();
|
||||
SysUser user = userService.selectUserByUserName(username);
|
||||
String password = user.getPassword();
|
||||
if (!SecurityUtils.matchesPassword(oldPassword, password))
|
||||
{
|
||||
if (!SecurityUtils.matchesPassword(oldPassword, password)) {
|
||||
return error("修改密码失败,旧密码错误");
|
||||
}
|
||||
if (SecurityUtils.matchesPassword(newPassword, password))
|
||||
{
|
||||
if (SecurityUtils.matchesPassword(newPassword, password)) {
|
||||
return error("新密码不能与旧密码相同");
|
||||
}
|
||||
if (userService.resetUserPwd(username, SecurityUtils.encryptPassword(newPassword)) > 0)
|
||||
{
|
||||
if (userService.resetUserPwd(username, SecurityUtils.encryptPassword(newPassword)) > 0) {
|
||||
// 更新缓存用户密码
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
loginUser.getSysUser().setPassword(SecurityUtils.encryptPassword(newPassword));
|
||||
|
@ -121,24 +111,19 @@ public class SysProfileController extends BaseController
|
|||
*/
|
||||
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/avatar")
|
||||
public Result avatar(@RequestParam("avatarfile") MultipartFile file)
|
||||
{
|
||||
if (!file.isEmpty())
|
||||
{
|
||||
public Result avatar(@RequestParam("avatarfile") MultipartFile file) {
|
||||
if (!file.isEmpty()) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
String extension = FileTypeUtils.getExtension(file);
|
||||
if (!StringUtils.equalsAnyIgnoreCase(extension, MimeTypeUtils.IMAGE_EXTENSION))
|
||||
{
|
||||
if (!StringUtils.equalsAnyIgnoreCase(extension, MimeTypeUtils.IMAGE_EXTENSION)) {
|
||||
return error("文件格式不正确,请上传" + Arrays.toString(MimeTypeUtils.IMAGE_EXTENSION) + "格式");
|
||||
}
|
||||
Result<SysFile> fileResult = remoteFileService.upload(file);
|
||||
if (StringUtils.isNull(fileResult) || StringUtils.isNull(fileResult.getData()))
|
||||
{
|
||||
if (StringUtils.isNull(fileResult) || StringUtils.isNull(fileResult.getData())) {
|
||||
return error("文件服务异常,请联系管理员");
|
||||
}
|
||||
String url = fileResult.getData().getUrl();
|
||||
if (userService.updateUserAvatar(loginUser.getUsername(), url))
|
||||
{
|
||||
if (userService.updateUserAvatar(loginUser.getUsername(), url)) {
|
||||
Result result = Result.success();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("imgUrl", url);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.health.system.server.controller;
|
||||
|
||||
import com.health.common.core.domain.Result;
|
||||
import com.health.common.core.utils.poi.ExcelUtil;
|
||||
import com.health.common.core.web.controller.BaseController;
|
||||
import com.health.common.core.domain.Result;
|
||||
import com.health.common.core.web.page.TableDataInfo;
|
||||
import com.health.common.log.annotation.Log;
|
||||
import com.health.common.log.enums.BusinessType;
|
||||
|
@ -32,8 +32,7 @@ import java.util.Map;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/role")
|
||||
public class SysRoleController extends BaseController
|
||||
{
|
||||
public class SysRoleController extends BaseController {
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
|
||||
|
@ -45,8 +44,7 @@ public class SysRoleController extends BaseController
|
|||
|
||||
@RequiresPermissions("system:role:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(SysRole role)
|
||||
{
|
||||
public Result<TableDataInfo> list(SysRole role) {
|
||||
startPage();
|
||||
List<SysRole> list = roleService.selectRoleList(role);
|
||||
return getDataTable(list);
|
||||
|
@ -55,8 +53,7 @@ public class SysRoleController extends BaseController
|
|||
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:role:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysRole role)
|
||||
{
|
||||
public void export(HttpServletResponse response, SysRole role) {
|
||||
List<SysRole> list = roleService.selectRoleList(role);
|
||||
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
||||
util.exportExcel(response, list, "角色数据");
|
||||
|
@ -67,8 +64,7 @@ public class SysRoleController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:role:query")
|
||||
@GetMapping(value = "/{roleId}")
|
||||
public Result getInfo(@PathVariable Long roleId)
|
||||
{
|
||||
public Result getInfo(@PathVariable Long roleId) {
|
||||
roleService.checkRoleDataScope(roleId);
|
||||
return success(roleService.selectRoleById(roleId));
|
||||
}
|
||||
|
@ -79,14 +75,10 @@ public class SysRoleController extends BaseController
|
|||
@RequiresPermissions("system:role:add")
|
||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@Validated @RequestBody SysRole role)
|
||||
{
|
||||
if (!roleService.checkRoleNameUnique(role))
|
||||
{
|
||||
public Result add(@Validated @RequestBody SysRole role) {
|
||||
if (!roleService.checkRoleNameUnique(role)) {
|
||||
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||
}
|
||||
else if (!roleService.checkRoleKeyUnique(role))
|
||||
{
|
||||
} else if (!roleService.checkRoleKeyUnique(role)) {
|
||||
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
}
|
||||
role.setCreateBy(SecurityUtils.getUsername());
|
||||
|
@ -100,16 +92,12 @@ public class SysRoleController extends BaseController
|
|||
@RequiresPermissions("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@Validated @RequestBody SysRole role)
|
||||
{
|
||||
public Result edit(@Validated @RequestBody SysRole role) {
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
if (!roleService.checkRoleNameUnique(role))
|
||||
{
|
||||
if (!roleService.checkRoleNameUnique(role)) {
|
||||
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||
}
|
||||
else if (!roleService.checkRoleKeyUnique(role))
|
||||
{
|
||||
} else if (!roleService.checkRoleKeyUnique(role)) {
|
||||
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
}
|
||||
role.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
@ -122,8 +110,7 @@ public class SysRoleController extends BaseController
|
|||
@RequiresPermissions("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/dataScope")
|
||||
public Result dataScope(@RequestBody SysRole role)
|
||||
{
|
||||
public Result dataScope(@RequestBody SysRole role) {
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
return toAjax(roleService.authDataScope(role));
|
||||
|
@ -135,8 +122,7 @@ public class SysRoleController extends BaseController
|
|||
@RequiresPermissions("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public Result changeStatus(@RequestBody SysRole role)
|
||||
{
|
||||
public Result changeStatus(@RequestBody SysRole role) {
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
role.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
@ -149,8 +135,7 @@ public class SysRoleController extends BaseController
|
|||
@RequiresPermissions("system:role:remove")
|
||||
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{roleIds}")
|
||||
public Result remove(@PathVariable Long[] roleIds)
|
||||
{
|
||||
public Result remove(@PathVariable Long[] roleIds) {
|
||||
return toAjax(roleService.deleteRoleByIds(roleIds));
|
||||
}
|
||||
|
||||
|
@ -159,17 +144,16 @@ public class SysRoleController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:role:query")
|
||||
@GetMapping("/optionselect")
|
||||
public Result optionselect()
|
||||
{
|
||||
public Result optionselect() {
|
||||
return success(roleService.selectRoleAll());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询已分配用户角色列表
|
||||
*/
|
||||
@RequiresPermissions("system:role:list")
|
||||
@GetMapping("/authUser/allocatedList")
|
||||
public Result<TableDataInfo> allocatedList(SysUser user)
|
||||
{
|
||||
public Result<TableDataInfo> allocatedList(SysUser user) {
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectAllocatedList(user);
|
||||
return getDataTable(list);
|
||||
|
@ -180,8 +164,7 @@ public class SysRoleController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:role:list")
|
||||
@GetMapping("/authUser/unallocatedList")
|
||||
public Result<TableDataInfo> unallocatedList(SysUser user)
|
||||
{
|
||||
public Result<TableDataInfo> unallocatedList(SysUser user) {
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectUnallocatedList(user);
|
||||
return getDataTable(list);
|
||||
|
@ -193,8 +176,7 @@ public class SysRoleController extends BaseController
|
|||
@RequiresPermissions("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/cancel")
|
||||
public Result cancelAuthUser(@RequestBody SysUserRole userRole)
|
||||
{
|
||||
public Result cancelAuthUser(@RequestBody SysUserRole userRole) {
|
||||
return toAjax(roleService.deleteAuthUser(userRole));
|
||||
}
|
||||
|
||||
|
@ -204,8 +186,7 @@ public class SysRoleController extends BaseController
|
|||
@RequiresPermissions("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/cancelAll")
|
||||
public Result cancelAuthUserAll(Long roleId, Long[] userIds)
|
||||
{
|
||||
public Result cancelAuthUserAll(Long roleId, Long[] userIds) {
|
||||
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
|
||||
}
|
||||
|
||||
|
@ -215,8 +196,7 @@ public class SysRoleController extends BaseController
|
|||
@RequiresPermissions("system:role:edit")
|
||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authUser/selectAll")
|
||||
public Result selectAuthUserAll(Long roleId, Long[] userIds)
|
||||
{
|
||||
public Result selectAuthUserAll(Long roleId, Long[] userIds) {
|
||||
roleService.checkRoleDataScope(roleId);
|
||||
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
||||
}
|
||||
|
@ -226,8 +206,7 @@ public class SysRoleController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:role:query")
|
||||
@GetMapping(value = "/deptTree/{roleId}")
|
||||
public Result deptTree(@PathVariable("roleId") Long roleId)
|
||||
{
|
||||
public Result deptTree(@PathVariable("roleId") Long roleId) {
|
||||
Result result = Result.success();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
||||
|
|
|
@ -38,8 +38,7 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class SysUserController extends BaseController
|
||||
{
|
||||
public class SysUserController extends BaseController {
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
|
@ -63,8 +62,7 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:user:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(SysUser user)
|
||||
{
|
||||
public Result<TableDataInfo> list(SysUser user) {
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
return getDataTable(list);
|
||||
|
@ -73,8 +71,7 @@ public class SysUserController extends BaseController
|
|||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:user:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysUser user)
|
||||
{
|
||||
public void export(HttpServletResponse response, SysUser user) {
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
util.exportExcel(response, list, "用户数据");
|
||||
|
@ -83,8 +80,7 @@ public class SysUserController extends BaseController
|
|||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||
@RequiresPermissions("system:user:import")
|
||||
@PostMapping("/importData")
|
||||
public Result importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||
{
|
||||
public Result importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
List<SysUser> userList = util.importExcel(file.getInputStream());
|
||||
String operName = SecurityUtils.getUsername();
|
||||
|
@ -93,8 +89,7 @@ public class SysUserController extends BaseController
|
|||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException
|
||||
{
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
util.importTemplateExcel(response, "用户数据");
|
||||
}
|
||||
|
@ -104,11 +99,9 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@InnerAuth
|
||||
@GetMapping("/info/{username}")
|
||||
public Result<LoginUser> info(@PathVariable("username") String username)
|
||||
{
|
||||
public Result<LoginUser> info(@PathVariable("username") String username) {
|
||||
SysUser sysUser = userService.selectUserByUserName(username);
|
||||
if (StringUtils.isNull(sysUser))
|
||||
{
|
||||
if (StringUtils.isNull(sysUser)) {
|
||||
return Result.error("用户名或密码错误");
|
||||
}
|
||||
// 角色集合
|
||||
|
@ -127,15 +120,12 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@InnerAuth
|
||||
@PostMapping("/register")
|
||||
public Result<Boolean> register(@RequestBody SysUser sysUser)
|
||||
{
|
||||
public Result<Boolean> register(@RequestBody SysUser sysUser) {
|
||||
String username = sysUser.getUserName();
|
||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
|
||||
{
|
||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) {
|
||||
return Result.error("当前系统没有开启注册功能!");
|
||||
}
|
||||
if (!userService.checkUserNameUnique(sysUser))
|
||||
{
|
||||
if (!userService.checkUserNameUnique(sysUser)) {
|
||||
return Result.error("保存用户'" + username + "'失败,注册账号已存在");
|
||||
}
|
||||
return Result.success(userService.registerUser(sysUser));
|
||||
|
@ -167,8 +157,7 @@ public class SysUserController extends BaseController
|
|||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping("getInfo")
|
||||
public Result getInfo()
|
||||
{
|
||||
public Result getInfo() {
|
||||
SysUser user = userService.selectUserById(SecurityUtils.getUserId());
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(user);
|
||||
|
@ -187,17 +176,15 @@ public class SysUserController extends BaseController
|
|||
* 根据用户编号获取详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:user:query")
|
||||
@GetMapping(value = { "/", "/{userId}" })
|
||||
public Result getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
||||
{
|
||||
@GetMapping(value = {"/", "/{userId}"})
|
||||
public Result getInfo(@PathVariable(value = "userId", required = false) Long userId) {
|
||||
userService.checkUserDataScope(userId);
|
||||
Result result = Result.success();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
List<SysRole> roles = roleService.selectRoleAll();
|
||||
map.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||
map.put("posts", postService.selectPostAll());
|
||||
if (StringUtils.isNotNull(userId))
|
||||
{
|
||||
if (StringUtils.isNotNull(userId)) {
|
||||
SysUser sysUser = userService.selectUserById(userId);
|
||||
map.put("susUser", sysUser);
|
||||
map.put("postIds", postService.selectPostListByUserId(userId));
|
||||
|
@ -213,18 +200,12 @@ public class SysUserController extends BaseController
|
|||
@RequiresPermissions("system:user:add")
|
||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@Validated @RequestBody SysUser user)
|
||||
{
|
||||
if (!userService.checkUserNameUnique(user))
|
||||
{
|
||||
public Result add(@Validated @RequestBody SysUser user) {
|
||||
if (!userService.checkUserNameUnique(user)) {
|
||||
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
||||
{
|
||||
} else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
|
||||
return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
||||
{
|
||||
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
|
||||
return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
//获取当前用户
|
||||
|
@ -240,20 +221,14 @@ public class SysUserController extends BaseController
|
|||
@RequiresPermissions("system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@Validated @RequestBody SysUser user)
|
||||
{
|
||||
public Result edit(@Validated @RequestBody SysUser user) {
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
if (!userService.checkUserNameUnique(user))
|
||||
{
|
||||
if (!userService.checkUserNameUnique(user)) {
|
||||
return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
||||
{
|
||||
} else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
|
||||
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
||||
{
|
||||
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
|
||||
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
@ -266,10 +241,8 @@ public class SysUserController extends BaseController
|
|||
@RequiresPermissions("system:user:remove")
|
||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{userIds}")
|
||||
public Result remove(@PathVariable Long[] userIds)
|
||||
{
|
||||
if (ArrayUtils.contains(userIds, SecurityUtils.getUserId()))
|
||||
{
|
||||
public Result remove(@PathVariable Long[] userIds) {
|
||||
if (ArrayUtils.contains(userIds, SecurityUtils.getUserId())) {
|
||||
return error("当前用户不能删除");
|
||||
}
|
||||
return toAjax(userService.deleteUserByIds(userIds));
|
||||
|
@ -281,8 +254,7 @@ public class SysUserController extends BaseController
|
|||
@RequiresPermissions("system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/resetPwd")
|
||||
public Result resetPwd(@RequestBody SysUser user)
|
||||
{
|
||||
public Result resetPwd(@RequestBody SysUser user) {
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
|
@ -296,8 +268,7 @@ public class SysUserController extends BaseController
|
|||
@RequiresPermissions("system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public Result changeStatus(@RequestBody SysUser user)
|
||||
{
|
||||
public Result changeStatus(@RequestBody SysUser user) {
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
user.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
@ -309,8 +280,7 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:user:query")
|
||||
@GetMapping("/authRole/{userId}")
|
||||
public Result authRole(@PathVariable("userId") Long userId)
|
||||
{
|
||||
public Result authRole(@PathVariable("userId") Long userId) {
|
||||
Result result = Result.success();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
SysUser user = userService.selectUserById(userId);
|
||||
|
@ -327,8 +297,7 @@ public class SysUserController extends BaseController
|
|||
@RequiresPermissions("system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
||||
@PutMapping("/authRole")
|
||||
public Result insertAuthRole(Long userId, Long[] roleIds)
|
||||
{
|
||||
public Result insertAuthRole(Long userId, Long[] roleIds) {
|
||||
userService.checkUserDataScope(userId);
|
||||
userService.insertUserAuth(userId, roleIds);
|
||||
return success();
|
||||
|
@ -339,8 +308,7 @@ public class SysUserController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("system:user:list")
|
||||
@GetMapping("/deptTree")
|
||||
public Result deptTree(SysDept dept)
|
||||
{
|
||||
public Result deptTree(SysDept dept) {
|
||||
return success(deptService.selectDeptTreeList(dept));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,8 +28,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/online")
|
||||
public class SysUserOnlineController extends BaseController
|
||||
{
|
||||
public class SysUserOnlineController extends BaseController {
|
||||
@Autowired
|
||||
private ISysUserOnlineService userOnlineService;
|
||||
|
||||
|
@ -38,27 +37,18 @@ public class SysUserOnlineController extends BaseController
|
|||
|
||||
@RequiresPermissions("monitor:online:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(String ipaddr, String userName)
|
||||
{
|
||||
public Result<TableDataInfo> list(String ipaddr, String userName) {
|
||||
Collection<String> keys = redisService.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
|
||||
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
|
||||
for (String key : keys)
|
||||
{
|
||||
for (String key : keys) {
|
||||
LoginUser user = redisService.getCacheObject(key);
|
||||
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName))
|
||||
{
|
||||
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) {
|
||||
userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(ipaddr))
|
||||
{
|
||||
} else if (StringUtils.isNotEmpty(ipaddr)) {
|
||||
userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(userName))
|
||||
{
|
||||
} else if (StringUtils.isNotEmpty(userName)) {
|
||||
userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
|
||||
}
|
||||
}
|
||||
|
@ -73,8 +63,7 @@ public class SysUserOnlineController extends BaseController
|
|||
@RequiresPermissions("monitor:online:forceLogout")
|
||||
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
||||
@DeleteMapping("/{tokenId}")
|
||||
public Result forceLogout(@PathVariable String tokenId)
|
||||
{
|
||||
public Result forceLogout(@PathVariable String tokenId) {
|
||||
redisService.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
|
||||
return success();
|
||||
}
|
||||
|
|
|
@ -12,8 +12,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysConfigMapper
|
||||
{
|
||||
public interface SysConfigMapper {
|
||||
/**
|
||||
* 查询参数配置信息
|
||||
*
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package com.health.system.server.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.health.system.common.domain.SysDept;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门管理 数据层
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface SysDeptMapper
|
||||
{
|
||||
public interface SysDeptMapper {
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
|
@ -22,7 +22,7 @@ public interface SysDeptMapper
|
|||
/**
|
||||
* 根据角色ID查询部门树信息
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param roleId 角色ID
|
||||
* @param deptCheckStrictly 部门树选择项是否关联显示
|
||||
* @return 选中部门列表
|
||||
*/
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package com.health.system.server.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.health.system.common.domain.SysDictData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典表 数据层
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface SysDictDataMapper
|
||||
{
|
||||
public interface SysDictDataMapper {
|
||||
/**
|
||||
* 根据条件分页查询字典数据
|
||||
*
|
||||
|
@ -30,7 +30,7 @@ public interface SysDictDataMapper
|
|||
/**
|
||||
* 根据字典类型和字典键值查询字典数据信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典键值
|
||||
* @return 字典标签
|
||||
*/
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package com.health.system.server.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.health.system.common.domain.SysDictType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典表 数据层
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface SysDictTypeMapper
|
||||
{
|
||||
public interface SysDictTypeMapper {
|
||||
/**
|
||||
* 根据条件分页查询字典类型
|
||||
*
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package com.health.system.server.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.health.system.common.domain.SysLogininfor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统访问日志情况信息 数据层
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface SysLogininforMapper
|
||||
{
|
||||
public interface SysLogininforMapper {
|
||||
/**
|
||||
* 新增系统登录日志
|
||||
*
|
||||
|
|
|
@ -11,8 +11,7 @@ import java.util.List;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface SysMenuMapper
|
||||
{
|
||||
public interface SysMenuMapper {
|
||||
/**
|
||||
* 查询系统菜单列表
|
||||
*
|
||||
|
@ -70,7 +69,7 @@ public interface SysMenuMapper
|
|||
/**
|
||||
* 根据角色ID查询菜单树信息
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param roleId 角色ID
|
||||
* @param menuCheckStrictly 菜单树选择项是否关联显示
|
||||
* @return 选中菜单列表
|
||||
*/
|
||||
|
|
|
@ -10,8 +10,7 @@ import java.util.List;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface SysNoticeMapper
|
||||
{
|
||||
public interface SysNoticeMapper {
|
||||
/**
|
||||
* 查询公告信息
|
||||
*
|
||||
|
|
|
@ -11,8 +11,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysOperLogMapper
|
||||
{
|
||||
public interface SysOperLogMapper {
|
||||
/**
|
||||
* 新增操作日志
|
||||
*
|
||||
|
|
|
@ -12,8 +12,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysPostMapper
|
||||
{
|
||||
public interface SysPostMapper {
|
||||
/**
|
||||
* 查询岗位数据集合
|
||||
*
|
||||
|
|
|
@ -10,8 +10,7 @@ import java.util.List;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface SysRoleDeptMapper
|
||||
{
|
||||
public interface SysRoleDeptMapper {
|
||||
/**
|
||||
* 通过角色ID删除角色和部门关联
|
||||
*
|
||||
|
|
|
@ -11,8 +11,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysRoleMapper
|
||||
{
|
||||
public interface SysRoleMapper {
|
||||
/**
|
||||
* 根据条件分页查询角色数据
|
||||
*
|
||||
|
|
|
@ -10,8 +10,7 @@ import java.util.List;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface SysRoleMenuMapper
|
||||
{
|
||||
public interface SysRoleMenuMapper {
|
||||
/**
|
||||
* 查询菜单使用数量
|
||||
*
|
||||
|
|
|
@ -13,8 +13,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysUserMapper
|
||||
{
|
||||
public interface SysUserMapper {
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
*
|
||||
|
@ -75,7 +74,7 @@ public interface SysUserMapper
|
|||
* 修改用户头像
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @param avatar 头像地址
|
||||
* @param avatar 头像地址
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar);
|
||||
|
|
|
@ -12,8 +12,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysUserPostMapper
|
||||
{
|
||||
public interface SysUserPostMapper {
|
||||
/**
|
||||
* 通过用户ID删除用户和岗位关联
|
||||
*
|
||||
|
|
|
@ -13,8 +13,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysUserRoleMapper
|
||||
{
|
||||
public interface SysUserRoleMapper {
|
||||
/**
|
||||
* 通过用户ID删除用户和角色关联
|
||||
*
|
||||
|
@ -58,7 +57,7 @@ public interface SysUserRoleMapper
|
|||
/**
|
||||
* 批量取消授权用户角色
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param roleId 角色ID
|
||||
* @param userIds 需要删除的用户数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
@ -10,8 +10,7 @@ import java.util.List;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface ISysConfigService
|
||||
{
|
||||
public interface ISysConfigService {
|
||||
/**
|
||||
* 查询参数配置信息
|
||||
*
|
||||
|
|
|
@ -10,8 +10,7 @@ import java.util.List;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface ISysDeptService
|
||||
{
|
||||
public interface ISysDeptService {
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package com.health.system.server.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.health.system.common.domain.SysDictData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典 业务层
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface ISysDictDataService
|
||||
{
|
||||
public interface ISysDictDataService {
|
||||
/**
|
||||
* 根据条件分页查询字典数据
|
||||
*
|
||||
|
@ -21,7 +21,7 @@ public interface ISysDictDataService
|
|||
/**
|
||||
* 根据字典类型和字典键值查询字典数据信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典键值
|
||||
* @return 字典标签
|
||||
*/
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package com.health.system.server.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.health.system.common.domain.SysDictData;
|
||||
import com.health.system.common.domain.SysDictType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典 业务层
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface ISysDictTypeService
|
||||
{
|
||||
public interface ISysDictTypeService {
|
||||
/**
|
||||
* 根据条件分页查询字典类型
|
||||
*
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package com.health.system.server.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.health.system.common.domain.SysLogininfor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统访问日志情况信息 服务层
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface ISysLogininforService
|
||||
{
|
||||
public interface ISysLogininforService {
|
||||
/**
|
||||
* 新增系统登录日志
|
||||
*
|
||||
|
|
|
@ -13,8 +13,7 @@ import java.util.Set;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface ISysMenuService
|
||||
{
|
||||
public interface ISysMenuService {
|
||||
/**
|
||||
* 根据用户查询系统菜单列表
|
||||
*
|
||||
|
@ -26,7 +25,7 @@ public interface ISysMenuService
|
|||
/**
|
||||
* 根据用户查询系统菜单列表
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @param menu 菜单信息
|
||||
* @param userId 用户ID
|
||||
* @return 菜单列表
|
||||
*/
|
||||
|
|
|
@ -10,8 +10,7 @@ import java.util.List;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface ISysNoticeService
|
||||
{
|
||||
public interface ISysNoticeService {
|
||||
/**
|
||||
* 查询公告信息
|
||||
*
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package com.health.system.server.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.health.system.common.domain.SysOperLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 操作日志 服务层
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface ISysOperLogService
|
||||
{
|
||||
public interface ISysOperLogService {
|
||||
/**
|
||||
* 新增操作日志
|
||||
*
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
package com.health.system.server.service;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.health.system.common.domain.SysUser;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 权限信息 服务层
|
||||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface ISysPermissionService
|
||||
{
|
||||
public interface ISysPermissionService {
|
||||
/**
|
||||
* 获取角色数据权限
|
||||
*
|
||||
|
|
|
@ -10,8 +10,7 @@ import java.util.List;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface ISysPostService
|
||||
{
|
||||
public interface ISysPostService {
|
||||
/**
|
||||
* 查询岗位信息集合
|
||||
*
|
||||
|
|
|
@ -12,8 +12,7 @@ import java.util.Set;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface ISysRoleService
|
||||
{
|
||||
public interface ISysRoleService {
|
||||
/**
|
||||
* 根据条件分页查询角色数据
|
||||
*
|
||||
|
@ -158,7 +157,7 @@ public interface ISysRoleService
|
|||
/**
|
||||
* 批量取消授权用户角色
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param roleId 角色ID
|
||||
* @param userIds 需要取消授权的用户数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -167,7 +166,7 @@ public interface ISysRoleService
|
|||
/**
|
||||
* 批量选择授权用户角色
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param roleId 角色ID
|
||||
* @param userIds 需要删除的用户数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
@ -9,13 +9,12 @@ import com.health.system.common.domain.model.LoginUser;
|
|||
*
|
||||
* @author health
|
||||
*/
|
||||
public interface ISysUserOnlineService
|
||||
{
|
||||
public interface ISysUserOnlineService {
|
||||
/**
|
||||
* 通过登录地址查询信息
|
||||
*
|
||||
* @param ipaddr 登录地址
|
||||
* @param user 用户信息
|
||||
* @param user 用户信息
|
||||
* @return 在线用户信息
|
||||
*/
|
||||
public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user);
|
||||
|
@ -24,7 +23,7 @@ public interface ISysUserOnlineService
|
|||
* 通过用户名称查询信息
|
||||
*
|
||||
* @param userName 用户名称
|
||||
* @param user 用户信息
|
||||
* @param user 用户信息
|
||||
* @return 在线用户信息
|
||||
*/
|
||||
public SysUserOnline selectOnlineByUserName(String userName, LoginUser user);
|
||||
|
@ -32,9 +31,9 @@ public interface ISysUserOnlineService
|
|||
/**
|
||||
* 通过登录地址/用户名称查询信息
|
||||
*
|
||||
* @param ipaddr 登录地址
|
||||
* @param ipaddr 登录地址
|
||||
* @param userName 用户名称
|
||||
* @param user 用户信息
|
||||
* @param user 用户信息
|
||||
* @return 在线用户信息
|
||||
*/
|
||||
public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user);
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
package com.health.system.server.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.health.common.core.domain.Result;
|
||||
import com.health.system.common.domain.SysUser;
|
||||
import com.health.system.common.domain.User;
|
||||
|
||||
/**
|
||||
* 用户 业务层
|
||||
|
@ -206,9 +203,4 @@ public interface ISysUserService
|
|||
* @return 结果
|
||||
*/
|
||||
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
||||
|
||||
Boolean registerNewUser(User user);
|
||||
|
||||
|
||||
Result getEmailCode(String emailCount);
|
||||
}
|
||||
|
|
|
@ -22,8 +22,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@Service
|
||||
public class SysConfigServiceImpl implements ISysConfigService
|
||||
{
|
||||
public class SysConfigServiceImpl implements ISysConfigService {
|
||||
@Autowired
|
||||
private SysConfigMapper sysConfigMapper;
|
||||
|
||||
|
@ -34,8 +33,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||
* 项目启动时,初始化参数到缓存
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init()
|
||||
{
|
||||
public void init() {
|
||||
loadingConfigCache();
|
||||
}
|
||||
|
||||
|
@ -46,8 +44,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||
* @return 参数配置信息
|
||||
*/
|
||||
@Override
|
||||
public SysConfig selectConfigById(Long configId)
|
||||
{
|
||||
public SysConfig selectConfigById(Long configId) {
|
||||
SysConfig config = new SysConfig();
|
||||
config.setConfigId(configId);
|
||||
return sysConfigMapper.selectConfig(config);
|
||||
|
@ -60,18 +57,15 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||
* @return 参数键值
|
||||
*/
|
||||
@Override
|
||||
public String selectConfigByKey(String configKey)
|
||||
{
|
||||
public String selectConfigByKey(String configKey) {
|
||||
String configValue = Convert.toStr(redisService.getCacheObject(getCacheKey(configKey)));
|
||||
if (StringUtils.isNotEmpty(configValue))
|
||||
{
|
||||
if (StringUtils.isNotEmpty(configValue)) {
|
||||
return configValue;
|
||||
}
|
||||
SysConfig config = new SysConfig();
|
||||
config.setConfigKey(configKey);
|
||||
SysConfig retConfig = sysConfigMapper.selectConfig(config);
|
||||
if (StringUtils.isNotNull(retConfig))
|
||||
{
|
||||
if (StringUtils.isNotNull(retConfig)) {
|
||||
redisService.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue());
|
||||
return retConfig.getConfigValue();
|
||||
}
|
||||
|
@ -85,8 +79,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||
* @return 参数配置集合
|
||||
*/
|
||||
@Override
|
||||
public List<SysConfig> selectConfigList(SysConfig config)
|
||||
{
|
||||
public List<SysConfig> selectConfigList(SysConfig config) {
|
||||
return sysConfigMapper.selectConfigList(config);
|
||||
}
|
||||
|
||||
|
@ -97,11 +90,9 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertConfig(SysConfig config)
|
||||
{
|
||||
public int insertConfig(SysConfig config) {
|
||||
int row = sysConfigMapper.insertConfig(config);
|
||||
if (row > 0)
|
||||
{
|
||||
if (row > 0) {
|
||||
redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
return row;
|
||||
|
@ -114,17 +105,14 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateConfig(SysConfig config)
|
||||
{
|
||||
public int updateConfig(SysConfig config) {
|
||||
SysConfig temp = sysConfigMapper.selectConfigById(config.getConfigId());
|
||||
if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey()))
|
||||
{
|
||||
if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) {
|
||||
redisService.deleteObject(getCacheKey(temp.getConfigKey()));
|
||||
}
|
||||
|
||||
int row = sysConfigMapper.updateConfig(config);
|
||||
if (row > 0)
|
||||
{
|
||||
if (row > 0) {
|
||||
redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
return row;
|
||||
|
@ -136,13 +124,10 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||
* @param configIds 需要删除的参数ID
|
||||
*/
|
||||
@Override
|
||||
public void deleteConfigByIds(Long[] configIds)
|
||||
{
|
||||
for (Long configId : configIds)
|
||||
{
|
||||
public void deleteConfigByIds(Long[] configIds) {
|
||||
for (Long configId : configIds) {
|
||||
SysConfig config = selectConfigById(configId);
|
||||
if (StringUtils.equals(UserConstants.YES, config.getConfigType()))
|
||||
{
|
||||
if (StringUtils.equals(UserConstants.YES, config.getConfigType())) {
|
||||
throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
|
||||
}
|
||||
sysConfigMapper.deleteConfigById(configId);
|
||||
|
@ -154,11 +139,9 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||
* 加载参数缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void loadingConfigCache()
|
||||
{
|
||||
public void loadingConfigCache() {
|
||||
List<SysConfig> configsList = sysConfigMapper.selectConfigList(new SysConfig());
|
||||
for (SysConfig config : configsList)
|
||||
{
|
||||
for (SysConfig config : configsList) {
|
||||
redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||
}
|
||||
}
|
||||
|
@ -167,8 +150,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||
* 清空参数缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void clearConfigCache()
|
||||
{
|
||||
public void clearConfigCache() {
|
||||
Collection<String> keys = redisService.keys(CacheConstants.SYS_CONFIG_KEY + "*");
|
||||
redisService.deleteObject(keys);
|
||||
}
|
||||
|
@ -177,8 +159,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||
* 重置参数缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void resetConfigCache()
|
||||
{
|
||||
public void resetConfigCache() {
|
||||
clearConfigCache();
|
||||
loadingConfigCache();
|
||||
}
|
||||
|
@ -190,12 +171,10 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkConfigKeyUnique(SysConfig config)
|
||||
{
|
||||
public boolean checkConfigKeyUnique(SysConfig config) {
|
||||
Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
|
||||
SysConfig info = sysConfigMapper.checkConfigKeyUnique(config.getConfigKey());
|
||||
if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue())
|
||||
{
|
||||
if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
|
@ -207,8 +186,7 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||
* @param configKey 参数键
|
||||
* @return 缓存键key
|
||||
*/
|
||||
private String getCacheKey(String configKey)
|
||||
{
|
||||
private String getCacheKey(String configKey) {
|
||||
return CacheConstants.SYS_CONFIG_KEY + configKey;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,8 +28,7 @@ import java.util.stream.Collectors;
|
|||
* @author health
|
||||
*/
|
||||
@Service
|
||||
public class SysDeptServiceImpl implements ISysDeptService
|
||||
{
|
||||
public class SysDeptServiceImpl implements ISysDeptService {
|
||||
@Autowired
|
||||
private SysDeptMapper deptMapper;
|
||||
|
||||
|
@ -44,8 +43,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "d")
|
||||
public List<SysDept> selectDeptList(SysDept dept)
|
||||
{
|
||||
public List<SysDept> selectDeptList(SysDept dept) {
|
||||
return deptMapper.selectDeptList(dept);
|
||||
}
|
||||
|
||||
|
@ -56,8 +54,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @return 部门树信息集合
|
||||
*/
|
||||
@Override
|
||||
public List<TreeSelect> selectDeptTreeList(SysDept dept)
|
||||
{
|
||||
public List<TreeSelect> selectDeptTreeList(SysDept dept) {
|
||||
List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
|
||||
return buildDeptTreeSelect(depts);
|
||||
}
|
||||
|
@ -69,21 +66,17 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @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 = depts.stream().map(SysDept::getDeptId).collect(Collectors.toList());
|
||||
for (SysDept dept : depts)
|
||||
{
|
||||
for (SysDept dept : depts) {
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
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;
|
||||
|
@ -96,8 +89,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @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());
|
||||
}
|
||||
|
@ -109,8 +101,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @return 选中部门列表
|
||||
*/
|
||||
@Override
|
||||
public List<Long> selectDeptListByRoleId(Long roleId)
|
||||
{
|
||||
public List<Long> selectDeptListByRoleId(Long roleId) {
|
||||
SysRole role = roleMapper.selectRoleById(roleId);
|
||||
return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());
|
||||
}
|
||||
|
@ -122,8 +113,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @return 部门信息
|
||||
*/
|
||||
@Override
|
||||
public SysDept selectDeptById(Long deptId)
|
||||
{
|
||||
public SysDept selectDeptById(Long deptId) {
|
||||
return deptMapper.selectDeptById(deptId);
|
||||
}
|
||||
|
||||
|
@ -134,8 +124,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @return 子部门数
|
||||
*/
|
||||
@Override
|
||||
public int selectNormalChildrenDeptById(Long deptId)
|
||||
{
|
||||
public int selectNormalChildrenDeptById(Long deptId) {
|
||||
return deptMapper.selectNormalChildrenDeptById(deptId);
|
||||
}
|
||||
|
||||
|
@ -146,8 +135,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean hasChildByDeptId(Long deptId)
|
||||
{
|
||||
public boolean hasChildByDeptId(Long deptId) {
|
||||
int result = deptMapper.hasChildByDeptId(deptId);
|
||||
return result > 0;
|
||||
}
|
||||
|
@ -159,8 +147,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @return 结果 true 存在 false 不存在
|
||||
*/
|
||||
@Override
|
||||
public boolean checkDeptExistUser(Long deptId)
|
||||
{
|
||||
public boolean checkDeptExistUser(Long deptId) {
|
||||
int result = deptMapper.checkDeptExistUser(deptId);
|
||||
return result > 0;
|
||||
}
|
||||
|
@ -172,12 +159,10 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkDeptNameUnique(SysDept dept)
|
||||
{
|
||||
public boolean checkDeptNameUnique(SysDept dept) {
|
||||
Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
|
||||
SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId());
|
||||
if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
|
||||
{
|
||||
if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
|
@ -189,15 +174,12 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @param deptId 部门id
|
||||
*/
|
||||
@Override
|
||||
public void checkDeptDataScope(Long deptId)
|
||||
{
|
||||
if (!SysUser.isAdmin(SecurityUtils.getUserId()))
|
||||
{
|
||||
public void checkDeptDataScope(Long deptId) {
|
||||
if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
|
||||
SysDept dept = new SysDept();
|
||||
dept.setDeptId(deptId);
|
||||
List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
|
||||
if (StringUtils.isEmpty(depts))
|
||||
{
|
||||
if (StringUtils.isEmpty(depts)) {
|
||||
throw new ServiceException("没有权限访问部门数据!");
|
||||
}
|
||||
}
|
||||
|
@ -210,12 +192,10 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @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 ServiceException("部门停用,不允许新增");
|
||||
}
|
||||
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
||||
|
@ -229,12 +209,10 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @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 (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept))
|
||||
{
|
||||
if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) {
|
||||
String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId();
|
||||
String oldAncestors = oldDept.getAncestors();
|
||||
dept.setAncestors(newAncestors);
|
||||
|
@ -242,8 +220,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
}
|
||||
int result = deptMapper.updateDept(dept);
|
||||
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())
|
||||
&& !StringUtils.equals("0", dept.getAncestors()))
|
||||
{
|
||||
&& !StringUtils.equals("0", dept.getAncestors())) {
|
||||
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
||||
updateParentDeptStatusNormal(dept);
|
||||
}
|
||||
|
@ -255,8 +232,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
*
|
||||
* @param dept 当前部门
|
||||
*/
|
||||
private void updateParentDeptStatusNormal(SysDept dept)
|
||||
{
|
||||
private void updateParentDeptStatusNormal(SysDept dept) {
|
||||
String ancestors = dept.getAncestors();
|
||||
Long[] deptIds = Convert.toLongArray(ancestors);
|
||||
deptMapper.updateDeptStatusNormal(deptIds);
|
||||
|
@ -265,19 +241,16 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
/**
|
||||
* 修改子元素关系
|
||||
*
|
||||
* @param deptId 被修改的部门ID
|
||||
* @param deptId 被修改的部门ID
|
||||
* @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().replaceFirst(oldAncestors, newAncestors));
|
||||
}
|
||||
if (children.size() > 0)
|
||||
{
|
||||
if (children.size() > 0) {
|
||||
deptMapper.updateDeptChildren(children);
|
||||
}
|
||||
}
|
||||
|
@ -289,23 +262,19 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
* @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);
|
||||
}
|
||||
}
|
||||
|
@ -314,15 +283,12 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
/**
|
||||
* 得到子节点列表
|
||||
*/
|
||||
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 (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue())
|
||||
{
|
||||
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) {
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
|
@ -332,8 +298,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
/**
|
||||
* 判断是否有子节点
|
||||
*/
|
||||
private boolean hasChild(List<SysDept> list, SysDept t)
|
||||
{
|
||||
private boolean hasChild(List<SysDept> list, SysDept t) {
|
||||
return getChildList(list, t).size() > 0 ? true : false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,8 +15,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@Service
|
||||
public class SysDictDataServiceImpl implements ISysDictDataService
|
||||
{
|
||||
public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||
@Autowired
|
||||
private SysDictDataMapper dictDataMapper;
|
||||
|
||||
|
@ -27,21 +26,19 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
|||
* @return 字典数据集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictData> selectDictDataList(SysDictData dictData)
|
||||
{
|
||||
public List<SysDictData> selectDictDataList(SysDictData dictData) {
|
||||
return dictDataMapper.selectDictDataList(dictData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典键值查询字典数据信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典键值
|
||||
* @return 字典标签
|
||||
*/
|
||||
@Override
|
||||
public String selectDictLabel(String dictType, String dictValue)
|
||||
{
|
||||
public String selectDictLabel(String dictType, String dictValue) {
|
||||
return dictDataMapper.selectDictLabel(dictType, dictValue);
|
||||
}
|
||||
|
||||
|
@ -52,8 +49,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
|||
* @return 字典数据
|
||||
*/
|
||||
@Override
|
||||
public SysDictData selectDictDataById(Long dictCode)
|
||||
{
|
||||
public SysDictData selectDictDataById(Long dictCode) {
|
||||
return dictDataMapper.selectDictDataById(dictCode);
|
||||
}
|
||||
|
||||
|
@ -63,10 +59,8 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
|||
* @param dictCodes 需要删除的字典数据ID
|
||||
*/
|
||||
@Override
|
||||
public void deleteDictDataByIds(Long[] dictCodes)
|
||||
{
|
||||
for (Long dictCode : dictCodes)
|
||||
{
|
||||
public void deleteDictDataByIds(Long[] dictCodes) {
|
||||
for (Long dictCode : dictCodes) {
|
||||
SysDictData data = selectDictDataById(dictCode);
|
||||
dictDataMapper.deleteDictDataById(dictCode);
|
||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
|
||||
|
@ -81,11 +75,9 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDictData(SysDictData data)
|
||||
{
|
||||
public int insertDictData(SysDictData data) {
|
||||
int row = dictDataMapper.insertDictData(data);
|
||||
if (row > 0)
|
||||
{
|
||||
if (row > 0) {
|
||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
|
||||
DictUtils.setDictCache(data.getDictType(), dictDatas);
|
||||
}
|
||||
|
@ -99,11 +91,9 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDictData(SysDictData data)
|
||||
{
|
||||
public int updateDictData(SysDictData data) {
|
||||
int row = dictDataMapper.updateDictData(data);
|
||||
if (row > 0)
|
||||
{
|
||||
if (row > 0) {
|
||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
|
||||
DictUtils.setDictCache(data.getDictType(), dictDatas);
|
||||
}
|
||||
|
|
|
@ -25,8 +25,7 @@ import java.util.stream.Collectors;
|
|||
* @author health
|
||||
*/
|
||||
@Service
|
||||
public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
{
|
||||
public class SysDictTypeServiceImpl implements ISysDictTypeService {
|
||||
@Autowired
|
||||
private SysDictTypeMapper dictTypeMapper;
|
||||
|
||||
|
@ -37,8 +36,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
* 项目启动时,初始化字典到缓存
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init()
|
||||
{
|
||||
public void init() {
|
||||
loadingDictCache();
|
||||
}
|
||||
|
||||
|
@ -49,8 +47,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
* @return 字典类型集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictType> selectDictTypeList(SysDictType dictType)
|
||||
{
|
||||
public List<SysDictType> selectDictTypeList(SysDictType dictType) {
|
||||
return dictTypeMapper.selectDictTypeList(dictType);
|
||||
}
|
||||
|
||||
|
@ -60,8 +57,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
* @return 字典类型集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictType> selectDictTypeAll()
|
||||
{
|
||||
public List<SysDictType> selectDictTypeAll() {
|
||||
return dictTypeMapper.selectDictTypeAll();
|
||||
}
|
||||
|
||||
|
@ -72,16 +68,13 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
* @return 字典数据集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictData> selectDictDataByType(String dictType)
|
||||
{
|
||||
public List<SysDictData> selectDictDataByType(String dictType) {
|
||||
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
|
||||
if (StringUtils.isNotEmpty(dictDatas))
|
||||
{
|
||||
if (StringUtils.isNotEmpty(dictDatas)) {
|
||||
return dictDatas;
|
||||
}
|
||||
dictDatas = dictDataMapper.selectDictDataByType(dictType);
|
||||
if (StringUtils.isNotEmpty(dictDatas))
|
||||
{
|
||||
if (StringUtils.isNotEmpty(dictDatas)) {
|
||||
DictUtils.setDictCache(dictType, dictDatas);
|
||||
return dictDatas;
|
||||
}
|
||||
|
@ -95,8 +88,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
* @return 字典类型
|
||||
*/
|
||||
@Override
|
||||
public SysDictType selectDictTypeById(Long dictId)
|
||||
{
|
||||
public SysDictType selectDictTypeById(Long dictId) {
|
||||
return dictTypeMapper.selectDictTypeById(dictId);
|
||||
}
|
||||
|
||||
|
@ -107,8 +99,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
* @return 字典类型
|
||||
*/
|
||||
@Override
|
||||
public SysDictType selectDictTypeByType(String dictType)
|
||||
{
|
||||
public SysDictType selectDictTypeByType(String dictType) {
|
||||
return dictTypeMapper.selectDictTypeByType(dictType);
|
||||
}
|
||||
|
||||
|
@ -118,13 +109,10 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
* @param dictIds 需要删除的字典ID
|
||||
*/
|
||||
@Override
|
||||
public void deleteDictTypeByIds(Long[] dictIds)
|
||||
{
|
||||
for (Long dictId : dictIds)
|
||||
{
|
||||
public void deleteDictTypeByIds(Long[] dictIds) {
|
||||
for (Long dictId : dictIds) {
|
||||
SysDictType dictType = selectDictTypeById(dictId);
|
||||
if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0)
|
||||
{
|
||||
if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) {
|
||||
throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
|
||||
}
|
||||
dictTypeMapper.deleteDictTypeById(dictId);
|
||||
|
@ -136,13 +124,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
* 加载字典缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void loadingDictCache()
|
||||
{
|
||||
public void loadingDictCache() {
|
||||
SysDictData dictData = new SysDictData();
|
||||
dictData.setStatus("0");
|
||||
Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType));
|
||||
for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet())
|
||||
{
|
||||
for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet()) {
|
||||
DictUtils.setDictCache(entry.getKey(), entry.getValue().stream().sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
@ -151,8 +137,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
* 清空字典缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void clearDictCache()
|
||||
{
|
||||
public void clearDictCache() {
|
||||
DictUtils.clearDictCache();
|
||||
}
|
||||
|
||||
|
@ -160,8 +145,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
* 重置字典缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void resetDictCache()
|
||||
{
|
||||
public void resetDictCache() {
|
||||
clearDictCache();
|
||||
loadingDictCache();
|
||||
}
|
||||
|
@ -173,11 +157,9 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDictType(SysDictType dict)
|
||||
{
|
||||
public int insertDictType(SysDictType dict) {
|
||||
int row = dictTypeMapper.insertDictType(dict);
|
||||
if (row > 0)
|
||||
{
|
||||
if (row > 0) {
|
||||
DictUtils.setDictCache(dict.getDictType(), null);
|
||||
}
|
||||
return row;
|
||||
|
@ -191,13 +173,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateDictType(SysDictType dict)
|
||||
{
|
||||
public int updateDictType(SysDictType dict) {
|
||||
SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId());
|
||||
dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType());
|
||||
int row = dictTypeMapper.updateDictType(dict);
|
||||
if (row > 0)
|
||||
{
|
||||
if (row > 0) {
|
||||
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType());
|
||||
DictUtils.setDictCache(dict.getDictType(), dictDatas);
|
||||
}
|
||||
|
@ -211,12 +191,10 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkDictTypeUnique(SysDictType dict)
|
||||
{
|
||||
public boolean checkDictTypeUnique(SysDictType dict) {
|
||||
Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
|
||||
SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
|
||||
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue())
|
||||
{
|
||||
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
|
|
|
@ -14,8 +14,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@Service
|
||||
public class SysLogininforServiceImpl implements ISysLogininforService
|
||||
{
|
||||
public class SysLogininforServiceImpl implements ISysLogininforService {
|
||||
|
||||
@Autowired
|
||||
private SysLogininforMapper logininforMapper;
|
||||
|
@ -26,8 +25,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService
|
|||
* @param logininfor 访问日志对象
|
||||
*/
|
||||
@Override
|
||||
public int insertLogininfor(SysLogininfor logininfor)
|
||||
{
|
||||
public int insertLogininfor(SysLogininfor logininfor) {
|
||||
return logininforMapper.insertLogininfor(logininfor);
|
||||
}
|
||||
|
||||
|
@ -38,8 +36,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService
|
|||
* @return 登录记录集合
|
||||
*/
|
||||
@Override
|
||||
public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor)
|
||||
{
|
||||
public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) {
|
||||
return logininforMapper.selectLogininforList(logininfor);
|
||||
}
|
||||
|
||||
|
@ -50,8 +47,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteLogininforByIds(Long[] infoIds)
|
||||
{
|
||||
public int deleteLogininforByIds(Long[] infoIds) {
|
||||
return logininforMapper.deleteLogininforByIds(infoIds);
|
||||
}
|
||||
|
||||
|
@ -59,8 +55,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService
|
|||
* 清空系统登录日志
|
||||
*/
|
||||
@Override
|
||||
public void cleanLogininfor()
|
||||
{
|
||||
public void cleanLogininfor() {
|
||||
logininforMapper.cleanLogininfor();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,8 +26,7 @@ import java.util.stream.Collectors;
|
|||
* @author health
|
||||
*/
|
||||
@Service
|
||||
public class SysMenuServiceImpl implements ISysMenuService
|
||||
{
|
||||
public class SysMenuServiceImpl implements ISysMenuService {
|
||||
public static final String PREMISSION_STRING = "perms[\"{0}\"]";
|
||||
|
||||
@Autowired
|
||||
|
@ -46,8 +45,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 菜单列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysMenu> selectMenuList(Long userId)
|
||||
{
|
||||
public List<SysMenu> selectMenuList(Long userId) {
|
||||
return selectMenuList(new SysMenu(), userId);
|
||||
}
|
||||
|
||||
|
@ -58,16 +56,12 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 菜单列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysMenu> selectMenuList(SysMenu menu, Long userId)
|
||||
{
|
||||
public List<SysMenu> selectMenuList(SysMenu menu, Long userId) {
|
||||
List<SysMenu> menuList = null;
|
||||
// 管理员显示所有菜单信息
|
||||
if (SysUser.isAdmin(userId))
|
||||
{
|
||||
if (SysUser.isAdmin(userId)) {
|
||||
menuList = menuMapper.selectMenuList(menu);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
menu.getParams().put("userId", userId);
|
||||
menuList = menuMapper.selectMenuListByUserId(menu);
|
||||
}
|
||||
|
@ -81,14 +75,11 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 权限列表
|
||||
*/
|
||||
@Override
|
||||
public Set<String> selectMenuPermsByUserId(Long userId)
|
||||
{
|
||||
public Set<String> selectMenuPermsByUserId(Long userId) {
|
||||
List<String> perms = menuMapper.selectMenuPermsByUserId(userId);
|
||||
Set<String> permsSet = new HashSet<>();
|
||||
for (String perm : perms)
|
||||
{
|
||||
if (StringUtils.isNotEmpty(perm))
|
||||
{
|
||||
for (String perm : perms) {
|
||||
if (StringUtils.isNotEmpty(perm)) {
|
||||
permsSet.addAll(Arrays.asList(perm.trim().split(",")));
|
||||
}
|
||||
}
|
||||
|
@ -102,14 +93,11 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 权限列表
|
||||
*/
|
||||
@Override
|
||||
public Set<String> selectMenuPermsByRoleId(Long roleId)
|
||||
{
|
||||
public Set<String> selectMenuPermsByRoleId(Long roleId) {
|
||||
List<String> perms = menuMapper.selectMenuPermsByRoleId(roleId);
|
||||
Set<String> permsSet = new HashSet<>();
|
||||
for (String perm : perms)
|
||||
{
|
||||
if (StringUtils.isNotEmpty(perm))
|
||||
{
|
||||
for (String perm : perms) {
|
||||
if (StringUtils.isNotEmpty(perm)) {
|
||||
permsSet.addAll(Arrays.asList(perm.trim().split(",")));
|
||||
}
|
||||
}
|
||||
|
@ -123,15 +111,11 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 菜单列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId)
|
||||
{
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId) {
|
||||
List<SysMenu> menus = null;
|
||||
if (SecurityUtils.isAdmin(userId))
|
||||
{
|
||||
if (SecurityUtils.isAdmin(userId)) {
|
||||
menus = menuMapper.selectMenuTreeAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
menus = menuMapper.selectMenuTreeByUserId(userId);
|
||||
}
|
||||
return getChildPerms(menus, 0);
|
||||
|
@ -144,8 +128,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 选中菜单列表
|
||||
*/
|
||||
@Override
|
||||
public List<Long> selectMenuListByRoleId(Long roleId)
|
||||
{
|
||||
public List<Long> selectMenuListByRoleId(Long roleId) {
|
||||
SysRole role = roleMapper.selectRoleById(roleId);
|
||||
return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly());
|
||||
}
|
||||
|
@ -157,11 +140,9 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 路由列表
|
||||
*/
|
||||
@Override
|
||||
public List<RouterVo> buildMenus(List<SysMenu> menus)
|
||||
{
|
||||
public List<RouterVo> buildMenus(List<SysMenu> menus) {
|
||||
List<RouterVo> routers = new LinkedList<RouterVo>();
|
||||
for (SysMenu menu : menus)
|
||||
{
|
||||
for (SysMenu menu : menus) {
|
||||
RouterVo router = new RouterVo();
|
||||
router.setHidden("1".equals(menu.getVisible()));
|
||||
router.setName(getRouteName(menu));
|
||||
|
@ -170,14 +151,11 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
router.setQuery(menu.getQuery());
|
||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
|
||||
List<SysMenu> cMenus = menu.getChildren();
|
||||
if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()))
|
||||
{
|
||||
if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
|
||||
router.setAlwaysShow(true);
|
||||
router.setRedirect("noRedirect");
|
||||
router.setChildren(buildMenus(cMenus));
|
||||
}
|
||||
else if (isMenuFrame(menu))
|
||||
{
|
||||
} else if (isMenuFrame(menu)) {
|
||||
router.setMeta(null);
|
||||
List<RouterVo> childrenList = new ArrayList<RouterVo>();
|
||||
RouterVo children = new RouterVo();
|
||||
|
@ -188,9 +166,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
children.setQuery(menu.getQuery());
|
||||
childrenList.add(children);
|
||||
router.setChildren(childrenList);
|
||||
}
|
||||
else if (menu.getParentId().intValue() == 0 && isInnerLink(menu))
|
||||
{
|
||||
} else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) {
|
||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon()));
|
||||
router.setPath("/");
|
||||
List<RouterVo> childrenList = new ArrayList<RouterVo>();
|
||||
|
@ -215,22 +191,18 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 树结构列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysMenu> buildMenuTree(List<SysMenu> menus)
|
||||
{
|
||||
public List<SysMenu> buildMenuTree(List<SysMenu> menus) {
|
||||
List<SysMenu> returnList = new ArrayList<SysMenu>();
|
||||
List<Long> tempList = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList());
|
||||
for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext();)
|
||||
{
|
||||
for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext(); ) {
|
||||
SysMenu menu = (SysMenu) iterator.next();
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
if (!tempList.contains(menu.getParentId()))
|
||||
{
|
||||
if (!tempList.contains(menu.getParentId())) {
|
||||
recursionFn(menus, menu);
|
||||
returnList.add(menu);
|
||||
}
|
||||
}
|
||||
if (returnList.isEmpty())
|
||||
{
|
||||
if (returnList.isEmpty()) {
|
||||
returnList = menus;
|
||||
}
|
||||
return returnList;
|
||||
|
@ -243,8 +215,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 下拉树结构列表
|
||||
*/
|
||||
@Override
|
||||
public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus)
|
||||
{
|
||||
public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus) {
|
||||
List<SysMenu> menuTrees = buildMenuTree(menus);
|
||||
return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
@ -256,8 +227,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 菜单信息
|
||||
*/
|
||||
@Override
|
||||
public SysMenu selectMenuById(Long menuId)
|
||||
{
|
||||
public SysMenu selectMenuById(Long menuId) {
|
||||
return menuMapper.selectMenuById(menuId);
|
||||
}
|
||||
|
||||
|
@ -268,8 +238,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean hasChildByMenuId(Long menuId)
|
||||
{
|
||||
public boolean hasChildByMenuId(Long menuId) {
|
||||
int result = menuMapper.hasChildByMenuId(menuId);
|
||||
return result > 0;
|
||||
}
|
||||
|
@ -281,8 +250,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkMenuExistRole(Long menuId)
|
||||
{
|
||||
public boolean checkMenuExistRole(Long menuId) {
|
||||
int result = roleMenuMapper.checkMenuExistRole(menuId);
|
||||
return result > 0;
|
||||
}
|
||||
|
@ -294,8 +262,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMenu(SysMenu menu)
|
||||
{
|
||||
public int insertMenu(SysMenu menu) {
|
||||
return menuMapper.insertMenu(menu);
|
||||
}
|
||||
|
||||
|
@ -306,8 +273,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMenu(SysMenu menu)
|
||||
{
|
||||
public int updateMenu(SysMenu menu) {
|
||||
return menuMapper.updateMenu(menu);
|
||||
}
|
||||
|
||||
|
@ -318,8 +284,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMenuById(Long menuId)
|
||||
{
|
||||
public int deleteMenuById(Long menuId) {
|
||||
return menuMapper.deleteMenuById(menuId);
|
||||
}
|
||||
|
||||
|
@ -330,12 +295,10 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkMenuNameUnique(SysMenu menu)
|
||||
{
|
||||
public boolean checkMenuNameUnique(SysMenu menu) {
|
||||
Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId();
|
||||
SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId());
|
||||
if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue())
|
||||
{
|
||||
if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
|
@ -347,12 +310,10 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @param menu 菜单信息
|
||||
* @return 路由名称
|
||||
*/
|
||||
public String getRouteName(SysMenu menu)
|
||||
{
|
||||
public String getRouteName(SysMenu menu) {
|
||||
String routerName = StringUtils.capitalize(menu.getPath());
|
||||
// 非外链并且是一级目录(类型为目录)
|
||||
if (isMenuFrame(menu))
|
||||
{
|
||||
if (isMenuFrame(menu)) {
|
||||
routerName = StringUtils.EMPTY;
|
||||
}
|
||||
return routerName;
|
||||
|
@ -364,23 +325,19 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @param menu 菜单信息
|
||||
* @return 路由地址
|
||||
*/
|
||||
public String getRouterPath(SysMenu menu)
|
||||
{
|
||||
public String getRouterPath(SysMenu menu) {
|
||||
String routerPath = menu.getPath();
|
||||
// 内链打开外网方式
|
||||
if (menu.getParentId().intValue() != 0 && isInnerLink(menu))
|
||||
{
|
||||
if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) {
|
||||
routerPath = innerLinkReplaceEach(routerPath);
|
||||
}
|
||||
// 非外链并且是一级目录(类型为目录)
|
||||
if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType())
|
||||
&& UserConstants.NO_FRAME.equals(menu.getIsFrame()))
|
||||
{
|
||||
&& UserConstants.NO_FRAME.equals(menu.getIsFrame())) {
|
||||
routerPath = "/" + menu.getPath();
|
||||
}
|
||||
// 非外链并且是一级目录(类型为菜单)
|
||||
else if (isMenuFrame(menu))
|
||||
{
|
||||
else if (isMenuFrame(menu)) {
|
||||
routerPath = "/";
|
||||
}
|
||||
return routerPath;
|
||||
|
@ -392,19 +349,13 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @param menu 菜单信息
|
||||
* @return 组件信息
|
||||
*/
|
||||
public String getComponent(SysMenu menu)
|
||||
{
|
||||
public String getComponent(SysMenu menu) {
|
||||
String component = UserConstants.LAYOUT;
|
||||
if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu))
|
||||
{
|
||||
if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) {
|
||||
component = menu.getComponent();
|
||||
}
|
||||
else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu))
|
||||
{
|
||||
} else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) {
|
||||
component = UserConstants.INNER_LINK;
|
||||
}
|
||||
else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu))
|
||||
{
|
||||
} else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) {
|
||||
component = UserConstants.PARENT_VIEW;
|
||||
}
|
||||
return component;
|
||||
|
@ -416,8 +367,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean isMenuFrame(SysMenu menu)
|
||||
{
|
||||
public boolean isMenuFrame(SysMenu menu) {
|
||||
return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType())
|
||||
&& menu.getIsFrame().equals(UserConstants.NO_FRAME);
|
||||
}
|
||||
|
@ -428,8 +378,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean isInnerLink(SysMenu menu)
|
||||
{
|
||||
public boolean isInnerLink(SysMenu menu) {
|
||||
return menu.getIsFrame().equals(UserConstants.NO_FRAME) && StringUtils.ishttp(menu.getPath());
|
||||
}
|
||||
|
||||
|
@ -439,27 +388,23 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean isParentView(SysMenu menu)
|
||||
{
|
||||
public boolean isParentView(SysMenu menu) {
|
||||
return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据父节点的ID获取所有子节点
|
||||
*
|
||||
* @param list 分类表
|
||||
* @param list 分类表
|
||||
* @param parentId 传入的父节点ID
|
||||
* @return String
|
||||
*/
|
||||
public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId)
|
||||
{
|
||||
public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) {
|
||||
List<SysMenu> returnList = new ArrayList<SysMenu>();
|
||||
for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext();)
|
||||
{
|
||||
for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext(); ) {
|
||||
SysMenu t = (SysMenu) iterator.next();
|
||||
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
|
||||
if (t.getParentId() == parentId)
|
||||
{
|
||||
if (t.getParentId() == parentId) {
|
||||
recursionFn(list, t);
|
||||
returnList.add(t);
|
||||
}
|
||||
|
@ -473,15 +418,12 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
* @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);
|
||||
}
|
||||
}
|
||||
|
@ -490,15 +432,12 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
/**
|
||||
* 得到子节点列表
|
||||
*/
|
||||
private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t)
|
||||
{
|
||||
private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) {
|
||||
List<SysMenu> tlist = new ArrayList<SysMenu>();
|
||||
Iterator<SysMenu> it = list.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
while (it.hasNext()) {
|
||||
SysMenu n = (SysMenu) it.next();
|
||||
if (n.getParentId().longValue() == t.getMenuId().longValue())
|
||||
{
|
||||
if (n.getParentId().longValue() == t.getMenuId().longValue()) {
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
|
@ -508,8 +447,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
/**
|
||||
* 判断是否有子节点
|
||||
*/
|
||||
private boolean hasChild(List<SysMenu> list, SysMenu t)
|
||||
{
|
||||
private boolean hasChild(List<SysMenu> list, SysMenu t) {
|
||||
return getChildList(list, t).size() > 0;
|
||||
}
|
||||
|
||||
|
@ -518,9 +456,8 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
public String innerLinkReplaceEach(String path)
|
||||
{
|
||||
return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, "." },
|
||||
new String[] { "", "", "", "/" });
|
||||
public String innerLinkReplaceEach(String path) {
|
||||
return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS, Constants.WWW, "."},
|
||||
new String[]{"", "", "", "/"});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,8 +14,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@Service
|
||||
public class SysNoticeServiceImpl implements ISysNoticeService
|
||||
{
|
||||
public class SysNoticeServiceImpl implements ISysNoticeService {
|
||||
@Autowired
|
||||
private SysNoticeMapper noticeMapper;
|
||||
|
||||
|
@ -26,8 +25,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
|||
* @return 公告信息
|
||||
*/
|
||||
@Override
|
||||
public SysNotice selectNoticeById(Long noticeId)
|
||||
{
|
||||
public SysNotice selectNoticeById(Long noticeId) {
|
||||
return noticeMapper.selectNoticeById(noticeId);
|
||||
}
|
||||
|
||||
|
@ -38,8 +36,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
|||
* @return 公告集合
|
||||
*/
|
||||
@Override
|
||||
public List<SysNotice> selectNoticeList(SysNotice notice)
|
||||
{
|
||||
public List<SysNotice> selectNoticeList(SysNotice notice) {
|
||||
return noticeMapper.selectNoticeList(notice);
|
||||
}
|
||||
|
||||
|
@ -50,8 +47,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertNotice(SysNotice notice)
|
||||
{
|
||||
public int insertNotice(SysNotice notice) {
|
||||
return noticeMapper.insertNotice(notice);
|
||||
}
|
||||
|
||||
|
@ -62,8 +58,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateNotice(SysNotice notice)
|
||||
{
|
||||
public int updateNotice(SysNotice notice) {
|
||||
return noticeMapper.updateNotice(notice);
|
||||
}
|
||||
|
||||
|
@ -74,8 +69,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNoticeById(Long noticeId)
|
||||
{
|
||||
public int deleteNoticeById(Long noticeId) {
|
||||
return noticeMapper.deleteNoticeById(noticeId);
|
||||
}
|
||||
|
||||
|
@ -86,8 +80,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNoticeByIds(Long[] noticeIds)
|
||||
{
|
||||
public int deleteNoticeByIds(Long[] noticeIds) {
|
||||
return noticeMapper.deleteNoticeByIds(noticeIds);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,8 +14,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@Service
|
||||
public class SysOperLogServiceImpl implements ISysOperLogService
|
||||
{
|
||||
public class SysOperLogServiceImpl implements ISysOperLogService {
|
||||
@Autowired
|
||||
private SysOperLogMapper operLogMapper;
|
||||
|
||||
|
@ -26,8 +25,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertOperlog(SysOperLog operLog)
|
||||
{
|
||||
public int insertOperlog(SysOperLog operLog) {
|
||||
return operLogMapper.insertOperlog(operLog);
|
||||
}
|
||||
|
||||
|
@ -38,8 +36,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService
|
|||
* @return 操作日志集合
|
||||
*/
|
||||
@Override
|
||||
public List<SysOperLog> selectOperLogList(SysOperLog operLog)
|
||||
{
|
||||
public List<SysOperLog> selectOperLogList(SysOperLog operLog) {
|
||||
return operLogMapper.selectOperLogList(operLog);
|
||||
}
|
||||
|
||||
|
@ -50,8 +47,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOperLogByIds(Long[] operIds)
|
||||
{
|
||||
public int deleteOperLogByIds(Long[] operIds) {
|
||||
return operLogMapper.deleteOperLogByIds(operIds);
|
||||
}
|
||||
|
||||
|
@ -62,8 +58,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService
|
|||
* @return 操作日志对象
|
||||
*/
|
||||
@Override
|
||||
public SysOperLog selectOperLogById(Long operId)
|
||||
{
|
||||
public SysOperLog selectOperLogById(Long operId) {
|
||||
return operLogMapper.selectOperLogById(operId);
|
||||
}
|
||||
|
||||
|
@ -71,8 +66,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService
|
|||
* 清空操作日志
|
||||
*/
|
||||
@Override
|
||||
public void cleanOperLog()
|
||||
{
|
||||
public void cleanOperLog() {
|
||||
operLogMapper.cleanOperLog();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
package com.health.system.server.service.impl;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import com.health.system.common.domain.SysRole;
|
||||
import com.health.system.common.domain.SysUser;
|
||||
import com.health.system.server.service.ISysMenuService;
|
||||
import com.health.system.server.service.ISysPermissionService;
|
||||
import com.health.system.server.service.ISysRoleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 用户权限处理
|
||||
|
@ -18,8 +19,7 @@ import com.health.system.server.service.ISysRoleService;
|
|||
* @author health
|
||||
*/
|
||||
@Service
|
||||
public class SysPermissionServiceImpl implements ISysPermissionService
|
||||
{
|
||||
public class SysPermissionServiceImpl implements ISysPermissionService {
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
|
||||
|
@ -33,16 +33,12 @@ public class SysPermissionServiceImpl implements ISysPermissionService
|
|||
* @return 角色权限信息
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getRolePermission(SysUser user)
|
||||
{
|
||||
public Set<String> getRolePermission(SysUser user) {
|
||||
Set<String> roles = new HashSet<String>();
|
||||
// 管理员拥有所有权限
|
||||
if (user.isAdmin())
|
||||
{
|
||||
if (user.isAdmin()) {
|
||||
roles.add("admin");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId()));
|
||||
}
|
||||
return roles;
|
||||
|
@ -55,29 +51,21 @@ public class SysPermissionServiceImpl implements ISysPermissionService
|
|||
* @return 菜单权限信息
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getMenuPermission(SysUser user)
|
||||
{
|
||||
public Set<String> getMenuPermission(SysUser user) {
|
||||
Set<String> perms = new HashSet<String>();
|
||||
// 管理员拥有所有权限
|
||||
if (user.isAdmin())
|
||||
{
|
||||
if (user.isAdmin()) {
|
||||
perms.add("*:*:*");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
List<SysRole> roles = user.getRoles();
|
||||
if (!CollectionUtils.isEmpty(roles))
|
||||
{
|
||||
if (!CollectionUtils.isEmpty(roles)) {
|
||||
// 多角色设置permissions属性,以便数据权限匹配权限
|
||||
for (SysRole role : roles)
|
||||
{
|
||||
for (SysRole role : roles) {
|
||||
Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId());
|
||||
role.setPermissions(rolePerms);
|
||||
perms.addAll(rolePerms);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,8 +18,7 @@ import java.util.List;
|
|||
* @author health
|
||||
*/
|
||||
@Service
|
||||
public class SysPostServiceImpl implements ISysPostService
|
||||
{
|
||||
public class SysPostServiceImpl implements ISysPostService {
|
||||
@Autowired
|
||||
private SysPostMapper postMapper;
|
||||
|
||||
|
@ -33,8 +32,7 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
* @return 岗位信息集合
|
||||
*/
|
||||
@Override
|
||||
public List<SysPost> selectPostList(SysPost post)
|
||||
{
|
||||
public List<SysPost> selectPostList(SysPost post) {
|
||||
return postMapper.selectPostList(post);
|
||||
}
|
||||
|
||||
|
@ -44,8 +42,7 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
* @return 岗位列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysPost> selectPostAll()
|
||||
{
|
||||
public List<SysPost> selectPostAll() {
|
||||
return postMapper.selectPostAll();
|
||||
}
|
||||
|
||||
|
@ -56,8 +53,7 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
* @return 角色对象信息
|
||||
*/
|
||||
@Override
|
||||
public SysPost selectPostById(Long postId)
|
||||
{
|
||||
public SysPost selectPostById(Long postId) {
|
||||
return postMapper.selectPostById(postId);
|
||||
}
|
||||
|
||||
|
@ -68,8 +64,7 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
* @return 选中岗位ID列表
|
||||
*/
|
||||
@Override
|
||||
public List<Long> selectPostListByUserId(Long userId)
|
||||
{
|
||||
public List<Long> selectPostListByUserId(Long userId) {
|
||||
return postMapper.selectPostListByUserId(userId);
|
||||
}
|
||||
|
||||
|
@ -80,12 +75,10 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkPostNameUnique(SysPost post)
|
||||
{
|
||||
public boolean checkPostNameUnique(SysPost post) {
|
||||
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||
SysPost info = postMapper.checkPostNameUnique(post.getPostName());
|
||||
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
|
||||
{
|
||||
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
|
@ -98,12 +91,10 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkPostCodeUnique(SysPost post)
|
||||
{
|
||||
public boolean checkPostCodeUnique(SysPost post) {
|
||||
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||
SysPost info = postMapper.checkPostCodeUnique(post.getPostCode());
|
||||
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
|
||||
{
|
||||
if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
|
@ -116,8 +107,7 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int countUserPostById(Long postId)
|
||||
{
|
||||
public int countUserPostById(Long postId) {
|
||||
return userPostMapper.countUserPostById(postId);
|
||||
}
|
||||
|
||||
|
@ -128,8 +118,7 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePostById(Long postId)
|
||||
{
|
||||
public int deletePostById(Long postId) {
|
||||
return postMapper.deletePostById(postId);
|
||||
}
|
||||
|
||||
|
@ -140,13 +129,10 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePostByIds(Long[] postIds)
|
||||
{
|
||||
for (Long postId : postIds)
|
||||
{
|
||||
public int deletePostByIds(Long[] postIds) {
|
||||
for (Long postId : postIds) {
|
||||
SysPost post = selectPostById(postId);
|
||||
if (countUserPostById(postId) > 0)
|
||||
{
|
||||
if (countUserPostById(postId) > 0) {
|
||||
throw new ServiceException(String.format("%1$s已分配,不能删除", post.getPostName()));
|
||||
}
|
||||
}
|
||||
|
@ -160,8 +146,7 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPost(SysPost post)
|
||||
{
|
||||
public int insertPost(SysPost post) {
|
||||
return postMapper.insertPost(post);
|
||||
}
|
||||
|
||||
|
@ -172,8 +157,7 @@ public class SysPostServiceImpl implements ISysPostService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updatePost(SysPost post)
|
||||
{
|
||||
public int updatePost(SysPost post) {
|
||||
return postMapper.updatePost(post);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,7 @@ import java.util.*;
|
|||
* @author health
|
||||
*/
|
||||
@Service
|
||||
public class SysRoleServiceImpl implements ISysRoleService
|
||||
{
|
||||
public class SysRoleServiceImpl implements ISysRoleService {
|
||||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
|
||||
|
@ -46,8 +45,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "d")
|
||||
public List<SysRole> selectRoleList(SysRole role)
|
||||
{
|
||||
public List<SysRole> selectRoleList(SysRole role) {
|
||||
return roleMapper.selectRoleList(role);
|
||||
}
|
||||
|
||||
|
@ -58,16 +56,12 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
* @return 角色列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysRole> selectRolesByUserId(Long userId)
|
||||
{
|
||||
public List<SysRole> selectRolesByUserId(Long userId) {
|
||||
List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId);
|
||||
List<SysRole> roles = selectRoleAll();
|
||||
for (SysRole role : roles)
|
||||
{
|
||||
for (SysRole userRole : userRoles)
|
||||
{
|
||||
if (role.getRoleId().longValue() == userRole.getRoleId().longValue())
|
||||
{
|
||||
for (SysRole role : roles) {
|
||||
for (SysRole userRole : userRoles) {
|
||||
if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) {
|
||||
role.setFlag(true);
|
||||
break;
|
||||
}
|
||||
|
@ -83,14 +77,11 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
* @return 权限列表
|
||||
*/
|
||||
@Override
|
||||
public Set<String> selectRolePermissionByUserId(Long userId)
|
||||
{
|
||||
public Set<String> selectRolePermissionByUserId(Long userId) {
|
||||
List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId);
|
||||
Set<String> permsSet = new HashSet<>();
|
||||
for (SysRole perm : perms)
|
||||
{
|
||||
if (StringUtils.isNotNull(perm))
|
||||
{
|
||||
for (SysRole perm : perms) {
|
||||
if (StringUtils.isNotNull(perm)) {
|
||||
permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
|
||||
}
|
||||
}
|
||||
|
@ -103,8 +94,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
* @return 角色列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysRole> selectRoleAll()
|
||||
{
|
||||
public List<SysRole> selectRoleAll() {
|
||||
return SpringUtils.getAopProxy(this).selectRoleList(new SysRole());
|
||||
}
|
||||
|
||||
|
@ -115,8 +105,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
* @return 选中角色ID列表
|
||||
*/
|
||||
@Override
|
||||
public List<Long> selectRoleListByUserId(Long userId)
|
||||
{
|
||||
public List<Long> selectRoleListByUserId(Long userId) {
|
||||
return roleMapper.selectRoleListByUserId(userId);
|
||||
}
|
||||
|
||||
|
@ -127,8 +116,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
* @return 角色对象信息
|
||||
*/
|
||||
@Override
|
||||
public SysRole selectRoleById(Long roleId)
|
||||
{
|
||||
public SysRole selectRoleById(Long roleId) {
|
||||
return roleMapper.selectRoleById(roleId);
|
||||
}
|
||||
|
||||
|
@ -139,12 +127,10 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkRoleNameUnique(SysRole role)
|
||||
{
|
||||
public boolean checkRoleNameUnique(SysRole role) {
|
||||
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||
SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
|
||||
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
|
||||
{
|
||||
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
|
@ -157,12 +143,10 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkRoleKeyUnique(SysRole role)
|
||||
{
|
||||
public boolean checkRoleKeyUnique(SysRole role) {
|
||||
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||
SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
|
||||
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
|
||||
{
|
||||
if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
|
@ -174,10 +158,8 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
* @param role 角色信息
|
||||
*/
|
||||
@Override
|
||||
public void checkRoleAllowed(SysRole role)
|
||||
{
|
||||
if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin())
|
||||
{
|
||||
public void checkRoleAllowed(SysRole role) {
|
||||
if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) {
|
||||
throw new ServiceException("不允许操作超级管理员角色");
|
||||
}
|
||||
}
|
||||
|
@ -188,15 +170,12 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
* @param roleId 角色id
|
||||
*/
|
||||
@Override
|
||||
public void checkRoleDataScope(Long roleId)
|
||||
{
|
||||
if (!SysUser.isAdmin(SecurityUtils.getUserId()))
|
||||
{
|
||||
public void checkRoleDataScope(Long roleId) {
|
||||
if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
|
||||
SysRole role = new SysRole();
|
||||
role.setRoleId(roleId);
|
||||
List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role);
|
||||
if (StringUtils.isEmpty(roles))
|
||||
{
|
||||
if (StringUtils.isEmpty(roles)) {
|
||||
throw new ServiceException("没有权限访问角色数据!");
|
||||
}
|
||||
}
|
||||
|
@ -209,8 +188,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int countUserRoleByRoleId(Long roleId)
|
||||
{
|
||||
public int countUserRoleByRoleId(Long roleId) {
|
||||
return userRoleMapper.countUserRoleByRoleId(roleId);
|
||||
}
|
||||
|
||||
|
@ -222,8 +200,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertRole(SysRole role)
|
||||
{
|
||||
public int insertRole(SysRole role) {
|
||||
// 新增角色信息
|
||||
roleMapper.insertRole(role);
|
||||
return insertRoleMenu(role);
|
||||
|
@ -237,8 +214,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateRole(SysRole role)
|
||||
{
|
||||
public int updateRole(SysRole role) {
|
||||
// 修改角色信息
|
||||
roleMapper.updateRole(role);
|
||||
// 删除角色与菜单关联
|
||||
|
@ -253,8 +229,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRoleStatus(SysRole role)
|
||||
{
|
||||
public int updateRoleStatus(SysRole role) {
|
||||
return roleMapper.updateRole(role);
|
||||
}
|
||||
|
||||
|
@ -266,8 +241,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int authDataScope(SysRole role)
|
||||
{
|
||||
public int authDataScope(SysRole role) {
|
||||
// 修改角色信息
|
||||
roleMapper.updateRole(role);
|
||||
// 删除角色与部门关联
|
||||
|
@ -281,20 +255,17 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
*
|
||||
* @param role 角色对象
|
||||
*/
|
||||
public int insertRoleMenu(SysRole role)
|
||||
{
|
||||
public int insertRoleMenu(SysRole role) {
|
||||
int rows = 1;
|
||||
// 新增用户与角色管理
|
||||
List<SysRoleMenu> list = new ArrayList<SysRoleMenu>();
|
||||
for (Long menuId : role.getMenuIds())
|
||||
{
|
||||
for (Long menuId : role.getMenuIds()) {
|
||||
SysRoleMenu rm = new SysRoleMenu();
|
||||
rm.setRoleId(role.getRoleId());
|
||||
rm.setMenuId(menuId);
|
||||
list.add(rm);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
if (list.size() > 0) {
|
||||
rows = roleMenuMapper.batchRoleMenu(list);
|
||||
}
|
||||
return rows;
|
||||
|
@ -305,20 +276,17 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
*
|
||||
* @param role 角色对象
|
||||
*/
|
||||
public int insertRoleDept(SysRole role)
|
||||
{
|
||||
public int insertRoleDept(SysRole role) {
|
||||
int rows = 1;
|
||||
// 新增角色与部门(数据权限)管理
|
||||
List<SysRoleDept> list = new ArrayList<SysRoleDept>();
|
||||
for (Long deptId : role.getDeptIds())
|
||||
{
|
||||
for (Long deptId : role.getDeptIds()) {
|
||||
SysRoleDept rd = new SysRoleDept();
|
||||
rd.setRoleId(role.getRoleId());
|
||||
rd.setDeptId(deptId);
|
||||
list.add(rd);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
if (list.size() > 0) {
|
||||
rows = roleDeptMapper.batchRoleDept(list);
|
||||
}
|
||||
return rows;
|
||||
|
@ -332,8 +300,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteRoleById(Long roleId)
|
||||
{
|
||||
public int deleteRoleById(Long roleId) {
|
||||
// 删除角色与菜单关联
|
||||
roleMenuMapper.deleteRoleMenuByRoleId(roleId);
|
||||
// 删除角色与部门关联
|
||||
|
@ -349,15 +316,12 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteRoleByIds(Long[] roleIds)
|
||||
{
|
||||
for (Long roleId : roleIds)
|
||||
{
|
||||
public int deleteRoleByIds(Long[] roleIds) {
|
||||
for (Long roleId : roleIds) {
|
||||
checkRoleAllowed(new SysRole(roleId));
|
||||
checkRoleDataScope(roleId);
|
||||
SysRole role = selectRoleById(roleId);
|
||||
if (countUserRoleByRoleId(roleId) > 0)
|
||||
{
|
||||
if (countUserRoleByRoleId(roleId) > 0) {
|
||||
throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
|
||||
}
|
||||
}
|
||||
|
@ -375,38 +339,34 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAuthUser(SysUserRole userRole)
|
||||
{
|
||||
public int deleteAuthUser(SysUserRole userRole) {
|
||||
return userRoleMapper.deleteUserRoleInfo(userRole);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量取消授权用户角色
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param roleId 角色ID
|
||||
* @param userIds 需要取消授权的用户数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAuthUsers(Long roleId, Long[] userIds)
|
||||
{
|
||||
public int deleteAuthUsers(Long roleId, Long[] userIds) {
|
||||
return userRoleMapper.deleteUserRoleInfos(roleId, userIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量选择授权用户角色
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param roleId 角色ID
|
||||
* @param userIds 需要授权的用户数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAuthUsers(Long roleId, Long[] userIds)
|
||||
{
|
||||
public int insertAuthUsers(Long roleId, Long[] userIds) {
|
||||
// 新增用户与角色管理
|
||||
List<SysUserRole> list = new ArrayList<SysUserRole>();
|
||||
for (Long userId : userIds)
|
||||
{
|
||||
for (Long userId : userIds) {
|
||||
SysUserRole ur = new SysUserRole();
|
||||
ur.setUserId(userId);
|
||||
ur.setRoleId(roleId);
|
||||
|
|
|
@ -12,20 +12,17 @@ import org.springframework.stereotype.Service;
|
|||
* @author health
|
||||
*/
|
||||
@Service
|
||||
public class SysUserOnlineServiceImpl implements ISysUserOnlineService
|
||||
{
|
||||
public class SysUserOnlineServiceImpl implements ISysUserOnlineService {
|
||||
/**
|
||||
* 通过登录地址查询信息
|
||||
*
|
||||
* @param ipaddr 登录地址
|
||||
* @param user 用户信息
|
||||
* @param user 用户信息
|
||||
* @return 在线用户信息
|
||||
*/
|
||||
@Override
|
||||
public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user)
|
||||
{
|
||||
if (StringUtils.equals(ipaddr, user.getIpaddr()))
|
||||
{
|
||||
public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) {
|
||||
if (StringUtils.equals(ipaddr, user.getIpaddr())) {
|
||||
return loginUserToUserOnline(user);
|
||||
}
|
||||
return null;
|
||||
|
@ -35,14 +32,12 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService
|
|||
* 通过用户名称查询信息
|
||||
*
|
||||
* @param userName 用户名称
|
||||
* @param user 用户信息
|
||||
* @param user 用户信息
|
||||
* @return 在线用户信息
|
||||
*/
|
||||
@Override
|
||||
public SysUserOnline selectOnlineByUserName(String userName, LoginUser user)
|
||||
{
|
||||
if (StringUtils.equals(userName, user.getUsername()))
|
||||
{
|
||||
public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) {
|
||||
if (StringUtils.equals(userName, user.getUsername())) {
|
||||
return loginUserToUserOnline(user);
|
||||
}
|
||||
return null;
|
||||
|
@ -51,16 +46,14 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService
|
|||
/**
|
||||
* 通过登录地址/用户名称查询信息
|
||||
*
|
||||
* @param ipaddr 登录地址
|
||||
* @param ipaddr 登录地址
|
||||
* @param userName 用户名称
|
||||
* @param user 用户信息
|
||||
* @param user 用户信息
|
||||
* @return 在线用户信息
|
||||
*/
|
||||
@Override
|
||||
public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user)
|
||||
{
|
||||
if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername()))
|
||||
{
|
||||
public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) {
|
||||
if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) {
|
||||
return loginUserToUserOnline(user);
|
||||
}
|
||||
return null;
|
||||
|
@ -73,10 +66,8 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService
|
|||
* @return 在线用户
|
||||
*/
|
||||
@Override
|
||||
public SysUserOnline loginUserToUserOnline(LoginUser user)
|
||||
{
|
||||
if (StringUtils.isNull(user))
|
||||
{
|
||||
public SysUserOnline loginUserToUserOnline(LoginUser user) {
|
||||
if (StringUtils.isNull(user)) {
|
||||
return null;
|
||||
}
|
||||
SysUserOnline sysUserOnline = new SysUserOnline();
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package com.health.system.server.service.impl;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.health.common.core.constant.UserConstants;
|
||||
import com.health.common.core.domain.Result;
|
||||
import com.health.common.core.exception.ServiceException;
|
||||
import com.health.common.core.utils.SpringUtils;
|
||||
import com.health.common.core.utils.StringUtils;
|
||||
|
@ -13,21 +11,13 @@ import com.health.system.common.domain.*;
|
|||
import com.health.system.server.mapper.*;
|
||||
import com.health.system.server.service.ISysConfigService;
|
||||
import com.health.system.server.service.ISysUserService;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.commons.lang3.RandomUtils;
|
||||
import org.bouncycastle.pqc.math.linearalgebra.RandUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
import org.springframework.mail.javamail.MimeMessageHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import javax.validation.Validator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -43,10 +33,6 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private RedisTemplate<String,String> redisTemplate;
|
||||
@Autowired
|
||||
private JavaMailSender javaMailSender;
|
||||
@Autowired
|
||||
private SysUserMapper userMapper;
|
||||
|
||||
|
@ -266,7 +252,7 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
// 新增用户信息
|
||||
int rows = userMapper.insertUser(user);
|
||||
// 新增用户岗位关联
|
||||
// insertUserPost(user);
|
||||
insertUserPost(user);
|
||||
// 新增用户与角色管理
|
||||
insertUserRole(user);
|
||||
return rows;
|
||||
|
@ -281,7 +267,6 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
@Override
|
||||
public boolean registerUser(SysUser user)
|
||||
{
|
||||
|
||||
return userMapper.insertUser(user) > 0;
|
||||
}
|
||||
|
||||
|
@ -303,7 +288,7 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
// 删除用户与岗位关联
|
||||
userPostMapper.deleteUserPostByUserId(userId);
|
||||
// 新增用户与岗位管理
|
||||
// insertUserPost(user);
|
||||
insertUserPost(user);
|
||||
return userMapper.updateUser(user);
|
||||
}
|
||||
|
||||
|
@ -390,7 +375,7 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
*/
|
||||
public void insertUserRole(SysUser user)
|
||||
{
|
||||
this.insertUserRole(user);
|
||||
this.insertUserRole(user.getUserId(), user.getRoleIds());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -398,11 +383,6 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
*
|
||||
* @param user 用户对象
|
||||
*/
|
||||
// public void insertUserPost(SysUser user){
|
||||
// Long deptId = user.getDeptId();
|
||||
// user.getUserId();
|
||||
// userPostMapper.addUserPost(userId,departmentId);
|
||||
// }
|
||||
public void insertUserPost(SysUser user)
|
||||
{
|
||||
Long[] posts = user.getPostIds();
|
||||
|
@ -555,45 +535,4 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
return successMsg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean registerNewUser(User user) {
|
||||
Long roleId = user.getRoleId();
|
||||
String code = user.getCode();
|
||||
String emailCode = redisTemplate.opsForValue().get(user.getEmailCount());
|
||||
if (StringUtils.isNull(emailCode)){
|
||||
return false;
|
||||
}
|
||||
if (!code.equals(emailCode)){
|
||||
return false;
|
||||
}
|
||||
//如果roleId==1证明是注册医生
|
||||
if (roleId==1){
|
||||
|
||||
return userMapper.registerNewDoctor(user)>0;
|
||||
}
|
||||
//注册患者
|
||||
if (roleId==2){
|
||||
return userMapper.registerNewPatient(user)>0;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getEmailCode(String emailCount) {
|
||||
String emailCode = RandomUtil.randomNumbers(4);
|
||||
MimeMessage mimeMessage = javaMailSender.createMimeMessage();
|
||||
try {
|
||||
MimeMessageHelper mimeMessageHelper = new MimeMessageHelper(mimeMessage, true);
|
||||
mimeMessageHelper.setFrom("371894675@qq.com");
|
||||
mimeMessageHelper.setTo(emailCount);
|
||||
mimeMessageHelper.setSubject("邮箱验证码");
|
||||
mimeMessageHelper.setText("验证码为:"+emailCode);
|
||||
|
||||
} catch (MessagingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
redisTemplate.opsForValue().set(emailCount,emailCode);
|
||||
return Result.success(emailCode,"邮箱验证码发送成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="./logs/health-system" />
|
||||
<property name="log.path" value="logs/health-system" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysConfigMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysConfig" id="SysConfigResult">
|
||||
<resultMap type="SysConfig" id="SysConfigResult">
|
||||
<id property="configId" column="config_id" />
|
||||
<result property="configName" column="config_name" />
|
||||
<result property="configKey" column="config_key" />
|
||||
|
@ -33,12 +33,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="selectConfig" parameterType="com.health.system.common.domain.SysConfig" resultMap="SysConfigResult">
|
||||
<select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<include refid="sqlwhereSearch"/>
|
||||
</select>
|
||||
|
||||
<select id="selectConfigList" parameterType="com.health.system.common.domain.SysConfig" resultMap="SysConfigResult">
|
||||
<select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<where>
|
||||
<if test="configName != null and configName != ''">
|
||||
|
@ -69,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where config_key = #{configKey} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertConfig" parameterType="com.health.system.common.domain.SysConfig">
|
||||
<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>
|
||||
|
@ -89,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateConfig" parameterType="com.health.system.common.domain.SysConfig">
|
||||
<update id="updateConfig" parameterType="SysConfig">
|
||||
update sys_config
|
||||
<set>
|
||||
<if test="configName != null and configName != ''">config_name = #{configName},</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysDeptMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysDept" id="SysDeptResult">
|
||||
<resultMap type="SysDept" id="SysDeptResult">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_dept d
|
||||
</sql>
|
||||
|
||||
<select id="selectDeptList" parameterType="com.health.system.common.domain.SysDept" resultMap="SysDeptResult">
|
||||
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0'
|
||||
<if test="deptId != null and deptId != 0">
|
||||
|
@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="com.health.system.common.domain.SysDept">
|
||||
<insert id="insertDept" parameterType="SysDept">
|
||||
insert into sys_dept(
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
|
@ -113,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDept" parameterType="com.health.system.common.domain.SysDept">
|
||||
<update id="updateDept" parameterType="SysDept">
|
||||
update sys_dept
|
||||
<set>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysDictDataMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysDictData" id="SysDictDataResult">
|
||||
<resultMap type="SysDictData" id="SysDictDataResult">
|
||||
<id property="dictCode" column="dict_code" />
|
||||
<result property="dictSort" column="dict_sort" />
|
||||
<result property="dictLabel" column="dict_label" />
|
||||
|
@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_dict_data
|
||||
</sql>
|
||||
|
||||
<select id="selectDictDataList" parameterType="com.health.system.common.domain.SysDictData" resultMap="SysDictDataResult">
|
||||
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
<where>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
|
@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by dict_sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectDictDataByType" parameterType="com.health.system.common.domain.SysDictData" resultMap="SysDictDataResult">
|
||||
<select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where status = '0' and dict_type = #{dictType} order by dict_sort asc
|
||||
</select>
|
||||
|
@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictData" parameterType="com.health.system.common.domain.SysDictData">
|
||||
<update id="updateDictData" parameterType="SysDictData">
|
||||
update sys_dict_data
|
||||
<set>
|
||||
<if test="dictSort != null">dict_sort = #{dictSort},</if>
|
||||
|
@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictData" parameterType="com.health.system.common.domain.SysDictData">
|
||||
<insert id="insertDictData" parameterType="SysDictData">
|
||||
insert into sys_dict_data(
|
||||
<if test="dictSort != null">dict_sort,</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysDictTypeMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysDictType" id="SysDictTypeResult">
|
||||
<resultMap type="SysDictType" id="SysDictTypeResult">
|
||||
<id property="dictId" column="dict_id" />
|
||||
<result property="dictName" column="dict_name" />
|
||||
<result property="dictType" column="dict_type" />
|
||||
|
@ -20,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_dict_type
|
||||
</sql>
|
||||
|
||||
<select id="selectDictTypeList" parameterType="com.health.system.common.domain.SysDictType" resultMap="SysDictTypeResult">
|
||||
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
<where>
|
||||
<if test="dictName != null and dictName != ''">
|
||||
|
@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictType" parameterType="com.health.system.common.domain.SysDictType">
|
||||
<update id="updateDictType" parameterType="SysDictType">
|
||||
update sys_dict_type
|
||||
<set>
|
||||
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
|
||||
|
@ -84,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where dict_id = #{dictId}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictType" parameterType="com.health.system.common.domain.SysDictType">
|
||||
<insert id="insertDictType" parameterType="SysDictType">
|
||||
insert into sys_dict_type(
|
||||
<if test="dictName != null and dictName != ''">dict_name,</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysLogininforMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysLogininfor" id="SysLogininforResult">
|
||||
<resultMap type="SysLogininfor" id="SysLogininforResult">
|
||||
<id property="infoId" column="info_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="status" column="status" />
|
||||
|
@ -13,12 +13,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="accessTime" column="access_time" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertLogininfor" parameterType="com.health.system.common.domain.SysLogininfor">
|
||||
<insert id="insertLogininfor" parameterType="SysLogininfor">
|
||||
insert into sys_logininfor (user_name, status, ipaddr, msg, access_time)
|
||||
values (#{userName}, #{status}, #{ipaddr}, #{msg}, sysdate())
|
||||
</insert>
|
||||
|
||||
<select id="selectLogininforList" parameterType="com.health.system.common.domain.SysLogininfor" resultMap="SysLogininforResult">
|
||||
<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
|
||||
select info_id, user_name, ipaddr, status, msg, access_time from sys_logininfor
|
||||
<where>
|
||||
<if test="ipaddr != null and ipaddr != ''">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysMenuMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysMenu" id="SysMenuResult">
|
||||
<resultMap type="SysMenu" id="SysMenuResult">
|
||||
<id property="menuId" column="menu_id" />
|
||||
<result property="menuName" column="menu_name" />
|
||||
<result property="parentName" column="parent_name" />
|
||||
|
@ -32,7 +32,7 @@
|
|||
from sys_menu
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuList" parameterType="com.health.system.common.domain.SysMenu" resultMap="SysMenuResult">
|
||||
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
<where>
|
||||
<if test="menuName != null and menuName != ''">
|
||||
|
@ -54,7 +54,7 @@
|
|||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByUserId" parameterType="com.health.system.common.domain.SysMenu" resultMap="SysMenuResult">
|
||||
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, 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
|
||||
|
@ -127,12 +127,12 @@
|
|||
select count(1) from sys_menu where parent_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<select id="checkMenuNameUnique" parameterType="com.health.system.common.domain.SysMenu" resultMap="SysMenuResult">
|
||||
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateMenu" parameterType="com.health.system.common.domain.SysMenu">
|
||||
<update id="updateMenu" parameterType="SysMenu">
|
||||
update sys_menu
|
||||
<set>
|
||||
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
|
||||
|
@ -155,7 +155,7 @@
|
|||
where menu_id = #{menuId}
|
||||
</update>
|
||||
|
||||
<insert id="insertMenu" parameterType="com.health.system.common.domain.SysMenu">
|
||||
<insert id="insertMenu" parameterType="SysMenu">
|
||||
insert into sys_menu(
|
||||
<if test="menuId != null and menuId != 0">menu_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysNoticeMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysNotice" id="SysNoticeResult">
|
||||
<resultMap type="SysNotice" id="SysNoticeResult">
|
||||
<result property="noticeId" column="notice_id" />
|
||||
<result property="noticeTitle" column="notice_title" />
|
||||
<result property="noticeType" column="notice_type" />
|
||||
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where notice_id = #{noticeId}
|
||||
</select>
|
||||
|
||||
<select id="selectNoticeList" parameterType="com.health.system.common.domain.SysNotice" resultMap="SysNoticeResult">
|
||||
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
||||
<include refid="selectNoticeVo"/>
|
||||
<where>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">
|
||||
|
@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertNotice" parameterType="com.health.system.common.domain.SysNotice">
|
||||
<insert id="insertNotice" parameterType="SysNotice">
|
||||
insert into sys_notice (
|
||||
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
||||
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
||||
|
@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateNotice" parameterType="com.health.system.common.domain.SysNotice">
|
||||
<update id="updateNotice" parameterType="SysNotice">
|
||||
update sys_notice
|
||||
<set>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysOperLogMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysOperLog" id="SysOperLogResult">
|
||||
<resultMap type="SysOperLog" id="SysOperLogResult">
|
||||
<id property="operId" column="oper_id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="businessType" column="business_type" />
|
||||
|
@ -28,12 +28,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_oper_log
|
||||
</sql>
|
||||
|
||||
<insert id="insertOperlog" parameterType="com.health.system.common.domain.SysOperLog">
|
||||
<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_param, json_result, status, error_msg, cost_time, oper_time)
|
||||
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate())
|
||||
</insert>
|
||||
|
||||
<select id="selectOperLogList" parameterType="com.health.system.common.domain.SysOperLog" resultMap="SysOperLogResult">
|
||||
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
|
||||
<include refid="selectOperLogVo"/>
|
||||
<where>
|
||||
<if test="operIp != null and operIp != ''">
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysPostMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysPost" id="SysPostResult">
|
||||
<resultMap type="SysPost" id="SysPostResult">
|
||||
<id property="postId" column="post_id" />
|
||||
<result property="postCode" column="post_code" />
|
||||
<result property="postName" column="post_name" />
|
||||
|
@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_post
|
||||
</sql>
|
||||
|
||||
<select id="selectPostList" parameterType="com.health.system.common.domain.SysPost" resultMap="SysPostResult">
|
||||
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
<where>
|
||||
<if test="postCode != null and postCode != ''">
|
||||
|
@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where post_code=#{postCode} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updatePost" parameterType="com.health.system.common.domain.SysPost">
|
||||
<update id="updatePost" parameterType="SysPost">
|
||||
update sys_post
|
||||
<set>
|
||||
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
||||
|
@ -86,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where post_id = #{postId}
|
||||
</update>
|
||||
|
||||
<insert id="insertPost" parameterType="com.health.system.common.domain.SysPost" useGeneratedKeys="true" keyProperty="postId">
|
||||
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
|
||||
insert into sys_post(
|
||||
<if test="postId != null and postId != 0">post_id,</if>
|
||||
<if test="postCode != null and postCode != ''">post_code,</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysRoleDeptMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysRoleDept" id="SysRoleDeptResult">
|
||||
<resultMap type="SysRoleDept" id="SysRoleDeptResult">
|
||||
<result property="roleId" column="role_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
</resultMap>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysRoleMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysRole" id="SysRoleResult">
|
||||
<resultMap type="SysRole" id="SysRoleResult">
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
|
@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectRoleList" parameterType="com.health.system.common.domain.SysRole" resultMap="SysRoleResult">
|
||||
<select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.del_flag = '0'
|
||||
<if test="roleId != null and roleId != 0">
|
||||
|
@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertRole" parameterType="com.health.system.common.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||
insert into sys_role(
|
||||
<if test="roleId != null and roleId != 0">role_id,</if>
|
||||
<if test="roleName != null and roleName != ''">role_name,</if>
|
||||
|
@ -121,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateRole" parameterType="com.health.system.common.domain.SysRole">
|
||||
<update id="updateRole" parameterType="SysRole">
|
||||
update sys_role
|
||||
<set>
|
||||
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysRoleMenuMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysRoleMenu" id="SysRoleMenuResult">
|
||||
<resultMap type="SysRoleMenu" id="SysRoleMenuResult">
|
||||
<result property="roleId" column="role_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
</resultMap>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysUserMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysUser" id="SysUserResult">
|
||||
<resultMap type="SysUser" id="SysUserResult">
|
||||
<id property="userId" column="user_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
|
@ -23,11 +23,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<association property="dept" javaType="com.health.system.common.domain.SysDept" resultMap="deptResult" />
|
||||
<association property="dept" javaType="SysDept" resultMap="deptResult" />
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="deptResult" type="com.health.system.common.domain.SysDept">
|
||||
<resultMap id="deptResult" type="SysDept">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
|
@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="status" column="dept_status" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="RoleResult" type="com.health.system.common.domain.SysRole">
|
||||
<resultMap id="RoleResult" type="SysRole">
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
|
@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join sys_role r on r.role_id = ur.role_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="com.health.system.common.domain.SysUser" resultMap="SysUserResult">
|
||||
<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.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'
|
||||
|
@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedList" parameterType="com.health.system.common.domain.SysUser" resultMap="SysUserResult">
|
||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
|
@ -102,7 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" parameterType="com.health.system.common.domain.SysUser" resultMap="SysUserResult">
|
||||
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
|
@ -142,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="com.health.system.common.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
|
@ -173,79 +173,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
<!--增加用户角色关联-->
|
||||
<insert id="insertUserRole">
|
||||
insert into tb_user_role values (#{userId},#{roleId})
|
||||
</insert>
|
||||
<!--新增user方法-->
|
||||
<insert id="registerNewUser">
|
||||
insert into
|
||||
</insert>
|
||||
<insert id="registerNewDoctor">
|
||||
insert into t_doctor(
|
||||
<if test="userName!=null and userName!=''">
|
||||
user_name,
|
||||
</if>
|
||||
<if test="deptId!=null">
|
||||
dept_id,
|
||||
</if>
|
||||
<if test="titleId!=null">
|
||||
title_id,
|
||||
</if>
|
||||
<if test="hospitalName!=null and hospitalName!=''">
|
||||
hospital_name,
|
||||
</if>
|
||||
<if test="emailCount!=null and emailCount!=''">
|
||||
email_count,
|
||||
</if>
|
||||
<if test="password!=null and password!=''">
|
||||
doctor_pwd,
|
||||
</if>
|
||||
<if test="userIntroduce!=null and userIntroduce!=''">
|
||||
doctor_introduce,
|
||||
</if>
|
||||
<if test="skilledArea!=null and skilledArea!=''">
|
||||
skill_area,
|
||||
</if>
|
||||
<if test="status!=null">
|
||||
status,
|
||||
</if>
|
||||
)
|
||||
values
|
||||
(
|
||||
<if test="userName!=null and userName!=''">
|
||||
#{userName},
|
||||
</if>
|
||||
<if test="departmentId!=null">
|
||||
#{departmentId},
|
||||
</if>
|
||||
<if test="titleId!=null">
|
||||
#{titleId},
|
||||
</if>
|
||||
<if test="hospitalName!=null and hospitalName!=''">
|
||||
#{hospitalName},
|
||||
</if>
|
||||
<if test="emailCount!=null and emailCount!=''">
|
||||
#{emailCount},
|
||||
</if>
|
||||
<if test="password!=null and password!=''">
|
||||
#{password},
|
||||
</if>
|
||||
<if test="userIntroduce!=null and userIntroduce!=''">
|
||||
#{userIntroduce},
|
||||
</if>
|
||||
<if test="skilledArea!=null and skilledArea!=''">
|
||||
#{skilledArea},
|
||||
</if>
|
||||
<if test="status!=null">
|
||||
#{status}
|
||||
</if>
|
||||
)
|
||||
</insert>
|
||||
<!--新增患者信息-->
|
||||
<insert id="registerNewPatient"></insert>
|
||||
|
||||
<update id="updateUser" parameterType="com.health.system.common.domain.SysUser">
|
||||
<update id="updateUser" parameterType="SysUser">
|
||||
update sys_user
|
||||
<set>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
|
@ -266,15 +195,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserStatus" parameterType="com.health.system.common.domain.SysUser">
|
||||
<update id="updateUserStatus" parameterType="SysUser">
|
||||
update sys_user set status = #{status} where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserAvatar" parameterType="com.health.system.common.domain.SysUser">
|
||||
<update id="updateUserAvatar" parameterType="SysUser">
|
||||
update sys_user set avatar = #{avatar} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
<update id="resetUserPwd" parameterType="com.health.system.common.domain.SysUser">
|
||||
<update id="resetUserPwd" parameterType="SysUser">
|
||||
update sys_user set password = #{password} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysUserPostMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysUserPost" id="SysUserPostResult">
|
||||
<resultMap type="SysUserPost" id="SysUserPostResult">
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="postId" column="post_id" />
|
||||
</resultMap>
|
||||
|
@ -30,8 +30,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
(#{item.userId},#{item.postId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="addUserPost">
|
||||
insert into
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.health.system.server.mapper.SysUserRoleMapper">
|
||||
|
||||
<resultMap type="com.health.system.common.domain.SysUserRole" id="SysUserRoleResult">
|
||||
<resultMap type="SysUserRole" id="SysUserRoleResult">
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="roleId" column="role_id" />
|
||||
</resultMap>
|
||||
|
@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteUserRoleInfo" parameterType="com.health.system.common.domain.SysUserRole">
|
||||
<delete id="deleteUserRoleInfo" parameterType="SysUserRole">
|
||||
delete from sys_user_role where user_id=#{userId} and role_id=#{roleId}
|
||||
</delete>
|
||||
|
||||
|
|
Loading…
Reference in New Issue