From d8b1f82c07cf723b2590cae5a432ff78a514b05e Mon Sep 17 00:00:00 2001
From: gtsxc <3272660260@qq.com>
Date: 星期一, 25 十一月 2024 10:30:30 +0800
Subject: [PATCH] #
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java | 46 +++++++++++++++++-----------------------------
1 files changed, 17 insertions(+), 29 deletions(-)
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
index e941845..1ac7110 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
@@ -930,7 +930,7 @@
.eq(BasLed::getDeviceId, ledDevice.getId()));
List<Integer> staArr = JSON.parseArray(led.getSta(), Integer.class);
- BasConveyor basConveyor = basConveyorService.getById(new LambdaQueryWrapper<BasConveyor>()
+ BasConveyor basConveyor = basConveyorService.getOne(new LambdaQueryWrapper<BasConveyor>()
.eq(BasConveyor::getDeviceId, led.getConveyorId().intValue()));
if (basConveyor == null) {
continue;
@@ -945,27 +945,24 @@
for (Integer staNo : staArr) {
// 鑾峰彇鍙夎溅绔欑偣
StaProtocol staProtocol = devpThread.getStation().get(staNo);
- if (null == staProtocol || null == staProtocol.getWorkNo() || 0 == staProtocol.getWorkNo() || !staProtocol.isLoading()) {
+ if (null == staProtocol || null == staProtocol.getWorkNo()) {
continue;
} else {
staProtocol = staProtocol.clone();
}
- // 鑾峰彇宸ヤ綔妗f暟鎹�
- Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getTaskNo, staProtocol.getWorkNo()));
- if (null == task) {
+ if (!staProtocol.isOutEnable()){
continue;
}
-
- tasks.add(task);
- // 缁勮鍛戒护
- LedCommand ledCommand = new LedCommand();
- ledCommand.setWorkNo(task.getTaskNo());
- ledCommand.setIoType(task.getTaskCtg().intValue());
- ledCommand.setTitle(task.getTaskCtg$());
- ledCommand.setSourceLocNo(task.getOriginLoc());
- ledCommand.setLocNo(task.getDestLoc());
- ledCommand.setStaNo(Integer.parseInt(task.getDestSite()));
-
+ String taskNo = "0";
+ if (0 != staProtocol.getWorkNo()){
+ Motion motion = motionService.getOne(new LambdaQueryWrapper<Motion>().eq(Motion::getMotionCtg, 9).eq(Motion::getTemp, staProtocol.getWorkNo()));
+ // 鑾峰彇宸ヤ綔妗f暟鎹�
+ Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getTaskNo, motion.getTaskNo()));
+ if (null == task) {
+ continue;
+ }
+ taskNo = task.getWmsTaskNo();
+ }
try {
//鑾峰彇WMS鍦板潃
Dict dict = dictService.getOne(new LambdaQueryWrapper<Dict>().eq(Dict::getFlag, "WMS_URL").eq(Dict::getStatus, 1));
@@ -973,32 +970,23 @@
String wmsUrl = dict.getValue();
HashMap<String, Object> param = new HashMap<>();
- param.put("taskNo", task.getTaskNo());
+ param.put("taskNo", taskNo);
+ param.put("sta",staNo);
String response = new HttpHandler.Builder()
.setUri(wmsUrl)
- .setPath("/queryTask")
+ .setPath("/rpc/led/getTask")
.setJson(JSON.toJSONString(param))
.build()
.doPost();
JSONObject jsonObject = JSON.parseObject(response);
Integer code = jsonObject.getInteger("code");
if (code.equals(200)) {
- List<MatDto> matDtos = JSON.parseArray(jsonObject.getString("data"), MatDto.class);
- ledCommand.setMatDtos(matDtos);
+
}
}
} catch (Exception e) {
e.printStackTrace();
}
-
- commands.add(ledCommand);
- }
- // 鑾峰彇LED绾跨▼
- LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, ledDevice.getId().intValue());
- // 鍛戒护涓嬪彂 -------------------------------------------------------------------------------
- if (!commands.isEmpty()) {
- ledThread.write(commands);
- ledThread.setLedMk(false);
}
}
}
--
Gitblit v1.9.1