Merge remote-tracking branch 'origin/master'

This commit is contained in:
2025-02-25 15:59:24 +08:00
2 changed files with 26 additions and 1 deletions

View File

@@ -65,7 +65,25 @@ public class ShopStaffServiceImpl extends ServiceImpl<ShopStaffMapper, ShopStaff
sysUsersRolesService.updateRole(shopStaff.getId(), shopStaffEditDTO.getRoleId());
}
sysUserService.updateSysUserPwd(shopStaff.getId(), shopStaffEditDTO.getAccountPwd());
if (!"*******".equals(shopStaffEditDTO.getAccountPwd())) {
sysUserService.updateSysUserPwd(shopStaff.getId(), shopStaffEditDTO.getAccountPwd());
}
SysUser sysUser = sysUserService.getById(sysUserId);
if (!shopStaffEditDTO.getPhone().equals(sysUser.getPhone())) {
sysUser.setPhone(shopStaffEditDTO.getPhone());
}
if (!shopStaffEditDTO.getAccountName().equals(sysUser.getAccount())) {
long count = sysUserService.count(new QueryWrapper().eq(SysUser::getAccount, shopStaffEditDTO.getAccountName()));
if (count > 0) {
throw new ApiNotPrintException("此账户名已存在");
}
sysUser.setAccount(shopStaffEditDTO.getAccountName());
}
sysUserService.updateById(sysUser);
BeanUtil.copyProperties(shopStaffEditDTO, shopStaff);
updateById(shopStaff);