| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.*; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.IntegralChangeRecordVo; |
| | | import com.ruoyi.system.vo.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | |
| | | |
| | | @Autowired |
| | | private TBigGiftPackageOrderService bigGiftPackageOrderService; |
| | | |
| | | @Autowired |
| | | private TIntegralSettlementService integralSettlementService; |
| | | |
| | | |
| | | @ApiOperation(value = "用户管理分页列表") |
| | |
| | | return R.ok(tBigGiftPackageOrderPage); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "用户- 推广记录") |
| | | @PostMapping("/promotionPageList") |
| | | public R<Page<UserPromotionPageListVo>> promotionPageList(@RequestBody @Valid UserPromotionPageListQuery query) { |
| | | Page<UserPromotionPageListVo> page = new Page<>(query.getPageNum(), query.getPageSize()); |
| | | List<UserPromotionPageListVo> list = appUserService.userPromotionPageList(page,query); |
| | | page.setRecords(list); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "用户-推广记录导出") |
| | | @PostMapping(value = "/exportUserPromotion") |
| | | @Log(title = "推广记录-导出", businessType = BusinessType.EXPORT) |
| | | public void exportUserPromotion(@RequestBody @Valid UserPromotionPageListQuery query){ |
| | | |
| | | List<UserPromotionPageListVo> list = appUserService.userPromotionPageListExport(query); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), UserPromotionPageListVo.class, list); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("推广记录导出信息.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "用户收益明细") |
| | | @PostMapping("/profitUserPageList") |
| | | public R<Page<UserProfitPageListVo>> profitUserPageList(@RequestBody @Valid UserProfitPageListQuery query) { |
| | | Page<UserProfitPageListVo> page = new Page<>(query.getPageNum(), query.getPageSize()); |
| | | List<UserProfitPageListVo> list = bigGiftPackageOrderService.profitUserPageList(page,query); |
| | | |
| | | page.setRecords(list); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "用户收益明细导出") |
| | | @PostMapping(value = "/exportUserProfit") |
| | | @Log(title = "收益明细-导出", businessType = BusinessType.EXPORT) |
| | | public void exportUserProfit(@RequestBody @Valid UserProfitPageListQuery query){ |
| | | |
| | | List<UserProfitPageListVo> list = bigGiftPackageOrderService.profitUserPageListExport(query); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), UserProfitPageListVo.class, list); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("收益明细导出信息.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "用户- 结算记录") |
| | | @PostMapping("/settlementPageList") |
| | | public R<Page<TIntegralSettlement>> settlementPageList(@RequestBody @Valid GoldChangeRecordQuery query) { |
| | | Page<TIntegralSettlement> page = new Page<>(query.getPageNum(), query.getPageSize()); |
| | | LambdaQueryWrapper<TIntegralSettlement> queryWrapper = new LambdaQueryWrapper<TIntegralSettlement>().eq(TIntegralSettlement::getAppUserId, query.getUserId()).orderByDesc(TIntegralSettlement::getCreateTime); |
| | | Page<TIntegralSettlement> integralSettlementPage = integralSettlementService.page(page, queryWrapper); |
| | | return R.ok(integralSettlementPage); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户结算记录导出") |
| | | @PostMapping(value = "/exportSettlementPageList") |
| | | @Log(title = "结算记录-导出", businessType = BusinessType.EXPORT) |
| | | public void exportSettlementPageList(@RequestBody @Valid GoldChangeRecordQuery query){ |
| | | |
| | | List<TIntegralSettlement> list = integralSettlementService.list(new LambdaQueryWrapper<TIntegralSettlement>().eq(TIntegralSettlement::getAppUserId, query.getUserId()).orderByDesc(TIntegralSettlement::getCreateTime)); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TIntegralSettlement.class, list); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("结算记录导出信息.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |