| | |
| | | import com.ruoyi.account.service.BalanceChangeRecordService; |
| | | import com.ruoyi.account.vo.CommissionStatistics; |
| | | import com.ruoyi.account.vo.WalletStatistics; |
| | | import com.ruoyi.account.vo.WalletStatisticsDetail; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "余额变更明细", tags = {"后台"}) |
| | | public R<IPage<BalanceChangeRecord>> page(@RequestBody BalanceQuery agentQuery) { |
| | | |
| | | return R.ok(balanceChangeRecordService.pageList(agentQuery)); |
| | | IPage<BalanceChangeRecord> page = balanceChangeRecordService.pageList(agentQuery); |
| | | for (BalanceChangeRecord record : page.getRecords()) { |
| | | if (record.getChangeDirection() == -1){ |
| | | record.setFlag(2); |
| | | }else { |
| | | record.setFlag(1); |
| | | } |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.ok(walletStatistics); |
| | | } |
| | | |
| | | /** |
| | | * 钱包统计导出 |
| | | */ |
| | | @GetMapping("/walletExport") |
| | | @ApiOperation(value = "钱包统计导出", tags = "管理后台-财务统计-钱包统计") |
| | | public void walletExport(HttpServletResponse response, BalanceChangeRecord balanceChangeRecord) { |
| | | WalletStatistics walletStatistics = balanceChangeRecordService.walletStatistics(Page.of(1, Integer.MAX_VALUE), balanceChangeRecord); |
| | | IPage<WalletStatisticsDetail> userPointPage = walletStatistics.getPage(); |
| | | List<WalletStatisticsDetail> userPointList = userPointPage.getRecords(); |
| | | ExcelUtil<WalletStatisticsDetail> util = new ExcelUtil<>(WalletStatisticsDetail.class); |
| | | util.exportExcel(response, userPointList, "钱包统计"); |
| | | } |
| | | |
| | | } |