From 30a4ce67971c5ad8f628b2002cd5b09c5e4e5e18 Mon Sep 17 00:00:00 2001 From: lizhicheng Date: Wed, 19 Oct 2022 10:16:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E5=8A=A0?= =?UTF-8?q?=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/CensusController.java | 5 ++++ .../service/impl/ResourceServiceImpl.java | 25 +++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index d8ddc33b..bcc0e981 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.renren.common.annotation.LogOperation; +import io.renren.common.constant.Constant; import io.renren.common.utils.Result; import io.renren.modules.processForm.service.TAbilityApplicationService; import io.renren.modules.resource.dao.ResourceDao; @@ -461,6 +462,8 @@ public class CensusController { @ApiOperation("查询部门上架资源及审批结果详细信息") @LogOperation("查询部门上架资源及审批结果详细信息") @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 = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"), @@ -526,6 +529,8 @@ public class CensusController { @ApiOperation("查询部门申请资源及审批结果详细信息") @LogOperation("查询部门申请资源及审批结果详细信息") @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 = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"), diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index a226a89c..cc91b246 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -15,6 +15,7 @@ import io.renren.common.domain.Tsingtao_xhaProperties; import io.renren.common.page.PageData; import io.renren.common.service.impl.CrudServiceImpl; 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.entity.CameraChannel; import io.renren.modules.monitor.mapper.CameraChannelMapper; @@ -2283,12 +2284,32 @@ public class ResourceServiceImpl extends CrudServiceImpl dtoList= resourceDao.selectCensusResourceTable(params); + List result = dtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList()); + return new PageData(result, dtoList.size()); } @Override 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 dtoList= resourceDao.selectCensusApplyTable(params); + List result = dtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList()); + return new PageData(result, dtoList.size()); } } \ No newline at end of file