| | |
| | | if (CollectionUtil.isNotEmpty(page.getRecords())) { |
| | | List<UserPointDetailVO> collect = page.getRecords().stream().map(p -> { |
| | | UserPointDetailVO userPointDetailVO = new UserPointDetailVO(); |
| | | if (p.getType() != null && (p.getType().equals(12) || p.getType().equals(13))){ |
| | | Long appUserId = p.getAppUserId(); |
| | | AppUser appUser = appUserService.getById(appUserId); |
| | | userPointDetailVO.setName(appUser.getName()); |
| | | } |
| | | userPointDetailVO.setType(p.getType()); |
| | | userPointDetailVO.setVariablePoint(p.getVariablePoint()); |
| | | String format = p.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | |
| | | appUserForPhoe.setTotalAvailablePoint(appUserForPhoe.getTotalAvailablePoint() + point); |
| | | appUserService.updateById(appUserForPhoe); |
| | | //构建积分流水记录 |
| | | 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()); |
| | | userPointService.save(userPoint); |
| | | 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()); |
| | | userPointService.save(userPoint); |
| | | } |
| | | |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | appUser.setLavePoint(appUser.getLavePoint() - point); |
| | |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() - point); |
| | | appUserService.updateById(appUser); |
| | | //构建积分流水记录 |
| | | userPoint = new UserPoint(); |
| | | userPoint.setType(13); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(point); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | 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()); |
| | | userPointService.save(userPoint); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |