fix(oms): 预约入库单列表接口补充申报数量字段

reservationStockInOrderApi/list 返回缺少申报数量,原因为查询只查主表、
未关联明细表汇总,且返回对象无对应字段

- ReservationStockInOrderPO 新增 declaredQuantity 字段
- StockInOrderResult resultMap 增加 declaredQuantity 映射
- selectStockInOrderPo 片段增加 reservation_in_material_detail
  的 DECLARED_QUANTITY 汇总子查询(按 level=1 过滤主明细行)
This commit is contained in:
rcx
2026-08-14 11:02:18 +08:00
parent 63dcfaf028
commit 6a87c5a75a
2 changed files with 15 additions and 0 deletions
@@ -163,6 +163,13 @@ public class ReservationStockInOrderPO extends BaseVOEntity {
@Excel(name = "入库数量")
private BigDecimal inQuantity;
/**
* 申报数量:入库单明细中申报数量(DECLARED_QUANTITY)汇总
*/
@ApiModelProperty("申报数量")
@Excel(name = "申报数量")
private BigDecimal declaredQuantity;
/**
* 计划入库数量:取入库单明细中的入库数量汇总
*/
@@ -33,6 +33,7 @@
<result property="directWarehouse" column="direct_warehouse" />
<result property="annexUrl" column="annex_url" />
<result property="quantity" column="quantity" />
<result property="declaredQuantity" column="declared_quantity" />
<result property="planInQuantity" column="plan_in_quantity" />
<result property="receiptQuantity" column="receipt_quantity" />
<result property="shelvesQuantity" column="shelves_quantity" />
@@ -136,6 +137,13 @@
<!-- where sso.in_order_number = a.in_order_number-->
<!-- and sso.del_flag = 1-->
<!-- ) as shelves_quantity,-->
-- 申报数量:入库单明细表 reservation_in_material_detail 的 DECLARED_QUANTITY 汇总
(select ifnull(sum(imd.declared_quantity), 0)
from reservation_in_material_detail imd
where imd.in_order_number = a.in_order_number
and imd.del_flag = 1
and (imd.level is null or imd.level = 1)
) as declared_quantity,
a.weight_limit, a.volume_limit, a.cancel_order, a.cancel_remark, a.cancel_by,a.PICTURE_URL,
a.cancel_by_name, a.cancel_time, a.close_order, a.close_remark, a.close_by, a.close_by_name, a.close_time, a.remark, a.create_time, a.create_by,
a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, a.over_stock_id, a.over_stock_status, a.over_stock_type,