| | |
| | | return R.ok(balanceChangeRecordService.pageList(agentQuery)); |
| | | } |
| | | |
| | | /** |
| | | * 用户分佣统计 |
| | | */ |
| | | @GetMapping("/commissionStatistics") |
| | | @ApiOperation(value = "用户分佣统计", tags = "管理后台-财务统计-用户分佣统计") |
| | | public R<CommissionStatistics> commissionStatistics(UserPoint userPoint) { |
| | | userPoint.setType(2); |
| | | IPage<UserPoint> userPointPage = userPointService.getUserPointPage(Page.of(userPoint.getPageNum(), userPoint.getPageSize()), userPoint); |
| | | UserPointStatistics statistics = userPointService.getStatistics(userPoint); |
| | | CommissionStatistics commissionStatistics = new CommissionStatistics(); |
| | | commissionStatistics.setStatistics(statistics); |
| | | commissionStatistics.setUserPointPage(userPointPage); |
| | | return R.ok(commissionStatistics); |
| | | } |
| | | |
| | | /** |
| | | * 导出用户分佣统计 |
| | | */ |
| | | @GetMapping("/commissionExport") |
| | | @ApiOperation(value = "用户分佣统计导出", tags = "管理后台-财务统计-用户分佣统计") |
| | | public void commissionExport(HttpServletResponse response, UserPoint userPoint) { |
| | | userPoint.setType(2); |
| | | IPage<UserPoint> userPointPage = userPointService.getUserPointPage(Page.of(1, Integer.MAX_VALUE), userPoint); |
| | | List<UserPoint> userPointList = userPointPage.getRecords(); |
| | | List<UserPointEx> userPointExList = new ArrayList<>(); |
| | | for (UserPoint point : userPointList) { |
| | | UserPointEx userPointEx = new UserPointEx(); |
| | | userPointEx.setUserName(point.getUserName()); |
| | | userPointEx.setPhone(point.getPhone()); |
| | | userPointEx.setChangeTime(point.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | userPointEx.setChangeNum(point.getVariablePoint().toString()); |
| | | Integer type = point.getType(); |
| | | switch (type) { |
| | | case 1: |
| | | userPointEx.setType("消费积分"); |
| | | break; |
| | | case 2: |
| | | userPointEx.setType("返佣积分"); |
| | | break; |
| | | case 3: |
| | | userPointEx.setType("拉新人积分"); |
| | | break; |
| | | case 4: |
| | | userPointEx.setType("兑换商品"); |
| | | break; |
| | | case 5: |
| | | userPointEx.setType("门店业绩"); |
| | | break; |
| | | case 6: |
| | | userPointEx.setType("门店返佣"); |
| | | break; |
| | | case 7: |
| | | userPointEx.setType("技师业绩"); |
| | | break; |
| | | case 8: |
| | | userPointEx.setType("转赠积分"); |
| | | break; |
| | | case 9: |
| | | userPointEx.setType("做工积分"); |
| | | break; |
| | | case 10: |
| | | userPointEx.setType("注册积分"); |
| | | break; |
| | | default: |
| | | userPointEx.setType("未知积分"); |
| | | } |
| | | userPointExList.add(userPointEx); |
| | | } |
| | | ExcelUtil<UserPointEx> util = new ExcelUtil<>(UserPointEx.class); |
| | | util.exportExcel(response, userPointExList, "用户分佣统计"); |
| | | } |
| | | // /** |
| | | // * 用户分佣统计 |
| | | // */ |
| | | // @GetMapping("/commissionStatistics") |
| | | // @ApiOperation(value = "用户分佣统计", tags = "管理后台-财务统计-用户分佣统计") |
| | | // public R<CommissionStatistics> commissionStatistics(UserPoint userPoint) { |
| | | // userPoint.setType(2); |
| | | // IPage<UserPoint> userPointPage = userPointService.getUserPointPage(Page.of(userPoint.getPageNum(), userPoint.getPageSize()), userPoint); |
| | | // UserPointStatistics statistics = userPointService.getStatistics(userPoint); |
| | | // CommissionStatistics commissionStatistics = new CommissionStatistics(); |
| | | // commissionStatistics.setStatistics(statistics); |
| | | // commissionStatistics.setUserPointPage(userPointPage); |
| | | // return R.ok(commissionStatistics); |
| | | // } |
| | | // |
| | | // /** |
| | | // * 导出用户分佣统计 |
| | | // */ |
| | | // @GetMapping("/commissionExport") |
| | | // @ApiOperation(value = "用户分佣统计导出", tags = "管理后台-财务统计-用户分佣统计") |
| | | // public void commissionExport(HttpServletResponse response, UserPoint userPoint) { |
| | | // userPoint.setType(2); |
| | | // IPage<UserPoint> userPointPage = userPointService.getUserPointPage(Page.of(1, Integer.MAX_VALUE), userPoint); |
| | | // List<UserPoint> userPointList = userPointPage.getRecords(); |
| | | // List<UserPointEx> userPointExList = new ArrayList<>(); |
| | | // for (UserPoint point : userPointList) { |
| | | // UserPointEx userPointEx = new UserPointEx(); |
| | | // userPointEx.setUserName(point.getUserName()); |
| | | // userPointEx.setPhone(point.getPhone()); |
| | | // userPointEx.setChangeTime(point.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | // userPointEx.setChangeNum(point.getVariablePoint().toString()); |
| | | // Integer type = point.getType(); |
| | | // switch (type) { |
| | | // case 1: |
| | | // userPointEx.setType("消费积分"); |
| | | // break; |
| | | // case 2: |
| | | // userPointEx.setType("返佣积分"); |
| | | // break; |
| | | // case 3: |
| | | // userPointEx.setType("拉新人积分"); |
| | | // break; |
| | | // case 4: |
| | | // userPointEx.setType("兑换商品"); |
| | | // break; |
| | | // case 5: |
| | | // userPointEx.setType("门店业绩"); |
| | | // break; |
| | | // case 6: |
| | | // userPointEx.setType("门店返佣"); |
| | | // break; |
| | | // case 7: |
| | | // userPointEx.setType("技师业绩"); |
| | | // break; |
| | | // case 8: |
| | | // userPointEx.setType("转赠积分"); |
| | | // break; |
| | | // case 9: |
| | | // userPointEx.setType("做工积分"); |
| | | // break; |
| | | // case 10: |
| | | // userPointEx.setType("注册积分"); |
| | | // break; |
| | | // default: |
| | | // userPointEx.setType("未知积分"); |
| | | // } |
| | | // userPointExList.add(userPointEx); |
| | | // } |
| | | // ExcelUtil<UserPointEx> util = new ExcelUtil<>(UserPointEx.class); |
| | | // util.exportExcel(response, userPointExList, "用户分佣统计"); |
| | | // } |
| | | |
| | | |
| | | |