修改报表管理-》院内库房情况查询报表-》库存商品明细查询报表,选择库存范围条件检索报错。

This commit is contained in:
2025-11-11 11:36:15 +08:00
parent d5f8b0f23b
commit 6762341fbd

View File

@@ -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<String> searchFields = new HashSet<>();
searchFields.add(CommonConstants.FieldName.BusNo);
@@ -76,6 +81,19 @@ public class InventoryProductReportAppServiceImpl implements IInventoryProductRe
QueryWrapper<InventoryProductReportSearchParam> queryWrapper =
HisQueryUtils.buildQueryWrapper(inventoryProductReportSearchParam, searchKey, searchFields, request);
// 库存范围无限制1、数量等于02、数量大于03、数量小于等于204、数量小于等于505
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<InventoryProductReportPageDto> 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<String> searchFields = new HashSet<>();
searchFields.add(CommonConstants.FieldName.BusNo);
@@ -112,6 +135,19 @@ public class InventoryProductReportAppServiceImpl implements IInventoryProductRe
QueryWrapper<InventoryProductReportSearchParam> queryWrapper =
HisQueryUtils.buildQueryWrapper(inventoryProductReportSearchParam, searchKey, searchFields, request);
// 库存范围无限制1、数量等于02、数量大于03、数量小于等于204、数量小于等于505
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<InventoryProductReportPageDto> productReportPage = inventoryProductReportMapper.selectProductReportPage(
new Page<>(pageNo, pageSize), queryWrapper, ConditionCode.LOT_NUMBER_COST.getValue().toString());