From 3863a5a1d26f2a22a4d62b71be6b6c0d46e94d95 Mon Sep 17 00:00:00 2001 From: tangqian Date: Tue, 23 May 2023 17:21:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9app=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shop/service/recharge/RechargeGearServiceImpl.java | 7 +++++++ .../member/controller/app/user/AppUserController.java | 1 + 2 files changed, 8 insertions(+) diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeGearServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeGearServiceImpl.java index 7ce76a52e..9e53955f4 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeGearServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeGearServiceImpl.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.shop.service.recharge; +import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.PhoneRecordDO; @@ -106,6 +107,9 @@ public class RechargeGearServiceImpl implements RechargeGearService { Assert.notNull(loginUser, "登录失效,请重新登录!"); List rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.lambdaQuery() .eq(RechargeGearDO::getDeleted, 0)); + if (CollectionUtils.isEmpty(rechargeGearDOS)) { + throw new ServiceException("未初始化档次信息!"); + } List rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS); List infoDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getUserId, loginUser.getId())); Map> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId)); @@ -125,6 +129,9 @@ public class RechargeGearServiceImpl implements RechargeGearService { List rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.lambdaQuery() .eq(RechargeGearDO::getDeleted, 0)); List rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS); + if (CollectionUtils.isEmpty(rechargeGearDOS)) { + throw new ServiceException("未初始化档次信息!"); + } List infoDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getPhone, phone)); Map> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId)); rechargeGearRespVOS.forEach(vo -> { diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.java index ba91db9ae..e06dc7d6f 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.java @@ -83,6 +83,7 @@ public class AppUserController { }else{ appUserInfoRespVO.setUserType(UserTypeEnum.MEMBER); } + appUserInfoRespVO.setUserId(user.getId()); return success(appUserInfoRespVO); }