员工账号修改
This commit is contained in:
@@ -61,6 +61,9 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
|
||||
public Boolean edit(ShopStaffEditDTO shopStaffEditDTO) {
|
||||
long sysUserId = StpKit.USER.getLoginIdAsLong();
|
||||
ShopStaff shopStaff = queryChain().eq(ShopStaff::getShopId, sysUserId).eq(ShopStaff::getId, shopStaffEditDTO.getId()).one();
|
||||
if (shopStaff == null) {
|
||||
throw new ApiNotPrintException("员工账户不存在");
|
||||
}
|
||||
if (shopStaffEditDTO.getRoleId() != null) {
|
||||
sysUsersRolesService.updateRole(shopStaff.getId(), shopStaffEditDTO.getRoleId());
|
||||
}
|
||||
@@ -69,7 +72,7 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
|
||||
sysUserService.updateSysUserPwd(shopStaff.getId(), shopStaffEditDTO.getAccountPwd());
|
||||
}
|
||||
|
||||
SysUser sysUser = sysUserService.getById(sysUserId);
|
||||
SysUser sysUser = sysUserService.getById(shopStaff.getId());
|
||||
if (StrUtil.isNotBlank(shopStaffEditDTO.getPhone()) && !shopStaffEditDTO.getPhone().equals(sysUser.getPhone())) {
|
||||
sysUser.setPhone(shopStaffEditDTO.getPhone());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user