| | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.xiaopeng.common.core.utils.StringUtils; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationDriverBaseInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationDriverCancelRegisterInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationDriverContractInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationDriverMobileTerminalInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationDriverPositionInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationDriverPunishInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationDriverReputationInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationDriverRegisterInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationDriverStatisticsInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationDriverTrainingInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationDriverVehicleRelationInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationOperateArriveInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationOrderCancelInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationOrderMatchInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationOrderCreateInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationOrderViolationInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationOperateDepartInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationOperatePayInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationVehicleCancelReportInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationPassengerComplaintInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationPassengerEvaluateInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationPassengerBaseInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationPlatformAggregationInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationPlatformPauseOperationRegisterInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationPlatformOperationRegisterInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationPlatformInvestorInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationVehicleBaseInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationVehicleInsuranceInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationVehicleMileageInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationVehicleOperationRegisterInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationVehicleOperateLoginInfoDTO; |
| | | import com.xiaopeng.vehicleConvoy.model.dto.RegulationVehicleOperateLogoutInfoDTO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.http.client.config.RequestConfig; |
| | | import org.apache.http.client.methods.HttpPost; |
| | |
| | | * 接口地址:https://wycapi.jtj.gz.gov.cn/api/app/common/binapi |
| | | */ |
| | | |
| | | private final String companyId = "4401XPQCB67N";//公司标识 |
| | | public static final String DEFAULT_COMPANY_ID = "4401XPQCB67N"; |
| | | |
| | | public static final String DEFAULT_SYMBOL = "XPQCB67N_S0612018007357G"; |
| | | |
| | | public static final String DEFAULT_PROTOCOL_VERSION = "V2.0"; |
| | | |
| | | private final String companyId = DEFAULT_COMPANY_ID;//公司标识 |
| | | |
| | | private final String platform = "XPQCB67N"; |
| | | |
| | |
| | | |
| | | private final String url = "https://wycapi.jtj.gz.gov.cn/api/app/common/binapi"; |
| | | |
| | | private static final String PTJB_SYMBOL = "XPQCB67N_S0612018007357G"; |
| | | private static final DateTimeFormatter FILE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-ddHHmmssSSS"); |
| | | |
| | | private static final String PROTOCOL_VERSION = "V2.0"; |
| | | |
| | | private static final DateTimeFormatter FILE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"); |
| | | |
| | | private static final DateTimeFormatter DATA_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); |
| | | public static final DateTimeFormatter DATA_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); |
| | | |
| | | |
| | | /** |
| | |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushPlatformBaseInfo() { |
| | | String token = parseToken(getToken()); |
| | | JSONObject item = buildPlatformBaseInfo(); |
| | | JSONObject body = new JSONObject(); |
| | | JSONArray items = new JSONArray(); |
| | | items.add(item); |
| | | body.put("items", items); |
| | | |
| | | String format = LocalDateTime.now().format(FILE_TIME_FORMATTER); |
| | | String filename = platform + "_BASIC_PTJB_REQ_" + format + ".json"; |
| | | return uploadJsonFile(filename, body.toJSONString(), token); |
| | | return pushBasicReqInfo(item,"PTJB"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 报送网约车平台公司运营规模信息(PTYYGM) |
| | |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushPlatformOperationScaleInfo() { |
| | | String token = parseToken(getToken()); |
| | | JSONObject item = buildPlatformOperationScaleInfo(); |
| | | return pushBasicReqInfo(item,"PTYYGM"); |
| | | } |
| | | |
| | | /** |
| | | * 报送网约车车辆基本信息(CLJB) |
| | | * |
| | | * @param dto 车辆基本信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushVehicleBaseInfo(RegulationVehicleBaseInfoDTO dto) { |
| | | JSONObject item = buildVehicleBaseInfo(dto); |
| | | return pushBasicReqInfo(item, "CLJB"); |
| | | } |
| | | |
| | | /** |
| | | * 报送网约车车辆保险信息(CLBX) |
| | | * |
| | | * @param dto 车辆保险信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushVehicleInsuranceInfo(RegulationVehicleInsuranceInfoDTO dto) { |
| | | JSONObject item = buildVehicleInsuranceInfo(dto); |
| | | return pushBasicReqInfo(item, "CLBX"); |
| | | } |
| | | |
| | | /** |
| | | * 报送网约车车辆里程信息(CLLC) |
| | | * |
| | | * @param dto 车辆里程信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushVehicleMileageInfo(RegulationVehicleMileageInfoDTO dto) { |
| | | JSONObject item = buildVehicleMileageInfo(dto); |
| | | return pushBasicReqInfo(item, "CLLC"); |
| | | } |
| | | |
| | | /** |
| | | * 报送网约车驾驶员基本信息(JSYJB) |
| | | * |
| | | * @param dto 驾驶员基本信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushDriverBaseInfo(RegulationDriverBaseInfoDTO dto) { |
| | | JSONObject item = buildDriverBaseInfo(dto); |
| | | return pushBasicReqInfo(item, "JSYJB"); |
| | | } |
| | | |
| | | /** |
| | | * 报送网约车驾驶员培训信息(JSYPX) |
| | | * |
| | | * @param dto 驾驶员培训信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushDriverTrainingInfo(RegulationDriverTrainingInfoDTO dto) { |
| | | JSONObject item = buildDriverTrainingInfo(dto); |
| | | return pushBasicReqInfo(item, "JSYPX"); |
| | | } |
| | | |
| | | /** |
| | | * 报送网约车驾驶员移动终端信息(JSYYDZD) |
| | | * |
| | | * @param dto 驾驶员移动终端信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushDriverMobileTerminalInfo(RegulationDriverMobileTerminalInfoDTO dto) { |
| | | JSONObject item = buildDriverMobileTerminalInfo(dto); |
| | | return pushBasicReqInfo(item, "JSYYDZD"); |
| | | } |
| | | |
| | | /** |
| | | * 报送网约车驾驶员统计信息(JSYTJ) |
| | | * |
| | | * @param dto 驾驶员统计信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushDriverStatisticsInfo(RegulationDriverStatisticsInfoDTO dto) { |
| | | JSONObject item = buildDriverStatisticsInfo(dto); |
| | | return pushBasicReqInfo(item, "JSYTJ"); |
| | | } |
| | | |
| | | /** |
| | | * 报送网约车乘客基本信息(CKJB) |
| | | * |
| | | * @param dto 乘客基本信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushPassengerBaseInfo(RegulationPassengerBaseInfoDTO dto) { |
| | | JSONObject item = buildPassengerBaseInfo(dto); |
| | | return pushBasicReqInfo(item, "CKJB"); |
| | | } |
| | | |
| | | /** |
| | | * 报送网约车平台投资人信息(PTTZR) |
| | | * |
| | | * @param dto 平台投资人信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushPlatformInvestorInfo(RegulationPlatformInvestorInfoDTO dto) { |
| | | JSONObject item = buildPlatformInvestorInfo(dto); |
| | | return pushBasicReqInfo(item, "PTTZR"); |
| | | } |
| | | |
| | | /** |
| | | * 报送驾驶员合同信息(GTJSYHT) |
| | | * |
| | | * @param dto 驾驶员合同信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushDriverContractInfo(RegulationDriverContractInfoDTO dto) { |
| | | JSONObject item = buildDriverContractInfo(dto); |
| | | return pushBasicReqInfo(item, "GTJSYHT"); |
| | | } |
| | | |
| | | /** |
| | | * 报送订单发起(DDFQ) |
| | | * |
| | | * @param dto 订单发起信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushOrderCreateInfo(RegulationOrderCreateInfoDTO dto) { |
| | | JSONObject item = buildOrderCreateInfo(dto); |
| | | return pushOrderReqInfo(item, "DDFQ"); |
| | | } |
| | | |
| | | /** |
| | | * 报送订单成功(DDCG) |
| | | * |
| | | * @param dto 订单成功信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushOrderMatchInfo(RegulationOrderMatchInfoDTO dto) { |
| | | JSONObject item = buildOrderMatchInfo(dto); |
| | | return pushOrderReqInfo(item, "DDCG"); |
| | | } |
| | | |
| | | /** |
| | | * 报送订单撤销(DDCX) |
| | | * |
| | | * @param dto 订单撤销信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushOrderCancelInfo(RegulationOrderCancelInfoDTO dto) { |
| | | JSONObject item = buildOrderCancelInfo(dto); |
| | | return pushOrderReqInfo(item, "DDCX"); |
| | | } |
| | | |
| | | /** |
| | | * 报送订单违约(DDWY) |
| | | * |
| | | * @param dto 订单违约信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushOrderViolationInfo(RegulationOrderViolationInfoDTO dto) { |
| | | JSONObject item = buildOrderViolationInfo(dto); |
| | | return pushOrderReqInfo(item, "DDWY"); |
| | | } |
| | | |
| | | /** |
| | | * 报送车辆营运上线(CLYYSX) |
| | | * |
| | | * @param dto 车辆营运上线信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushVehicleOperateLoginInfo(RegulationVehicleOperateLoginInfoDTO dto) { |
| | | JSONObject item = buildVehicleOperateLoginInfo(dto); |
| | | return pushOperationReqInfo(item, "CLYYSX"); |
| | | } |
| | | |
| | | /** |
| | | * 报送车辆营运下线(CLYYXX) |
| | | * |
| | | * @param dto 车辆营运下线信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushVehicleOperateLogoutInfo(RegulationVehicleOperateLogoutInfoDTO dto) { |
| | | JSONObject item = buildVehicleOperateLogoutInfo(dto); |
| | | return pushOperationReqInfo(item, "CLYYXX"); |
| | | } |
| | | |
| | | /** |
| | | * 报送营运出发(YYCF) |
| | | * |
| | | * @param dto 营运出发信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushOperateDepartInfo(RegulationOperateDepartInfoDTO dto) { |
| | | JSONObject item = buildOperateDepartInfo(dto); |
| | | return pushOperationReqInfo(item, "YYCF"); |
| | | } |
| | | |
| | | /** |
| | | * 报送营运到达(YYDD) |
| | | * |
| | | * @param dto 营运到达信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushOperateArriveInfo(RegulationOperateArriveInfoDTO dto) { |
| | | JSONObject item = buildOperateArriveInfo(dto); |
| | | return pushOperationReqInfo(item, "YYDD"); |
| | | } |
| | | |
| | | /** |
| | | * 报送营运支付(YYZF) |
| | | * |
| | | * @param dto 营运支付信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushOperatePayInfo(RegulationOperatePayInfoDTO dto) { |
| | | JSONObject item = buildOperatePayInfo(dto); |
| | | return pushOperationReqInfo(item, "YYZF"); |
| | | } |
| | | |
| | | /** |
| | | * 报送驾驶员定位信息(JSYDW) |
| | | * |
| | | * @param dto 驾驶员定位信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushDriverPositionInfo(RegulationDriverPositionInfoDTO dto) { |
| | | JSONObject item = buildDriverPositionInfo(dto); |
| | | return pushGpsReqInfo(item, "JSYDW"); |
| | | } |
| | | |
| | | /** |
| | | * 报送乘客评价信息(CKPJ) |
| | | * |
| | | * @param dto 乘客评价信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushPassengerEvaluateInfo(RegulationPassengerEvaluateInfoDTO dto) { |
| | | JSONObject item = buildPassengerEvaluateInfo(dto); |
| | | return pushQualityReqInfo(item, "CKPJ"); |
| | | } |
| | | |
| | | /** |
| | | * 报送乘客投诉处理信息(CKTSCL) |
| | | * |
| | | * @param dto 乘客投诉处理信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushPassengerComplaintInfo(RegulationPassengerComplaintInfoDTO dto) { |
| | | JSONObject item = buildPassengerComplaintInfo(dto); |
| | | return pushQualityReqInfo(item, "CKTSCL"); |
| | | } |
| | | |
| | | /** |
| | | * 报送车辆注销报备(CLZXBB) |
| | | * |
| | | * @param dto 车辆注销报备信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushVehicleCancelReportInfo(RegulationVehicleCancelReportInfoDTO dto) { |
| | | JSONObject item = buildVehicleCancelReportInfo(dto); |
| | | return pushRegistReqInfo(item, "CLZXBB"); |
| | | } |
| | | |
| | | /** |
| | | * 报送驾驶员处罚信息(JSYCF) |
| | | * |
| | | * @param dto 驾驶员处罚信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushDriverPunishInfo(RegulationDriverPunishInfoDTO dto) { |
| | | JSONObject item = buildDriverPunishInfo(dto); |
| | | return pushQualityReqInfo(item, "JSYCF"); |
| | | } |
| | | |
| | | /** |
| | | * 报送驾驶员信誉信息(JSYXY) |
| | | * |
| | | * @param dto 驾驶员信誉信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushDriverReputationInfo(RegulationDriverReputationInfoDTO dto) { |
| | | JSONObject item = buildDriverReputationInfo(dto); |
| | | return pushQualityReqInfo(item, "JSYXY"); |
| | | } |
| | | |
| | | /** |
| | | * 报送人车对应关系信息(RCDYGX) |
| | | * |
| | | * @param dto 人车对应关系信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushDriverVehicleRelationInfo(RegulationDriverVehicleRelationInfoDTO dto) { |
| | | JSONObject item = buildDriverVehicleRelationInfo(dto); |
| | | return pushBasicReqInfo(item, "RCDYGX"); |
| | | } |
| | | |
| | | /** |
| | | * 报送平台营运报备(PTYYBB) |
| | | * |
| | | * @param dto 平台营运报备信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushPlatformOperationRegisterInfo(RegulationPlatformOperationRegisterInfoDTO dto) { |
| | | JSONObject item = buildPlatformOperationRegisterInfo(dto); |
| | | return pushRegistReqInfo(item, "PTYYBB"); |
| | | } |
| | | |
| | | /** |
| | | * 报送平台暂停营运报备(PTZTYYBB) |
| | | * |
| | | * @param dto 平台暂停营运报备信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushPlatformPauseOperationRegisterInfo(RegulationPlatformPauseOperationRegisterInfoDTO dto) { |
| | | JSONObject item = buildPlatformPauseOperationRegisterInfo(dto); |
| | | return pushRegistReqInfo(item, "PTZTYYBB"); |
| | | } |
| | | |
| | | /** |
| | | * 报送合作聚合平台信息(PTJHPTXX) |
| | | * |
| | | * @param dto 合作聚合平台信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushPlatformAggregationInfo(RegulationPlatformAggregationInfoDTO dto) { |
| | | JSONObject item = buildPlatformAggregationInfo(dto); |
| | | return pushRegistReqInfo(item, "PTJHPTXX"); |
| | | } |
| | | |
| | | /** |
| | | * 报送车辆营运报备(CLYYBB) |
| | | * |
| | | * @param dto 车辆营运报备信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushVehicleOperationRegisterInfo(RegulationVehicleOperationRegisterInfoDTO dto) { |
| | | JSONObject item = buildVehicleOperationRegisterInfo(dto); |
| | | return pushRegistReqInfo(item, "CLYYBB"); |
| | | } |
| | | |
| | | /** |
| | | * 报送驾驶员注册报备(JSYZCBB) |
| | | * |
| | | * @param dto 驾驶员注册报备信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushDriverRegisterInfo(RegulationDriverRegisterInfoDTO dto) { |
| | | JSONObject item = buildDriverRegisterInfo(dto); |
| | | return pushRegistReqInfo(item, "JSYZCBB"); |
| | | } |
| | | |
| | | /** |
| | | * 报送驾驶员注销注册(JSYZXZC) |
| | | * |
| | | * @param dto 驾驶员注销注册信息 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushDriverCancelRegisterInfo(RegulationDriverCancelRegisterInfoDTO dto) { |
| | | JSONObject item = buildDriverCancelRegisterInfo(dto); |
| | | return pushRegistReqInfo(item, "JSYZXZC"); |
| | | } |
| | | |
| | | /** |
| | | * 报送网约车平台公司支付信息(PTZF) |
| | | * |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushPlatformPayInfo() { |
| | | JSONObject item = new JSONObject(); |
| | | item.put("symbol", DEFAULT_SYMBOL); |
| | | item.put("companyId", companyId); |
| | | item.put("payName", ""); //TODO 后续补充完整 |
| | | item.put("payId", ""); //TODO 后续补充完整 |
| | | item.put("payType", ""); //TODO 后续补充完整 |
| | | item.put("payScope", ""); //TODO 后续补充完整 |
| | | item.put("prepareBank", ""); //TODO 后续补充完整 |
| | | item.put("countDate", ""); //TODO 后续补充完整 |
| | | item.put("state", "0"); |
| | | item.put("flag", "1"); |
| | | item.put("updateTime", LocalDateTime.now().format(DATA_TIME_FORMATTER)); |
| | | item.put("protocolVersion", DEFAULT_PROTOCOL_VERSION); |
| | | return pushBasicReqInfo(item,"PTZF"); |
| | | } |
| | | |
| | | /** |
| | | * 网约车平台公司服务机构(PTFWJG) |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushPlatformServiceInfo() { |
| | | JSONObject item = new JSONObject(); |
| | | item.put("symbol", DEFAULT_SYMBOL); |
| | | item.put("companyId", companyId); |
| | | item.put("address", "");//TODO 后续补充完整 |
| | | item.put("serviceName", "");//TODO 后续补充完整 |
| | | item.put("serviceNo", "");//TODO 后续补充完整 |
| | | item.put("detailAddress", "");//TODO 后续补充完整 |
| | | item.put("responsibleName", "");//TODO 后续补充完整 |
| | | item.put("responsiblePhone", "");//TODO 后续补充完整 |
| | | item.put("managerName", "");//TODO 后续补充完整 |
| | | item.put("managerPhone", "");//TODO 后续补充完整 |
| | | item.put("contactPhone", "");//TODO 后续补充完整 |
| | | item.put("mailAddress", "");//TODO 后续补充完整 |
| | | item.put("createDate", "");//TODO 后续补充完整 |
| | | item.put("state", "0"); |
| | | item.put("flag", "1"); |
| | | item.put("updateTime", LocalDateTime.now().format(DATA_TIME_FORMATTER)); |
| | | item.put("protocolVersion", DEFAULT_PROTOCOL_VERSION); |
| | | return pushBasicReqInfo(item,"PTFWJG"); |
| | | } |
| | | |
| | | /** |
| | | * 网约车平台公司经营许可(CPTJYXK) |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushPlatformLicenseInfo() { |
| | | JSONObject item = new JSONObject(); |
| | | item.put("symbol", DEFAULT_SYMBOL); |
| | | item.put("companyId", companyId); |
| | | item.put("address", "");//TODO 后续补充完整 |
| | | item.put("certificate", "");//TODO 后续补充完整 |
| | | item.put("operationArea", "");//TODO 后续补充完整 |
| | | item.put("ownerName", "");//TODO 后续补充完整 |
| | | item.put("organization", "");//TODO 后续补充完整 |
| | | item.put("startDate", "");//TODO 后续补充完整 |
| | | item.put("stopDate", "");//TODO 后续补充完整 |
| | | item.put("certifyDate", "");//TODO 后续补充完整 |
| | | item.put("state", "1"); |
| | | item.put("flag", "1"); |
| | | item.put("updateTime", LocalDateTime.now().format(DATA_TIME_FORMATTER)); |
| | | item.put("protocolVersion", DEFAULT_PROTOCOL_VERSION); |
| | | return pushBasicReqInfo(item,"CPTJYXK"); |
| | | } |
| | | |
| | | /** |
| | | * 网约车平台公司计程计价方式(PTYJ) |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | public String pushPlatformPriceInfo() { |
| | | JSONObject item = new JSONObject(); |
| | | item.put("symbol", DEFAULT_SYMBOL); |
| | | item.put("companyId", companyId); |
| | | item.put("address", "");//TODO 后续补充完整 |
| | | item.put("fareType", "");//TODO 后续补充完整 |
| | | item.put("fareTypeNote", "");//TODO 后续补充完整 |
| | | item.put("fareValidOn", "");//TODO 后续补充完整 |
| | | item.put("fareValidOff", "");//TODO 后续补充完整 |
| | | item.put("startFare", "0");//TODO 后续补充完整 |
| | | item.put("startMile", "0");//TODO 后续补充完整 |
| | | item.put("upPrice", "0");//TODO 后续补充完整 |
| | | item.put("upPriceStartMile", "");//TODO 后续补充完整 |
| | | item.put("morningPeakTimeOn", "");//TODO 后续补充完整 |
| | | item.put("morningPeakTimeOff", "");//TODO 后续补充完整 |
| | | item.put("eveningPeakTimeOn", "");//TODO 后续补充完整 |
| | | item.put("eveningPeakTimeOff", "");//TODO 后续补充完整 |
| | | item.put("otherPeakTimeOn", "");//TODO 后续补充完整 |
| | | item.put("otherPeakTimeOff", "");//TODO 后续补充完整 |
| | | item.put("peakUnitPrice", "");//TODO 后续补充完整 |
| | | item.put("peakPriceStartMile", "");//TODO 后续补充完整 |
| | | item.put("unitPricePerMile", "");//TODO 后续补充完整 |
| | | item.put("longDistancePrice", "");//TODO 后续补充完整 |
| | | item.put("longDistanceStartMile", "");//TODO 后续补充完整 |
| | | item.put("lowSpeedPricePerMinute", "");//TODO 后续补充完整 |
| | | item.put("nightPricePerMile", "");//TODO 后续补充完整 |
| | | item.put("nightPricePerMinute", "");//TODO 后续补充完整 |
| | | item.put("otherPrice", "");//TODO 后续补充完整 |
| | | item.put("state", "0");//TODO 后续补充完整 |
| | | item.put("updateTime", LocalDateTime.now().format(DATA_TIME_FORMATTER)); |
| | | item.put("fareRuleUrl", "");//TODO 后续补充完整 |
| | | item.put("protocolVersion", DEFAULT_PROTOCOL_VERSION); |
| | | return pushBasicReqInfo(item,"PTYJ"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 推送基础信息 |
| | | * @param item 推送基础信息 |
| | | * @param command 推送基础信息类型 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | private String pushBasicReqInfo(JSONObject item,String command) { |
| | | return pushReqInfo(item,"BASIC",command); |
| | | } |
| | | |
| | | /** |
| | | * 推送订单信息 |
| | | * @param item 推送基础信息 |
| | | * @param command 推送基础信息类型 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | private String pushOrderReqInfo(JSONObject item,String command) { |
| | | return pushReqInfo(item,"ORDER",command); |
| | | } |
| | | |
| | | /** |
| | | * 推送营运信息 |
| | | * @param item 推送营运信息 |
| | | * @param command 推送营运信息类型 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | private String pushOperationReqInfo(JSONObject item,String command) { |
| | | return pushReqInfo(item,"OPERATE",command); |
| | | } |
| | | |
| | | /** |
| | | * 推送服务质量信息 |
| | | * @param item 推送服务质量信息 |
| | | * @param command 推送服务质量信息类型 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | private String pushQualityReqInfo(JSONObject item,String command) { |
| | | return pushReqInfo(item,"QUALITY",command); |
| | | } |
| | | |
| | | /** |
| | | * 推送注册报备信息 |
| | | * @param item 推送注册报备信息 |
| | | * @param command 推送注册报备信息类型 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | private String pushRegistReqInfo(JSONObject item,String command) { |
| | | return pushReqInfo(item,"REGIST",command); |
| | | } |
| | | |
| | | /** |
| | | * 推送GPS信息 |
| | | * @param item 推送信息 |
| | | * @param command 推送信息关键字 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | private String pushGpsReqInfo(JSONObject item,String command) { |
| | | return pushReqInfo(item,"GPS",command); |
| | | } |
| | | |
| | | /** |
| | | * 推送服务质量信息 |
| | | * @param item 推送信息 |
| | | * @param command 推送信息关键字 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | private String pushEvaluateReqInfo(JSONObject item,String command) { |
| | | return pushReqInfo(item,"EVALUATE",command); |
| | | } |
| | | |
| | | /** |
| | | * 推送人车关系信息 |
| | | * @param item 推送信息 |
| | | * @param command 推送信息关键字 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | private String pushRelationshipReqInfo(JSONObject item,String command) { |
| | | return pushReqInfo(item,"RELATIONSHIP",command); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 推送信息 |
| | | * @param item 推送信息 |
| | | * @param type 推送信息类型 |
| | | * @param command 推送信息关键字 |
| | | * @return 监管平台原始响应 |
| | | */ |
| | | private String pushReqInfo(JSONObject item,String type,String command) { |
| | | String token = parseToken(getToken()); |
| | | JSONObject body = new JSONObject(); |
| | | JSONArray items = new JSONArray(); |
| | | items.add(item); |
| | | body.put("items", items); |
| | | |
| | | String format = LocalDateTime.now().format(FILE_TIME_FORMATTER); |
| | | String filename = platform + "_BASIC_PTYYGM_REQ_" + format + ".json"; |
| | | String filename = platform + "_"+ type +"_"+ command +"_REQ_" + format + ".json"; |
| | | return uploadJsonFile(filename, body.toJSONString(), token); |
| | | } |
| | | |
| | | |
| | | private JSONObject buildPlatformBaseInfo() { |
| | | JSONObject item = new JSONObject(); |
| | | item.put("symbol", PTJB_SYMBOL); |
| | | item.put("symbol", DEFAULT_SYMBOL); |
| | | item.put("companyId", companyId); |
| | | item.put("companyName", "广州易点智慧出行科技有限公司"); |
| | | item.put("identifier", "91440101MA5AWEB67N"); |
| | |
| | | item.put("updateTime", LocalDateTime.now().format(DATA_TIME_FORMATTER)); |
| | | item.put("serviceItem", "网络预约出租汽车服务"); |
| | | item.put("servicePromise", "严格遵守国家及地方有关网络预约出租汽车经营的法律法规及行业规范,依法取得相关许可,证照齐全、亮证经营"); |
| | | item.put("protocolVersion", PROTOCOL_VERSION); |
| | | item.put("protocolVersion", DEFAULT_PROTOCOL_VERSION); |
| | | return item; |
| | | } |
| | | |
| | | private JSONObject buildPlatformOperationScaleInfo() { |
| | | JSONObject item = new JSONObject(); |
| | | item.put("symbol", PTJB_SYMBOL); |
| | | item.put("symbol", DEFAULT_SYMBOL); |
| | | item.put("companyId", companyId); |
| | | item.put("vehicleNum", "1"); //TODO 后续补充完整 |
| | | item.put("driverNum", "1"); //TODO 后续补充完整 |
| | | item.put("flag", "1"); |
| | | item.put("updateTime", LocalDateTime.now().format(DATA_TIME_FORMATTER)); |
| | | item.put("protocolVersion", PROTOCOL_VERSION); |
| | | item.put("protocolVersion", DEFAULT_PROTOCOL_VERSION); |
| | | return item; |
| | | } |
| | | |
| | | private JSONObject buildVehicleBaseInfo(RegulationVehicleBaseInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("网约车车辆基本信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildVehicleInsuranceInfo(RegulationVehicleInsuranceInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("网约车车辆保险信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildVehicleMileageInfo(RegulationVehicleMileageInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("网约车车辆里程信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildDriverBaseInfo(RegulationDriverBaseInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("网约车驾驶员基本信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildDriverTrainingInfo(RegulationDriverTrainingInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("网约车驾驶员培训信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildDriverMobileTerminalInfo(RegulationDriverMobileTerminalInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("网约车驾驶员移动终端信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildDriverStatisticsInfo(RegulationDriverStatisticsInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("网约车驾驶员统计信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildPassengerBaseInfo(RegulationPassengerBaseInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("网约车乘客基本信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildPlatformInvestorInfo(RegulationPlatformInvestorInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("网约车平台投资人信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildDriverContractInfo(RegulationDriverContractInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("驾驶员合同信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildOrderCreateInfo(RegulationOrderCreateInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("订单发起信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildOrderMatchInfo(RegulationOrderMatchInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("订单成功信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildOrderCancelInfo(RegulationOrderCancelInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("订单撤销信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildOrderViolationInfo(RegulationOrderViolationInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("订单违约信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildVehicleOperateLoginInfo(RegulationVehicleOperateLoginInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("车辆营运上线信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildVehicleOperateLogoutInfo(RegulationVehicleOperateLogoutInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("车辆营运下线信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildOperateDepartInfo(RegulationOperateDepartInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("营运出发信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildOperateArriveInfo(RegulationOperateArriveInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("营运到达信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildOperatePayInfo(RegulationOperatePayInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("营运支付信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildDriverPositionInfo(RegulationDriverPositionInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("驾驶员定位信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildPassengerEvaluateInfo(RegulationPassengerEvaluateInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("乘客评价信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildPassengerComplaintInfo(RegulationPassengerComplaintInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("乘客投诉处理信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildVehicleCancelReportInfo(RegulationVehicleCancelReportInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("车辆注销报备信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildDriverPunishInfo(RegulationDriverPunishInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("驾驶员处罚信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildDriverReputationInfo(RegulationDriverReputationInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("驾驶员信誉信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildDriverVehicleRelationInfo(RegulationDriverVehicleRelationInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("人车对应关系信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildPlatformOperationRegisterInfo(RegulationPlatformOperationRegisterInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("平台营运报备信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildPlatformPauseOperationRegisterInfo(RegulationPlatformPauseOperationRegisterInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("平台暂停营运报备信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildPlatformAggregationInfo(RegulationPlatformAggregationInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("合作聚合平台信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildVehicleOperationRegisterInfo(RegulationVehicleOperationRegisterInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("车辆营运报备信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildDriverRegisterInfo(RegulationDriverRegisterInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("驾驶员注册报备信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private JSONObject buildDriverCancelRegisterInfo(RegulationDriverCancelRegisterInfoDTO dto) { |
| | | if (dto == null) { |
| | | throw new RuntimeException("驾驶员注销注册信息不能为空"); |
| | | } |
| | | return (JSONObject) JSON.toJSON(dto); |
| | | } |
| | | |
| | | private String encodePdf(String filename) { |
| | | if (StringUtils.isBlank(filename)) { |
| | | if (filename == null || filename.trim().isEmpty()) { |
| | | return ""; |
| | | } |
| | | String resourcePath = "files/" + filename.trim(); |