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

138 lines
3.3 KiB
Java
Raw Normal View History

2017-12-29 16:18:40 +08:00
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审核员
*/
2017-12-29 16:18:40 +08:00
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;
2017-12-29 16:18:40 +08:00
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));
}
}
}