feat(coal): 添加组织ID筛选条件

- 在 CoalWashingDailyAnalysisCoalReportRequest 中添加 organizationId 字段
- 在报告查询 SQL 中加入 organization_id 的筛选条件- 自动设置当前用户的组织ID作为查询条件
This commit is contained in:
2025-03-13 12:43:51 +08:00
parent d905e1dd1e
commit f90878e702
2 changed files with 3 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ month
private List<String> productIds;
private List<String> coalInfoIds;
private String organizationId;
@Data
public static class FieldInfo {

View File

@@ -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>
<#if endTime??> and date <= :endTime </#if>