fix: 修改app获取用户信息

pull/2/head
tangqian 2023-05-23 17:21:26 +08:00
parent a8bfcebce4
commit 3863a5a1d2
2 changed files with 8 additions and 0 deletions

View File

@ -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<RechargeGearDO> rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.<RechargeGearDO>lambdaQuery()
.eq(RechargeGearDO::getDeleted, 0));
if (CollectionUtils.isEmpty(rechargeGearDOS)) {
throw new ServiceException("未初始化档次信息!");
}
List<RechargeGearRespVO> rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS);
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getUserId, loginUser.getId()));
Map<Long, List<PhoneRecordDO>> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId));
@ -125,6 +129,9 @@ public class RechargeGearServiceImpl implements RechargeGearService {
List<RechargeGearDO> rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.<RechargeGearDO>lambdaQuery()
.eq(RechargeGearDO::getDeleted, 0));
List<RechargeGearRespVO> rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS);
if (CollectionUtils.isEmpty(rechargeGearDOS)) {
throw new ServiceException("未初始化档次信息!");
}
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getPhone, phone));
Map<Long, List<PhoneRecordDO>> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId));
rechargeGearRespVOS.forEach(vo -> {

View File

@ -83,6 +83,7 @@ public class AppUserController {
}else{
appUserInfoRespVO.setUserType(UserTypeEnum.MEMBER);
}
appUserInfoRespVO.setUserId(user.getId());
return success(appUserInfoRespVO);
}