refactor(andon): 将工位查询逻辑改为产线查询逻辑

- 替换 BaseProcessStation 为 BaseProductLine 查询
- 修改服务依赖从 IBaseProcessStationService 到 IBaseProductLineService
- 调整查询条件添加产线类型过滤(productLineType=2)
- 更新产线编码获取方式从父级产线ID获取
- 修正工位名称显示逻辑使用产线名称
master
zangch@mesnac.com 3 days ago
parent 2eb76b394b
commit 7736ccb69d

@ -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<BaseProcessStation> 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<BaseProductLine> 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<String, Object> 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);

Loading…
Cancel
Save