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-ntc/src/main/java/com/nis/domain/SysRole.java
2018-03-05 10:39:18 +08:00

139 lines
3.4 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所在省中心数据
* 6所在部门及以下数据7所在部门数据,8:配置员9审核员10审计员
*/
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 static final Integer DATA_SCOPE_CREATOR = 8;
public static final Integer DATA_SCOPE_AUDITOR = 9;
public static final Integer DATA_SCOPE_SHOWER = 10;
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));
}
}
}