菜单接口修改
This commit is contained in:
@@ -109,12 +109,11 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||
|
||||
@Override
|
||||
public Boolean add(Long shopId, ShopUserAddDTO shopUserAddDTO) {
|
||||
long userCount = userInfoService.queryChain().eq(UserInfo::getId, shopUserAddDTO.getUserId()).count();
|
||||
if (userCount == 0) {
|
||||
throw new ApiNotPrintException("用户信息不存在");
|
||||
}
|
||||
long count = queryChain().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, shopUserAddDTO.getUserId()).count();
|
||||
if (count > 0) {
|
||||
UserInfo userInfo = userInfoService.queryChain().eq(UserInfo::getPhone, shopUserAddDTO.getPhone()).one();
|
||||
if (userInfo == null) {
|
||||
userInfo = BeanUtil.copyProperties(shopUserAddDTO, UserInfo.class);
|
||||
userInfoService.save(userInfo);
|
||||
}else {
|
||||
throw new ApiNotPrintException("此用户已存在");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user