| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.model.BalanceChangeRecord; |
| | | import com.ruoyi.account.api.model.UserClickLog; |
| | | import com.ruoyi.account.api.model.UserPoint; |
| | | import com.ruoyi.account.dto.BalanceQuery; |
| | | import com.ruoyi.account.dto.UserCancelQuery; |
| | | import com.ruoyi.account.excel.UserPointEx; |
| | | import com.ruoyi.account.excel.BalanceChangeRecordEX; |
| | | import com.ruoyi.account.service.BalanceChangeRecordService; |
| | | import com.ruoyi.account.vo.CommissionStatistics; |
| | | import com.ruoyi.account.vo.UserPointStatistics; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | 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("/commissionStatistics") |
| | | @ApiOperation(value = "用户分佣统计", tags = "管理后台-财务统计-用户分佣统计") |
| | | public R<CommissionStatistics> commissionStatistics(@ApiParam("页码") @RequestParam Integer pageNum, |
| | | @ApiParam("每一页数据大小") Integer pageSize, |
| | | BalanceChangeRecord balanceChangeRecord) { |
| | | CommissionStatistics commissionStatistics1 = balanceChangeRecordService.commissionStatistics(Page.of(pageNum, pageSize), balanceChangeRecord); |
| | | return R.ok(commissionStatistics1); |
| | | } |
| | | // |
| | | // /** |
| | | // * 导出用户分佣统计 |
| | | // */ |
| | | // @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("/commissionExport") |
| | | @ApiOperation(value = "用户分佣统计导出", tags = "管理后台-财务统计-用户分佣统计") |
| | | public void commissionExport(HttpServletResponse response, BalanceChangeRecord balanceChangeRecord) { |
| | | CommissionStatistics commissionStatistics1 = balanceChangeRecordService.commissionStatistics(Page.of(1, Integer.MAX_VALUE), balanceChangeRecord); |
| | | IPage<BalanceChangeRecord> userPointPage = commissionStatistics1.getUserPointPage(); |
| | | List<BalanceChangeRecord> userPointList = userPointPage.getRecords(); |
| | | List<BalanceChangeRecordEX> userPointExList = new ArrayList<>(); |
| | | for (BalanceChangeRecord balanceChangeRecord1 : userPointList) { |
| | | BalanceChangeRecordEX balanceChangeRecordEX = new BalanceChangeRecordEX(); |
| | | balanceChangeRecordEX.setUserName(balanceChangeRecord1.getUserName()); |
| | | balanceChangeRecordEX.setPhone(balanceChangeRecord1.getUserPhone()); |
| | | balanceChangeRecordEX.setChangeTime(balanceChangeRecord1.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | balanceChangeRecordEX.setChangeNum(balanceChangeRecord1.getAfterAmount().toString()); |
| | | Integer type = balanceChangeRecord1.getChangeType(); |
| | | // 类型:1充值2提现3红包4分佣5商城购物6订单取消回退 |
| | | switch (type) { |
| | | case 1: |
| | | balanceChangeRecordEX.setType("充值"); |
| | | break; |
| | | case 2: |
| | | balanceChangeRecordEX.setType("提现"); |
| | | break; |
| | | case 3: |
| | | balanceChangeRecordEX.setType("红包"); |
| | | break; |
| | | case 4: |
| | | balanceChangeRecordEX.setType("分佣"); |
| | | break; |
| | | case 5: |
| | | balanceChangeRecordEX.setType("商城购物"); |
| | | break; |
| | | case 6: |
| | | balanceChangeRecordEX.setType("订单取消回退"); |
| | | break; |
| | | default: |
| | | balanceChangeRecordEX.setType("未知积分"); |
| | | } |
| | | userPointExList.add(balanceChangeRecordEX); |
| | | } |
| | | ExcelUtil<BalanceChangeRecordEX> util = new ExcelUtil<>(BalanceChangeRecordEX.class); |
| | | util.exportExcel(response, userPointExList, "用户分佣统计"); |
| | | } |
| | | |
| | | |
| | | |