From 18a5823a73015918fd535391eb75a29824f6b816 Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Sat, 11 Oct 2025 13:52:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(mes):=20=E6=B7=BB=E5=8A=A0=E7=A7=9F?= =?UTF-8?q?=E6=88=B7ID=E5=8F=82=E6=95=B0=E4=BB=A5=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=A4=9A=E7=A7=9F=E6=88=B7=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 ProdReportMapper 接口中为 getOrdersProcessProgressBatch 方法新增 tenantId 参数 - 在 ProdReportServiceImpl 类中调用 LoginHelper 获取当前租户ID - 调整批量查询方法传参以传递租- 新户ID信息增 LoginHelper 工具类导入用于获取登录租户信息 --- .../main/java/org/dromara/mes/mapper/ProdReportMapper.java | 3 ++- .../org/dromara/mes/service/impl/ProdReportServiceImpl.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) 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();