用户接口修改

This commit is contained in:
张松
2025-03-11 17:47:56 +08:00
parent f234ed74d6
commit 5c0febbb9a

View File

@@ -252,17 +252,16 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
userInfoService.updateById(userInfo);
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("您已加入店铺会员");
}
shopUser = BeanUtil.copyProperties(shopUserAddDTO, ShopUser.class);
shopUser.setIsVip(1);
shopUser.setCode(generateCode(shopId));
shopUser.setJoinTime(DateUtil.date().toLocalDateTime());
shopUser.setShopId(shopId);
shopUser.setUserId(userId);
return save(shopUser);
return saveOrUpdate(shopUser);
}
@Override