Compare commits

...

2 Commits

Author SHA1 Message Date
tangqian 9a6e45053c Merge remote-tracking branch 'origin/feature/mall_product' into feature/mall_product 2023-05-23 17:21:37 +08:00
tangqian 3863a5a1d2 fix: 修改app获取用户信息 2023-05-23 17:21:26 +08:00
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.shop.service.recharge; 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.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.PhoneRecordDO; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.PhoneRecordDO;
@ -106,6 +107,9 @@ public class RechargeGearServiceImpl implements RechargeGearService {
Assert.notNull(loginUser, "登录失效,请重新登录!"); Assert.notNull(loginUser, "登录失效,请重新登录!");
List<RechargeGearDO> rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.<RechargeGearDO>lambdaQuery() List<RechargeGearDO> rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.<RechargeGearDO>lambdaQuery()
.eq(RechargeGearDO::getDeleted, 0)); .eq(RechargeGearDO::getDeleted, 0));
if (CollectionUtils.isEmpty(rechargeGearDOS)) {
throw new ServiceException("未初始化档次信息!");
}
List<RechargeGearRespVO> rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS); List<RechargeGearRespVO> rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS);
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getUserId, loginUser.getId())); 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)); 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() List<RechargeGearDO> rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.<RechargeGearDO>lambdaQuery()
.eq(RechargeGearDO::getDeleted, 0)); .eq(RechargeGearDO::getDeleted, 0));
List<RechargeGearRespVO> rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS); 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)); List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getPhone, phone));
Map<Long, List<PhoneRecordDO>> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId)); Map<Long, List<PhoneRecordDO>> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId));
rechargeGearRespVOS.forEach(vo -> { rechargeGearRespVOS.forEach(vo -> {

View File

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