package com.sinata.ministryoftransport.util;
|
|
|
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSONObject;
|
import com.sinata.ministryoftransport.model.*;
|
import com.sinata.ministryoftransport.util.httpClinet.HttpClientUtil;
|
import com.sinata.ministryoftransport.util.httpClinet.HttpResult;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
|
|
import java.text.SimpleDateFormat;
|
import java.util.HashMap;
|
import java.util.Map;
|
|
/**
|
* 交通部接口对接
|
*/
|
@Component
|
public class MinistryOfTransport {
|
|
private final String CompanyId = "5306ZTSRQ50D";//公司标识
|
|
private final String Source = "0";//消息来源标识
|
|
private final String url = "http://123.59.106.162:48085";
|
|
@Autowired
|
private HttpClientUtil httpClientUtil;
|
|
private SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
private SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
|
private SimpleDateFormat sdf2 = new SimpleDateFormat("yyyyMMdd");
|
|
|
/**
|
* 上传企业基础信息
|
*/
|
public String baseInfoCompany(BaseInfoCompany baseInfoCompany) throws Exception{
|
System.err.println("公司信息"+baseInfoCompany);
|
String IPCType = "baseInfoCompany";
|
String path = url + "/baseinfo/company";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("CompanyName", baseInfoCompanya.getCompanyName());//公司名称
|
jsonObject.put("Identifier", baseInfoCompany.getIdentifier());//统一社会信用代码
|
jsonObject.put("Address", baseInfoCompany.getAddress());//注册地行政区划代码
|
jsonObject.put("BusinessScope", baseInfoCompany.getBusinessScope());//经营范围
|
jsonObject.put("ContactAddress", baseInfoCompany.getContactAddress());//通信地址
|
jsonObject.put("EconomicType", baseInfoCompany.getEconomicType());//经营业户经济类型
|
jsonObject.put("RegCapital", baseInfoCompany.getRegCapital());//注册资本
|
jsonObject.put("LegalName", baseInfoCompany.getLegalName());//法人代表姓名
|
jsonObject.put("LegalID", baseInfoCompany.getLegalID());//法人代表身份证号
|
jsonObject.put("LegalPhone", baseInfoCompany.getLegalPhone());//法人代表电话
|
jsonObject.put("LegalPhoto", baseInfoCompany.getLegalPhoto());//法人代表身份证扫描件文件编号(.jpg)
|
jsonObject.put("State", baseInfoCompany.getState());//状态(0:有效,1:失效)
|
jsonObject.put("Flag", baseInfoCompany.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", baseInfoCompany.getUpdateTime());
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 网约车平台公司营运规模信息接口
|
*/
|
public String baseInfoCompanyStat(BaseInfoCompanyStat baseInfoCompanyStat) throws Exception{
|
System.err.println("网约车平台公司营运规模信息接口"+baseInfoCompanyStat);
|
|
String IPCType = "baseInfoCompanyStat";
|
String path = url + "/baseinfo/companystat";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("VehicleNum", baseInfoCompanyStat.getVehicleNum());//平台注册网约车辆数
|
jsonObject.put("DriverNum", baseInfoCompanyStat.getDriverNum());//平台注册驾驶员数
|
jsonObject.put("Flag", baseInfoCompanyStat.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoCompanyStat.getUpdateTime())));
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 网约车平台公司支付信息
|
*/
|
public String baseInfoCompanyPay(BaseInfoCompanyPay baseInfoCompanyPay) throws Exception{
|
System.err.println("网约车平台公司支付信息"+baseInfoCompanyPay);
|
String IPCType = "baseInfoCompanyPay";
|
String path = url + "/baseinfo/companypay";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("PayName", baseInfoCompanyPay.getPayName());//银行或者非银行支付机构名称
|
jsonObject.put("PayId", baseInfoCompanyPay.getPayId());//非银行支付机构支付业务许可证编号
|
jsonObject.put("PayType", baseInfoCompanyPay.getPayType());//支付业务类型
|
jsonObject.put("PayScope", baseInfoCompanyPay.getPayScope());//业务覆盖范围
|
jsonObject.put("PrepareBank", baseInfoCompanyPay.getPrepareBank());//备付金存管银行
|
jsonObject.put("CountDate", baseInfoCompanyPay.getCountDate());//结算周期
|
jsonObject.put("State", baseInfoCompanyPay.getState());//状态(0:有效,1:失效)
|
jsonObject.put("Flag", baseInfoCompanyPay.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoCompanyPay.getUpdateTime())));
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 网约车平台公司服务机构
|
*/
|
public String baseInfoCompanyService(BaseInfoCompanyService baseInfoCompanyService) throws Exception{
|
System.err.println("网约车平台公司服务机构"+baseInfoCompanyService);
|
String IPCType = "baseInfoCompanyService";
|
String path = url + "/baseinfo/companyservice";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", baseInfoCompanyService.getAddress());//行政区划代码
|
jsonObject.put("ServiceName", baseInfoCompanyService.getServiceName());//服务机构名称
|
jsonObject.put("ServiceNo", baseInfoCompanyService.getServiceNo());//服务机构代码
|
jsonObject.put("DetailAddress", baseInfoCompanyService.getDetailAddress());//服务机构地址
|
jsonObject.put("ResponsibleName", baseInfoCompanyService.getResponsibleName());//服务机构负责人姓名
|
jsonObject.put("ResponsiblePhone", baseInfoCompanyService.getResponsiblePhone());//负责人联系电话
|
jsonObject.put("ManagerName", baseInfoCompanyService.getManagerName());//服务机构管理人姓名
|
jsonObject.put("ManagerPhone", baseInfoCompanyService.getManagerPhone());//管理人联系电话
|
jsonObject.put("ContactPhone", baseInfoCompanyService.getContactPhone());//服务机构紧急联系电话
|
jsonObject.put("MailAddress", baseInfoCompanyService.getMailAddress());//行政文书送达邮寄地址
|
jsonObject.put("CreateDate", Long.valueOf(sdf.format(baseInfoCompanyService.getCreateDate())));//服务机构设立日期
|
jsonObject.put("State", baseInfoCompanyService.getState());//状态(0:有效,1:失效)
|
jsonObject.put("Flag", baseInfoCompanyService.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoCompanyService.getUpdateTime())));
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 网约车平台公司经营许可
|
*/
|
public String baseInfoCompanyPermit(BaseInfoCompanyPermit baseInfoCompanyPermit) throws Exception{
|
System.err.println("网约车平台公司经营许可"+baseInfoCompanyPermit);
|
|
String IPCType = "baseInfoCompanyPermit";
|
String path = url + "/baseinfo/companypermit";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", baseInfoCompanyPermit.getAddress());//许可地行政区划代码
|
jsonObject.put("Certificate", baseInfoCompanyPermit.getCertificate());//网络预约出租车经营许可证号
|
jsonObject.put("OperationArea", baseInfoCompanyPermit.getOperationArea());//经营区域
|
jsonObject.put("OwnerName", baseInfoCompanyPermit.getOwnerName());//公司名称
|
jsonObject.put("Organization", baseInfoCompanyPermit.getOrganization());//发证机构名称
|
jsonObject.put("StartDate", Long.valueOf(sdf2.format(baseInfoCompanyPermit.getStartDate())));//有效期起YYYYMMDD
|
jsonObject.put("StopDate", Long.valueOf(sdf2.format(baseInfoCompanyPermit.getStopDate())));//有效期止YYYYMMDD
|
jsonObject.put("CertifyDate", Long.valueOf(sdf2.format(baseInfoCompanyPermit.getCertifyDate())));//初次发证日期YYYYMMDD
|
jsonObject.put("State", baseInfoCompanyPermit.getState());//状态(0:有效,1:失效)
|
jsonObject.put("Flag", baseInfoCompanyPermit.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoCompanyPermit.getUpdateTime())));
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 网约车平台公司运价信息
|
*/
|
public String baseInfoCompanyFare(BaseInfoCompanyFare baseInfoCompanyFare) throws Exception{
|
System.err.println("网约车平台公司运价信息"+baseInfoCompanyFare);
|
|
String IPCType = "baseInfoCompanyFare";
|
String path = url + "/baseinfo/companyfare";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", baseInfoCompanyFare.getAddress());//运价适用地行政区划代码
|
jsonObject.put("FareType", baseInfoCompanyFare.getFareType());//运价类型编码(由网约车平台公司统一编码,应确保唯一性)
|
jsonObject.put("FareTypeNote", baseInfoCompanyFare.getFareTypeNote());//运价类型说明
|
jsonObject.put("FareValidOn", Long.valueOf(sdf.format(baseInfoCompanyFare.getFareValidOn())));//运价有效期起YYYYMMDDhhmmss
|
jsonObject.put("FareValidOff", Long.valueOf(sdf.format(baseInfoCompanyFare.getFareValidOff())));//运价有效止YYYYMMDDhhmmss
|
jsonObject.put("StartFare", baseInfoCompanyFare.getStartFare().intValue());//起步价(元)
|
jsonObject.put("StartMile", baseInfoCompanyFare.getStartMile());//起步里程(km)
|
jsonObject.put("UnitPricePerMile", baseInfoCompanyFare.getUnitPricePerMile().intValue());//计程单价(按公里/元)
|
jsonObject.put("UnitPricePerMinute", baseInfoCompanyFare.getUnitPricePerMinute().intValue());//计时单价(按分钟/元)
|
jsonObject.put("UpPrice", baseInfoCompanyFare.getUpPrice().intValue());//单程加价单价(元)
|
jsonObject.put("UpPriceStartMile", baseInfoCompanyFare.getUpPriceStartMile());//单程加价公里(km)
|
jsonObject.put("MorningPeakTimeOn", baseInfoCompanyFare.getMorningPeakTimeOn());//营运早高峰时间起(HHmm 24小时)
|
jsonObject.put("MorningPeakTimeOff", baseInfoCompanyFare.getMorningPeakTimeOff());//营运早高峰时间止(HHmm 24小时)
|
jsonObject.put("EveningPeakTimeOn", baseInfoCompanyFare.getEveningPeakTimeOn());//营运晚高峰时间起(HHmm 24小时)
|
jsonObject.put("EveningPeakTimeOff", baseInfoCompanyFare.getEveningPeakTimeOff());//营运晚高峰时间止(HHmm 24小时)
|
jsonObject.put("OtherPeakTimeOn", baseInfoCompanyFare.getOtherPeakTimeOn());//其他营运高等时间起(HHmm 24小时)
|
jsonObject.put("OtherPeakTineOff", baseInfoCompanyFare.getOtherPeakTineOff());//其他营运高等时间止(HHmm 24小时)
|
jsonObject.put("PeakUnitPrice", baseInfoCompanyFare.getPeakUnitPrice().intValue());//高峰时间单程加价单价(元)
|
jsonObject.put("PeakPriceStartMile", baseInfoCompanyFare.getPeakPriceStartMile());//高峰时间单程加价公里(km)
|
jsonObject.put("LowSpeedPriceMinute", baseInfoCompanyFare.getLowSpeedPriceMinute().intValue());//低速计时加价(按分钟 元)
|
jsonObject.put("NightPricePerMile", baseInfoCompanyFare.getNightPricePerMile().intValue());//夜间费(按公里 元)
|
jsonObject.put("NightPricePerMinute", baseInfoCompanyFare.getNightPricePerMinute().intValue());//夜间费(按分钟 元)
|
jsonObject.put("OtherPrice", baseInfoCompanyFare.getOtherPrice().intValue());//其它加价金额(元)
|
|
jsonObject.put("State", baseInfoCompanyFare.getState());//状态(0:有效,1:失效)
|
jsonObject.put("Flag", baseInfoCompanyFare.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoCompanyFare.getUpdateTime())));
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 车辆基本信息
|
*/
|
public String baseInfoVehicle(BaseInfoVehicle baseInfoVehicle) throws Exception{
|
System.err.println("车辆基本信息"+baseInfoVehicle);
|
|
String IPCType = "baseInfoVehicle";
|
String path = url + "/baseinfo/vehicle";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", baseInfoVehicle.getAddress());//车辆所在城市行政区划代码
|
jsonObject.put("VehicleNo", baseInfoVehicle.getVehicleNo());//车辆号牌
|
jsonObject.put("PlateColor", baseInfoVehicle.getPlateColor());//车牌颜色
|
jsonObject.put("Seats", baseInfoVehicle.getSeats());//核定载客位
|
jsonObject.put("Brand", baseInfoVehicle.getBrand());//车辆厂牌
|
jsonObject.put("Model", baseInfoVehicle.getModel());//车辆型号
|
jsonObject.put("VehicleType", baseInfoVehicle.getVehicleType());//车辆类型(以机动车行驶证为准)
|
jsonObject.put("OwnerName", baseInfoVehicle.getOwnerName());//车辆所有人(以机动车行驶证为准)
|
jsonObject.put("VehicleColor", baseInfoVehicle.getVehicleColor());//车身颜色
|
jsonObject.put("EngineId", baseInfoVehicle.getEngineId());//发动机号(以机动车行驶证为准)
|
jsonObject.put("VIN", baseInfoVehicle.getVIN());//车辆VIN码(以机动车行驶证为准)
|
jsonObject.put("CertifyDateA", Long.valueOf(sdf2.format(baseInfoVehicle.getCertifyDateA())));//车辆注册日期(以机动车行驶证为准)YYYY-MM-DD
|
jsonObject.put("FuelType", baseInfoVehicle.getFuelType());//车辆燃料类型
|
jsonObject.put("EngineDisplace", baseInfoVehicle.getEngineDisplace());//发送机排量(毫升)
|
jsonObject.put("PhotoId", baseInfoVehicle.getPhotoId());//车辆照片文件编号
|
jsonObject.put("Certificate", baseInfoVehicle.getCertificate());//运输证字号
|
jsonObject.put("TransAgency", baseInfoVehicle.getTransAgency());//车辆运输证发证机构
|
jsonObject.put("TransArea", baseInfoVehicle.getTransArea());//车辆经营区域
|
jsonObject.put("TransDateStart", Long.valueOf(sdf2.format(baseInfoVehicle.getTransDateStart())));//车辆运输证有效期起YYYYMMDD
|
jsonObject.put("TransDateStop", Long.valueOf(sdf2.format(baseInfoVehicle.getTransDateStop())));//车辆运输证有效期止YYYYMMDD
|
jsonObject.put("CertifyDateB", Long.valueOf(sdf2.format(baseInfoVehicle.getCertifyDateB())));//车辆初次登记日期YYYY-MM-DD
|
jsonObject.put("FixState", baseInfoVehicle.getFixState());//车辆维修状态(0:未检修,1:已检修,2:未知)
|
jsonObject.put("NextFixDate", Long.valueOf(sdf2.format(baseInfoVehicle.getNextFixDate())));//车辆下次年检时间YYYY-MM-DD
|
jsonObject.put("CheckState", baseInfoVehicle.getCheckState());//车辆年度审验状态
|
jsonObject.put("FeePrintId", baseInfoVehicle.getFeePrintId());//发票打印设备序列号
|
jsonObject.put("GPSBrand", baseInfoVehicle.getGPSBrand());//卫星定位装置品牌
|
jsonObject.put("GPSModel", baseInfoVehicle.getGPSModel());//卫星定位装置型号
|
jsonObject.put("GPSIMEI", baseInfoVehicle.getGPSIMEI());//卫星定位装置IMEI号
|
jsonObject.put("GPSInstallDate", Long.valueOf(sdf2.format(baseInfoVehicle.getGPSInstallDate())));//卫星定位设备安装日期YYYYMMDD
|
jsonObject.put("RegisterDate", Long.valueOf(sdf2.format(baseInfoVehicle.getRegisterDate())));//报备日期(车辆信息向服务所在地出租车行政主管部门报备日期YYYYMMDD)
|
jsonObject.put("CommercialType", baseInfoVehicle.getCommercialType());//服务类型(1:网络预约出租车,2:巡游出租汽车,3:私人小客车合乘)
|
jsonObject.put("FareType", baseInfoVehicle.getFareType());//运价类型编码(与云间信息中一一对应)
|
|
jsonObject.put("State", baseInfoVehicle.getSeats());//状态(0:有效,1:失效)
|
jsonObject.put("Flag", baseInfoVehicle.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoVehicle.getUpdateTime())));//YYYYMMDDhhmmss
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 车辆保险信息
|
*/
|
public String baseInfoVehicleInsurance(BaseInfoVehicleInsurance baseInfoVehicleInsurance) throws Exception{
|
System.err.println("车辆保险信息"+baseInfoVehicleInsurance);
|
|
String IPCType = "baseInfoVehicleInsurance";
|
String path = url + "/baseinfo/vehicleinsurance";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("VehicleNo", baseInfoVehicleInsurance.getVehicleNo());//车辆号牌
|
jsonObject.put("InsurCom", baseInfoVehicleInsurance.getInsurCom());//保险公司名称
|
jsonObject.put("InsurNum", baseInfoVehicleInsurance.getInsurNum());//保险号
|
jsonObject.put("InsurType", baseInfoVehicleInsurance.getInsurType());//保险类型
|
jsonObject.put("InsurCount", baseInfoVehicleInsurance.getInsurCount());//保险金额(元)
|
jsonObject.put("InsurEff", Long.valueOf(sdf2.format(baseInfoVehicleInsurance.getInsurEff())));//保险生效时间YYYYMMDD
|
jsonObject.put("InsurExp", Long.valueOf(sdf2.format(baseInfoVehicleInsurance.getInsurExp())));//保险到期时间YYYYMMDD
|
|
jsonObject.put("Flag", baseInfoVehicleInsurance.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoVehicleInsurance.getUpdateTime())));
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 网约车车辆里程信息
|
*/
|
public String baseInfoVehicleTotalMile(BaseInfoVehicleTotalMile baseInfoVehicleTotalMile) throws Exception{
|
System.err.println("网约车车辆里程信息"+baseInfoVehicleTotalMile);
|
|
String IPCType = "baseInfoVehicleTotalMile";
|
String path = url + "/baseinfo/vehicletotalmile";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", baseInfoVehicleTotalMile.getAddress());//注册地行政区划代码
|
jsonObject.put("VehicleNo", baseInfoVehicleTotalMile.getVehicleNo());//车辆号牌
|
jsonObject.put("TotalMile", baseInfoVehicleTotalMile.getTotalMile());//行驶总里程(km)
|
|
jsonObject.put("Flag", baseInfoVehicleTotalMile.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoVehicleTotalMile.getUpdateTime())));
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 驾驶员基本信息
|
*/
|
public String baseInfoDriver(BaseInfoDriver baseInfoDriver) throws Exception{
|
System.err.println("驾驶员基本信息"+baseInfoDriver);
|
|
String IPCType = "baseInfoDriver";
|
String path = url + "/baseinfo/driver";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", baseInfoDriver.getAddress());//注册地行政区划代码
|
jsonObject.put("DriverName", baseInfoDriver.getDriverName());//机动车驾驶员姓名
|
jsonObject.put("DriverPhone", baseInfoDriver.getDriverPhone());//驾驶员手机号
|
jsonObject.put("DriverGender", baseInfoDriver.getDriverGender());//驾驶员性别
|
jsonObject.put("DriverBirthday", null == baseInfoDriver.getDriverBirthday() ? 0 : Long.valueOf(sdf2.format(baseInfoDriver.getDriverBirthday())));//出生日期YYYYMMDD
|
jsonObject.put("DriverNationality", baseInfoDriver.getDriverNationality());//国籍
|
jsonObject.put("DriverNation", baseInfoDriver.getDriverNation());//驾驶员民族
|
jsonObject.put("DriverMaritalStatus", baseInfoDriver.getDriverMaritalStatus());//驾驶员婚姻状况(未婚,已婚,离异)
|
jsonObject.put("DriverLanguageLevel", baseInfoDriver.getDriverLanguageLevel());//驾驶员外语能力
|
jsonObject.put("DriverEducation", baseInfoDriver.getDriverEducation());//驾驶员学历
|
jsonObject.put("DriverCensus", baseInfoDriver.getDriverCensus());//户口登记机关名称
|
jsonObject.put("DriverAddress", baseInfoDriver.getDriverAddress());//户口住址或长住地址
|
jsonObject.put("DriverContactAddress", baseInfoDriver.getDriverContactAddress());//驾驶员通信地址
|
jsonObject.put("PhotoId", baseInfoDriver.getPhotoId());//驾驶员照片文件编号
|
jsonObject.put("LicenseId", null != baseInfoDriver.getLicenseId() ? baseInfoDriver.getLicenseId() : "");//机动车驾驶证号
|
jsonObject.put("LicensePhotoId", baseInfoDriver.getLicensePhotoId());//机动车驾驶证扫描件文件编号
|
jsonObject.put("DriverType", baseInfoDriver.getDriverType());//准驾车型
|
jsonObject.put("GetDriverLicenseDate", null == baseInfoDriver.getGetDriverLicenseDate() ? 0 : Long.valueOf(sdf2.format(baseInfoDriver.getGetDriverLicenseDate())));//初次领取驾驶证日期YYYYMMDD
|
jsonObject.put("DriverLicenseOn", null == baseInfoDriver.getDriverLicenseOn() ? 0 : Long.valueOf(sdf2.format(baseInfoDriver.getDriverLicenseOn())));//驾驶证有效期限起YYYYMMDD
|
jsonObject.put("DriverLicenseOff", null == baseInfoDriver.getDriverLicenseOff() ? 0 : Long.valueOf(sdf2.format(baseInfoDriver.getDriverLicenseOff())));//驾驶证有效期限止YYYYMMDD
|
jsonObject.put("TaxiDriver", baseInfoDriver.getTaxiDriver());//是否巡游出租汽车驾驶员(1:是,2:否)
|
jsonObject.put("CertificateNo", baseInfoDriver.getCertificateNo());//网络预约出租汽车驾驶员资格证号
|
jsonObject.put("NetworkCarIssueOrganization", baseInfoDriver.getNetworkCarIssueOrganization());//网络预约出租汽车驾驶员证发证机构
|
jsonObject.put("NetworkCarIssueDate", null == baseInfoDriver.getNetworkCarIssueDate() ? 0 : Long.valueOf(sdf2.format(baseInfoDriver.getNetworkCarIssueDate())));//资格证发证日期YYYYMMDD
|
jsonObject.put("GetNetworkCarProofDate", null == baseInfoDriver.getGetNetworkCarProofDate() ? 0 : Long.valueOf(sdf2.format(baseInfoDriver.getGetNetworkCarProofDate())));//初次领取资格证日期YYYYMMDD
|
jsonObject.put("NetworkCarProofOn", null == baseInfoDriver.getNetworkCarProofOn() ? 0 : Long.valueOf(sdf2.format(baseInfoDriver.getNetworkCarProofOn())));//资格证有效起始日期YYYYMMDD
|
jsonObject.put("NetworkCarProofOff", null == baseInfoDriver.getNetworkCarProofOff() ? 0 : Long.valueOf(sdf2.format(baseInfoDriver.getNetworkCarProofOff())));//资格证有截止日期YYYYMMDD
|
jsonObject.put("RegisterDate", null == baseInfoDriver.getRegisterDate() ? 0 : Long.valueOf(sdf2.format(baseInfoDriver.getRegisterDate())));//报备日期(驾驶员信息向服务所在地出租车行政主管部门报备日期)
|
jsonObject.put("FullTimeDriver", baseInfoDriver.getFullTimeDriver());//是否专职驾驶员(1:是,0:否)
|
jsonObject.put("InDriverBlacklist", baseInfoDriver.getInDriverBlacklist());//是否在驾驶员黑名单内(1:是,0:否)
|
jsonObject.put("CommercialType", baseInfoDriver.getCommercialType());//服务类型(1:网络预约出租汽车,2:巡游出租汽车,3:私人小客车合乘)
|
jsonObject.put("ContractCompany", baseInfoDriver.getContractCompany());//驾驶员合同签署公司
|
jsonObject.put("ContractOn", null == baseInfoDriver.getContractOn() ? 0 : Long.valueOf(sdf2.format(baseInfoDriver.getContractOn())));//合同有效期起YYYYMMDD
|
jsonObject.put("ContractOff", null == baseInfoDriver.getContractOff() ? 0 : Long.valueOf(sdf2.format(baseInfoDriver.getContractOff())));//合同有效期止YYYYMMDD
|
jsonObject.put("EmergencyContact", baseInfoDriver.getEmergencyContact());//紧急情况联系人
|
jsonObject.put("EmergencyContactPhone", baseInfoDriver.getEmergencyContactPhone());//紧急情况联系人电话
|
jsonObject.put("EmergencyContactAddress", baseInfoDriver.getEmergencyContactAddress());//紧急情况联系人通信地址
|
jsonObject.put("State", baseInfoDriver.getState());//状态(0:有效,1:失效)
|
jsonObject.put("Flag", baseInfoDriver.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoDriver.getUpdateTime())));
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 网约车驾驶员培训信息
|
*/
|
public String baseInfoDriverEducate(BaseInfoDriverEducate baseInfoDriverEducate) throws Exception{
|
System.err.println("网约车驾驶员培训信息"+baseInfoDriverEducate);
|
|
String IPCType = "baseInfoDriverEducate";
|
String path = url + "/baseinfo/drivereducate";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", baseInfoDriverEducate.getAddress());//注册地行政区划代码
|
jsonObject.put("LicenseId", null != baseInfoDriverEducate.getLicenseId() ? baseInfoDriverEducate.getLicenseId() : "");//机动车驾驶证号
|
jsonObject.put("CourseName", baseInfoDriverEducate.getCourseName());//驾驶员培训课程名称
|
jsonObject.put("CourseDate", Long.valueOf(sdf2.format(baseInfoDriverEducate.getCourseDate())));//培训课程日期YYYYMMDD
|
jsonObject.put("StartTime", baseInfoDriverEducate.getStartTime());//培训开始时间
|
jsonObject.put("StopTime", baseInfoDriverEducate.getStopTime());//培训结束时间
|
jsonObject.put("Duration", baseInfoDriverEducate.getDuration());//培训时长
|
|
jsonObject.put("Flag", baseInfoDriverEducate.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoDriverEducate.getUpdateTime())));
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 驾驶员移动终端信息
|
*/
|
public String baseInfoDriverApp(BaseInfoDriverApp baseInfoDriverApp) throws Exception{
|
System.err.println("驾驶员移动终端信息"+baseInfoDriverApp);
|
|
String IPCType = "baseInfoDriverApp";
|
String path = url + "/baseinfo/driverapp";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", baseInfoDriverApp.getAddress());//注册地行政区划代码
|
jsonObject.put("LicenseId", null != baseInfoDriverApp.getLicenseId() ? baseInfoDriverApp.getLicenseId() : "");//机动车驾驶证号
|
jsonObject.put("DriverPhone", baseInfoDriverApp.getDriverPhone());//驾驶员手机号
|
jsonObject.put("NetType", baseInfoDriverApp.getNetType());//手机运营商(1:中国联通,2:中国移动,3:中国电信,4:其他)
|
jsonObject.put("AppVersion", baseInfoDriverApp.getAppVersion());//使用APP版本号
|
jsonObject.put("MapType", baseInfoDriverApp.getMapType());//使用地图类型(1:百度地图,2:高德地图,3:其他)
|
|
jsonObject.put("State", baseInfoDriverApp.getState());//状态(0:有效,1:失效)
|
jsonObject.put("Flag", baseInfoDriverApp.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoDriverApp.getUpdateTime())));
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 驾驶员统计信息
|
*/
|
public String baseInfoDriverStat(BaseInfoDriverStat baseInfoDriverStat) throws Exception{
|
System.err.println("驾驶员统计信息"+baseInfoDriverStat);
|
|
String IPCType = "baseInfoDriverStat";
|
String path = url + "/baseinfo/driverstat";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", baseInfoDriverStat.getAddress());//注册地行政区划代码
|
jsonObject.put("LicenseId", null != baseInfoDriverStat.getLicenseId() ? baseInfoDriverStat.getLicenseId() : "");//机动车驾驶证号
|
jsonObject.put("Cycle", Long.valueOf(sdf2.format(baseInfoDriverStat.getCycle())));//统计周期(统计周期按月,内容填写统计月份YYYYMM)
|
jsonObject.put("OrderCount", baseInfoDriverStat.getOrderCount());//完成订单次数
|
jsonObject.put("TrafficViolationCount", baseInfoDriverStat.getTrafficViolationCount());//交通违章次数
|
jsonObject.put("ComplainedCount", baseInfoDriverStat.getComplainedCount());//被投诉次数
|
|
jsonObject.put("Flag", baseInfoDriverStat.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoDriverStat.getUpdateTime())));
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 乘客基本信息
|
*/
|
public String baseInfoPassenger(BaseInfoPassenger baseInfoPassenger) throws Exception{
|
System.err.println("乘客基本信息"+baseInfoPassenger);
|
|
String IPCType = "baseInfoPassenger";
|
String path = url + "/baseinfo/passenger";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("RegisterDate", Long.valueOf(sdf2.format(baseInfoPassenger.getRegisterDate())));//注册日期YYYYMMDD
|
jsonObject.put("PassengerPhone", null != baseInfoPassenger.getPassengerPhone() ? baseInfoPassenger.getPassengerPhone() : "");//乘客手机号
|
jsonObject.put("PassengerName", null != baseInfoPassenger.getPassengerName() ? baseInfoPassenger.getPassengerName() : "");//乘客称谓
|
jsonObject.put("PassengerGender", null != baseInfoPassenger.getPassengerGender() ? baseInfoPassenger.getPassengerGender() : "");//乘客性别
|
|
jsonObject.put("State", baseInfoPassenger.getState());//状态(0:有效,1:失效)
|
jsonObject.put("Flag", baseInfoPassenger.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(baseInfoPassenger.getUpdateTime())));
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 订单发起接口
|
*/
|
public String orderCreate(OrderCreate orderCreate) throws Exception{
|
System.err.println("订单发起接口"+orderCreate);
|
|
String IPCType = "orderCreate";
|
String path = url + "/order/create";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", orderCreate.getAddress());//发起第行政区划代码
|
jsonObject.put("OrderId", orderCreate.getOrderId());//订单编号
|
jsonObject.put("DepartTime", Long.valueOf(sdf.format(orderCreate.getDepartTime())));//预计用车时间YYYYMMDDhhmmss
|
jsonObject.put("OrderTime", Long.valueOf(sdf.format(orderCreate.getOrderTime())));//订单发起时间YYYYMMDDhhmmss
|
jsonObject.put("PassengerNote", orderCreate.getPassengerNote());//乘客备注
|
jsonObject.put("Departure", orderCreate.getDeparture());//预计出发地点详细地址
|
jsonObject.put("DepLongitude", Double.valueOf(orderCreate.getDepLongitude() * 1000000).intValue());//预计出发地点经度
|
jsonObject.put("DepLatitude", Double.valueOf(orderCreate.getDepLatitude() * 1000000).intValue());//预计出发地点纬度
|
jsonObject.put("Destination", orderCreate.getDestination());//预计目的地
|
jsonObject.put("DestLongitude", Double.valueOf(orderCreate.getDestLongitude() * 1000000).intValue());//预计目的地经度
|
jsonObject.put("DestLatitude", Double.valueOf(orderCreate.getDestLatitude() * 1000000).intValue());//预计目的地纬度
|
jsonObject.put("Encrypt", orderCreate.getEncrypt());//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他)
|
jsonObject.put("FareType", orderCreate.getFareType());//运价类型编码
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 订单成功接口
|
*/
|
public String orderMatch(OrderMatch orderMatch) throws Exception{
|
System.err.println("订单成功接口"+orderMatch);
|
|
String IPCType = "orderMatch";
|
String path = url + "/order/match";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", orderMatch.getAddress());//发起地行政区划代码
|
jsonObject.put("OrderId", orderMatch.getOrderId());//订单编号
|
jsonObject.put("Longitude", Double.valueOf(orderMatch.getLongitude() * 1000000).intValue());//车辆经度
|
jsonObject.put("Latitude", Double.valueOf(orderMatch.getLatitude() * 1000000).intValue());//车辆纬度
|
jsonObject.put("Encrypt", orderMatch.getEncrypt());//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他)
|
jsonObject.put("LicenseId", null != orderMatch.getLicenseId() ? orderMatch.getLicenseId() : "");//机动车驾驶证编号
|
jsonObject.put("DriverPhone", orderMatch.getDriverPhone());//驾驶员手机号
|
jsonObject.put("VehicleNo", orderMatch.getVehicleNo());//车辆号牌
|
jsonObject.put("DistributeTime", Long.valueOf(sdf.format(orderMatch.getDistributeTime())));//派单成功时间YYYYMMDDhhmmss
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 订单撤销接口
|
*/
|
public String orderCancel(OrderCancel orderCancel) throws Exception{
|
System.err.println("订单撤销接口"+orderCancel);
|
|
String IPCType = "orderCancel";
|
String path = url + "/order/cancel";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", orderCancel.getAddress());//上车地点行政区划代码
|
jsonObject.put("OrderId", orderCancel.getOrderId());//订单编号
|
jsonObject.put("OrderTime", Long.valueOf(sdf.format(orderCancel.getOrderTime())));//订单时间YYYYMMDDhhmmss
|
jsonObject.put("CancelTime", Long.valueOf(sdf.format(orderCancel.getCancelTime())));//订单撤销时间YYYYMMDDhhmmss
|
jsonObject.put("Operator", orderCancel.getOperator());//撤销发起方(1:乘客,2:驾驶员,3:平台公司)
|
jsonObject.put("CancelTypeCode", orderCancel.getCancelTypeCode());//机动车驾驶证编号
|
jsonObject.put("CancelReason", orderCancel.getCancelReason());//撤销或违约原因
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 车辆经营上线接口
|
*/
|
public String operateLogin(OperateLogin operateLogin) throws Exception{
|
System.err.println("车辆经营上线接口"+operateLogin);
|
|
String IPCType = "operateLogin";
|
String path = url + "/operate/login";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("LicenseId", null != operateLogin.getLicenseId() ? operateLogin.getLicenseId() : "");//机动车驾驶证号
|
jsonObject.put("VehicleNo", operateLogin.getVehicleNo());//车辆号牌
|
jsonObject.put("LoginTime", Long.valueOf(sdf.format(operateLogin.getLoginTime())));//车辆经营上线时间YYYYMMDDhhmmss
|
jsonObject.put("Longitude", Double.valueOf(operateLogin.getLongitude() * 1000000).intValue());//上线经度
|
jsonObject.put("Latitude", Double.valueOf(operateLogin.getLatitude() * 1000000).intValue());//上线纬度
|
jsonObject.put("Encrypt", operateLogin.getEncrypt());//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他)
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 车辆经营下线接口
|
*/
|
public String operateLogout(OperateLogout operateLogout) throws Exception{
|
System.err.println("车辆经营下线接口"+operateLogout);
|
|
String IPCType = "operateLogout";
|
String path = url + "/operate/logout";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("LicenseId", null != operateLogout.getLicenseId() ? operateLogout.getLicenseId() : "");//机动车驾驶证号
|
jsonObject.put("VehicleNo", operateLogout.getVehicleNo());//车辆号牌
|
jsonObject.put("LogoutTime", Long.valueOf(sdf.format(operateLogout.getLogoutTime())));//车辆经营下线时间YYYYMMDDhhmmss
|
jsonObject.put("Longitude", Double.valueOf(operateLogout.getLongitude() * 1000000).intValue());//下线经度
|
jsonObject.put("Latitude", Double.valueOf(operateLogout.getLatitude() * 1000000).intValue());//下线纬度
|
jsonObject.put("Encrypt", operateLogout.getEncrypt());//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他)
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 经营出发接口
|
*/
|
public String operateDepart(OperateDepart operateDepart) throws Exception{
|
System.err.println("经营出发接口"+operateDepart);
|
|
String IPCType = "operateDepart";
|
String path = url + "/operate/depart";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("OrderId", operateDepart.getOrderId());//订单号
|
jsonObject.put("LicenseId", null != operateDepart.getLicenseId() ? operateDepart.getLicenseId() : "");//机动车驾驶证号
|
jsonObject.put("FareType", operateDepart.getFareType());//运价类型编码
|
jsonObject.put("VehicleNo", operateDepart.getVehicleNo());//车辆号牌
|
jsonObject.put("DepLongitude", Double.valueOf(operateDepart.getDepLongitude() * 1000000).intValue());//车辆出发经度
|
jsonObject.put("DepLatitude", Double.valueOf(operateDepart.getDepLatitude() * 1000000).intValue());//车辆出发纬度
|
jsonObject.put("Encrypt", operateDepart.getEncrypt());//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他)
|
jsonObject.put("DepTime", Long.valueOf(sdf.format(operateDepart.getDepTime())));//上车时间YYYYMMDDhhmmss
|
jsonObject.put("WaitMile", operateDepart.getWaitMile());//空驶里程(km)
|
jsonObject.put("WaitTime", operateDepart.getWaitTime());//等待时间(秒)
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 经营到达接口
|
*/
|
public String operateArrive(OperateArrive operateArrive) throws Exception{
|
System.err.println("经营到达接口"+operateArrive);
|
|
String IPCType = "operateArrive";
|
String path = url + "/operate/arrive";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("OrderId", operateArrive.getOrderId());//订单号
|
jsonObject.put("DestLongitude", Double.valueOf(operateArrive.getDestLongitude() * 1000000).intValue());//车辆到达经度
|
jsonObject.put("DestLatitude", Double.valueOf(operateArrive.getDestLatitude() * 1000000).intValue());//车辆到达纬度
|
jsonObject.put("Encrypt", operateArrive.getEncrypt());//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他)
|
jsonObject.put("DestTime", Long.valueOf(sdf.format(operateArrive.getDestTime())));//下车时间YYYYMMDDhhmmss
|
jsonObject.put("DriveMile", operateArrive.getDriveMile());//载客里程(km)
|
jsonObject.put("DriveTime", operateArrive.getDriveTime());//载客时间(秒)
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 经营支付接口
|
*/
|
public String operatePay(OperatePay operatePay) throws Exception{
|
System.err.println("经营支付接口"+operatePay);
|
|
String IPCType = "operatePay";
|
String path = url + "/operate/pay";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("OrderId", operatePay.getOrderId());//订单号
|
jsonObject.put("OnArea", operatePay.getOnArea());//上车位置行政区划代码
|
jsonObject.put("DriverName", operatePay.getDriverName());//机动车驾驶员
|
jsonObject.put("LicenseId", null != operatePay.getLicenseId() ? operatePay.getLicenseId() : "");//机动车驾驶证号
|
jsonObject.put("FareType", operatePay.getFareType());//运价类型编码(由网约车公司定义,与运价信息接口保持一街)
|
jsonObject.put("VehicleNo", operatePay.getVehicleNo());//车辆号牌
|
jsonObject.put("BookDepTime", Long.valueOf(sdf.format(operatePay.getBookDepTime())));//预计上车时间YYYYMMDDhhmmss
|
jsonObject.put("WaitTime", operatePay.getWaitTime());//等待时间(秒)
|
jsonObject.put("DepLongitude", Double.valueOf(operatePay.getDepLongitude() * 1000000).intValue());//车辆出发经度
|
jsonObject.put("DepLatitude", Double.valueOf(operatePay.getDepLatitude() * 1000000).intValue());//车辆出发纬度
|
jsonObject.put("DepArea", operatePay.getDepArea());//上车点
|
jsonObject.put("DepTime", Long.valueOf(sdf.format(operatePay.getDepTime())));//上车时间YYYYMMDDhhmmss
|
jsonObject.put("DestLongitude", Double.valueOf(operatePay.getDestLongitude() * 1000000).intValue());//车辆到达经度
|
jsonObject.put("DestLatitude", Double.valueOf(operatePay.getDestLatitude() * 1000000).intValue());//车辆到达纬度
|
jsonObject.put("DestArea", operatePay.getDestArea());//下车地点
|
jsonObject.put("DestTime", Long.valueOf(sdf.format(operatePay.getDestTime())));//下车时间YYYYMMDDhhmmss
|
jsonObject.put("BookModel", operatePay.getBookModel());//预定车型
|
jsonObject.put("Model", operatePay.getModel());//实际使用车型
|
jsonObject.put("DriveMile", operatePay.getDriveMile());//载客里程(km)
|
jsonObject.put("DriveTime", operatePay.getDriveTime());//载客时间(秒)
|
jsonObject.put("WaitMile", operatePay.getWaitMile());//空驶里程(km)
|
jsonObject.put("FactPrice", operatePay.getFactPrice());//实收金额(元)
|
jsonObject.put("Price", operatePay.getPrice());//应收金额(元)
|
jsonObject.put("CashPrice", operatePay.getCashPrice());//现金支付金额(元)
|
jsonObject.put("LineName", operatePay.getLineName());//电子支付机构
|
jsonObject.put("LinePrice", operatePay.getLinePrice());//电子支付金额(元)
|
jsonObject.put("PosName", operatePay.getPosName());//POS机支付机构
|
jsonObject.put("PosPrice", operatePay.getPosPrice());//POS机支付金额(元)
|
jsonObject.put("BenfitPrice", operatePay.getBenfitPrice());//优惠金额(元)
|
jsonObject.put("BookTip", operatePay.getBookTip());//预约服务费(元)
|
jsonObject.put("PassengerTip", operatePay.getPassengerTip());//附加费(元)
|
jsonObject.put("PeakUpPrice", operatePay.getPeakUpPrice());//高峰时段时间加价金额(元)
|
jsonObject.put("NightUpPrice", operatePay.getNightUpPrice());//夜间时段里程加价金额(元)
|
jsonObject.put("FarUpPrice", operatePay.getFarUpPrice());//远途加价金额(元)
|
jsonObject.put("OtherUpPrice", operatePay.getOtherUpPrice());//其他加价金额(元)
|
jsonObject.put("PayState", operatePay.getPayState());//结算状态(0:未结算,1:已结算,2:未知)
|
jsonObject.put("PayTime", Long.valueOf(sdf.format(operatePay.getPayTime())));//乘客结算时间YYYYMMDDhhmmss
|
jsonObject.put("OrderMatchTime", Long.valueOf(sdf.format(operatePay.getOrderMatchTime())));//订单完成时间YYYYMMDDhhmmss
|
jsonObject.put("InvoiceStatus", operatePay.getInvoiceStatus());//发票状态(0:未开票,1:已开票,2:未知)
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 驾驶员定位信息
|
*/
|
public String positionDriver(PositionDriver positionDriver) throws Exception{
|
System.err.println("驾驶员定位信息"+positionDriver);
|
|
String IPCType = "positionDriver";
|
String path = url + "/position/driver";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("LicenseId", null != positionDriver.getLicenseId() ? positionDriver.getLicenseId() : "");//机动车驾驶证号
|
jsonObject.put("DriverRegionCode", positionDriver.getDriverRegionCode());//行政区划代码
|
jsonObject.put("VehicleNo", positionDriver.getVehicleNo());//车辆号牌
|
jsonObject.put("PositionTime", positionDriver.getPositionTime());//定位时间(时间戳)
|
jsonObject.put("Longitude", Double.valueOf(positionDriver.getLongitude() * 1000000).intValue());//经度
|
jsonObject.put("Latitude", Double.valueOf(positionDriver.getLatitude() * 1000000).intValue());//纬度
|
jsonObject.put("Encrypt", positionDriver.getEncrypt());//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他)
|
jsonObject.put("Direction", positionDriver.getDirection().intValue());//方向角
|
jsonObject.put("Elevation", positionDriver.getElevation().intValue());//海拔高度
|
jsonObject.put("Speed", positionDriver.getSpeed());//瞬时速度(km/h)
|
jsonObject.put("BizStatus", positionDriver.getBizStatus());//营运状态(1:载客,2:接单,3:空驶,4:停运)
|
jsonObject.put("OrderId", positionDriver.getOrderId());//订单编号
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
System.err.println("响应结果"+httpResult.getData());
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 车辆定位信息
|
*/
|
public String positionVehicle(PositionVehicle positionVehicle) throws Exception{
|
System.err.println("车辆定位信息"+positionVehicle);
|
|
String IPCType = "positionVehicle";
|
String path = url + "/position/vehicle";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("VehicleNo", positionVehicle.getVehicleNo());//车辆号牌
|
jsonObject.put("VehicleRegionCode", positionVehicle.getVehicleRegionCode());//行政区划代码
|
jsonObject.put("PositionTime", positionVehicle.getPositionTime());//定位时间(时间戳)
|
jsonObject.put("Longitude", Double.valueOf(positionVehicle.getLongitude() * 1000000).intValue());//经度
|
jsonObject.put("Latitude", Double.valueOf(positionVehicle.getLatitude() * 1000000).intValue());//纬度
|
jsonObject.put("Speed", positionVehicle.getSpeed());//瞬时速度(km/h)
|
jsonObject.put("Direction", positionVehicle.getDirection().intValue());//方向角
|
jsonObject.put("Elevation", positionVehicle.getElevation().intValue());//海拔高度
|
jsonObject.put("Mileage", positionVehicle.getMileage());//行驶里程(KM)
|
jsonObject.put("Encrypt", positionVehicle.getEncrypt());//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他)
|
jsonObject.put("WarnStatus", positionVehicle.getWarnStatus());//预警状态
|
jsonObject.put("VehStatus", positionVehicle.getVehStatus());//车辆状态
|
jsonObject.put("BizStatus", positionVehicle.getBizStatus());//营运状态(1:载客,2:接单,3:空驶,4:停运)
|
jsonObject.put("OrderId", positionVehicle.getOrderId());//订单编号(非营运状态下填"0")
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 乘客评价信息
|
*/
|
public String ratedPassenger(RatedPassenger ratedPassenger) throws Exception{
|
System.err.println("乘客评价信息"+ratedPassenger);
|
|
String IPCType = "ratedPassenger";
|
String path = url + "/rated/passenger";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("OrderId", ratedPassenger.getOrderId());//订单号
|
jsonObject.put("EvaluateTime", Long.valueOf(sdf.format(ratedPassenger.getEvaluateTime())));//评价时间YYYYMMDDhhmms
|
jsonObject.put("ServiceScore", ratedPassenger.getServiceScore());//服务满意度(五分制)
|
jsonObject.put("DriverScore", ratedPassenger.getDriverScore());//驾驶员满意度(五分制)
|
jsonObject.put("VehicleScore", ratedPassenger.getVehicleScore());//车辆满意度(五分制)
|
jsonObject.put("Detail", ratedPassenger.getDetail());//评价内容
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 乘客投诉信息
|
*/
|
public String ratedPassengerComplaint(RatedPassengerComplaint ratedPassengerComplaint) throws Exception{
|
System.err.println("乘客投诉信息"+ratedPassengerComplaint);
|
|
String IPCType = "ratedPassengerComplaint";
|
String path = url + "/rated/passengercomplaint";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("OrderId", ratedPassengerComplaint.getOrderId());//订单号
|
jsonObject.put("ComplaintTime", Long.valueOf(sdf.format(ratedPassengerComplaint.getComplaintTime())));//投诉时间YYYYMMDDhhmms
|
jsonObject.put("Detail", ratedPassengerComplaint.getDetail());//投诉内容
|
jsonObject.put("Result", ratedPassengerComplaint.getResult());//处理结果
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
/**
|
* 驾驶员处罚信息
|
*/
|
public String ratedDriverPunish(RatedDriverPunish ratedDriverPunish) throws Exception{
|
System.err.println("驾驶员处罚信息"+ratedDriverPunish);
|
|
String IPCType = "ratedDriverPunish";
|
String path = url + "/rated/driverpunish";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("LicenseId", null != ratedDriverPunish.getLicenseId() ? ratedDriverPunish.getLicenseId() : "");//机动车驾驶证编号
|
jsonObject.put("PunishTime", Long.valueOf(sdf.format(ratedDriverPunish.getPunishTime())));//处罚时间YYYYMMDDhhmms
|
jsonObject.put("PunishReason", ratedDriverPunish.getPunishReason());//处罚原因
|
jsonObject.put("PunishReault", ratedDriverPunish.getPunishReault());//处罚结果
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 驾驶员信誉信息
|
*/
|
public String ratedDriver(RatedDriver ratedDriver) throws Exception{
|
System.err.println("驾驶员信誉信息"+ratedDriver);
|
|
String IPCType = "ratedDriver";
|
String path = url + "/rated/driver";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("LicenseId", null != ratedDriver.getLicenseId() ? ratedDriver.getLicenseId() : "");//机动车驾驶证编号
|
jsonObject.put("Level", ratedDriver.getLevel());//服务质量信誉等级(五分制)
|
jsonObject.put("TestDate", Long.valueOf(sdf2.format(ratedDriver.getTestDate())));//服务质量信誉考核日期YYYYMMDD
|
jsonObject.put("TestDepartment", ratedDriver.getTestDepartment());//服务质量信誉考核机构
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 私人小客车合乘信息服务平台基本信息
|
*/
|
public String shareCompany(ShareCompany shareCompany) throws Exception{
|
System.err.println("私人小客车合乘信息服务平台基本信息"+shareCompany);
|
|
String IPCType = "shareCompany";
|
String path = url + "/share/company";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("CompanyName", shareCompany.getCompanyName());//公司名称
|
jsonObject.put("Identifier", shareCompany.getIdentifier());//统一社会信用代码
|
jsonObject.put("Address", shareCompany.getAddress());//注册地行政区划代码
|
jsonObject.put("ContactAddress", shareCompany.getContactAddress());//通信地址
|
jsonObject.put("EconomicType", shareCompany.getEconomicType());//经营业户经济类型
|
jsonObject.put("LegalName", shareCompany.getLegalName());//法人代表姓名(按照营业执照填写)
|
jsonObject.put("LegalPhone", shareCompany.getLegalPhone());//法人代表电话
|
jsonObject.put("State", shareCompany.getState());//状态(0:有效,1:失效)
|
jsonObject.put("Flag", shareCompany.getFlag());//操作标识(1:新增,2:更新,3:删除)
|
jsonObject.put("UpdateTime", Long.valueOf(sdf.format(shareCompany.getUpdateTime())));//更新时间YYYYMMDDhhmmss
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
/**
|
* 私人小客车合乘驾驶员行程发布接口
|
*/
|
public String shareRoute(ShareRoute shareRoute) throws Exception{
|
System.err.println("私人小客车合乘驾驶员行程发布接口"+shareRoute);
|
|
String IPCType = "shareRoute";
|
String path = url + "/share/route";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", shareRoute.getAddress());//行政区划代码
|
jsonObject.put("RouteId", shareRoute.getRouteId());//驾驶员发起行程编号
|
jsonObject.put("DriverName", shareRoute.getDriverName());//驾驶员姓名
|
jsonObject.put("DriverPhone", shareRoute.getDriverPhone());//驾驶员手机号
|
jsonObject.put("LicenseId", null != shareRoute.getLicenseId() ? shareRoute.getLicenseId() : "");//机动车驾驶证号
|
jsonObject.put("VehicleNo", shareRoute.getVehicleNo());//车辆号牌
|
jsonObject.put("Departure", shareRoute.getDeparture());//行程出发地点
|
jsonObject.put("DepLongitude", Double.valueOf(shareRoute.getDepLongitude() * 1000000).intValue());//车辆出发经度
|
jsonObject.put("DepLatitude", Double.valueOf(shareRoute.getDepLatitude() * 1000000).intValue());//车辆出发纬度
|
jsonObject.put("Destination", shareRoute.getDestination());//行程到达地点
|
jsonObject.put("DestLongitude", Double.valueOf(shareRoute.getDestLongitude() * 1000000).intValue());//到达地经度
|
jsonObject.put("DestLatitude", Double.valueOf(shareRoute.getDestLatitude() * 1000000).intValue());//到达纬度
|
jsonObject.put("Encrypt", shareRoute.getEncrypt());//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他)
|
jsonObject.put("RouteCreateTime", Long.valueOf(sdf.format(shareRoute.getRouteCreateTime())));//行程发布时间YYYYMMDDhhmmss
|
jsonObject.put("RouteMile", shareRoute.getRouteMile());//行程预计里程(km)
|
jsonObject.put("RouteNote", shareRoute.getRouteNote());//行程备注
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 私人小客车合乘订单接口
|
*/
|
public String shareOrder(ShareOrder shareOrder) throws Exception{
|
System.err.println("私人小客车合乘订单接口"+shareOrder);
|
|
String IPCType = "shareOrder";
|
String path = url + "/share/order";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", shareOrder.getAddress());//行政区划代码
|
jsonObject.put("RouteId", shareOrder.getRouteId());//驾驶员发起行程编号
|
jsonObject.put("OrderId", shareOrder.getOrderId());//乘客合乘订单号
|
jsonObject.put("BookDepartTime", Integer.valueOf(sdf.format(shareOrder.getBookDepartTime())));//预计上车时间YYYYMMDDhhmmss
|
jsonObject.put("Departure", shareOrder.getDeparture());//预计上车地点
|
jsonObject.put("DepLongitude", Double.valueOf(shareOrder.getDepLongitude() * 1000000).intValue());//预计上车地点经度
|
jsonObject.put("DepLatitude", Double.valueOf(shareOrder.getDepLatitude() * 1000000).intValue());//预计上车地点纬度
|
jsonObject.put("Destination", shareOrder.getDestination());//预计下车地点
|
jsonObject.put("DestLongitude", Double.valueOf(shareOrder.getDestLongitude() * 1000000).intValue());//预计下车地点经度
|
jsonObject.put("DestLatitude", Double.valueOf(shareOrder.getDestLatitude() * 1000000).intValue());//预计下车地点纬度
|
jsonObject.put("Encrypt", shareOrder.getEncrypt());//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他)
|
jsonObject.put("OrderEnsureTime", Integer.valueOf(sdf.format(shareOrder.getOrderEnsureTime())));//订单确认时间YYYYMMDDhhmmss
|
jsonObject.put("PassengerNum", shareOrder.getPassengerNum());//乘客人数
|
jsonObject.put("PassengerNote", shareOrder.getPassengerNote());//乘客备注
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
|
/**
|
* 私人小客车合乘订单支付接口
|
*/
|
public String sharePay(SharePay sharePay) throws Exception{
|
System.err.println("私人小客车合乘订单支付接口"+sharePay);
|
|
String IPCType = "sharePay";
|
String path = url + "/share/pay";
|
Map<String, Object> data = new HashMap<>();
|
JSONObject jsonObject = new JSONObject();
|
jsonObject.put("CompanyId", CompanyId);
|
jsonObject.put("Address", sharePay.getAddress());//行政区划代码
|
jsonObject.put("RouteId", sharePay.getRouteId());//驾驶员发起行程编号
|
jsonObject.put("OrderId", sharePay.getOrderId());//乘客合乘订单号
|
jsonObject.put("DriverPhone", sharePay.getDriverPhone());//驾驶员手机号
|
jsonObject.put("LicenseId", null != sharePay.getLicenseId() ? sharePay.getLicenseId() : "");//机动车驾驶证号
|
jsonObject.put("VehicleNo", sharePay.getVehicleNo());//车辆号牌
|
jsonObject.put("FareType", sharePay.getFareType());//运价类型编码
|
jsonObject.put("BookDepartTime", Integer.valueOf(sdf.format(sharePay.getBookDepartTime())));//预计上车时间YYYYMMDDhhmmss
|
jsonObject.put("DepartTime", Integer.valueOf(sdf.format(sharePay.getDepartTime())));//实际上车时间YYYYMMDDhhmmss
|
jsonObject.put("Departure", sharePay.getDeparture());//上车地点
|
jsonObject.put("DepLongitude", Double.valueOf(sharePay.getDepLongitude() * 1000000).intValue());//上车地点经度
|
jsonObject.put("DepLatitude", Double.valueOf(sharePay.getDepLatitude() * 1000000).intValue());//上车地点纬度
|
jsonObject.put("DestTime", Integer.valueOf(sdf.format(sharePay.getDestTime())));//下车时间YYYYMMDDhhmmss
|
jsonObject.put("Destination", sharePay.getDestination());//下车地点
|
jsonObject.put("DestLongitude", Double.valueOf(sharePay.getDestLongitude() * 1000000).intValue());//下车地点经度
|
jsonObject.put("DestLatitude", Double.valueOf(sharePay.getDestLatitude() * 1000000).intValue());//下车地点纬度
|
jsonObject.put("Encrypt", sharePay.getEncrypt());//坐标加密标识(1:GCJ-02测绘局标准,2:WGS84 GPS标准,3:BD-09百度标准,4:CGCS2000北斗标准,0:其他)
|
jsonObject.put("DriveMile", sharePay.getDriveMile());//载客里程(km)
|
jsonObject.put("DriveTime", sharePay.getDriveTime());//载客时间(秒)
|
jsonObject.put("FactPrice", sharePay.getFactPrice());//实收金额(元)
|
jsonObject.put("Price", sharePay.getPrice());//应收金额(元)
|
jsonObject.put("CashPrice", sharePay.getCashPrice());//现金支付金额(元)
|
jsonObject.put("LineName", sharePay.getLineName());//电子支付机构
|
jsonObject.put("LinePrice", sharePay.getLinePrice());//电子支付金额(元)
|
jsonObject.put("BenfitPrice", sharePay.getBenfitPrice());//优惠金额(元)
|
jsonObject.put("ShareFuelFee", sharePay.getShareFuelFee());//燃料成本分摊金额(元)
|
jsonObject.put("ShareHighwayToll", sharePay.getShareHighwayToll());//路桥通行分摊金额(元)
|
jsonObject.put("PassengerTip", sharePay.getPassengerTip());//附加费(元)
|
jsonObject.put("ShareOther", sharePay.getShareOther());//其他费用分摊金额(元)
|
jsonObject.put("PayState", sharePay.getPayState());//结算状态(0:未结算,1:已结算,2:未知)
|
jsonObject.put("PassengerNum", sharePay.getPassengerNum());//乘客人数
|
jsonObject.put("PayTime", Integer.valueOf(sdf.format(sharePay.getPayTime())));//乘客结算时间YYYYMMDDhhmmss
|
jsonObject.put("OrderMatchTime", Integer.valueOf(sdf.format(sharePay.getOrderMatchTime())));//订单完成时间YYYYMMDDhhmmss
|
|
data.put("CompanyId", CompanyId);
|
data.put("Source", Source);
|
data.put("IPCType", IPCType);
|
data.put(IPCType, jsonObject);
|
|
Map<String, String> header = new HashMap<>();
|
header.put("connection", "keep-alive");
|
header.put("content-type", "application/json; charset=UTF-8");
|
header.put("accept", "application/json");
|
header.put("accept-encoding", "gzip");
|
header.put("accept-charset", "utf-8");
|
HttpResult httpResult = httpClientUtil.pushHttpRequset("POST", path, data, header, "json");
|
|
if(httpResult.getCode() == 200){
|
analysisResult(httpResult.getData());
|
}
|
return JSON.toJSONString(httpResult);
|
}
|
|
/**
|
* 处理返回结果
|
* @param result
|
*/
|
private void analysisResult(String result){
|
JSONObject jsonObject = JSON.parseObject(result);
|
// if(null == jsonObject){
|
// System.err.println("请求接口出错!");
|
// return;
|
// }
|
System.err.println("(成功)服务器已成功处理了请求");
|
|
// int code = (Integer)jsonObject.get("status");
|
// if(code == 200){
|
// System.err.println("(成功)服务器已成功处理了请求");
|
// }
|
// if(code == 201){
|
// System.err.println("请求已经完成并一个新的返回资源被创建");
|
// }
|
// if(code == 400){
|
// System.err.println("(错误请求)服务器不理解请求的语法");
|
// System.err.println(jsonObject.getString("error"));
|
// }
|
// if(code == 401){
|
// System.err.println("(未授权)请求要求身份验证");
|
// System.err.println(jsonObject.getString("error"));
|
// }
|
// if(code == 403){
|
// System.err.println("(禁止)服务器拒绝请求");
|
// System.err.println(jsonObject.getString("error"));
|
// }
|
// if(code == 404){
|
// System.err.println("(未找到)服务器找不到请求的网页");
|
// System.err.println(jsonObject.getString("error"));
|
// }
|
// if(code == 500){
|
// System.err.println("服务器遭遇异常阻止了当前请求的执行");
|
// System.err.println(jsonObject.getString("error"));
|
// }
|
// if(code == 502){
|
// System.err.println("(错误网关)服务器作为网关或代理,从上游服务器收到无效响应");
|
// System.err.println(jsonObject.getString("error"));
|
// }
|
// if(code == 702){
|
// System.err.println("请求文件不存在");
|
// System.err.println(jsonObject.getString("error"));
|
// }
|
// if(code == 948){
|
// System.err.println("请求文件名格式不正确");
|
// System.err.println(jsonObject.getString("error"));
|
// }
|
// if(code == 949){
|
// System.err.println("文件解压失败");
|
// System.err.println(jsonObject.getString("error"));
|
// }
|
// if(code == 952){
|
// System.err.println("格式校验失败");
|
// System.err.println(jsonObject.getString("error"));
|
// }
|
// if(code == 1000){
|
// System.err.println("请求异常");
|
// System.err.println(jsonObject.getString("error"));
|
// }
|
|
}
|
|
|
|
|
|
}
|