Merge remote-tracking branch 'origin/master'
| | |
| | | SnowFlake snowFlake = new SnowFlake(0, 0); |
| | | snowFlake.withStartTimestamp(1420041600000L); |
| | | long sequence = snowFlake.nextId(); |
| | | xpuUtil.cloudOrderOperation(operationBuilder.build(), dto.getVin(), sequence); |
| | | redisService.setCacheObject(String.valueOf(sequence), "cancelOrder_" + dto.getOrderId() + "_" + dto.getVin(), 30l, TimeUnit.MINUTES); |
| | | return R.ok(true); |
| | | MqttPublishDto mqttPublishDto = xpuUtil.cloudOrderOperation(operationBuilder.build(), dto.getVin(), sequence); |
| | | |
| | | if (mqttPublishDto.getCode() == 200) { |
| | | if(!dto.getOrderId().contains("XU")){ |
| | | // 正常订单处理 |
| | | redisService.setCacheObject(String.valueOf(sequence), "cancelOrder_" + dto.getOrderId() + "_" + dto.getVin(), 30l, TimeUnit.MINUTES); |
| | | } |
| | | return R.ok(true); |
| | | } |
| | | |
| | | return R.ok(false); |
| | | |
| | | |
| | | } |
| | |
| | | return AjaxResult.error("白名单手机号存在重复!"); |
| | | } |
| | | Map<String, Long> codeMap = xpWhitelistService.list().stream() |
| | | .collect(Collectors.toMap(XpWhitelist::getAccount, XpWhitelist::getId)); |
| | | .collect(Collectors.toMap( |
| | | XpWhitelist::getAccount, |
| | | XpWhitelist::getId, |
| | | (existing, replacement) -> replacement // 如果冲突,用新的覆盖 |
| | | )); |
| | | JSONObject result = new JSONObject(); |
| | | List<XpWhitelist> addList = new ArrayList<>(); |
| | | for (WhitelistImportExcel whitelistImportExcel : whitelistImportExcels) { |
| | |
| | | continue; |
| | | } |
| | | // 关闭巡游单子 |
| | | xpCruiseOrderClient.updateCruiseOrder(vehiclePosition.getVehicleVin()); |
| | | R<String> stringR = xpCruiseOrderClient.updateCruiseOrder(vehiclePosition.getVehicleVin()); |
| | | if(stringR ==null || stringR.getData()==null){ |
| | | log.info("关闭巡游单子失败"); |
| | | continue; |
| | | } |
| | | |
| | | // 下发命令 |
| | | PushOrderDto pushOrderDto = new PushOrderDto(); |
| | |
| | | continue; |
| | | } |
| | | // 关闭巡游单子 |
| | | xpCruiseOrderClient.updateCruiseOrder(vehicleId1.getVehicleVin()); |
| | | R<String> stringR = xpCruiseOrderClient.updateCruiseOrder(vehicleId1.getVehicleVin()); |
| | | if(stringR ==null || stringR.getData()==null){ |
| | | log.info("关闭巡游单子失败"); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | PushOrderDto pushOrderDto = new PushOrderDto(); |
| | | pushOrderDto.setVin(vehiclePosition.getVin()); |
| | |
| | | continue; |
| | | } |
| | | // 关闭巡游单子 |
| | | xpCruiseOrderClient.updateCruiseOrder(vehicleId1.getVehicleVin()); |
| | | R<String> stringR = xpCruiseOrderClient.updateCruiseOrder(vehicleId1.getVehicleVin()); |
| | | if(stringR ==null || stringR.getData()==null){ |
| | | log.info("关闭巡游单子失败"); |
| | | continue; |
| | | } |
| | | |
| | | PushOrderDto pushOrderDto = new PushOrderDto(); |
| | | pushOrderDto.setVin(vehiclePosition.getVin()); |
| | |
| | | private final XpVehicleClient xpVehicleClient; |
| | | private final XpFleetVehicleClient xpFleetVehicleClient; |
| | | private final XpFleetClient xpFleetClient; |
| | | |
| | | private final OrderMissionClient orderMissionClient; |
| | | /** |
| | | * 关闭当前巡游单子 |
| | | * @param vin |
| | |
| | | xpCruiseOrder.setStatus(2); |
| | | this.update(xpCruiseOrder, wrapper); |
| | | // todo 给XPU下发订单取消报文,如果取消不成功需要重试。两次不成功,则需要换车 |
| | | PushOrderDto pushOrderDto = new PushOrderDto(); |
| | | pushOrderDto.setVin(vin); |
| | | pushOrderDto.setOrderId(xpCruiseOrder.getId()); |
| | | pushOrderDto.setOperation_type(OrderOperationType.VEHICLE_CANCEL_ORDER); |
| | | R<Boolean> booleanR = orderMissionClient.cancelOrder(pushOrderDto); |
| | | if(booleanR==null || !booleanR.getData()){ |
| | | log.error("下发失败重试一次"); |
| | | R<Boolean> booleanR1 = orderMissionClient.cancelOrder(pushOrderDto); |
| | | if(booleanR1==null || !booleanR1.getData()){ |
| | | log.error("换车"); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | return xpCruiseOrder.getId(); |
| | | } |
| | |
| | | |
| | | // Redis弹出这个队列元素 |
| | | // value 订单Id_经纬度_状态_用户id_订单编号_距离_时间 |
| | | String popFirstElement = redisService.popFirstElement(order.getQueueName()); |
| | | redisService.popFirstElement(order.getQueueName()); |
| | | XpGeoQueryEntity xpGeoQueryEntity = new XpGeoQueryEntity(); |
| | | String[] split = popFirstElement.split("_"); |
| | | xpGeoQueryEntity.setOrderId(split[0]); |
| | | xpGeoQueryEntity.setOrderId(order.getId().toString()); |
| | | // 存mongo数据 |
| | | xpPricingClient.updateXpGeoQueryEntity(order.getId().toString()); |
| | | |
| | |
| | | addTaxiPassengerVo.setAppId(""); |
| | | userVehicleClient.addTaxiPassenger(addTaxiPassengerVo); |
| | | //推送乘客车辆到达预约点的导航数据 |
| | | sendRoute(addTaxiPassengerVo.getUid(), orderId, "ORDER_NAVIGATION_START_DATA", dto.getXpVehicleVin()); |
| | | // sendRoute(addTaxiPassengerVo.getUid(), orderId, "ORDER_NAVIGATION_START_DATA", dto.getXpVehicleVin()); |
| | | }else{ |
| | | //推送行起点到终点的驶轨迹给乘客端 |
| | | sendRoute(appUserId.toString(), orderId, "ORDER_NAVIGATION_END_DATA", dto.getXpVehicleVin()); |