| | |
| | | private MapDataDispatcher mapDataDispatcher; |
| | | @Autowired |
| | | private AvoidWaveCalculator avoidWaveCalculator; |
| | | @Autowired |
| | | private PatrolService patrolService; |
| | | |
| | | @RequestMapping(value = "/control/agv", method = {RequestMethod.GET, RequestMethod.POST}) |
| | | @Transactional |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/agv/patrol", method = {RequestMethod.GET, RequestMethod.POST}) |
| | | public R agvPatrol(@RequestHeader String appKey, |
| | | @RequestBody HandlerPublishParam param) throws ExecutionException, InterruptedException { |
| | | if (Cools.isEmpty(param.getAgvNo(), appKey)) { |
| | | return R.error(); |
| | | } |
| | | if (!APP_KEY.equals(appKey)) { |
| | | return R.error(); |
| | | } |
| | | String agvNo = param.getAgvNo(); |
| | | if (patrolService.isPatrolling(agvNo)) { |
| | | return patrolService.shutdownPatrol(agvNo); |
| | | } else { |
| | | return patrolService.startupPatrol(agvNo); |
| | | } |
| | | } |
| | | |
| | | } |