From 6762341fbd7aaf076791a414fcf38777d13e71bb Mon Sep 17 00:00:00 2001 From: wzk <2438381872@qq.com> Date: Tue, 11 Nov 2025 11:36:15 +0800 Subject: [PATCH] =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E3=80=8B=E9=99=A2=E5=86=85=E5=BA=93?= =?UTF-8?q?=E6=88=BF=E6=83=85=E5=86=B5=E6=9F=A5=E8=AF=A2=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?-=E3=80=8B=E5=BA=93=E5=AD=98=E5=95=86=E5=93=81=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=9F=A5=E8=AF=A2=E6=8A=A5=E8=A1=A8=EF=BC=8C=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=BA=93=E5=AD=98=E8=8C=83=E5=9B=B4=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=E6=8A=A5=E9=94=99=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InventoryProductReportAppServiceImpl.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/InventoryProductReportAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/InventoryProductReportAppServiceImpl.java index 5a836620..d4580f86 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/InventoryProductReportAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportmanage/appservice/impl/InventoryProductReportAppServiceImpl.java @@ -68,6 +68,11 @@ public class InventoryProductReportAppServiceImpl implements IInventoryProductRe public R getPage(InventoryProductReportSearchParam inventoryProductReportSearchParam, Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request) { + // 数据初始化,不使用eq条件拼接 + // 库存范围 + Integer inventoryScope = inventoryProductReportSearchParam.getInventoryScope(); + inventoryProductReportSearchParam.setInventoryScope(null); + // 设置模糊查询的字段名 HashSet searchFields = new HashSet<>(); searchFields.add(CommonConstants.FieldName.BusNo); @@ -76,6 +81,19 @@ public class InventoryProductReportAppServiceImpl implements IInventoryProductRe QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(inventoryProductReportSearchParam, searchKey, searchFields, request); + // 库存范围:无限制(1)、数量等于0(2)、数量大于0(3)、数量小于等于20(4)、数量小于等于50(5) + if (inventoryScope != null) { + if (inventoryScope.equals(2)) { + queryWrapper.eq("item_quantity", 0); + } else if (inventoryScope.equals(3)) { + queryWrapper.gt("item_quantity", 0); + } else if (inventoryScope.equals(4)) { + queryWrapper.le("item_quantity", 20); + } else if (inventoryScope.equals(5)) { + queryWrapper.le("item_quantity", 50); + } + } + // 查询库存商品明细分页列表 Page productReportPage = inventoryProductReportMapper.selectProductReportPage( new Page<>(pageNo, pageSize), queryWrapper, ConditionCode.LOT_NUMBER_COST.getValue().toString()); @@ -104,6 +122,11 @@ public class InventoryProductReportAppServiceImpl implements IInventoryProductRe Integer pageSize, String searchKey, HttpServletRequest request, HttpServletResponse response) { pageNo = 1; pageSize = 10000; + // 数据初始化,不使用eq条件拼接 + // 库存范围 + Integer inventoryScope = inventoryProductReportSearchParam.getInventoryScope(); + inventoryProductReportSearchParam.setInventoryScope(null); + // 设置模糊查询的字段名 HashSet searchFields = new HashSet<>(); searchFields.add(CommonConstants.FieldName.BusNo); @@ -112,6 +135,19 @@ public class InventoryProductReportAppServiceImpl implements IInventoryProductRe QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(inventoryProductReportSearchParam, searchKey, searchFields, request); + // 库存范围:无限制(1)、数量等于0(2)、数量大于0(3)、数量小于等于20(4)、数量小于等于50(5) + if (inventoryScope != null) { + if (inventoryScope.equals(2)) { + queryWrapper.eq("item_quantity", 0); + } else if (inventoryScope.equals(3)) { + queryWrapper.gt("item_quantity", 0); + } else if (inventoryScope.equals(4)) { + queryWrapper.le("item_quantity", 20); + } else if (inventoryScope.equals(5)) { + queryWrapper.le("item_quantity", 50); + } + } + // 查询库存商品明细分页列表 Page productReportPage = inventoryProductReportMapper.selectProductReportPage( new Page<>(pageNo, pageSize), queryWrapper, ConditionCode.LOT_NUMBER_COST.getValue().toString());