| | |
| | | car.setVehicleId(UUIDUtil.getRandomCode()); |
| | | carService.updateById(car); |
| | | } |
| | | String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId()); |
| | | if(ToolUtil.isEmpty(vehicles)){ |
| | | TCarModel carModel = carModelMapper.selectById(car.getCarModelId()); |
| | | boolean createVehicles = fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId()); |
| | | if(!createVehicles){ |
| | | for (int i = 0; i < 5; i++) { |
| | | createVehicles = fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId()); |
| | | if(createVehicles){ |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //修改google订单信息或者创建新的行程 |
| | | String trip = fleetEngineUtil.getTrip(orderPrivateCar.getTripId()); |
| | | if(ToolUtil.isEmpty(trip)){ |
| | | JSONObject createTrip = fleetEngineUtil.createTrip(car.getVehicleId(), 1, orderPrivateCar.getTripId(), |
| | | orderPrivateCar.getStartLat().toString(), orderPrivateCar.getStartLon().toString(), orderPrivateCar.getEndLat().toString(), orderPrivateCar.getEndLon().toString()); |
| | | JSONObject error = createTrip.getJSONObject("error"); |
| | | if(null != error){ |
| | | for (int i = 0; i < 5; i++) { |
| | | createTrip = fleetEngineUtil.createTrip(car.getVehicleId(), 1, orderPrivateCar.getTripId(), |
| | | orderPrivateCar.getStartLat().toString(), orderPrivateCar.getStartLon().toString(), orderPrivateCar.getEndLat().toString(), orderPrivateCar.getEndLon().toString()); |
| | | error = createTrip.getJSONObject("error"); |
| | | String tripStatus = createTrip.getString("tripStatus"); |
| | | if(null == error && "NEW".equals(tripStatus)){ |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | //开始修改行程数据 |
| | | boolean updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderPrivateCar.getTripId(), null, null, null, null, orderPrivateCar.getId(), 1); |
| | | if(!updateTrip){ |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderPrivateCar.getTripId(), null, null, null, null, orderPrivateCar.getId(), 1); |
| | | if(updateTrip){ |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId()); |
| | | // if(ToolUtil.isEmpty(vehicles)){ |
| | | // TCarModel carModel = carModelMapper.selectById(car.getCarModelId()); |
| | | // boolean createVehicles = fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId()); |
| | | // if(!createVehicles){ |
| | | // for (int i = 0; i < 5; i++) { |
| | | // createVehicles = fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId()); |
| | | // if(createVehicles){ |
| | | // break; |
| | | // } |
| | | // try { |
| | | // Thread.sleep(3000L); |
| | | // } catch (InterruptedException e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // //修改google订单信息或者创建新的行程 |
| | | // String trip = fleetEngineUtil.getTrip(orderPrivateCar.getTripId()); |
| | | // if(ToolUtil.isEmpty(trip)){ |
| | | // JSONObject createTrip = fleetEngineUtil.createTrip(car.getVehicleId(), 1, orderPrivateCar.getTripId(), |
| | | // orderPrivateCar.getStartLat().toString(), orderPrivateCar.getStartLon().toString(), orderPrivateCar.getEndLat().toString(), orderPrivateCar.getEndLon().toString()); |
| | | // JSONObject error = createTrip.getJSONObject("error"); |
| | | // if(null != error){ |
| | | // for (int i = 0; i < 5; i++) { |
| | | // createTrip = fleetEngineUtil.createTrip(car.getVehicleId(), 1, orderPrivateCar.getTripId(), |
| | | // orderPrivateCar.getStartLat().toString(), orderPrivateCar.getStartLon().toString(), orderPrivateCar.getEndLat().toString(), orderPrivateCar.getEndLon().toString()); |
| | | // error = createTrip.getJSONObject("error"); |
| | | // String tripStatus = createTrip.getString("tripStatus"); |
| | | // if(null == error && "NEW".equals(tripStatus)){ |
| | | // break; |
| | | // } |
| | | // try { |
| | | // Thread.sleep(3000L); |
| | | // } catch (InterruptedException e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | // } |
| | | // } |
| | | // }else{ |
| | | // //开始修改行程数据 |
| | | // boolean updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderPrivateCar.getTripId(), null, null, null, null, orderPrivateCar.getId(), 1); |
| | | // if(!updateTrip){ |
| | | // for (int i = 0; i < 5; i++) { |
| | | // updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderPrivateCar.getTripId(), null, null, null, null, orderPrivateCar.getId(), 1); |
| | | // if(updateTrip){ |
| | | // break; |
| | | // } |
| | | // try { |
| | | // Thread.sleep(3000L); |
| | | // } catch (InterruptedException e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | |
| | |
| | | car.setVehicleId(UUIDUtil.getRandomCode()); |
| | | carService.updateById(car); |
| | | } |
| | | String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId()); |
| | | if(ToolUtil.isEmpty(vehicles)){ |
| | | TCarModel carModel = carModelMapper.selectById(car.getCarModelId()); |
| | | boolean createVehicles = fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId()); |
| | | if(!createVehicles){ |
| | | for (int i = 0; i < 5; i++) { |
| | | createVehicles = fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId()); |
| | | if(createVehicles){ |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //修改google订单信息或者创建新的行程 |
| | | String trip = fleetEngineUtil.getTrip(orderLogistics.getTripId()); |
| | | if(ToolUtil.isEmpty(trip)){ |
| | | JSONObject createTrip = fleetEngineUtil.createTrip(car.getVehicleId(), 1, orderLogistics.getTripId(), |
| | | orderLogistics.getStartLat().toString(), orderLogistics.getStartLon().toString(), orderLogistics.getEndLat().toString(), orderLogistics.getEndLon().toString()); |
| | | JSONObject error = createTrip.getJSONObject("error"); |
| | | if(null != error){ |
| | | for (int i = 0; i < 5; i++) { |
| | | createTrip = fleetEngineUtil.createTrip(car.getVehicleId(), 1, orderLogistics.getTripId(), |
| | | orderLogistics.getStartLat().toString(), orderLogistics.getStartLon().toString(), orderLogistics.getEndLat().toString(), orderLogistics.getEndLon().toString()); |
| | | error = createTrip.getJSONObject("error"); |
| | | String tripStatus = createTrip.getString("tripStatus"); |
| | | if(null == error && "NEW".equals(tripStatus)){ |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | //开始修改行程数据 |
| | | boolean updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null, orderLogistics.getId(), 4); |
| | | if(!updateTrip){ |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null, orderLogistics.getId(), 4); |
| | | if(updateTrip){ |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId()); |
| | | // if(ToolUtil.isEmpty(vehicles)){ |
| | | // TCarModel carModel = carModelMapper.selectById(car.getCarModelId()); |
| | | // boolean createVehicles = fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId()); |
| | | // if(!createVehicles){ |
| | | // for (int i = 0; i < 5; i++) { |
| | | // createVehicles = fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId()); |
| | | // if(createVehicles){ |
| | | // break; |
| | | // } |
| | | // try { |
| | | // Thread.sleep(3000L); |
| | | // } catch (InterruptedException e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // //修改google订单信息或者创建新的行程 |
| | | // String trip = fleetEngineUtil.getTrip(orderLogistics.getTripId()); |
| | | // if(ToolUtil.isEmpty(trip)){ |
| | | // JSONObject createTrip = fleetEngineUtil.createTrip(car.getVehicleId(), 1, orderLogistics.getTripId(), |
| | | // orderLogistics.getStartLat().toString(), orderLogistics.getStartLon().toString(), orderLogistics.getEndLat().toString(), orderLogistics.getEndLon().toString()); |
| | | // JSONObject error = createTrip.getJSONObject("error"); |
| | | // if(null != error){ |
| | | // for (int i = 0; i < 5; i++) { |
| | | // createTrip = fleetEngineUtil.createTrip(car.getVehicleId(), 1, orderLogistics.getTripId(), |
| | | // orderLogistics.getStartLat().toString(), orderLogistics.getStartLon().toString(), orderLogistics.getEndLat().toString(), orderLogistics.getEndLon().toString()); |
| | | // error = createTrip.getJSONObject("error"); |
| | | // String tripStatus = createTrip.getString("tripStatus"); |
| | | // if(null == error && "NEW".equals(tripStatus)){ |
| | | // break; |
| | | // } |
| | | // try { |
| | | // Thread.sleep(3000L); |
| | | // } catch (InterruptedException e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | // } |
| | | // } |
| | | // }else{ |
| | | // //开始修改行程数据 |
| | | // boolean updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null, orderLogistics.getId(), 4); |
| | | // if(!updateTrip){ |
| | | // for (int i = 0; i < 5; i++) { |
| | | // updateTrip = fleetEngineUtil.updateTrip(null, car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null, orderLogistics.getId(), 4); |
| | | // if(updateTrip){ |
| | | // break; |
| | | // } |
| | | // try { |
| | | // Thread.sleep(3000L); |
| | | // } catch (InterruptedException e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | //删除定时任务 |