From 59599d193b404c9de8b16164d8e93a2ff0fc58e9 Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Sun, 23 Feb 2025 15:32:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(warehouseReceipt):=20=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E6=9F=A5=E8=AF=A2=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=88=97=E8=A1=A8=E6=B7=BB=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=8D=95=20ID=20=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在查询供应商统计列表的 SQL 中添加了入库单 ID 字段 - 该字段通过子查询获取,包含多个筛选条件以满足不同查询需求 - 新增的入库单 ID 字段为数组形式,包含所有符合条件的入库单 ID --- .../service/WarehouseReceiptService.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/main/java/cn/lihongjie/coal/warehouseReceipt/service/WarehouseReceiptService.java b/src/main/java/cn/lihongjie/coal/warehouseReceipt/service/WarehouseReceiptService.java index 3c84015a..1c1180b6 100644 --- a/src/main/java/cn/lihongjie/coal/warehouseReceipt/service/WarehouseReceiptService.java +++ b/src/main/java/cn/lihongjie/coal/warehouseReceipt/service/WarehouseReceiptService.java @@ -1008,6 +1008,58 @@ from ( ) as "入库单数量", + + (select array_agg(distinct re.id) + from t_warehouse_receipt re + inner join t_warehouse_receipt_detail d + on re.id = d.receipt_id + inner join t_warehouse_goods gs on d.goods_id = gs.id + where re.organization_id = s.organization_id + and re.receipt_type = '0' + and d.supplier_id = s.id + <#if startTime??> + and re.receipt_date >= :startTime + + <#if endTime??> + and re.receipt_date <= :endTime + + <#if reason??> + and re.reason like '%' || :reason || '%' + + <#if goodsIds?has_content> + and gs.id in :goodsIds + + + <#if barCode??> + and gs.bar_code like '%' || :barCode || '%' + + <#if code??> + and gs.code like '%' || :code || '%' + + + + <#if goodsName??> + + and gs.name like '%' || :goodsName || '%' + + + <#if categoryIds?has_content> + and gs.category_id in :categoryIds + + + <#if brandIds?has_content> + and gs.brand_id in :brandIds + + + <#if unitIds?has_content> + and gs.unit_id in :unitIds + + + <#if warehouseIds?has_content> + and d.warehouse_id in :warehouseIds + + + ) as "入库单ID", (select COALESCE(count(d.id),0) from t_warehouse_receipt re