| | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | 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.AppUser; |
| | | import com.ruoyi.account.api.model.BalanceChangeRecord; |
| | | import com.ruoyi.account.api.model.BalancePayment; |
| | |
| | | */ |
| | | @ApiOperation(value = "变更明细", notes = "变更明细") |
| | | @GetMapping("change") |
| | | public R<List<BalanceChangeRecord>> change(@ApiParam(value = "变更类型") |
| | | public R<IPage<BalanceChangeRecord>> change(@ApiParam(value = "变更类型") |
| | | @RequestParam(required = false) Integer changeType, |
| | | Integer pageCurr, |
| | | Integer pageSize, |
| | | @ApiParam(value = "创建时间") |
| | | @RequestParam(required = false) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | |
| | | endTime = lastDayOfMonth.atTime(LocalTime.MAX); |
| | | } |
| | | |
| | | List<BalanceChangeRecord> list = balanceChangeRecordService.list(new LambdaQueryWrapper<BalanceChangeRecord>() |
| | | Page<BalanceChangeRecord> page = balanceChangeRecordService.page(Page.of(pageCurr, pageSize), new LambdaQueryWrapper<BalanceChangeRecord>() |
| | | .eq(changeType != null, BalanceChangeRecord::getChangeType, changeType) |
| | | .between(startTime != null, BalanceChangeRecord::getCreateTime, startTime, endTime) |
| | | .eq(BalanceChangeRecord::getAppUserId, userId).orderByDesc(BalanceChangeRecord::getCreateTime)); |
| | | |
| | | List<BalanceChangeRecord> list = page.getRecords(); |
| | | |
| | | List<Long> orderIds = list.stream().map(BalanceChangeRecord::getOrderId).collect(Collectors.toList()); |
| | | if (CollectionUtil.isNotEmpty(orderIds)){ |
| | |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(list); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | /** |