| | |
| | | this.brief = brief; |
| | | } |
| | | |
| | | public static PosType of(String posTypeStr) { |
| | | if (Cools.isEmpty(posTypeStr)) { |
| | | return null; |
| | | } |
| | | for (PosType type : PosType.values()) { |
| | | if (type.toString().equals(posTypeStr)) { |
| | | return type; |
| | | } |
| | | } |
| | | throw new IllegalArgumentException(posTypeStr); |
| | | } |
| | | |
| | | } |
| | | |
| | | public static void packagePosGroup(Map<String, List<TaskPosDto>> groups, Task task, Code code, PosType posType, String sameGroupXy) { |
| | |
| | | |
| | | // query current segment |
| | | Segment currSeg = segmentService.getCurrRunningSeg(agv.getId(), agv_06_up.getQrCode()); |
| | | if (null == currSeg) { |
| | | log.error("failed to find curr segment [{}]", agv.getUuid()); |
| | | } else { |
| | | |
| | | boolean responseAck = true; |
| | | TaskPosDto.PosType posType = TaskPosDto.PosType.of(currSeg.getPosType()); |
| | | assert null != posType; |
| | | switch (posType) { |
| | | case ORI_LOC: |
| | | case DEST_LOC: |
| | | break; |
| | | case ORI_STA: |
| | | case DEST_STA: |
| | | // todo |
| | | break; |
| | | default: |
| | | responseAck = false; |
| | | log.error("agv[{}] has wrong posType [{}], segment [{}]", protocol.getAgvNo(), posType.toString(), currSeg.getId()); |
| | | break; |
| | | } |
| | | |
| | | if (responseAck) { |
| | | |
| | | // todo:vincent 校验是否可以取放货 |
| | | |
| | |
| | | redis.push(RedisConstant.AGV_PATH_DOWN_FLAG, AgvProtocol.build(protocol.getAgvNo()).setMessageBody(agv_06_down)); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | // 料仓信息包 |
| | | if (msgBody instanceof AGV_70_UP) { |
| | | AGV_70_UP agv_70_up = (AGV_70_UP) msgBody; |
| | |
| | | .eq(Segment::getAgvId, agvId) |
| | | .eq(Segment::getState, SegmentStateType.RUNNING.toString()) |
| | | .eq(Segment::getEndNode, codeId) |
| | | .orderByDesc(Segment::getId) |
| | | ); |
| | | |
| | | if (Cools.isEmpty(segments)) { |