From 6e7005a9c8f0e9c21f2d3a4d77a779381e859ac3 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期六, 11 四月 2026 10:35:09 +0800
Subject: [PATCH] 1
---
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/controller/WmsController.java | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/controller/WmsController.java b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/controller/WmsController.java
index 72f5a46..47b55e5 100644
--- a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/controller/WmsController.java
+++ b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/controller/WmsController.java
@@ -2,15 +2,12 @@
import com.zy.acs.conveyor.common.web.BaseController;
import com.zy.acs.conveyor.controller.requestParam.StaParam;
-import com.zy.acs.conveyor.controller.responseParam.StationResponseParam;
import com.zy.acs.conveyor.controller.vo.PlcErrorTableVo;
+import com.zy.acs.conveyor.core.model.StaProtocol;
+import com.zy.acs.conveyor.core.service.StationService;
import com.zy.acs.conveyor.entity.Job;
import com.zy.acs.conveyor.service.JobService;
import com.zy.acs.framework.common.R;
-import com.zy.acs.conveyor.core.DevpThread;
-import com.zy.acs.conveyor.core.cache.SlaveConnection;
-import com.zy.acs.conveyor.core.enums.SlaveType;
-import com.zy.acs.conveyor.core.model.protocol.StaProtocol;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@@ -33,6 +30,9 @@
@Autowired
private JobService jobService;
+ @Autowired
+ private StationService stationService;
+
/**
* 绔欑偣鏌ヨ
*/
@@ -41,9 +41,7 @@
public R query(@RequestBody StaParam param) {
log.info("鏍规嵁绔欑偣鏌ヨstaNo锛歿}", param);
String staNo = param.getStaNo();
- DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, param.getDevpId());
- List<StationResponseParam> list = new ArrayList<>();
- Map<Integer, StaProtocol> station = devpThread.getStation();
+ Map<Integer, StaProtocol> station = stationService.getStationMap(param.getDevpId());
StaProtocol staProtocol = station.get(Integer.parseInt(staNo));
Integer workNo = staProtocol.getWorkNo();
if (workNo != null) {
@@ -64,8 +62,7 @@
public R getError(@RequestBody StaParam param) {
log.info("鏍规嵁绔欑偣鏌ヨstaNo锛歿}", param);
String staNo = param.getStaNo();
- DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, param.getDevpId());
- Map<Integer, StaProtocol> station = devpThread.getStation();
+ Map<Integer, StaProtocol> station = stationService.getStationMap(param.getDevpId());
StaProtocol staProtocol = station.get(Integer.parseInt(staNo));
return R.ok(staPlcErr(staProtocol));
}
--
Gitblit v1.9.1