提交 2b2cbc0a authored 作者: chaoyanjun's avatar chaoyanjun

--no commit message

上级 b917ac69
......@@ -116,59 +116,9 @@ public class UserServiceImpl extends BaseServiceImpl<User,String> implements Use
redis.set(user.getToken(), JsonUtil.bean2Json(user),60*60*24*7,TimeUnit.SECONDS);
}
// 添加用户id到组、角色、部门对象集合
/*if(ArrayUtils.isNotEmpty(form.getDeptList())){
List<UserDepartmentRelation> udList = new ArrayList<UserDepartmentRelation>();
for (UserDepartmentRelationForm dept : form.getDeptList()) {
UserDepartmentRelation ud = new UserDepartmentRelation();
ud.setUserId(user.getId());
ud.setDepartmentId(dept.getDeptId());
udList.add(ud);
}
udMapper.insertList(udList);
}
if(ArrayUtils.isNotEmpty(form.getRoleList())){
List<UserRoleRelation> urList = new ArrayList<UserRoleRelation>();
for (UserRoleRelationForm role : form.getRoleList()) {
UserRoleRelation ur = new UserRoleRelation();
ur.setUserId(user.getId());
ur.setRoleId(role.getRoleId());
urList.add(ur);
}
urMapper.insertList(urList);
}*/
}
/*@Override
public boolean update(SaveUserForm form) throws Exception {
User entity = userMapper.selectByPrimaryKey(form.getId());
// md5密码加密
if (StringUtils.isNotEmpty(form.getPassword())) {
if(form.getPassword().equals("******")){
form.setPassword(entity.getPassword());
}else{
form.setPassword(MD5Util.getEncoderByMd5(form.getPassword()));
}
}
BeanUtils.copyProperties(form, entity);
userMapper.updateByPrimaryKeySelective(entity);
// 根据用户id 删除用户与角色关系
UserRoleRelation rr = new UserRoleRelation();
rr.setUserId(form.getId());
urMapper.delete(rr);
// 添加用户与角色关系
if(ArrayUtils.isNotEmpty(form.getRoleId())){
form.getRoleId().forEach(v -> {
UserRoleRelation t = new UserRoleRelation();
t.setUserId(form.getId());
t.setRoleId(v);
urMapper.insertSelective(t);
});
}
return true;
}*/
@Override
......@@ -228,20 +178,6 @@ public class UserServiceImpl extends BaseServiceImpl<User,String> implements Use
User member = notNull(oid);
UserVO vo = BeanUtils.copy(member, UserVO.class);
vo.setPassword(null);
// 2. 查询角色列表
/*List<UserRoleRelation> qldyList = null;
List<Role> roleList = new ArrayList<Role>();
UserRoleRelation type = new UserRoleRelation();
type.setUserId(oid);
qldyList = urMapper.select(type);
if(ArrayUtils.isNotEmpty(qldyList)){
for(UserRoleRelation q : qldyList){
Integer roleId = q.getRoleId();
Role role = roleMapper.selectByPrimaryKey(roleId);
roleList.add(role);
}
vo.setRoleList(roleList);
}*/
// 角色
List<UserRoleRelation> urList = new ArrayList<UserRoleRelation>();
UserRoleRelation ur = new UserRoleRelation();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论