This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
k18-ntcs-web-argus-service/src/main/java/com/nis/domain/SysRole.java
zhangdongxu 13acafd43d 上传代码
2017-12-19 14:55:52 +08:00

132 lines
3.1 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.nis.domain;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import com.google.common.collect.Lists;
public class SysRole extends BaseEntity<SysRole>{
private static final long serialVersionUID = -5388120268433030734L;
private String name;
public String getOldName() {
return oldName;
}
public void setOldName(String oldName) {
this.oldName = oldName;
}
private String oldName; // 原角色名称
private String roleType;
private Integer dataScope;
private String remark;
private List<SysMenu> menuList = Lists.newArrayList(); // 拥有菜单列表
public List<SysMenu> getMenuList() {
return menuList;
}
public void setMenuList(List<SysMenu> menuList) {
this.menuList = menuList;
}
public Integer getDataScope() {
return dataScope;
}
public void setDataScope(Integer dataScope) {
this.dataScope = dataScope;
}
private Integer status;
private Date createTime;
// 数据范围1所有数据2所在公司及以下数据3所在公司数据4所在部门及以下数据5所在部门数据8所在单位及以下数据9所在单位数据
public static final Integer DATA_SCOPE_ALL = 1;
public static final Integer DATA_SCOPE_COMPANY_AND_CHILD = 2;
public static final Integer DATA_SCOPE_COMPANY = 3;
public static final Integer DATA_SCOPE_OFFICE_AND_CHILD = 4;
public static final Integer DATA_SCOPE_OFFICE = 5;
public static final Integer DATA_SCOPE_ENTITY_AND_CHILD = 6;
public static final Integer DATA_SCOPE_ENTITY = 7;
public String getRoleType() {
return roleType;
}
public void setRoleType(String roleType) {
this.roleType = roleType;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public List<Long> getMenuIdList() {
List<Long> menuIdList = Lists.newArrayList();
for (SysMenu menu : menuList) {
menuIdList.add(menu.getId());
}
return menuIdList;
}
public void setMenuIdList(List<String> menuIdList) {
menuList = Lists.newArrayList();
for (String menuId : menuIdList) {
SysMenu menu = new SysMenu();
menu.setId(Long.parseLong(menuId));
menuList.add(menu);
}
}
public String getMenuIds() {
return StringUtils.join(getMenuIdList(), ",");
}
public void setMenuIds(String menuIds) {
menuList = Lists.newArrayList();
if (menuIds != null){
String[] ids = StringUtils.split(menuIds, ",");
setMenuIdList(Lists.newArrayList(ids));
}
}
}