修改了用户信息模型
This commit is contained in:
@ -16,132 +16,131 @@ import java.util.Date;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class BaseCacheUser {
|
public class BaseCacheUser {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PKID
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PKID
|
* 姓名
|
||||||
*/
|
*/
|
||||||
private Long userId;
|
private String lastName;
|
||||||
|
/**
|
||||||
|
* 姓氏
|
||||||
|
*/
|
||||||
|
private String firstName;
|
||||||
|
/**
|
||||||
|
* 全名
|
||||||
|
*/
|
||||||
|
private String fullName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 姓名
|
* 电子邮件
|
||||||
*/
|
*/
|
||||||
private String lastName;
|
private String emailAddress;
|
||||||
/**
|
//
|
||||||
*姓氏
|
/**
|
||||||
*/
|
* 用户名
|
||||||
private String firstName;
|
*/
|
||||||
/**
|
private String loginName;
|
||||||
* 全名
|
//
|
||||||
*/
|
/**
|
||||||
private String fullName;
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String mobilePhone;
|
||||||
|
/**
|
||||||
|
* 办公号
|
||||||
|
*/
|
||||||
|
private String officePhone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电子邮件
|
* 性别
|
||||||
*/
|
*/
|
||||||
private String emailAddress;
|
private String sex;
|
||||||
//
|
|
||||||
/**
|
|
||||||
* 用户名
|
|
||||||
*/
|
|
||||||
private String loginName;
|
|
||||||
//
|
|
||||||
/**
|
|
||||||
* 手机号
|
|
||||||
*/
|
|
||||||
private String mobilePhone;
|
|
||||||
/**
|
|
||||||
* 办公号
|
|
||||||
*/
|
|
||||||
private String officePhone;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 性别
|
* 员工类别
|
||||||
*/
|
*/
|
||||||
private String sex;
|
private String employeeCategory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 员工类别
|
* 用户类型
|
||||||
*/
|
*/
|
||||||
private String employeeCategory;
|
private String userType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户类型
|
* 出生日期
|
||||||
*/
|
*/
|
||||||
private String userType;
|
private Date dateOfBirth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出生日期
|
* 年龄
|
||||||
*/
|
*/
|
||||||
private Date dateOfBirth;
|
private Integer age;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 年龄
|
* 员工编号
|
||||||
*/
|
*/
|
||||||
private Integer age;
|
private String employeeNumber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 员工编号
|
* 国籍ID
|
||||||
*/
|
*/
|
||||||
private String employeeNumber;
|
private String nationalityId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国籍ID
|
* 国籍
|
||||||
*/
|
*/
|
||||||
private String nationalityId;
|
private String nationality;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国籍
|
* 身份证号码
|
||||||
*/
|
*/
|
||||||
private String nationality;
|
private String nationalIdentifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 身份证号码
|
* 主管ID
|
||||||
*/
|
*/
|
||||||
private String nationalIdentifier;
|
private Integer supervisorId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主管ID
|
* 组织ID
|
||||||
*/
|
*/
|
||||||
private Integer supervisorId;
|
private String organizationId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组织ID
|
* 组织名称
|
||||||
*/
|
*/
|
||||||
private String organizationId;
|
private String organizationName;
|
||||||
|
//
|
||||||
|
/**
|
||||||
|
* 组织机构类别
|
||||||
|
*/
|
||||||
|
private String orgCategory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组织名称
|
* 部门ID
|
||||||
*/
|
*/
|
||||||
private String organizationName;
|
private String deptId;
|
||||||
//
|
|
||||||
/**
|
|
||||||
* 组织机构类别
|
|
||||||
*/
|
|
||||||
private String orgCategory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门ID
|
* 部门名称
|
||||||
*/
|
*/
|
||||||
private String deptId;
|
private String deptName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门名称
|
* 角色ID
|
||||||
*/
|
*/
|
||||||
private String deptName;
|
private String roleIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色ID
|
* 业务组id
|
||||||
*/
|
*/
|
||||||
private String roleIds;
|
private Integer bussiGroupId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务组id
|
* 职位ID
|
||||||
*/
|
*/
|
||||||
private Integer bussiGroupId;
|
private Integer positionId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 职位ID
|
|
||||||
*/
|
|
||||||
private Integer positionId;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BaseCacheUserServiceImpl implements IBaseCacheUserService {
|
public class BaseCacheUserServiceImpl implements IBaseCacheUserService {
|
||||||
|
// TODO 设置种子ID, 对其雪花ID长度
|
||||||
|
private static final long ID_SEED = 1345977833027100000L;
|
||||||
|
|
||||||
private static final Map<String, BaseCacheUser> USERS = new ConcurrentHashMap<>();
|
private static final Map<String, BaseCacheUser> USERS = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
@ -31,19 +33,10 @@ public class BaseCacheUserServiceImpl implements IBaseCacheUserService {
|
|||||||
|
|
||||||
log.debug("Current user principal: " + map);
|
log.debug("Current user principal: " + map);
|
||||||
|
|
||||||
return new BaseCacheUser().setUserId(1L).setFullName((String) map.get("staffName"))
|
return new BaseCacheUser().setUserId(getUserId((String) map.get("staffId")))
|
||||||
.setLoginName((String) map.get("username")).setRoleIds((String) map.get("staffId"))
|
.setFullName((String) map.get("staffName")).setLoginName((String) map.get("username"))
|
||||||
.setOrganizationId((String) map.get("ou")).setOrganizationName((String) map.get("ouName"));
|
.setRoleIds((String) map.get("staffId")).setOrganizationId((String) map.get("ou"))
|
||||||
|
.setOrganizationName((String) map.get("ouName"));
|
||||||
// BaseCacheUser user = new BaseCacheUser();
|
|
||||||
// ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
|
||||||
// if (attributes != null) {
|
|
||||||
// HttpServletRequest request = attributes.getRequest();
|
|
||||||
// String token = request.getHeader("JwtToken");
|
|
||||||
// user = USERS.get(token);
|
|
||||||
// }
|
|
||||||
// log.info(" --------------- 当前用户:" + JsonUtils.objectToJson(user) + " ------------------------------");
|
|
||||||
// return user;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -51,6 +44,21 @@ public class BaseCacheUserServiceImpl implements IBaseCacheUserService {
|
|||||||
return USERS.values();
|
return USERS.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
// TODO: 山东框架使用未使用雪花ID存放字符串,暂时使用该方法进行id转换
|
||||||
|
private Long getUserId(String rawUid) {
|
||||||
|
long id = ID_SEED;
|
||||||
|
byte[] bytes = rawUid.getBytes();
|
||||||
|
|
||||||
|
for (byte b : bytes) {
|
||||||
|
id += b;
|
||||||
|
}
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
BaseCacheUser user = new BaseCacheUser().setUserId(1L).setFullName("采购经理").setLoginName("caigou")
|
BaseCacheUser user = new BaseCacheUser().setUserId(1L).setFullName("采购经理").setLoginName("caigou")
|
||||||
.setRoleIds("caigou").setOrganizationId("100").setOrganizationName("中国联通吉林分公司");
|
.setRoleIds("caigou").setOrganizationId("100").setOrganizationName("中国联通吉林分公司");
|
||||||
|
Reference in New Issue
Block a user