| | |
| | | package com.gkhy.exam.pay.controller; |
| | | |
| | | import com.gkhy.exam.pay.dto.rep.NonCategoryCount; |
| | | import com.gkhy.exam.pay.dto.req.NonCountCategoryReqDto; |
| | | import com.gkhy.exam.pay.entity.NonCoalCategory; |
| | | import com.gkhy.exam.pay.service.NonCoalCategoryService; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | return toAjax(nonCoalCategoryService.deleteNonCoalCategoryByIds(ids)); |
| | | } |
| | | |
| | | @GetMapping("/count") |
| | | @ApiOperation(value = "非煤工种缴费统计") |
| | | public TableDataInfo count(NonCountCategoryReqDto countCategoryReqDto){ |
| | | List<NonCategoryCount> nonCategoryCounts = nonCoalCategoryService.countCategory(countCategoryReqDto); |
| | | int pageNum = countCategoryReqDto.getPageNum(); // 当前页码 |
| | | int pageSize = countCategoryReqDto.getPageSize(); // 每页大小 |
| | | List<NonCategoryCount> pagedList = nonCategoryCounts.stream() |
| | | .skip((pageNum - 1) * pageSize) // 跳过前面的数据 |
| | | .limit(pageSize) // 限制当前页的数据量 |
| | | .collect(Collectors.toList()); |
| | | |
| | | // 封装分页结果 |
| | | TableDataInfo dataTable = new TableDataInfo(); |
| | | dataTable.setCode(HttpStatus.SUCCESS); |
| | | dataTable.setMsg("查询成功"); |
| | | dataTable.setRows(pagedList); // 当前页数据 |
| | | dataTable.setTotal(nonCategoryCounts.size()); // 总数据量 |
| | | return dataTable; |
| | | } |
| | | } |