From 10c76dfd9eb24443742819705e386360b71f2e0d Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 11 Dec 2023 20:21:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E8=B4=A7sql=E9=87=8D=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/mapper/DistributionReservationMapper.xml | 7 ++++--- .../service/impl/DistributionDeliveryListServiceImpl.java | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index 67e04b3a4..a812c7357 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -306,8 +306,8 @@ t.cargoUnit AS cargoUnit, ldslNew.tray_name AS trayName, ldslNew.unpack AS unpack, - (SELECT count(*) FROM logpm_distribution_stock AS lds WHERE lds.stock_list_id =#{reservationId} AND lds.is_deleted = 0) AS realNum, - t.reservationNum as planNum, + (SELECT SUM(aldrs.reality_num) FROM logpm_distribution_reservation_stocklist AS aldrs WHERE aldrs.reservation_id = #{reservationId} AND aldrs.stocklist_id in (t.aaa)) AS realNum, + (SELECT SUM(newldrs.reservation_num) FROM logpm_distribution_reservation_stocklist AS newldrs WHERE newldrs.reservation_id = #{reservationId} AND newldrs.stocklist_id in (t.aaa)) AS planNum, ( select GROUP_CONCAT( DISTINCT (allocation_id)) from logpm_warehouse_updown_goods where association_value =ldslNew.cargo_number or association_value in ( SELECT order_package_code from logpm_distribution_parcel_list where conditions=2 and material_code=ldslNew.cargo_number) @@ -320,7 +320,8 @@ ldsl.id, ldrs.id as deliveryDetailsId, ldsl.cargo_unit as cargoUnit, - ldrs.reservation_num AS reservationNum + ldrs.reservation_num AS reservationNum, + GROUP_CONCAT(ldsl.id) AS aaa FROM logpm_distribution_reservation_stocklist ldrs LEFT JOIN logpm_distribution_stock_list ldsl ON ldrs.stocklist_id = ldsl.id diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 900c4f0cf..6484cc1a1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -5005,7 +5005,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl goodsLsit = trayTypeDataVO.getGoodsLsit(); if (Func.isNotEmpty(goodsLsit)) { List longs = goodsLsit.stream().map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList());