This commit is contained in:
xiangwb
2017-11-15 15:33:31 +08:00
parent 2e236d25b4
commit 57fd86750b
6 changed files with 24 additions and 19 deletions
@@ -65,5 +65,5 @@ public class SysUser extends BaseEntity {
private transient String modified;
private transient String sexName;
private transient List<SysAuthority> menuArray;
private transient List<SysAuthority> otherArray;
private transient List<SysAuthority> buttonArray;
}
@@ -137,8 +137,6 @@ public class SysAuthorityService {
* @return
*/
public List<SysAuthority> listByParentEnable(String parentId, String enable) {
if (StringUtils.isEmpty(parentId))
parentId = CommonConstant.ROOT;
if (StringUtils.isNotEmpty(enable))
return sysAuthorityRepository.getByParentIdAndEnable(parentId, enable);
else
@@ -155,7 +153,7 @@ public class SysAuthorityService {
public List<SysAuthority> listByRoleIdEnable(String roleId, String enable) {
List<SysAuthority> list = new ArrayList<>();
List<SysRoleAuthority> roleAuthorities = sysRoleAuthorityService.listByRoleId(roleId);
if (CollectionUtils.isNotEmpty(roleAuthorities))
if (CollectionUtils.isEmpty(roleAuthorities))
return list;
List<String> authorityIds = roleAuthorities.stream().map(SysRoleAuthority::getAuthorityId).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(authorityIds))
@@ -51,7 +51,8 @@ public class SysUserService {
if (old != null) {
throw new BusinessException("已经存在此用户名");
}
sysUser.setId(PassWordUtil.createId());
String id=PassWordUtil.createId();
sysUser.setId(id);
sysUser.setCreateTime(new Date());
// 获取初始密码
String[] res = PassWordUtil.getUserSecret(null, null);
@@ -70,6 +71,7 @@ public class SysUserService {
throw new BusinessException("发送密码邮件错误");
}
result.setSuccess(true);
result.setId(id);
return result;
}
@@ -131,6 +133,7 @@ public class SysUserService {
SysUser one = sysUserRepository.save(old);
if (one != null) {
result.setMessage("更新成功");
result.setId(sysUser.getId());
result.setSuccess(true);
} else {
result.setMessage("更新失败");