| | |
| | | @Autowired |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | |
| | | private String path = "http://120.77.11.218:8868/"; |
| | | private String path = "http://127.0.0.1:8868/"; |
| | | |
| | | |
| | | /** |
| | |
| | | mileage += (orderPrivateCar.getMileage() == null ? 0 : orderPrivateCar.getMileage()); |
| | | } |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("Address", 450204);//注册地行政区划代码 |
| | | jsonObject.put("Address", 530602);//注册地行政区划代码 |
| | | jsonObject.put("VehicleNo", car.getCarLicensePlate());//车辆号牌 |
| | | jsonObject.put("TotalMile", Integer.valueOf(mileage / 1000));//行驶总里程(km) |
| | | jsonObject.put("Flag", 1);//操作标识(1:新增,2:更新,3:删除) |
| | | jsonObject.put("UpdateTime", new Date()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("baseInfoVehicleTotalMile", jsonObject.toJSONString()); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/baseInfoVehicleTotalMile", map,null,"form"); |
| | | System.out.println("网约车车辆里程信息:" + result); |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("Connection", "keep-alive"); |
| | | header.put("Content-Type", "application/x-www-form-urlencoded"); |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/baseInfoVehicleTotalMile", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("--------------------------网约车车辆里程信息------------------------:" + result); |
| | | } |
| | | |
| | | |
| | |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | Map<String, Object> query = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId()); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("Address", 450204);//发起第行政区划代码 |
| | | jsonObject.put("Address", 530602);//发起第行政区划代码 |
| | | jsonObject.put("OrderId", orderPrivateCar.getOrderNum());//订单编号 |
| | | jsonObject.put("DepartTime", orderPrivateCar.getTravelTime());//预计用车时间YYYYMMDDhhmmss |
| | | jsonObject.put("OrderTime", orderPrivateCar.getInsertTime());//订单发起时间YYYYMMDDhhmmss |
| | |
| | | jsonObject.put("FareType", query.get("id").toString());//运价类型编码 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderCreate", jsonObject.toJSONString()); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderCreate", map,null,"form"); |
| | | System.out.println("订单发起接口:" + result); |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("Connection", "keep-alive"); |
| | | header.put("Content-Type", "application/x-www-form-urlencoded"); |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderCreate", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("---------------------------订单发起接口----------------------:" + result); |
| | | } |
| | | |
| | | |
| | |
| | | Car car = carService.selectById(orderPrivateCar.getCarId()); |
| | | String value = redisUtil.getValue("DRIVER" + orderPrivateCar.getDriverId()); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("Address", 450204);//发起地行政区划代码 |
| | | jsonObject.put("Address", 530602);//发起地行政区划代码 |
| | | jsonObject.put("OrderId", orderPrivateCar.getOrderNum());//订单编号 |
| | | jsonObject.put("Longitude", Double.valueOf(value.split(",")[0]));//车辆经度 |
| | | jsonObject.put("Latitude", Double.valueOf(value.split(",")[1]));//车辆纬度 |
| | |
| | | jsonObject.put("DistributeTime", new Date());//派单成功时间YYYYMMDDhhmmss |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderMatch", jsonObject.toJSONString()); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderMatch", map,null,"form"); |
| | | System.out.println("订单成功接口:" + result); |
| | | |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("Connection", "keep-alive"); |
| | | header.put("Content-Type", "application/x-www-form-urlencoded"); |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderMatch", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("--------------------------------订单成功接口---------------------------:" + result); |
| | | } |
| | | |
| | | |
| | |
| | | jsonObject.put("Encrypt", 1);//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他) |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("operateLogin", jsonObject.toJSONString()); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateLogin", map,null,"form"); |
| | | System.out.println("车辆经营上线接口:" + result); |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("Connection", "keep-alive"); |
| | | header.put("Content-Type", "application/x-www-form-urlencoded"); |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateLogin", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("--------------------------车辆经营上线接口------------------------:" + result); |
| | | } |
| | | } |
| | | |
| | |
| | | jsonObject.put("Encrypt", 1);//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他) |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("operateLogout", jsonObject.toJSONString()); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateLogout", map,null,"form"); |
| | | System.out.println("车辆经营下线接口:" + result); |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("Connection", "keep-alive"); |
| | | header.put("Content-Type", "application/x-www-form-urlencoded"); |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateLogout", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("--------------------------------车辆经营下线接口------------------------:" + result); |
| | | } |
| | | } |
| | | |
| | |
| | | jsonObject.put("WaitTime", orderPrivateCar.getWait() * 60);//等待时间(秒) |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("operateDepart", jsonObject.toJSONString()); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateDepart", map,null,"form"); |
| | | System.out.println("经营出发接口:" + result); |
| | | |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("Connection", "keep-alive"); |
| | | header.put("Content-Type", "application/x-www-form-urlencoded"); |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateDepart", map,header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("--------------------------------经营出发接口-------------------------:" + result); |
| | | } |
| | | |
| | | |
| | |
| | | jsonObject.put("DriveTime", Double.valueOf((orderPrivateCar.getGetoffTime().getTime() - orderPrivateCar.getBoardingTime().getTime()) / 1000).intValue());//载客时间(秒) |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("operateArrive", jsonObject.toJSONString()); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateArrive", map,null,"form"); |
| | | System.out.println("经营到达接口:" + result); |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("Connection", "keep-alive"); |
| | | header.put("Content-Type", "application/x-www-form-urlencoded"); |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateArrive", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("-------------------------------经营到达接口-------------------------:" + result); |
| | | } |
| | | |
| | | |
| | |
| | | TransactionDetails transactionDetails = transactionDetailsService.selectById(new EntityWrapper<TransactionDetails>().eq("orderType", 1).eq("orderId", orderId)); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("OrderId", orderPrivateCar.getOrderNum());//订单号 |
| | | jsonObject.put("OnArea", 450204);//上车位置行政区划代码 |
| | | jsonObject.put("OnArea", 530602);//上车位置行政区划代码 |
| | | jsonObject.put("DriverName", driver.getName());//机动车驾驶员 |
| | | jsonObject.put("LicenseId", driver.getDriveCard());//机动车驾驶证号 |
| | | jsonObject.put("FareType", query.get("id").toString());//运价类型编码(由网约车公司定义,与运价信息接口保持一街) |
| | |
| | | jsonObject.put("InvoiceStatus", "0");//发票状态(0:未开票,1:已开票,2:未知) |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("operatePay", jsonObject.toJSONString()); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operatePay", map,null,"form"); |
| | | System.out.println("经营支付接口:" + result); |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("Connection", "keep-alive"); |
| | | header.put("Content-Type", "application/x-www-form-urlencoded"); |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operatePay", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("-----------------------经营支付接口-----------------------:" + result); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("LicenseId", driver.getDriveCard());//机动车驾驶证号 |
| | | jsonObject.put("DriverRegionCode", 450204);//行政区划代码 |
| | | jsonObject.put("DriverRegionCode", 530602);//行政区划代码 |
| | | jsonObject.put("VehicleNo", car.getCarLicensePlate());//车辆号牌 |
| | | jsonObject.put("PositionTime", new Date());//定位时间(时间戳) |
| | | jsonObject.put("Longitude", Longitude);//经度 |
| | |
| | | jsonObject.put("OrderId", orderNum);//订单编号 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("positionDriver", jsonObject.toJSONString()); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/positionDriver", map,null,"form"); |
| | | System.out.println("驾驶员定位信息:" + result); |
| | | |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("Connection", "keep-alive"); |
| | | header.put("Content-Type", "application/x-www-form-urlencoded"); |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/positionDriver", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("-----------------------------驾驶员定位信息------------------------:" + result); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("VehicleNo", car.getCarLicensePlate());//车辆号牌 |
| | | jsonObject.put("VehicleRegionCode", 450204);//行政区划代码 |
| | | jsonObject.put("VehicleRegionCode", 530602);//行政区划代码 |
| | | jsonObject.put("PositionTime", new Date());//定位时间(时间戳) |
| | | jsonObject.put("Longitude", Longitude);//经度 |
| | | jsonObject.put("Latitude", Latitude);//纬度 |
| | |
| | | jsonObject.put("OrderId", orderNum);//订单编号(非营运状态下填"0") |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("positionVehicle", jsonObject.toJSONString()); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/positionVehicle", map,null,"form"); |
| | | System.out.println("车辆定位信息:" + result); |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("Connection", "keep-alive"); |
| | | header.put("Content-Type", "application/x-www-form-urlencoded"); |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/positionVehicle", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("----------------------------车辆定位信息---------------------------:" + result); |
| | | } |
| | | |
| | | |