用户修改接口调整

This commit is contained in:
张松 2025-03-11 16:06:05 +08:00
parent d151432ad7
commit deb751919e
1 changed files with 5 additions and 3 deletions

View File

@ -87,9 +87,11 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
@Override
public Boolean updateInfo(Long shopId, ShopUserEditDTO shopUserEditDTO) {
long count = count(new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getPhone, shopUserEditDTO.getPhone()).ne(ShopUser::getId, shopUserEditDTO.getId()));
if (count > 0) {
throw new ApiNotPrintException("手机号已存在");
if (StrUtil.isNotBlank(shopUserEditDTO.getPhone())) {
long count = count(new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getPhone, shopUserEditDTO.getPhone()).ne(ShopUser::getId, shopUserEditDTO.getId()));
if (count > 0) {
throw new ApiNotPrintException("手机号已存在");
}
}
ShopUser shopUser = getUserInfo(shopId, shopUserEditDTO.getId());
BeanUtil.copyProperties(shopUserEditDTO, shopUser);