|
|
@ -136,7 +136,7 @@ public class SysUserController extends BaseController {
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
|
|
|
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
|
|
|
@PostMapping
|
|
|
|
@PostMapping
|
|
|
|
public R<Void> add(@Validated @RequestBody SysUser user) {
|
|
|
|
public R<Void> add(@Validated @RequestBody SysUser user) {
|
|
|
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) {
|
|
|
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) {
|
|
|
|
return R.fail("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
|
|
|
return R.fail("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
|
|
|
} else if (StringUtils.isNotEmpty(user.getPhonenumber())
|
|
|
|
} else if (StringUtils.isNotEmpty(user.getPhonenumber())
|
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
|
|
@ -158,7 +158,7 @@ public class SysUserController extends BaseController {
|
|
|
|
public R<Void> edit(@Validated @RequestBody SysUser user) {
|
|
|
|
public R<Void> edit(@Validated @RequestBody SysUser user) {
|
|
|
|
userService.checkUserAllowed(user);
|
|
|
|
userService.checkUserAllowed(user);
|
|
|
|
userService.checkUserDataScope(user.getUserId());
|
|
|
|
userService.checkUserDataScope(user.getUserId());
|
|
|
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) {
|
|
|
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) {
|
|
|
|
return R.fail("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
|
|
|
|
return R.fail("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
|
|
|
|
} else if (StringUtils.isNotEmpty(user.getPhonenumber())
|
|
|
|
} else if (StringUtils.isNotEmpty(user.getPhonenumber())
|
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
|
|
|