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