用户接口修改
This commit is contained in:
@@ -252,17 +252,16 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
|||||||
userInfoService.updateById(userInfo);
|
userInfoService.updateById(userInfo);
|
||||||
|
|
||||||
ShopUser shopUser = getOne(new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, userId));
|
ShopUser shopUser = getOne(new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, userId));
|
||||||
if (shopUser != null) {
|
if (shopUser != null && shopUser.getIsVip() == 1) {
|
||||||
throw new ApiNotPrintException("您已加入店铺会员");
|
throw new ApiNotPrintException("您已加入店铺会员");
|
||||||
}
|
}
|
||||||
|
|
||||||
shopUser = BeanUtil.copyProperties(shopUserAddDTO, ShopUser.class);
|
shopUser = BeanUtil.copyProperties(shopUserAddDTO, ShopUser.class);
|
||||||
shopUser.setIsVip(1);
|
shopUser.setIsVip(1);
|
||||||
shopUser.setCode(generateCode(shopId));
|
shopUser.setCode(generateCode(shopId));
|
||||||
shopUser.setJoinTime(DateUtil.date().toLocalDateTime());
|
shopUser.setJoinTime(DateUtil.date().toLocalDateTime());
|
||||||
shopUser.setShopId(shopId);
|
shopUser.setShopId(shopId);
|
||||||
shopUser.setUserId(userId);
|
shopUser.setUserId(userId);
|
||||||
return save(shopUser);
|
return saveOrUpdate(shopUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user