按日期查询报错;

This commit is contained in:
王奎兴
2026-06-03 09:42:27 +08:00
parent 32dde06899
commit 08ac9b2eba
5 changed files with 17 additions and 5 deletions
@@ -247,4 +247,6 @@ public class MaterialInventoryDO extends MaterialBaseDO {
/** 为 true 时 SQL 排除库存数量为 0(含 null 视为 0) */
private Boolean excludeZeroInventoryQuantity;
private String expiryDateStr;
private String productionDateStr;
}
@@ -188,5 +188,7 @@ public class MaterialInventoryDTO extends MaterialBaseDTO {
/** 为 true 时排除库存数量为 0 的行(出库分配选库存用);库存查询页不传或 false */
@ApiModelProperty(value = "是否排除库存数量为0", example = "false")
private Boolean excludeZeroInventoryQuantity;
private String expiryDate;
private String productionDate;
}
@@ -81,6 +81,8 @@ public class MaterialInventoryApi extends BaseController {
//转换实体
MaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO);
materialInventoryDO.setExpiryDateStr(materialInventoryDTO.getExpiryDate());
materialInventoryDO.setProductionDateStr(materialInventoryDTO.getProductionDate());
startPage();
// 使用带批次属性的查询方法,批次属性值从库存表中获取
List<MaterialInventoryPO> list = materialInventoryApplicationService.queryListWithBatchAttributes(materialInventoryDO);
@@ -220,4 +222,4 @@ public class MaterialInventoryApi extends BaseController {
return AjaxResult.success(materialInventoryApplicationService.sumInventoryQuantity(materialInventoryDO));
}
}
}
@@ -232,6 +232,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="boxPalletNo != null and boxPalletNo != ''">
and a.BOX_PALLET_NO like concat('%', #{boxPalletNo}, '%')
</if>
<if test="expiryDateStr != null and expiryDateStr != ''">
AND TO_CHAR(b.expiry_date, 'yyyy-MM-dd') = #{expiryDateStr}
</if>
<if test="productionDateStr != null and productionDateStr != ''">
AND TO_CHAR(b.production_date, 'yyyy-MM-dd') = #{productionDateStr}
</if>
</sql>
<!-- 与 selectMaterialInventoryPo1 相同条件,表别名为 mi(用于 queryListByWl 最新明细子查询) -->