| | |
| | | public UserPointVO getUserPoint(Long userId) { |
| | | AppUser appUser = appUserService.getById(userId); |
| | | VipSetting vipSetting = vipSettingService.getVipSettingByUserId(userId); |
| | | List<AppUserGiveawayTemporary> list = appUserGiveawayTemporaryService.list(new LambdaQueryWrapper<AppUserGiveawayTemporary>().eq(AppUserGiveawayTemporary::getAppUserId, userId)); |
| | | List<AppUserGiveawayTemporary> list = appUserGiveawayTemporaryService.list(new LambdaQueryWrapper<AppUserGiveawayTemporary>() |
| | | .eq(AppUserGiveawayTemporary::getAppUserId, userId)); |
| | | int totalPoint = 0; |
| | | int sharePoint = 0; |
| | | int shopAchievementPoint = 0; |
| | |
| | | @Override |
| | | public UserPointStatistics getStatistics(UserPoint userPoint) { |
| | | List<UserPoint> userPointList = this.baseMapper.selectUserPoint(userPoint); |
| | | |
| | | userPointList.forEach(item -> { |
| | | int i = item.getHistoricalPoint() - item.getBalance(); |
| | | if (i>0){ |
| | | item.setVariablePoint(item.getVariablePoint() * -1); |
| | | }else { |
| | | item.setVariablePoint(item.getVariablePoint()); |
| | | } |
| | | }); |
| | | |
| | | Map<Integer, Integer> userBalanceMap = userPointList.stream() |
| | | .collect(Collectors.groupingBy( |
| | | UserPoint::getType, |
| | |
| | | |
| | | @Override |
| | | public IPage<UserPoint> getUserPointPage(Page<UserPoint> page, UserPoint userPoint) { |
| | | return this.baseMapper.queryUserPointPage(page, userPoint); |
| | | IPage<UserPoint> userPointIPage = this.baseMapper.queryUserPointPage(page, userPoint); |
| | | userPointIPage.getRecords().forEach(item -> { |
| | | int i = item.getHistoricalPoint() - item.getBalance(); |
| | | if (i>0){ |
| | | item.setVariablePoint(item.getVariablePoint() * -1); |
| | | }else { |
| | | item.setVariablePoint(item.getVariablePoint()); |
| | | } |
| | | }); |
| | | return userPointIPage; |
| | | } |
| | | } |