| | |
| | | if(point > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(12); |
| | | userPoint.setHistoricalPoint(lavePoint1); |
| | | userPoint.setVariablePoint(point); |
| | | userPoint.setBalance(appUserForPhoe.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUserForPhoe.getId()); |
| | | userPoint.setObjectId(userid); |
| | | userPoint.setChangeDirection(1); |
| | | userPointService.save(userPoint); |
| | | } |
| | | |
| | |
| | | if(point > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(13); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(point); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(appUserForPhoe.getId()); |
| | | userPoint.setChangeDirection(-1); |
| | | userPointService.save(userPoint); |
| | | } |
| | | return R.ok(); |
| | |
| | | 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()); |
| | | } |
| | | item.setVariablePoint(item.getVariablePoint() * item.getChangeDirection()); |
| | | }); |
| | | |
| | | Map<Integer, Integer> userBalanceMap = userPointList.stream() |
| | |
| | | public IPage<UserPoint> getUserPointPage(Page<UserPoint> page, UserPoint 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()); |
| | | } |
| | | item.setVariablePoint(item.getVariablePoint() * item.getChangeDirection()); |
| | | }); |
| | | return userPointIPage; |
| | | } |