From 6a526991d99490fa607ed2a924c871524e8210b2 Mon Sep 17 00:00:00 2001 From: yuanwei Date: Mon, 15 Jan 2024 17:05:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug=E4=B8=8D=E8=89=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/anno/AnncmntDevController.java | 11 +++++++---- .../controller/anno/AnncmntManuCertController.java | 12 ++++++++---- .../api/controller/anno/AnncmntManuController.java | 11 +++++++---- .../anno/AnncmntProductBatchController.java | 12 ++++++++---- .../controller/anno/AnncmntProductController.java | 12 ++++++++---- .../controller/anno/AnncmntYlqxzcrController.java | 10 ++++++---- .../controller/anno/AnncmntYlqxzczhController.java | 10 ++++++---- 7 files changed, 50 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/anno/AnncmntDevController.java b/src/main/java/com/glxp/api/controller/anno/AnncmntDevController.java index a25a9f3..bd2547c 100644 --- a/src/main/java/com/glxp/api/controller/anno/AnncmntDevController.java +++ b/src/main/java/com/glxp/api/controller/anno/AnncmntDevController.java @@ -4,7 +4,8 @@ package com.glxp.api.controller.anno; import cn.hutool.core.lang.func.Func; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.Log; @@ -15,6 +16,7 @@ import com.glxp.api.constant.BusinessType; import com.glxp.api.controller.BaseController; import com.glxp.api.entity.anno.AnncmntDevEntity; import com.glxp.api.entity.auth.SysCustomConfigDetailEntity; +import com.glxp.api.entity.stat.AnncmntYlqxzcrEntity; import com.glxp.api.req.anno.AnncmntDevEntityRequest; import com.glxp.api.req.auth.SysCustomConfigDetailRequest; import com.glxp.api.req.system.DeleteRequest; @@ -51,11 +53,12 @@ public class AnncmntDevController extends BaseController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - IPage page = new Page(request.getPage(),request.getLimit()); - IPage pages = anncmntDevService.page(page, getQueryWrapper(request)); + int offset = (request.getPage() - 1) * request.getLimit(); + Page pages = PageHelper.offsetPage(offset, request.getLimit()); + List list = anncmntDevService.list(getQueryWrapper(request)); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(pages.getTotal()); - pageSimpleResponse.setList(pages.getRecords()); + pageSimpleResponse.setList(list); return ResultVOUtils.success(pageSimpleResponse); } diff --git a/src/main/java/com/glxp/api/controller/anno/AnncmntManuCertController.java b/src/main/java/com/glxp/api/controller/anno/AnncmntManuCertController.java index 5116eaf..093ba50 100644 --- a/src/main/java/com/glxp/api/controller/anno/AnncmntManuCertController.java +++ b/src/main/java/com/glxp/api/controller/anno/AnncmntManuCertController.java @@ -3,7 +3,8 @@ package com.glxp.api.controller.anno; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.Log; import com.glxp.api.common.enums.ResultEnum; @@ -11,6 +12,7 @@ import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BusinessType; import com.glxp.api.controller.BaseController; +import com.glxp.api.entity.anno.AnncmntDevEntity; import com.glxp.api.entity.stat.AnncmntManuCertEntity; import com.glxp.api.entity.stat.AnncmntManuEntity; import com.glxp.api.req.anno.AnncmntDevEntityRequest; @@ -29,6 +31,7 @@ import springfox.documentation.annotations.ApiIgnore; import javax.validation.Valid; import java.util.Date; +import java.util.List; /** * 用户信息 @@ -49,11 +52,12 @@ public class AnncmntManuCertController extends BaseController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - IPage page = new Page(request.getPage(),request.getLimit()); - IPage pages = anncmntManuCertService.page(page, getQueryWrapper(request)); + int offset = (request.getPage() - 1) * request.getLimit(); + Page pages = PageHelper.offsetPage(offset, request.getLimit()); + List list = anncmntManuCertService.list(getQueryWrapper(request)); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(pages.getTotal()); - pageSimpleResponse.setList(pages.getRecords()); + pageSimpleResponse.setList(list); return ResultVOUtils.success(pageSimpleResponse); } diff --git a/src/main/java/com/glxp/api/controller/anno/AnncmntManuController.java b/src/main/java/com/glxp/api/controller/anno/AnncmntManuController.java index 2ba19f0..ce750a1 100644 --- a/src/main/java/com/glxp/api/controller/anno/AnncmntManuController.java +++ b/src/main/java/com/glxp/api/controller/anno/AnncmntManuController.java @@ -3,7 +3,8 @@ package com.glxp.api.controller.anno; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.Log; import com.glxp.api.common.enums.ResultEnum; @@ -13,6 +14,7 @@ import com.glxp.api.constant.BusinessType; import com.glxp.api.controller.BaseController; import com.glxp.api.dto.DictDto; import com.glxp.api.entity.anno.AnncmntDevEntity; +import com.glxp.api.entity.stat.AnncmntManuCertEntity; import com.glxp.api.entity.stat.AnncmntManuEntity; import com.glxp.api.entity.stat.AnncmntYlqxzcrEntity; import com.glxp.api.req.anno.AnncmntDevEntityRequest; @@ -54,11 +56,12 @@ public class AnncmntManuController extends BaseController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - IPage page = new Page(request.getPage(),request.getLimit()); - IPage pages = anncmntManuService.page(page, getQueryWrapper(request)); + int offset = (request.getPage() - 1) * request.getLimit(); + Page pages = PageHelper.offsetPage(offset, request.getLimit()); + List list = anncmntManuService.list(getQueryWrapper(request)); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(pages.getTotal()); - pageSimpleResponse.setList(pages.getRecords()); + pageSimpleResponse.setList(list); return ResultVOUtils.success(pageSimpleResponse); } diff --git a/src/main/java/com/glxp/api/controller/anno/AnncmntProductBatchController.java b/src/main/java/com/glxp/api/controller/anno/AnncmntProductBatchController.java index 9827178..f648432 100644 --- a/src/main/java/com/glxp/api/controller/anno/AnncmntProductBatchController.java +++ b/src/main/java/com/glxp/api/controller/anno/AnncmntProductBatchController.java @@ -3,7 +3,8 @@ package com.glxp.api.controller.anno; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.Log; import com.glxp.api.common.enums.ResultEnum; @@ -12,6 +13,7 @@ import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BusinessType; import com.glxp.api.controller.BaseController; import com.glxp.api.entity.stat.AnncmntManuCertEntity; +import com.glxp.api.entity.stat.AnncmntManuEntity; import com.glxp.api.entity.stat.AnncmntProductBatchEntity; import com.glxp.api.req.anno.AnncmntManuCertEntityRequest; import com.glxp.api.req.anno.AnncmntProductBatchEntityRequest; @@ -29,6 +31,7 @@ import springfox.documentation.annotations.ApiIgnore; import javax.validation.Valid; import java.util.Date; +import java.util.List; /** * 用户信息 @@ -49,11 +52,12 @@ public class AnncmntProductBatchController extends BaseController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - IPage page = new Page(request.getPage(),request.getLimit()); - IPage pages = anncmntProductBatchService.page(page, getQueryWrapper(request)); + int offset = (request.getPage() - 1) * request.getLimit(); + Page pages = PageHelper.offsetPage(offset, request.getLimit()); + List list = anncmntProductBatchService.list(getQueryWrapper(request)); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(pages.getTotal()); - pageSimpleResponse.setList(pages.getRecords()); + pageSimpleResponse.setList(list); return ResultVOUtils.success(pageSimpleResponse); } diff --git a/src/main/java/com/glxp/api/controller/anno/AnncmntProductController.java b/src/main/java/com/glxp/api/controller/anno/AnncmntProductController.java index 82d2e31..763b667 100644 --- a/src/main/java/com/glxp/api/controller/anno/AnncmntProductController.java +++ b/src/main/java/com/glxp/api/controller/anno/AnncmntProductController.java @@ -3,7 +3,8 @@ package com.glxp.api.controller.anno; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.Log; import com.glxp.api.common.enums.ResultEnum; @@ -12,6 +13,7 @@ import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BusinessType; import com.glxp.api.controller.BaseController; import com.glxp.api.entity.stat.AnncmntManuEntity; +import com.glxp.api.entity.stat.AnncmntProductBatchEntity; import com.glxp.api.entity.stat.AnncmntProductEntity; import com.glxp.api.req.anno.AnncmntDevEntityRequest; import com.glxp.api.req.anno.AnncmntProductEntityRequest; @@ -29,6 +31,7 @@ import springfox.documentation.annotations.ApiIgnore; import javax.validation.Valid; import java.util.Date; +import java.util.List; /** * 用户信息 @@ -49,11 +52,12 @@ public class AnncmntProductController extends BaseController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - IPage page = new Page(request.getPage(),request.getLimit()); - IPage pages = anncmntProductService.page(page, getQueryWrapper(request)); + int offset = (request.getPage() - 1) * request.getLimit(); + Page pages = PageHelper.offsetPage(offset, request.getLimit()); + List list = anncmntProductService.list(getQueryWrapper(request)); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(pages.getTotal()); - pageSimpleResponse.setList(pages.getRecords()); + pageSimpleResponse.setList(list); return ResultVOUtils.success(pageSimpleResponse); } diff --git a/src/main/java/com/glxp/api/controller/anno/AnncmntYlqxzcrController.java b/src/main/java/com/glxp/api/controller/anno/AnncmntYlqxzcrController.java index 5a62c01..587d4ce 100644 --- a/src/main/java/com/glxp/api/controller/anno/AnncmntYlqxzcrController.java +++ b/src/main/java/com/glxp/api/controller/anno/AnncmntYlqxzcrController.java @@ -3,7 +3,8 @@ package com.glxp.api.controller.anno; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.Log; import com.glxp.api.common.enums.ResultEnum; @@ -51,11 +52,12 @@ public class AnncmntYlqxzcrController extends BaseController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - IPage page = new Page(request.getPage(),request.getLimit()); - IPage pages = anncmntYlqxzcrService.page(page, getQueryWrapper(request)); + int offset = (request.getPage() - 1) * request.getLimit(); + Page pages = PageHelper.offsetPage(offset, request.getLimit()); + List list = anncmntYlqxzcrService.list(getQueryWrapper(request)); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(pages.getTotal()); - pageSimpleResponse.setList(pages.getRecords()); + pageSimpleResponse.setList(list); return ResultVOUtils.success(pageSimpleResponse); } diff --git a/src/main/java/com/glxp/api/controller/anno/AnncmntYlqxzczhController.java b/src/main/java/com/glxp/api/controller/anno/AnncmntYlqxzczhController.java index f12581f..6f96528 100644 --- a/src/main/java/com/glxp/api/controller/anno/AnncmntYlqxzczhController.java +++ b/src/main/java/com/glxp/api/controller/anno/AnncmntYlqxzczhController.java @@ -3,7 +3,8 @@ package com.glxp.api.controller.anno; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.Log; import com.glxp.api.common.enums.ResultEnum; @@ -52,11 +53,12 @@ public class AnncmntYlqxzczhController extends BaseController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - IPage page = new Page(request.getPage(),request.getLimit()); - IPage pages = anncmntYlqxzczhService.page(page, getQueryWrapper(request)); + int offset = (request.getPage() - 1) * request.getLimit(); + Page pages = PageHelper.offsetPage(offset, request.getLimit()); + List list = anncmntYlqxzczhService.list(getQueryWrapper(request)); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(pages.getTotal()); - pageSimpleResponse.setList(pages.getRecords()); + pageSimpleResponse.setList(list); return ResultVOUtils.success(pageSimpleResponse); }