| | |
| | | @ApiOperation(value = "车辆运维-车辆调度-发车/收车", tags = {"运维APP-车辆管理"}) |
| | | @PostMapping("/api/v1/vehicle/vehicleDispatchDeparture") |
| | | public R<String> vehicleDispatchDeparture(@RequestBody VehicleDispatchDepartureDTO dto) { |
| | | |
| | | // 判断是否有正在进行的正常订单 |
| | | // 查询车辆 |
| | | XpVehicle xpVehicle = xpVehicleClient.queryById(dto.getVehicleId()).getData(); |
| | | if(xpVehicle.getState()==1){ |
| | | return R.fail("车辆正在接单中"); |
| | | } |
| | | xpVehicle.setOperatingStatus(dto.getDepartureStatus()); |
| | | xpVehicleClient.updateVehicleById(xpVehicle); |
| | | |
| | | // 发车 |
| | | if(dto.getDepartureStatus()==1){ |
| | | // 找车辆的任务 生成巡游单子 下发命令 TODO |
| | | }else if(dto.getDepartureStatus()==3){ |
| | | // 收车 关闭巡游单子 TODO |
| | | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |