用户修改接口调整
This commit is contained in:
parent
d151432ad7
commit
deb751919e
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue