From 7736ccb69d20a5c62b151ebba1a29f7171ee6e2d Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Tue, 30 Dec 2025 17:07:02 +0800 Subject: [PATCH] =?UTF-8?q?refactor(andon):=20=E5=B0=86=E5=B7=A5=E4=BD=8D?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91=E6=94=B9=E4=B8=BA=E4=BA=A7?= =?UTF-8?q?=E7=BA=BF=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 替换 BaseProcessStation 为 BaseProductLine 查询 - 修改服务依赖从 IBaseProcessStationService 到 IBaseProductLineService - 调整查询条件添加产线类型过滤(productLineType=2) - 更新产线编码获取方式从父级产线ID获取 - 修正工位名称显示逻辑使用产线名称 --- .../controller/AndonMobileController.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/aucma-production/src/main/java/com/aucma/production/controller/AndonMobileController.java b/aucma-production/src/main/java/com/aucma/production/controller/AndonMobileController.java index 6f35ac9..33edbbb 100644 --- a/aucma-production/src/main/java/com/aucma/production/controller/AndonMobileController.java +++ b/aucma-production/src/main/java/com/aucma/production/controller/AndonMobileController.java @@ -1,7 +1,7 @@ package com.aucma.production.controller; -import com.aucma.base.domain.BaseProcessStation; -import com.aucma.base.service.IBaseProcessStationService; +import com.aucma.base.domain.BaseProductLine; +import com.aucma.base.service.IBaseProductLineService; import com.aucma.common.constant.AnDonConstants; import com.aucma.common.core.domain.AjaxResult; import com.aucma.common.utils.DateUtils; @@ -38,7 +38,7 @@ import java.util.Map; public class AndonMobileController { @Autowired - private IBaseProcessStationService baseProcessStationService; + private IBaseProductLineService baseProductLineService; @Autowired private AndonRuleMapper andonRuleMapper; @@ -102,15 +102,16 @@ public class AndonMobileController { return AjaxResult.error("呼叫类型不能为空"); } - // 1. 根据 stationCode 查询工位信息 - BaseProcessStation stationQuery = new BaseProcessStation(); - stationQuery.setProcessCode(stationCode); - List stations = baseProcessStationService.selectBaseProcessStationList(stationQuery); - if (stations == null || stations.isEmpty()) { + // 1. 根据 stationCode 查询产线信息(productLineType=2 表示工位) + BaseProductLine lineQuery = new BaseProductLine(); + lineQuery.setProductLineCode(stationCode); + lineQuery.setProductLineType(2L); // 2表示工位类型 + List lines = baseProductLineService.selectBaseProductLineList(lineQuery); + if (lines == null || lines.isEmpty()) { return AjaxResult.error("工位不存在:" + stationCode); } - BaseProcessStation station = stations.get(0); - String productLineCode = station.getProductLineCode(); + BaseProductLine productLine = lines.get(0); + String productLineCode = productLine.getParentId(); // 父级产线编码 // 2. 根据 stationCode + callTypeCode 匹配安灯规则 AndonRule ruleQuery = new AndonRule(); @@ -155,7 +156,7 @@ public class AndonMobileController { Map data = new LinkedHashMap<>(); data.put("eventId", event.getEventId()); data.put("callCode", event.getCallCode()); - data.put("stationName", station.getStationName() != null ? station.getStationName() : station.getProcessName()); + data.put("stationName", productLine.getProductLineName()); data.put("callType", rule.getRuleName()); data.put("message", "安灯呼叫成功,已通知相关人员"); return AjaxResult.success(data);