zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/action/ShuttleAction.java
@@ -151,10 +151,11 @@ // 托盘顶升 //判断是否顶升到位 if (shuttleProtocol.getHasLift()) { //判断是否有物 if (shuttleProtocol.getHasPallet()) { command.setComplete(true); } command.setComplete(true); // //判断是否有物 // if (shuttleProtocol.getHasPallet()) { // command.setComplete(true); // } } } else if (command.getMode() == ShuttleCommandModeType.PALLET_DOWN.id) { // 托盘下降命令 @@ -186,12 +187,12 @@ // 系统任务 if (assignCommand.getAuto()) { // if (!assignCommand.getCharge()) { // //对主线程抛出等待确认状态waiting // shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.WAITING); // }else { // shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.CHARGING_WAITING); // } if (!assignCommand.getCharge()) { //对主线程抛出等待确认状态waiting shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.WAITING); }else { shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.CHARGING_WAITING); } News.info("四向穿梭车任务执行下发完成等待执行结束,穿梭车号={},任务数据={}", shuttleProtocol.getShuttleNo(), JSON.toJSON(command)); // 手动任务 @@ -220,6 +221,7 @@ return false; } shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.WORKING); commandStep++; //更新redis数据 redisCommand.setCommandStep(commandStep); zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java
@@ -258,11 +258,11 @@ return true; } // if (!shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.WAITING) // && !shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.CHARGING_WAITING) // ) { // return false; // } if (!shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.WAITING) && !shuttleProtocol.getProtocolStatusType().equals(ShuttleProtocolStatusType.CHARGING_WAITING) ) { return false; } //判断设备是否空闲 if (!shuttleThread.isIdle()) { zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
@@ -3,6 +3,8 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.zy.asrs.common.utils.HttpHandler; import com.zy.asrs.framework.common.DateUtils; import com.zy.asrs.framework.common.SpringUtils; @@ -412,7 +414,7 @@ boolean res = (this.shuttleProtocol.getDeviceStatus() == 3 || this.shuttleProtocol.getDeviceStatus() == 11) && this.shuttleProtocol.getPakMk() && this.shuttleProtocol.getErrorCode().equals("0") && this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.IDLE.id && (this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.IDLE.id || this.shuttleProtocol.getProtocolStatus() == ShuttleProtocolStatusType.WAITING.id) ; return res; } @@ -484,12 +486,18 @@ @Override public List<NavigateNode> getMoveAdvancePath() { ObjectMapper objectMapper = SpringUtils.getBean(ObjectMapper.class); ArrayList<NavigateNode> path = new ArrayList<>(); if (shuttleProtocol.getTaskNo() != 0) { //存在任务,获取指令 Object object = redisUtil.get(DeviceRedisConstant.SHUTTLE_WORK_FLAG + shuttleProtocol.getTaskNo()); if (object != null) { ShuttleRedisCommand redisCommand = JSON.parseObject(object.toString(), ShuttleRedisCommand.class); ShuttleRedisCommand redisCommand = null; try { redisCommand = objectMapper.readValue(String.valueOf(object), ShuttleRedisCommand.class); } catch (JsonProcessingException e) { return path; } List<NavigateNode> nodes = redisCommand.getAssignCommand().getNodes();//穿梭车预计路径 if (!nodes.isEmpty()) { path.addAll(nodes);