From f90878e70216e7baea721957e91d8204a34be947 Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Thu, 13 Mar 2025 12:43:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(coal):=20=E6=B7=BB=E5=8A=A0=E7=BB=84?= =?UTF-8?q?=E7=BB=87ID=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 CoalWashingDailyAnalysisCoalReportRequest 中添加 organizationId 字段 - 在报告查询 SQL 中加入 organization_id 的筛选条件- 自动设置当前用户的组织ID作为查询条件 --- .../dto/CoalWashingDailyAnalysisCoalReportRequest.java | 1 + .../service/CoalWashingDailyAnalysisService.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/dto/CoalWashingDailyAnalysisCoalReportRequest.java b/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/dto/CoalWashingDailyAnalysisCoalReportRequest.java index c553e809..373cd379 100644 --- a/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/dto/CoalWashingDailyAnalysisCoalReportRequest.java +++ b/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/dto/CoalWashingDailyAnalysisCoalReportRequest.java @@ -39,6 +39,7 @@ month private List productIds; private List coalInfoIds; + private String organizationId; @Data public static class FieldInfo { diff --git a/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/service/CoalWashingDailyAnalysisService.java b/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/service/CoalWashingDailyAnalysisService.java index 694554d7..45b86d4f 100644 --- a/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/service/CoalWashingDailyAnalysisService.java +++ b/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/service/CoalWashingDailyAnalysisService.java @@ -249,6 +249,7 @@ public class CoalWashingDailyAnalysisService public Object report(CoalWashingDailyAnalysisCoalReportRequest request) { + request.setOrganizationId(Ctx.currentUser().getOrganizationId()); String sql = FreeMakerUtils.render( """ @@ -273,7 +274,7 @@ public class CoalWashingDailyAnalysisService inner join t_product p on p.id = a.product_id - where 1=1 + where 1=1 and d.organization_id = :organizationId <#if startTime??> and date >= :startTime <#if endTime??> and date <= :endTime