diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/mapper/ProdReportMapper.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/mapper/ProdReportMapper.java index 96aa7b25..8dafbf7f 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/mapper/ProdReportMapper.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/mapper/ProdReportMapper.java @@ -130,7 +130,8 @@ public interface ProdReportMapper { * @return 工序进度明细 */ List getOrdersProcessProgressBatch(@Param("productOrderIds") List productOrderIds, - @Param("planTableName") String planTableName); + @Param("planTableName") String planTableName, + @Param("tenantId") String tenantId); // 新增:小时产量统计(按结束时间小时分桶) List> hourlyOutputByHour(@Param("map") Map hashMap, diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdReportServiceImpl.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdReportServiceImpl.java index ae46a863..00843d80 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdReportServiceImpl.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdReportServiceImpl.java @@ -3,6 +3,7 @@ package org.dromara.mes.service.impl; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; import org.dromara.common.constant.DatabaseConstants; +import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -315,7 +316,8 @@ public class ProdReportServiceImpl implements IProdReportService { try { // 使用批量查询避免 N+1:一次性查询该工序表下所有订单的工序进度 // 返回结果中包含 productOrderId 字段,便于在此处进行分组 - List batchResults = prodReportMapper.getOrdersProcessProgressBatch(orderIds, tableName); + String tenantId = LoginHelper.getTenantId(); + List batchResults = prodReportMapper.getOrdersProcessProgressBatch(orderIds, tableName, tenantId); if (batchResults != null && !batchResults.isEmpty()) { for (ProcessProgressVo progress : batchResults) { Long orderId = progress.getProductOrderId();