zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/LiftCommandService.java
@@ -139,6 +139,7 @@ if (!liftProtocol.getLev().equals(Integer.valueOf(motion.getTarget()))) { return false; } break; case LIFT_WITH_GOODS: // 判断提升机是否空闲 @@ -193,6 +194,7 @@ } liftThread.setSyncTaskNo(0);//清零工作号 liftThread.commandFinished(motion.getTaskNo());//调用完成后续指令(部分提升机有后续指令,实际情况看是否有真正实现方法) return true; } zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/LiftThread.java
@@ -1,6 +1,7 @@ package com.zy.asrs.wcs.rcs.thread; import com.zy.asrs.wcs.common.ExecuteSupport; import com.zy.asrs.wcs.core.entity.Motion; import com.zy.asrs.wcs.core.model.command.LiftCommand; import com.zy.asrs.wcs.core.model.enums.LiftCommandModeType; import com.zy.asrs.wcs.rcs.entity.Device; @@ -33,6 +34,8 @@ boolean isLock(ExecuteSupport support); boolean commandFinished(Integer taskNo); //***************获取命令***************** LiftCommand getMoveCommand(Integer taskNo, Integer sourceLev, Integer targetLev, LiftCommandModeType mode);//提升机移动 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java
@@ -346,6 +346,11 @@ } @Override public boolean commandFinished(Integer taskNo) { return false; } @Override public LiftCommand getMoveCommand(Integer taskNo, Integer sourceLev, Integer targetLev, LiftCommandModeType mode) { /** * 任务类型 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayLiftThread.java
@@ -374,6 +374,36 @@ return extend.getLock(); } @Override public boolean commandFinished(Integer taskNo) { try { LiftCommand command = getTaskClearCommand(); String loginToken = requestLoginToken(); if (loginToken == null) { return false; } HashMap<String, Object> headers = new HashMap<>(); headers.put("Authorization", "Bearer " + loginToken); String response = new HttpHandler.Builder() .setUri(API_URL) .setPath("/RDS/lifterOperation") .setHeaders(headers) .setJson(command.getBody()) .build() .doPost(); JSONObject jsonObject = JSON.parseObject(response); Integer code = jsonObject.getInteger("code"); if (code.equals(200)) { return true; } } catch (Exception e) { e.printStackTrace(); } return false; } //***************设备层通讯-不同厂商设备通讯方案不一致*************** //请求登录 @@ -544,6 +574,21 @@ return command; } //获取提升机任务清除命令 private LiftCommand getTaskClearCommand() { HashMap<String, Object> body = new HashMap<>(); body.put("messageName", "lifterOperation"); body.put("msgTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); body.put("deviceNo", Integer.parseInt(this.device.getDeviceNo())); body.put("operation", 1); LiftCommand command = new LiftCommand(); command.setLiftNo(Integer.valueOf(this.device.getDeviceNo())); command.setBody(JSON.toJSONString(body)); command.setMode(LiftCommandModeType.RESET.id); return command; } /** * 扩展字段 */