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

This commit is contained in:
2025-11-11 11:51:52 +08:00
parent 6762341fbd
commit c086dc8c77
3 changed files with 23 additions and 29 deletions

View File

@@ -81,22 +81,10 @@ public class InventoryProductReportAppServiceImpl implements IInventoryProductRe
QueryWrapper<InventoryProductReportSearchParam> queryWrapper = QueryWrapper<InventoryProductReportSearchParam> queryWrapper =
HisQueryUtils.buildQueryWrapper(inventoryProductReportSearchParam, searchKey, searchFields, request); 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( Page<InventoryProductReportPageDto> productReportPage = inventoryProductReportMapper.selectProductReportPage(
new Page<>(pageNo, pageSize), queryWrapper, ConditionCode.LOT_NUMBER_COST.getValue().toString()); new Page<>(pageNo, pageSize), queryWrapper, ConditionCode.LOT_NUMBER_COST.getValue().toString(),
inventoryScope);
productReportPage.getRecords().forEach(e -> { productReportPage.getRecords().forEach(e -> {
// 药品类型 // 药品类型
@@ -135,22 +123,10 @@ public class InventoryProductReportAppServiceImpl implements IInventoryProductRe
QueryWrapper<InventoryProductReportSearchParam> queryWrapper = QueryWrapper<InventoryProductReportSearchParam> queryWrapper =
HisQueryUtils.buildQueryWrapper(inventoryProductReportSearchParam, searchKey, searchFields, request); 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( Page<InventoryProductReportPageDto> productReportPage = inventoryProductReportMapper.selectProductReportPage(
new Page<>(pageNo, pageSize), queryWrapper, ConditionCode.LOT_NUMBER_COST.getValue().toString()); new Page<>(pageNo, pageSize), queryWrapper, ConditionCode.LOT_NUMBER_COST.getValue().toString(),
inventoryScope);
productReportPage.getRecords().forEach(e -> { productReportPage.getRecords().forEach(e -> {
// 药品类型 // 药品类型

View File

@@ -27,9 +27,11 @@ public interface InventoryProductReportMapper {
* @param page 分页 * @param page 分页
* @param queryWrapper 查询条件 * @param queryWrapper 查询条件
* @param lotNumber 命中条件枚举类型:产品批号 * @param lotNumber 命中条件枚举类型:产品批号
* @param inventoryScope 库存范围无限制1、数量等于02、数量大于03、数量小于等于204、数量小于等于505
* @return 库存商品明细 * @return 库存商品明细
*/ */
Page<InventoryProductReportPageDto> selectProductReportPage(@Param("page") Page<InventoryProductReportPageDto> page, Page<InventoryProductReportPageDto> selectProductReportPage(@Param("page") Page<InventoryProductReportPageDto> page,
@Param(Constants.WRAPPER) QueryWrapper<InventoryProductReportSearchParam> queryWrapper, @Param(Constants.WRAPPER) QueryWrapper<InventoryProductReportSearchParam> queryWrapper,
@Param("lotNumber") String lotNumber); @Param("lotNumber") String lotNumber,
@Param("inventoryScope") Integer inventoryScope);
} }

View File

@@ -139,5 +139,21 @@
WHERE T1.delete_flag = '0') AS T10 WHERE T1.delete_flag = '0') AS T10
) AS T ) AS T
${ew.customSqlSegment} ${ew.customSqlSegment}
<if test="inventoryScope != null">
<choose>
<when test="inventoryScope == 2">
AND item_quantity = 0
</when>
<when test="inventoryScope == 3">
AND item_quantity > 0
</when>
<when test="inventoryScope == 4">
AND item_quantity <![CDATA[ <= ]]> 20
</when>
<when test="inventoryScope == 5">
AND item_quantity <![CDATA[ <= ]]> 50
</when>
</choose>
</if>
</select> </select>
</mapper> </mapper>