员工修改bug修复
This commit is contained in:
@@ -77,12 +77,13 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
|
||||
sysUser.setPhone(shopStaffEditDTO.getPhone());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(shopStaffEditDTO.getAccountName()) && !shopStaffEditDTO.getAccountName().equals(sysUser.getAccount())) {
|
||||
long count = sysUserService.count(new QueryWrapper().eq(SysUser::getAccount, shopStaffEditDTO.getAccountName()).ne(SysUser::getId, sysUser.getId()));
|
||||
String accountName = StpKit.USER.getLoginIdAsString() + "@" + shopStaffEditDTO.getAccountName();
|
||||
if (StrUtil.isNotBlank(shopStaffEditDTO.getAccountName()) && !accountName.equals(sysUser.getAccount())) {
|
||||
long count = sysUserService.count(new QueryWrapper().eq(SysUser::getAccount, accountName).ne(SysUser::getId, sysUser.getId()));
|
||||
if (count > 0) {
|
||||
throw new ApiNotPrintException("此账户名已存在");
|
||||
}
|
||||
sysUser.setAccount(StpKit.USER.getLoginIdAsString() + "@" + shopStaffEditDTO.getAccountName());
|
||||
sysUser.setAccount(accountName);
|
||||
}
|
||||
sysUserService.updateById(sysUser);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user