| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.model.UserPoint; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.UserPointService; |
| | | import com.ruoyi.account.vo.TransferPoint; |
| | | import com.ruoyi.account.vo.UserPointDetailVO; |
| | | import com.ruoyi.account.vo.UserPointStatistics; |
| | | import com.ruoyi.account.vo.UserPointVO; |
| | |
| | | */ |
| | | @PostMapping("/transferPoint") |
| | | @ApiOperation("转赠积分") |
| | | public R<Void> transferPoint(@ApiParam("积分") @RequestParam BigDecimal point, @ApiParam("手机号") @RequestParam String phone) { |
| | | userPointService.transferPoint(point, phone); |
| | | return R.ok(); |
| | | public R<Void> transferPoint(@RequestBody TransferPoint transferPoint) { |
| | | return userPointService.transferPoint(transferPoint.getPoint(), transferPoint.getPhone()); |
| | | } |
| | | |
| | | |
| | |
| | | return R.ok(userPointPage); |
| | | } |
| | | |
| | | @GetMapping("/user/list") |
| | | @ApiOperation(value = "积分管理-用户积分明细(必传用户id)", tags = "后台") |
| | | public R<Page<UserPoint>> userlist(UserPoint userPoint) { |
| | | Page<UserPoint> page = userPointService.lambdaQuery().eq(UserPoint::getAppUserId, userPoint.getAppUserId()).orderByDesc(UserPoint::getCreateTime).page(Page.of(userPoint.getPageNum(), userPoint.getPageSize())); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 导出 |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取积分变动记录 |
| | | * @param userPoint |
| | | * @return |
| | | */ |
| | | @PostMapping("/getUserPointList") |
| | | public R<List<UserPoint>> getUserPointList(@RequestBody UserPoint userPoint){ |
| | | LambdaQueryWrapper<UserPoint> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if(null != userPoint.getType()){ |
| | | queryWrapper.eq(UserPoint::getType, userPoint.getType()); |
| | | } |
| | | if(null != userPoint.getObjectId()){ |
| | | queryWrapper.eq(UserPoint::getObjectId, userPoint.getObjectId()); |
| | | } |
| | | if(null != userPoint.getAppUserId()){ |
| | | queryWrapper.eq(UserPoint::getAppUserId, userPoint.getAppUserId()); |
| | | } |
| | | List<UserPoint> list = userPointService.list(queryWrapper); |
| | | return R.ok(list); |
| | | } |
| | | } |
| | | |