From fb46c1fc6bea60ec147dd9f1cb41c4dbdff1e12c Mon Sep 17 00:00:00 2001
From: caoyizhong <1270296080@qq.com>
Date: Mon, 28 Aug 2023 10:59:46 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=87=E8=B4=A7=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E6=9F=A5=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mapper/DistributionDeliveryInfoMapper.xml | 14 +++++++-------
.../mapper/DistributionDeliveryListMapper.xml | 11 +++++------
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
index c81661d34..db515e57e 100644
--- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
+++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
@@ -315,11 +315,11 @@
ldr.consignee consignee,
ldr.reservation_num reservationNum,
COALESCE(lds.loaded_number + lds.loadedin_number, 0) loadingNub,
- (SELECT COALESCE(COUNT(*), 0) from logpm_distribution_reservation_stockarticle ldrs WHERE ldrs.reservation_id =ldr.id ) ordNub,
+ (SELECT COALESCE(COUNT(*), 0) from logpm_distribution_reservation_stockarticle ldrs WHERE ldrs.reservation_id =ldr.id and ldrs.stock_article_status in (1,3) ) ordNub,
COALESCE(lds.received_quantity + lds.receivedin_quantity, 0) signNub
FROM
logpm_distribution_signfor lds
- JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id
+ JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id and ldr.reservation_status != '40'
WHERE
lds.is_deleted = 0
AND lds.delivery_id = #{id}
@@ -337,12 +337,12 @@
lbm.logpm_unit logpmUnit
FROM
logpm_distribution_reservation ldr
- join logpm_distribution_reservation_stocklist ldrs on ldr.id = ldrs.reservation_id
+ join logpm_distribution_reservation_stocklist ldrs on ldr.id = ldrs.reservation_id and ldrs.stock_article_status in (1,3)
join logpm_distribution_stock_list ldsl on ldsl.id = ldrs.stocklist_id
LEFT JOIN logpm_distribution_loadscaninvn ldl on ldsl.id = ldl.inventory_id
left join logpm_basicdata_material lbm on ldsl.material_id = lbm.id
- ldr.is_deleted = 0
+ ldr.is_deleted = 0 and ldr.reservation_status != '40'
AND ldr.id = #{param.reservationId}
@@ -367,7 +367,7 @@
GROUP BY
ldsa.id
) AS loading
- JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id
+ JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3)
JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id
JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id
@@ -406,7 +406,7 @@
GROUP BY
ldsa.id
) AS loading
- JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id
+ JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3)
JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id
JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id
@@ -442,7 +442,7 @@
GROUP BY
ldsa.id
) AS loading
- JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id
+ JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3)
JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id
JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id
diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
index 59619d254..198c3aa93 100644
--- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
+++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
@@ -655,16 +655,15 @@
WHERE lds.delivery_id = lddl.id
) forkliftName, -->
lddl.create_time createTime,
- (SELECT COALESCE(COUNT(*), 0) FROM logpm_distribution_signfor lds WHERE lds.delivery_id =lddl.id)
- customersNumber,
+ lddl.customers_number customersNumber,
lddl.price price,
lddl.added_services_id addedServicesId,
(SELECT COALESCE (COUNT(*) ,0)
FROM
logpm_distribution_signfor lds
- join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id
+ join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id and ldr.reservation_status != '40'
join logpm_distribution_reservation_stockarticle ldrs on ldrs.reservation_id =ldr.id
- WHERE lds.delivery_id = lddl.id
+ WHERE lds.delivery_id = lddl.id and ldrs.stock_article_status in (1,3)
) orderNumber,
(SELECT COALESCE (sum(ldr.reservation_num + ldr.reservation_stock_list_num) ,0)
FROM
@@ -689,7 +688,7 @@
(SELECT COALESCE (sum(ldr.reservation_stock_list_num) ,0)
FROM
logpm_distribution_signfor lds
- join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id
+ join logpm_distribution_reservation ldr on lds.reservation_id =ldr.id and ldr.reservation_status != '40'
WHERE lds.delivery_id = lddl.id) inventoryNub,
(SELECT COALESCE(sum(lds.loaded_number+lds.loadedin_number), 0) FROM logpm_distribution_signfor lds WHERE
lddl.id = lds.delivery_id) scannedNumber,
@@ -699,7 +698,7 @@
where ldr.id in
(select lds.reservation_id
from logpm_distribution_signfor lds
- where lds.delivery_id = lddl.id )
+ where lds.delivery_id = lddl.id ) and ldr.reservation_status != '40'
) consignee
FROM
logpm_distribution_delivery_list lddl