|
|
|
@ -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 -> {
|
|
|
|
|