feat(oms):入库业务单新增页面新增按物料编号查询库存批次最近5条过期日期接口 /reservationMaterialInventoryApi/queryRecentExpiryDates/{materialCode},按物料编号关联 NGWL_TEST_WMS.material_base_info 查 reservation_material_inventory 库存批次,返回过期日期+批次号(date_format 按天去重、到期日倒序、limit 5),供前端下拉回显(也可点日期图标手动选择);非平台租户按登录用户一级组织 top_organization_id 过滤(与 /list 一致);沿用 Api→ApplicationService→DomainService→Facade→Impl→Mapper 分层,新增响应对象 MaterialInventoryExpiryBatchPO(expiryDate/batchNumber)
This commit is contained in:
+17
@@ -557,4 +557,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
FROM NGWL_TEST_WMS.material_bar_code
|
||||
WHERE material_base_info_id = #{id} AND del_flag = 1
|
||||
</select>
|
||||
|
||||
<!-- 入库业务单新增:根据物料编号查询其库存批次的过期日期+批次号,去重后取最近5条,供前端下拉回显 -->
|
||||
<select id="selectRecentExpiryBatches" resultType="com.mhd.oms.domain.reservationMaterialInventory.repository.po.MaterialInventoryExpiryBatchPO">
|
||||
select distinct
|
||||
date_format(a.expiry_date, '%Y-%m-%d') as expiryDate,
|
||||
a.batch_number as batchNumber
|
||||
from reservation_material_inventory a
|
||||
left join NGWL_TEST_WMS.material_base_info b on a.material_base_info_id = b.material_base_info_id
|
||||
where a.del_flag = 1
|
||||
and a.expiry_date is not null
|
||||
and b.material_code = #{materialCode}
|
||||
<if test="topOrganizationId != null">
|
||||
and a.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
order by expiryDate desc, batchNumber desc
|
||||
limit 5
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user