统计报表加分页

This commit is contained in:
lizhicheng 2022-10-19 10:16:23 +08:00
parent 1bcb055baf
commit 30a4ce6797
2 changed files with 28 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import io.renren.common.annotation.LogOperation; import io.renren.common.annotation.LogOperation;
import io.renren.common.constant.Constant;
import io.renren.common.utils.Result; import io.renren.common.utils.Result;
import io.renren.modules.processForm.service.TAbilityApplicationService; import io.renren.modules.processForm.service.TAbilityApplicationService;
import io.renren.modules.resource.dao.ResourceDao; import io.renren.modules.resource.dao.ResourceDao;
@ -461,6 +462,8 @@ public class CensusController {
@ApiOperation("查询部门上架资源及审批结果详细信息") @ApiOperation("查询部门上架资源及审批结果详细信息")
@LogOperation("查询部门上架资源及审批结果详细信息") @LogOperation("查询部门上架资源及审批结果详细信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"),
@ -526,6 +529,8 @@ public class CensusController {
@ApiOperation("查询部门申请资源及审批结果详细信息") @ApiOperation("查询部门申请资源及审批结果详细信息")
@LogOperation("查询部门申请资源及审批结果详细信息") @LogOperation("查询部门申请资源及审批结果详细信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"),

View File

@ -15,6 +15,7 @@ import io.renren.common.domain.Tsingtao_xhaProperties;
import io.renren.common.page.PageData; import io.renren.common.page.PageData;
import io.renren.common.service.impl.CrudServiceImpl; import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.common.utils.DateUtils; import io.renren.common.utils.DateUtils;
import io.renren.modules.device.dto.TbDeviceApplyDTO;
import io.renren.modules.monitor.dto.CameraChannelDto1; import io.renren.modules.monitor.dto.CameraChannelDto1;
import io.renren.modules.monitor.entity.CameraChannel; import io.renren.modules.monitor.entity.CameraChannel;
import io.renren.modules.monitor.mapper.CameraChannelMapper; import io.renren.modules.monitor.mapper.CameraChannelMapper;
@ -2283,12 +2284,32 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Override @Override
public Object selectCensusResourceTable(Map params) { public Object selectCensusResourceTable(Map params) {
return resourceDao.selectCensusResourceTable(params); int curPage = 1;
int limit = 10;
if (params.containsKey("limit") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("limit").toString())) {
limit = Integer.parseInt(params.get("limit").toString());
}
if (params.containsKey("page") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("page").toString())) {
curPage = Integer.parseInt(params.get("page").toString());
}
List<Map> dtoList= resourceDao.selectCensusResourceTable(params);
List result = dtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList());
return new PageData(result, dtoList.size());
} }
@Override @Override
public Object selectCensusApplyTable(Map params) { public Object selectCensusApplyTable(Map params) {
return resourceDao.selectCensusApplyTable(params); int curPage = 1;
int limit = 10;
if (params.containsKey("limit") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("limit").toString())) {
limit = Integer.parseInt(params.get("limit").toString());
}
if (params.containsKey("page") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("page").toString())) {
curPage = Integer.parseInt(params.get("page").toString());
}
List<Map> dtoList= resourceDao.selectCensusApplyTable(params);
List result = dtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList());
return new PageData(result, dtoList.size());
} }
} }