| | |
| | | package com.zy.asrs.wcs.core.action; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.zy.asrs.wcs.common.ExecuteSupport; |
| | | import com.zy.asrs.wcs.core.entity.Loc; |
| | |
| | | redisCommand.setCommandStep(0);//命令执行步序 |
| | | redisCommand.setAssignCommand(assignCommand);//命令 |
| | | //任务数据保存到redis |
| | | if (redisUtil.set(DeviceRedisConstant.SHUTTLE_WORK_FLAG + assignCommand.getTaskNo(), JSON.toJSONString(redisCommand))) { |
| | | if (redisUtil.set(DeviceRedisConstant.SHUTTLE_WORK_FLAG + assignCommand.getTaskNo(), JSON.toJSONString(redisCommand, SerializerFeature.DisableCircularReferenceDetect))) { |
| | | if (assignCommand.getTaskMode() == ShuttleTaskModeType.PAK_IN.id |
| | | || assignCommand.getTaskMode() == ShuttleTaskModeType.PAK_OUT.id |
| | | || assignCommand.getTaskMode() == ShuttleTaskModeType.MOVE_LOC_NO.id |
| | |
| | | if (command.getTargetLocNo().equals(shuttleProtocol.getCurrentLocNo())) { |
| | | command.setComplete(true); |
| | | //解锁锁定路径,上一条路径 |
| | | List<NavigateNode> nodes = JSON.parseArray(JSON.toJSONString(command.getNodes()), NavigateNode.class);//进行深度copy |
| | | List<NavigateNode> nodes = null; |
| | | try { |
| | | String nodesStr = objectMapper.writeValueAsString(command.getNodes()); |
| | | nodes = objectMapper.readValue(nodesStr, new TypeReference<List<NavigateNode>>() { |
| | | }); |
| | | } catch (JsonProcessingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | if (nodes != null) { |
| | | NavigateNode targetNode = assignCommand.getNodes().get(assignCommand.getNodes().size() - 1);//最终节点 |
| | | NavigateNode node = nodes.get(nodes.size() - 1); |
| | |
| | | } |
| | | |
| | | // 更新redis数据 |
| | | redisUtil.set(DeviceRedisConstant.SHUTTLE_WORK_FLAG + redisCommand.getTaskNo(), JSON.toJSONString(redisCommand)); |
| | | redisUtil.set(DeviceRedisConstant.SHUTTLE_WORK_FLAG + redisCommand.getTaskNo(), JSON.toJSONString(redisCommand, SerializerFeature.DisableCircularReferenceDetect)); |
| | | |
| | | if (!command.getComplete()) { |
| | | return false; |