diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/stockInOrder/repository/po/StockInOrderPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/stockInOrder/repository/po/StockInOrderPO.java index b50bce6f6..ab1ce0335 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/stockInOrder/repository/po/StockInOrderPO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/stockInOrder/repository/po/StockInOrderPO.java @@ -149,10 +149,31 @@ public class StockInOrderPO extends BaseVOEntity { @Excel(name = "物料种数") private Integer materialQuantity; - @ApiModelProperty("计划数量") - @Excel(name = "计划数量") + @ApiModelProperty("计划数量(原字段)") + @Excel(name = "计划数量(原字段)") private BigDecimal quantity; + /** + * 计划入库数量:取入库单明细中的入库数量汇总 + */ + @ApiModelProperty("计划入库数量") + @Excel(name = "计划入库数量") + private BigDecimal planInQuantity; + + /** + * 收货数量:入库单对应的收货单实际收货数量汇总 + */ + @ApiModelProperty("收货数量") + @Excel(name = "收货数量") + private BigDecimal receiptQuantity; + + /** + * 上架数量:入库单对应的上架单实际上架数量汇总 + */ + @ApiModelProperty("上架数量") + @Excel(name = "上架数量") + private BigDecimal shelvesQuantity; + @ApiModelProperty("净重 单位:千克") @Excel(name = "净重 单位:千克") private BigDecimal weightLimit; diff --git a/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml b/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml index f65eacbca..13c75df64 100644 --- a/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml +++ b/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml @@ -33,6 +33,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + @@ -84,7 +87,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.in_order_id, a.organization_id, a.organization_name, a.top_organization_id, a.notice_number, a.in_order_number, a.status, a.audit_status, a.audit_remark, a.audit_by, a.audit_by_name, a.audit_time, a.warehouse_id, a.warehouse_code, a.warehouse_name, a.shipper_id, a.shipper_code, a.shipper_name, a.order_type_code, a.order_type_name, a.supplier_id, a.supplier_code, a.supplier_name, a.expect_time, a.supply_chain_number, - a.priority_level_code, a.priority_level_name, a.direct_warehouse, a.annex_url, a.material_quantity, a.quantity, a.weight_limit, a.volume_limit, a.cancel_order, a.cancel_remark, a.cancel_by, + a.priority_level_code, a.priority_level_name, a.direct_warehouse, a.annex_url, a.material_quantity, a.quantity, + -- 计划入库数量:入库明细表 in_material_detail 的 quantity 汇总 + (select ifnull(sum(imd.quantity), 0) + from 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 plan_in_quantity, + -- 收货数量:收货单表 stock_receipt_order 的 receipt_quantity 汇总 + (select ifnull(sum(sro.receipt_quantity), 0) + from stock_receipt_order sro + where sro.in_order_number = a.in_order_number + and sro.del_flag = 1 + ) as receipt_quantity, + -- 上架数量:上架单表 stock_shelf_order 的 shelves_quantity 汇总 + (select ifnull(sum(sso.shelves_quantity), 0) + from stock_shelf_order sso + where sso.in_order_number = a.in_order_number + and sso.del_flag = 1 + ) as shelves_quantity, + a.weight_limit, a.volume_limit, a.cancel_order, a.cancel_remark, a.cancel_by, 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, over_stock_id, over_stock_status, over_stock_type, a."TO", a.CONTACT_PERSON, a.VEHICLE_INFO, a.CONSIGNMENT_NO, a.TEL, a.DRIVER_SIGNATURE, a.FAX, a.DECLARATION_AREA, a.MANUFACTURER,