|
@@ -0,0 +1,583 @@
|
|
|
+package info.aspirecn.rdc.iov.sjjh.servicenode.supplier.action;
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+
|
|
|
+import org.apache.tomcat.util.ExceptionUtils;
|
|
|
+import org.apache.tomcat.util.codec.binary.Base64;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestHeader;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.context.request.RequestContextHolder;
|
|
|
+import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
+
|
|
|
+import info.aspirecn.iov.sjjh.commons.lang.ChannelTypeHandleResponseObject;
|
|
|
+import info.aspirecn.iov.sjjh.commons.lang.Constant;
|
|
|
+import info.aspirecn.rdc.aspirecloud.node.except.utils.ErrorUtils;
|
|
|
+import info.aspirecn.rdc.iov.sjjh.servicenode.supplier.config.SupplierConfig;
|
|
|
+import info.aspirecn.rdc.iov.sjjh.servicenode.supplier.service.CarService;
|
|
|
+import info.aspirecn.rdc.iov.sjjh.servicenode.supplier.utils.SjjhConstant;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+
|
|
|
+/*
|
|
|
+ * 车辆运力与车企运力接口*/
|
|
|
+@Slf4j
|
|
|
+@RestController
|
|
|
+public class CarAction {
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CarService carService;
|
|
|
+ @Autowired
|
|
|
+ private SupplierConfig supplierConfig;
|
|
|
+
|
|
|
+ @ApiOperation(value = "车辆运力信息查询", notes = "")
|
|
|
+ @PostMapping(value = "/carCapacity.do")
|
|
|
+ public ChannelTypeHandleResponseObject carCapacity(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+
|
|
|
+ log.info("车辆运力信息查询请求--->channelId:{}--->outTime:{},--->customBody:{}",channelId,outTime,customBody);
|
|
|
+ //日志记录通道类型 - 同步
|
|
|
+ ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
|
|
+ HttpServletRequest request = servletRequestAttributes.getRequest();
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_ISCHARGE_KEY,Constant.IS_NOT_CHARGE);
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode,Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Up_ResponseCode, Constant.LOG_UPSTREAM_DEFAULT_RESPONSE_CODE);
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject responseObject = new ChannelTypeHandleResponseObject();
|
|
|
+ try{
|
|
|
+ responseObject = carService.getCarCapacity(
|
|
|
+ request,customBody,outTime);
|
|
|
+ //日志记录通道响应码
|
|
|
+ if(responseObject.getCode() == 1){
|
|
|
+ log.info("ifJk:{}",request.getHeader(Constant.CUSTOMER_RETURN_TYPE_PARA));
|
|
|
+ if(Constant.CUSTOMER_RETURN_JK.equals(request.getHeader(Constant.CUSTOMER_RETURN_TYPE_PARA))){
|
|
|
+
|
|
|
+ String code = supplierConfig.getCode().get(responseObject.getResultCode());
|
|
|
+ log.info("resultCode:{},jkCode:{}",responseObject.getResultCode(),code);
|
|
|
+ if(code!=null){
|
|
|
+ responseObject.setResultCode(Integer.valueOf(code));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode,Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ //日志记录通道查询参数
|
|
|
+ if(customBody != null){
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY, Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ ExceptionUtils.handleThrowable(e);
|
|
|
+ log.error("异常信息:{}",e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key,responseObject.getIsCharge());
|
|
|
+
|
|
|
+ return responseObject;
|
|
|
+ }catch(Exception ex){
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("message:{}",ex);
|
|
|
+ return responseObject;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "车企运力信息接口", notes = "")
|
|
|
+ @PostMapping(value = "/carEnterpriseTransportInfo.do")
|
|
|
+ public ChannelTypeHandleResponseObject carEnterpriseTransportInfoCheck(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.carEnterpriseTransportInfoCheck(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("carEnterpriseTransportInfoCheck.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "车辆历史轨迹接口", notes = "")
|
|
|
+ @PostMapping(value = "/carHistoricalTrajectoryQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject carHistoricalTrajectoryQuery(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.carHistoricalTrajectoryQuery(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("carHistoricalTrajectoryQuery.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "车辆实时位置接口", notes = "")
|
|
|
+ @PostMapping(value = "/carLastPositionQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject carLastPositionQuery(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.carLastPositionQuery(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("carLastPositionQuery.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ @ApiOperation(value = "车辆历史轨迹接口(校验装卸货)", notes = "")
|
|
|
+ @PostMapping(value = "/carHistoricalTrajectoryQueryByBaidu.do")
|
|
|
+ public ChannelTypeHandleResponseObject carHistoricalTrajectoryQueryByBaidu(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.carHistoricalTrajectoryQueryByBaidu(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("carHistoricalTrajectoryQuery.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ @ApiOperation(value = "车辆入网核验接口", notes = "")
|
|
|
+ @PostMapping(value = "/truckExistCheck.do")
|
|
|
+ public ChannelTypeHandleResponseObject truckExistCheck(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.truckExistCheck(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("truckExistCheck.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "多车最新位置接口", notes = "")
|
|
|
+ @PostMapping(value = "/carsLastPositionQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject carsLastPositionQuery(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.carsLastPositionQuery(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("carsLastPositionQuery.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "企业运输许可证信息查询接口", notes = "")
|
|
|
+ @PostMapping(value = "/enterpriseTransportPermitQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject enterpriseTransportPermitQuery(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.enterpriseTransportPermitQuery(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("enterpriseTransportPermit.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "人员从业资格证信息接口", notes = "")
|
|
|
+ @PostMapping(value = "/personQualificationCertificateQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject personQualificationCertificateQuery(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.personQualificationCertificateQuery(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("personQualificationCertificateQuery.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "车辆运输许可证信息查询接口", notes = "")
|
|
|
+ @PostMapping(value = "/vehicleTransportPermitQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject vehicleTransportPermitQuery(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.vehicleTransportPermitQuery(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("vehicleTransportPermitQuery.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "车主真实性验证接口", notes = "")
|
|
|
+ @PostMapping(value = "/carOwnerAuthenticityCheck.do")
|
|
|
+ public ChannelTypeHandleResponseObject carOwnerAuthenticityCheck(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.carOwnerAuthenticityCheck(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("carOwnerAuthenticityCheck.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "货车车辆画像接口", notes = "")
|
|
|
+ @PostMapping(value = "/truckInfoQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject truckInfoQuery(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.truckInfoQuery(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("carOwnerAuthenticityCheck.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "车辆运营信息接口", notes = "")
|
|
|
+ @PostMapping(value = "/carOperationQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject carOperationQuery(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.carOperationInfoQuery(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("carOperationQuery.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "车身照片及运输证号查询接口", notes = "")
|
|
|
+ @PostMapping(value = "/carPicTransportNoQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject carPicTransportNoQuery(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.carPicTransportNoQuery(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("carPicTransportNoQuery.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "车辆里程信息接口", notes = "")
|
|
|
+ @PostMapping(value = "/carMileageQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject carMileageQuery(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.carMileageQuery(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("carMileageQuery.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "车辆停车信息接口", notes = "")
|
|
|
+ @PostMapping(value = "/carParkingInfoQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject carParkingInfoQuery(
|
|
|
+ @ApiParam(value="通道ID")@RequestHeader(name="channelId") String channelId,
|
|
|
+ @ApiParam(value="超时时间,单位:毫秒",example = "10000")@RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @ApiParam(value="请求参数JSON串")@RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject ret = carService.carParkingInfoQuery(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(SjjhConstant.PARA_ENCODE)));
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("carParkingInfoQuery.encodeBase64String.Exception={}", ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+}
|