用户接口修改

This commit is contained in:
张松 2025-03-11 17:08:17 +08:00
parent 3757d92cba
commit 592518daca
1 changed files with 6 additions and 0 deletions

View File

@ -271,7 +271,13 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
long couponNum = 0;
if (shopUser == null) {
UserInfo userInfo = userInfoService.getById(userId);
if (userInfo == null) {
throw new ApiNotPrintException("用户信息不存在");
}
shopUser = BeanUtil.copyProperties(userInfo, ShopUser.class);
shopUser.setShopId(shopId);
shopUser.setId(null);
shopUser.setUserId(userId);
save(shopUser);
}else {
couponNum = shopActivateCouponRecordService.count(new QueryWrapper().eq(ShopActivateCouponRecord::getShopUserId, shopUser.getId()).eq(ShopActivateCouponRecord::getStatus, 0));