From d97c837d91048c9dbf5687ced8d05412fd6b3c72 Mon Sep 17 00:00:00 2001 From: zhaoqing <1670883518@qq.com> Date: Wed, 13 May 2026 19:11:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=9B=BD=E5=88=AB=20?= =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=8D=95=E4=BD=8D=E8=BF=94=E5=9B=9E=E5=80=BC?= =?UTF-8?q?total=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erpCountry/ErpCountryApplicationService.java | 7 ++++++- .../ErpEnterpriseUnitApplicationService.java | 13 ++++++++++++- .../repository/todo/ErpEnterpriseUnitDO.java | 3 ++- .../interfaces/dto/erpCountry/ErpCountryDTO.java | 7 +++++++ 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java index 161ccecee..9ffd5822f 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpCountry/ErpCountryApplicationService.java @@ -2,6 +2,8 @@ package com.mhd.oms.application.service.erpCountry; import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import com.mhd.common.core.web.domain.AjaxResult; import com.mhd.common.core.web.page.TableDataInfo; import com.mhd.common.security.utils.SecurityUtils; @@ -49,10 +51,13 @@ public class ErpCountryApplicationService{ erpCountryDTO.setTopOrganizationId(topOrganizationId); } } + PageHelper.startPage(erpCountryDTO.getPageNum(),erpCountryDTO.getPageSize()); List list = erpCountryMapper.queryList(erpCountryDTO); + + Page page = (Page) list; TableDataInfo tableDataInfo = new TableDataInfo(); tableDataInfo.setData(list); - tableDataInfo.setTotal(list.size()); + tableDataInfo.setTotal(page.getTotal()); tableDataInfo.setCode(200); return tableDataInfo; diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/erpEnterpriseUnit/ErpEnterpriseUnitApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpEnterpriseUnit/ErpEnterpriseUnitApplicationService.java index bfff5115e..dd20c5960 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/erpEnterpriseUnit/ErpEnterpriseUnitApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/erpEnterpriseUnit/ErpEnterpriseUnitApplicationService.java @@ -2,6 +2,8 @@ package com.mhd.oms.application.service.erpEnterpriseUnit; import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import com.mhd.common.core.utils.bean.BeanUtils; import com.mhd.common.core.web.domain.AjaxResult; import com.mhd.common.core.web.page.TableDataInfo; @@ -44,10 +46,19 @@ public class ErpEnterpriseUnitApplicationService { private GwLogMapper gwLogMapper; public TableDataInfo queryList(ErpEnterpriseUnitDO erpEnterpriseUnitDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1) { + erpEnterpriseUnitDO.setTopOrganizationId(topOrganizationId); + } + } + PageHelper.startPage(erpEnterpriseUnitDO.getPageNum(),erpEnterpriseUnitDO.getPageSize()); List list = erpEnterpriseUnitMapper.queryList(erpEnterpriseUnitDO); + Page page = (Page) list; TableDataInfo tableDataInfo = new TableDataInfo(); tableDataInfo.setData(list); - tableDataInfo.setTotal(list.size()); + tableDataInfo.setTotal(page.getTotal()); tableDataInfo.setCode(200); return tableDataInfo; } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/repository/todo/ErpEnterpriseUnitDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/repository/todo/ErpEnterpriseUnitDO.java index effedcf9f..e587d1c6c 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/repository/todo/ErpEnterpriseUnitDO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/erpEnterpriseUnit/repository/todo/ErpEnterpriseUnitDO.java @@ -51,6 +51,7 @@ public class ErpEnterpriseUnitDO extends BaseVOEntity { @ApiModelProperty(value = "每页数量") private Integer pageSize = 10; - + @ApiModelProperty(value = "每页数量") + private Long TopOrganizationId; } diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/erpCountry/ErpCountryDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/erpCountry/ErpCountryDTO.java index 8452c6265..ddf8639cf 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/erpCountry/ErpCountryDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/erpCountry/ErpCountryDTO.java @@ -32,4 +32,11 @@ public class ErpCountryDTO { @ApiModelProperty(value = "所属组织ID") private Long TopOrganizationId; + + @ApiModelProperty(value = "页码") + private Integer pageNum = 1; + + @ApiModelProperty(value = "每页数量") + private Integer pageSize = 10; + }