| | |
| | | break; |
| | | case STA_TO_LOC: |
| | | oriSta = staService.getById(task.getOriSta()); |
| | | if (oriSta.getStaTypeIsCheck() != 1) { |
| | | if (locStaStatusCheck && !oriSta.getStaSts().equals(StaStsType.STOCK.val())) { |
| | | throw new BusinessException("oriSta:" + task.getOriSta$() + " is not in STOCK status"); |
| | | } |
| | | } |
| | | // if (oriSta.getStaTypeIsCheck() != 1) { |
| | | // if (locStaStatusCheck && !oriSta.getStaSts().equals(StaStsType.STOCK.val())) { |
| | | // throw new BusinessException("oriSta:" + task.getOriSta$() + " is not in STOCK status"); |
| | | // } |
| | | // } |
| | | oriSta.setStaSts(StaStsType.READY_TAKE.val()); |
| | | oriSta.setUpdateTime(now); |
| | | if (!staService.updateById(oriSta)) { |
| | |
| | | boolean reverse = false; |
| | | if (nextDirection.equals((workDirection + 180) % 360)) { |
| | | nextDirection = workDirection; |
| | | reverse = true; |
| | | if (Objects.requireNonNull(TaskPosDto.queryPosType(segment.getPosType())).equals(TaskPosDto.PosType.ORI_STA)) { |
| | | reverse = false; |
| | | } else { |
| | | reverse = true; |
| | | } |
| | | } |
| | | |
| | | // 第二步:判断当前节点是否可以旋转 |
| | |
| | | nextDirection = lastDirection; |
| | | reverse = true; |
| | | } else { |
| | | // turn |
| | | actionList.add(new Action( |
| | | null, // 编号s |
| | | task.getBusId(), // 总线 |
| | | task.getId(), // 任务 |
| | | null, // 动作号 |
| | | null, // 优先级 |
| | | ActionTypeType.TurnCorner.desc, // 名称 |
| | | mapService.isTurnCorner(lastCode.getData()) ? 1D : 0D, // 属性值 |
| | | lastCode.getData(), // 地面码 |
| | | String.valueOf(nextDirection), // 动作参数 |
| | | ActionTypeType.TurnCorner.val(), // 动作类型 |
| | | actionPrepareSts, // 动作进度 |
| | | agvId, // AGV |
| | | now // 工作时间 |
| | | )); |
| | | if ((Objects.requireNonNull(TaskPosDto.queryPosType(segment.getPosType())) |
| | | .equals(TaskPosDto.PosType.ORI_STA) || Objects.requireNonNull(TaskPosDto.queryPosType(segment.getPosType())) |
| | | .equals(TaskPosDto.PosType.DEST_STA)) && lastCode.getData().equals("00000050")) { |
| | | // turn |
| | | reverse = false; |
| | | |
| | | actionList.add(new Action( |
| | | null, // 编号s |
| | | task.getBusId(), // 总线 |
| | | task.getId(), // 任务 |
| | | null, // 动作号 |
| | | null, // 优先级 |
| | | ActionTypeType.TurnCorner.desc, // 名称 |
| | | mapService.isTurnCorner(lastCode.getData()) ? 1D : 0D, // 属性值 |
| | | lastCode.getData(), // 地面码 |
| | | String.valueOf(180), // 动作参数 |
| | | ActionTypeType.TurnCorner.val(), // 动作类型 |
| | | actionPrepareSts, // 动作进度 |
| | | agvId, // AGV |
| | | now // 工作时间 |
| | | )); |
| | | } else { |
| | | // turn |
| | | actionList.add(new Action( |
| | | null, // 编号s |
| | | task.getBusId(), // 总线 |
| | | task.getId(), // 任务 |
| | | null, // 动作号 |
| | | null, // 优先级 |
| | | ActionTypeType.TurnCorner.desc, // 名称 |
| | | mapService.isTurnCorner(lastCode.getData()) ? 1D : 0D, // 属性值 |
| | | lastCode.getData(), // 地面码 |
| | | String.valueOf(nextDirection), // 动作参数 |
| | | ActionTypeType.TurnCorner.val(), // 动作类型 |
| | | actionPrepareSts, // 动作进度 |
| | | agvId, // AGV |
| | | now // 工作时间 |
| | | )); |
| | | } |
| | | |
| | | lastDirection = nextDirection; |
| | | } |
| | |
| | | Sta oriSta = staService.getById(task.getOriSta()); |
| | | Double oriStaWorkDirection = mapService.getStaAngle(oriSta, workDirection); |
| | | // 检验方向 |
| | | if (!lastDirection.equals(oriStaWorkDirection)) { |
| | | if (!lastCode.getCornerBool()) { |
| | | throw new CoolException(agvNo + "号小车方向错误,请推至转弯点手动调整"); |
| | | } |
| | | // turn |
| | | actionList.add(new Action( |
| | | null, // 编号 |
| | | task.getBusId(), // 总线 |
| | | task.getId(), // 任务 |
| | | null, // 动作号 |
| | | null, // 优先级 |
| | | ActionTypeType.TurnCorner.desc, // 名称 |
| | | mapService.isTurnCorner(lastCode.getData()) ? 1D : 0D, // 属性값 |
| | | lastCode.getData(), // 地面码 |
| | | String.valueOf(oriStaWorkDirection), // 动作参数 |
| | | ActionTypeType.TurnCorner.val(), // 动作类型 |
| | | actionPrepareSts, // 动作进度 |
| | | agvId, // AGV |
| | | now // 工作时间 |
| | | )); |
| | | lastDirection = oriStaWorkDirection; |
| | | } |
| | | // if (!lastDirection.equals(oriStaWorkDirection)) { |
| | | // if (!lastCode.getCornerBool()) { |
| | | // throw new CoolException(agvNo + "号小车方向错误,请推至转弯点手动调整"); |
| | | // } |
| | | // // turn |
| | | // actionList.add(new Action( |
| | | // null, // 编号 |
| | | // task.getBusId(), // 总线 |
| | | // task.getId(), // 任务 |
| | | // null, // 动作号 |
| | | // null, // 优先级 |
| | | // ActionTypeType.TurnCorner.desc, // 名称 |
| | | // mapService.isTurnCorner(lastCode.getData()) ? 1D : 0D, // 属性값 |
| | | // lastCode.getData(), // 地面码 |
| | | // String.valueOf(oriStaWorkDirection), // 动作参数 |
| | | // ActionTypeType.TurnCorner.val(), // 动作类型 |
| | | // actionPrepareSts, // 动作进度 |
| | | // agvId, // AGV |
| | | // now // 工作时间 |
| | | // )); |
| | | // lastDirection = oriStaWorkDirection; |
| | | // } |
| | | // 计算货叉工作方向 |
| | | staWorkDirection = mapService.calculateAgvWorkDirectionByStation(oriStaWorkDirection, lastDirection); |
| | | actionList.add(new Action( |
| | |
| | | task.getId(), // 任务 |
| | | null, // 动作号 |
| | | null, // 优先级 |
| | | ActionTypeType.ReadyTakeFromConveyorSta.desc, // 名称 |
| | | staWorkDirection, // 属性值 |
| | | ActionTypeType.ReadyTakeFromShelvesLoc.desc, // 名称 |
| | | Double.parseDouble("0"), // 属性值 |
| | | lastCode.getData(), // 地面码 |
| | | String.valueOf(oriSta.getOffset()), // 动作参数 |
| | | ActionTypeType.ReadyTakeFromConveyorSta.val(), // 动作类型 |
| | | ActionTypeType.ReadyTakeFromShelvesLoc.val(), // 动作类型 |
| | | actionPrepareSts, // 动作进度 |
| | | agvId, // AGV |
| | | now, // 工作时间 |
| | |
| | | // 站点放货 |
| | | Sta destSta = staService.getById(task.getDestSta()); |
| | | Double destStaWorkDirection = mapService.getStaAngle(destSta, workDirection); |
| | | // CodeGap gap = codeGapService.findByCodeOfBoth(lastCode.getId(), nextCode.getId()); |
| | | |
| | | // 检验方向 |
| | | if (!lastDirection.equals(destStaWorkDirection)) { |
| | | if (!lastCode.getCornerBool()) { |
| | | throw new CoolException(agvNo + "号小车方向错误,请推至转弯点手动调整"); |
| | | } |
| | | // turn |
| | | actionList.add(new Action( |
| | | null, // 编号 |
| | | task.getBusId(), // 总线 |
| | | task.getId(), // 任务 |
| | | null, // 动作号 |
| | | null, // 优先级 |
| | | ActionTypeType.TurnCorner.desc, // 名称 |
| | | mapService.isTurnCorner(lastCode.getData()) ? 1D : 0D, // 属性값 |
| | | lastCode.getData(), // 地面码 |
| | | String.valueOf(destStaWorkDirection), // 动作参数 |
| | | ActionTypeType.TurnCorner.val(), // 动作类型 |
| | | actionPrepareSts, // 动作进度 |
| | | agvId, // AGV |
| | | now // 工作时间 |
| | | )); |
| | | lastDirection = destStaWorkDirection; |
| | | } |
| | | // if (!lastDirection.equals(destStaWorkDirection)) { |
| | | // if (!lastCode.getCornerBool()) { |
| | | // throw new CoolException(agvNo + "号小车方向错误,请推至转弯点手动调整"); |
| | | // } |
| | | // |
| | | // actionList.add(new Action( |
| | | // null, // 编号 |
| | | // task.getBusId(), // 总线 |
| | | // task.getId(), // 任务 |
| | | // null, // 动作号 |
| | | // null, // 优先级 |
| | | // actionType.desc, // 名称 |
| | | // (double) agvSpeedType.val, // 属性值 |
| | | // lastCode.getData(), // 地面码 |
| | | // String.valueOf(gap.getDistance()), // 动作参数 |
| | | // actionType.val(), // 动作类型 |
| | | // actionPrepareSts, // 动作进度 |
| | | // agvId, // AGV |
| | | // now // 工作时间 |
| | | // )); |
| | | // // turn |
| | | // actionList.add(new Action( |
| | | // null, // 编号 |
| | | // task.getBusId(), // 总线 |
| | | // task.getId(), // 任务 |
| | | // null, // 动作号 |
| | | // null, // 优先级 |
| | | // ActionTypeType.TurnCorner.desc, // 名称 |
| | | // mapService.isTurnCorner(lastCode.getData()) ? 1D : 0D, // 属性값 |
| | | // lastCode.getData(), // 地面码 |
| | | // String.valueOf(destStaWorkDirection), // 动作参数 |
| | | // ActionTypeType.TurnCorner.val(), // 动作类型 |
| | | // actionPrepareSts, // 动作进度 |
| | | // agvId, // AGV |
| | | // now // 工作时间 |
| | | // )); |
| | | // lastDirection = destStaWorkDirection; |
| | | // } |
| | | // 暂存点取货 |
| | | assert backpackType != null; |
| | | actionList.add(new Action( |
| | |
| | | task.getId(), // 任务 |
| | | null, // 动作号 |
| | | null, // 优先级 |
| | | ActionTypeType.ReadyReleaseToConveyorSta.desc, // 名称 |
| | | staWorkDirection, // 属性값 |
| | | ActionTypeType.ReadyReleaseToShelvesLoc.desc, // 名称 |
| | | Double.parseDouble("0"), // 属性值 |
| | | lastCode.getData(), // 地面码 |
| | | String.valueOf(destSta.getOffset()), // 动作参数 |
| | | ActionTypeType.ReadyReleaseToConveyorSta.val(), // 动作类型 |
| | | ActionTypeType.ReadyReleaseToShelvesLoc.val(), // 动作类型 |
| | | actionPrepareSts, // 动作进度 |
| | | agvId, // AGV |
| | | now, // 工作时间 |