Browse Source

Merge branch 'dev' into pre-production

master
zhenghaoyu 10 months ago
parent
commit
83c1af5346
  1. 57
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

57
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

@ -283,39 +283,54 @@
</where>
</select>
<select id="selectDistributionDeliveryinventoryByDeliveryId" resultType="com.logpm.distribution.vo.DistributionStockListVO">
select
ldsl.sku sku,
SELECT
ldsl.sku AS sku,
ldsl.incoming_batch AS incomingBatch,
ldsl.order_code AS order_code,
ldsl.warehouse_name AS warehouseName,
ldsl.market_name AS marketName,
ldsl.brand_name AS brandName,
ldrsl.reservation_num AS plannedQuantity,
ldsl.description_goods descriptionGoods,
ldsl.cargo_unit cargoUnit,
( SELECT
sum(ldrsl.reservation_num)
ldsl.description_goods AS descriptionGoods,
ldsl.cargo_unit AS cargoUnit,
(
SELECT COALESCE
( count(*), 0 )
FROM
logpm_distribution_reservation_stocklist ldrsl
logpm_dis_stock_list_detail ldsld
WHERE
ldrsl.stocklist_id = ldsl.id) deliveryNumber,
ldsl.id = ldsld.stock_list_id
AND ldrsl.reservation_id = ldsld.reservation_id
) AS plannedQuantity,
( SELECT COALESCE ( count(*), 0 ) FROM logpm_distribution_stock lds WHERE ldsl.id = lds.stock_list_id AND lds.reservation_id =ldrsl.reservation_id AND lds.tenant_id = '627683' ) AS readyStock,
(
SELECT
COALESCE(count(*), 0)
SELECT COALESCE
( count(*), 0 )
FROM
logpm_distribution_stock lds
logpm_dis_stock_list_detail ldsld
WHERE
ldsl.id = lds.stock_list_id
) readyStock,
( SELECT COALESCE ( count(*), 0 ) FROM logpm_dis_stock_list_detail ldsld WHERE ldsl.id = ldsld.stock_list_id AND ldrsl.reservation_id = ldsld.reservation_id AND ldsld.stock_locking_status = '20' ) AS loadedinNumber,
( SELECT COALESCE ( count(*), 0 ) FROM logpm_dis_stock_list_detail ldsld WHERE ldsl.id = ldsld.stock_list_id AND ldrsl.reservation_id = ldsld.reservation_id AND ldsld.stock_signfo_status = '20' ) AS signedinNumber,
ldsl.storage_location goodsAllocation,
ldsl.cargo_number cargoNumber
ldsl.id = ldsld.stock_list_id
AND ldrsl.reservation_id = ldsld.reservation_id
AND ldsld.stock_locking_status = '20'
AND ldsld.tenant_id = '627683'
) AS loadingNumber,
(
SELECT COALESCE
( count(*), 0 )
FROM
logpm_dis_stock_list_detail ldsld
WHERE
ldsl.id = ldsld.stock_list_id
AND ldrsl.reservation_id = ldsld.reservation_id
AND ldsld.stock_signfo_status = '20'
AND ldsld.tenant_id = '627683'
) AS signedingNumber,
ldsl.storage_location AS goodsAllocation,
ldsl.cargo_number AS cargoNumber
FROM
logpm_distribution_reservation_stocklist ldrsl
JOIN logpm_distribution_signfor lds on lds.reservation_id = ldrsl.reservation_id
JOIN logpm_distribution_delivery_list lddl on lddl.id = lds.delivery_id
join logpm_distribution_stock_list ldsl on ldrsl.stocklist_id = ldsl.id
JOIN logpm_distribution_signfor lds ON lds.reservation_id = ldrsl.reservation_id
JOIN logpm_distribution_delivery_list lddl ON lddl.id = lds.delivery_id
JOIN logpm_distribution_stock_list ldsl ON ldrsl.stocklist_id = ldsl.id
<where>
lds.is_deleted =0 and lddl.id = #{deliveryId}
</where>

Loading…
Cancel
Save