| | |
| | | @Resource |
| | | private UserPointCopyMapper userPointCopyMapper; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | private OrderClient orderClient; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @DeleteMapping("/deleteUserPointCopy") |
| | | public R deleteUserPointCopy(@RequestParam Long orderId) { |
| | | userPointCopyMapper.delete(new LambdaQueryWrapper<UserPointCopy>() |
| | | public R deleteUserPointCopy(@RequestParam("orderId") Long orderId, @RequestParam("type") List<Integer> type) { |
| | | userPointCopyMapper.delete(new LambdaQueryWrapper<UserPointCopy>().in(UserPointCopy::getType, type) |
| | | .eq(UserPointCopy::getObjectId, orderId)); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @DeleteMapping("/deleteUserPointCopyByIds") |
| | | public R deleteUserPointCopyByIds(@RequestParam("ids") List<Long> ids){ |
| | | userPointCopyMapper.deleteBatchIds(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/getUserPointCopy") |
| | | public R<List<UserPointCopy>> getUserPointCopy(@RequestParam("orderId") Long orderId, @RequestParam("type") List<Integer> type) { |
| | | List<UserPointCopy> list = userPointCopyMapper.selectList(new LambdaQueryWrapper<UserPointCopy>().in(UserPointCopy::getType, type) |
| | | .eq(UserPointCopy::getObjectId, orderId)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | |
| | | IPage<UserPoint> userPointPage = userPointService.getUserPointPage(Page.of(userPoint.getPageNum(), userPoint.getPageSize()), userPoint); |
| | | return R.ok(userPointPage); |
| | | } |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | |
| | | @GetMapping("/user/list") |
| | | @ApiOperation(value = "积分管理-用户积分明细(必传用户id)", tags = "后台") |
| | | public R<Page<UserPoint>> userlist(UserPoint userPoint) { |
| | | Page<UserPoint> page = userPointService.lambdaQuery() |
| | | .eq(userPoint.getType()!=null,UserPoint::getType, userPoint.getType()) |
| | | .eq(UserPoint::getAppUserId, userPoint.getAppUserId()) |
| | | .orderByDesc(UserPoint::getCreateTime) |
| | | .page(Page.of(userPoint.getPageNum(), userPoint.getPageSize())); |
| | | public R<IPage<UserPoint>> userlist(UserPoint userPoint) { |
| | | IPage<UserPoint> page = userPointService.getUserPointPage(Page.of(userPoint.getPageNum(), userPoint.getPageSize()), userPoint); |
| | | for (UserPoint record : page.getRecords()) { |
| | | if (record.getType()==1 || record.getType()==11){ |
| | | Order data = orderClient.getOrderById(record.getObjectId()).getData(); |
| | |
| | | record.setExtention(data.getOrderNumber()); |
| | | } |
| | | } |
| | | int i = record.getHistoricalPoint() - record.getBalance(); |
| | | if (i>0){ |
| | | if (record.getChangeDirection() == -1){ |
| | | record.setVariableType(2); |
| | | }else if (i<0){ |
| | | record.setVariableType(1); |
| | | }else{ |
| | | record.setVariableType(0); |
| | | record.setVariableType(1); |
| | | } |
| | | } |
| | | return R.ok(page); |