| | |
| | | userInfo.setLanguage(language); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | new Thread(() -> { |
| | | try { |
| | | //google创建车辆信息 |
| | | String vehicleId = null; |
| | | if(null != orderPrivateCar.getDriverId()){ |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | Car car = carMapper.selectById(driver.getCarId()); |
| | |
| | | car.setVehicleId(UUIDUtil.getRandomCode()); |
| | | carMapper.updateById(car); |
| | | } |
| | | String vehicleId = car.getVehicleId(); |
| | | vehicleId = car.getVehicleId(); |
| | | //查询车辆信息,没有则创建信息 |
| | | String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId()); |
| | | if(ToolUtil.isEmpty(vehicles)){ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | //创建行程数据 |
| | | boolean createTrip = fleetEngineUtil.createTrip(vehicleId, 1, orderPrivateCar.getTripId(), |
| | | String trip = fleetEngineUtil.getTrip(orderPrivateCar.getTripId()); |
| | | int count = orderLogisticsService.selectCount(new EntityWrapper<OrderLogistics>().eq("tripId", orderPrivateCar.getTripId())); |
| | | int count1 = this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("tripId", orderPrivateCar.getTripId())); |
| | | if(ToolUtil.isNotEmpty(trip) || (count + count1) > 0){ |
| | | String randomCode = UUIDUtil.getRandomCode(); |
| | | redisUtil.setStrValue("trip" + orderPrivateCar.getUserId(), randomCode); |
| | | OrderPrivateCar orderPrivateCar1 = new OrderPrivateCar(); |
| | | orderPrivateCar1.setId(orderPrivateCar.getCarId()); |
| | | orderPrivateCar1.setTripId(randomCode); |
| | | this.updateById(orderPrivateCar1); |
| | | orderPrivateCar.setTripId(randomCode); |
| | | } |
| | | JSONObject createTrip = fleetEngineUtil.createTrip(vehicleId, 1, orderPrivateCar.getTripId(), |
| | | orderPrivateCar.getStartLat().toString(), orderPrivateCar.getStartLon().toString(), orderPrivateCar.getEndLat().toString(), orderPrivateCar.getEndLon().toString()); |
| | | if(!createTrip){ |
| | | JSONObject error = createTrip.getJSONObject("error"); |
| | | if(null != error){ |
| | | for (int i = 0; i < 5; i++) { |
| | | createTrip = fleetEngineUtil.createTrip(vehicleId, 1, orderPrivateCar.getTripId(), |
| | | orderPrivateCar.getStartLat().toString(), orderPrivateCar.getStartLon().toString(), orderPrivateCar.getEndLat().toString(), orderPrivateCar.getEndLon().toString()); |
| | | if(createTrip){ |
| | | error = createTrip.getJSONObject("error"); |
| | | String tripStatus = createTrip.getString("tripStatus"); |
| | | if(null == error && "NEW".equals(tripStatus)){ |
| | | break; |
| | | } |
| | | Thread.sleep(5000L); |
| | | try { |
| | | Thread.sleep(3000L); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | }).start(); |
| | | |
| | | |
| | | if(orderSource == 2){//扫码下单 |
| | |
| | | } |
| | | |
| | | //修改行程信息 |
| | | if((orderPrivateCar.getState() == 10 || orderPrivateCar.getState() == 12) && null != orderPrivateCar.getDriverId()){ |
| | | if(orderPrivateCar.getState() == 10 || orderPrivateCar.getState() == 12){ |
| | | boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", null, null, orderPrivateCar.getTripId(), null, null, null, null); |
| | | if(!updateTrip){ |
| | | for (int i = 0; i < 5; i++) { |
| | |
| | | if(updateTrip){ |
| | | break; |
| | | } |
| | | Thread.sleep(5000L); |
| | | Thread.sleep(3000L); |
| | | } |
| | | } |
| | | } |
| | | log.warn("取消订单:{} {}", System.currentTimeMillis(), orderPrivateCar.getTripId()); |
| | | //添加消息 |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功取消出行订单,谢谢使用!" : language == 2 ? "You've cancelled the ride order successfully, thank you for using I-GO " : "Vous avez annulé la commande de course avec succès, merci d’utiliser I-GO", orderPrivateCar.getUserId(), 1); |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | userCouponRecordService.updateById(userCouponRecord); |
| | | } |
| | | |
| | | if(orderPrivateCar.getIsplatPay()==1){ |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double speMoney = company.getSpeMoney(); |
| | |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | } |
| | | |
| | | if(ToolUtil.isNotEmpty(userInfo.getEmail())){ |
| | | new Thread(new Runnable() { |
| | |
| | | } |
| | | |
| | | |
| | | if(orderPrivateCar.getIsplatPay()==1){ |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double speMoney = company.getSpeMoney(); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | }).start(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | query.setState(2); |
| | | query.setCode(order_id); |
| | | paymentRecordService.updateById(query); |
| | | if(orderPrivateCar.getIsplatPay()==1){ |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double taxi = company.getSpeMoney(); |
| | |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | } |
| | | |
| | | |
| | | if(ToolUtil.isNotEmpty(userInfo.getEmail())){ |