|
@@ -0,0 +1,398 @@
|
|
|
+package info.aspirecn.rdc.iov.sjjh.servicenode.supplier.action;
|
|
|
+
|
|
|
+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.constant.ChannelConstant;
|
|
|
+import info.aspirecn.rdc.iov.sjjh.servicenode.supplier.service.WycChannelService;
|
|
|
+import info.aspirecn.rdc.iov.sjjh.servicenode.supplier.utils.SupplierProperties;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+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 javax.servlet.http.HttpServletRequest;
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author chenqingqing
|
|
|
+ * @Description 网约车接口
|
|
|
+ */
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@RestController
|
|
|
+public class WycChannelActionImpl {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ WycChannelService wycChannelService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ SupplierProperties property;
|
|
|
+
|
|
|
+ @ApiOperation(value = "网约车信息查询", notes = "")
|
|
|
+ @PostMapping(value = "/wycDriverInfo.do")
|
|
|
+ public ChannelTypeHandleResponseObject twoParamIdCard(
|
|
|
+ @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(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, Constant.LOG_UPSTREAM_DEFAULT_RESPONSE_CODE);
|
|
|
+ String channel_price = request.getHeader(Constant.CHANNEL_PRICE);
|
|
|
+ String channel_second_price = request.getHeader(Constant.CHANNEL_SECOND_PRICE);
|
|
|
+ log.info("channel_price:{},channel_second_price:{}",channel_price,channel_second_price);
|
|
|
+ request.setAttribute(Constant.CHANNEL_PRICE,request.getHeader(Constant.CHANNEL_PRICE));
|
|
|
+ ChannelTypeHandleResponseObject responseObject = new ChannelTypeHandleResponseObject();
|
|
|
+ try{
|
|
|
+ responseObject = wycChannelService.WycInfoRequest(
|
|
|
+ request, channelId,outTime,customBody);
|
|
|
+ //日志记录通道响应码
|
|
|
+ if(responseObject.getCode() != 1){
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ }else{
|
|
|
+ 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 = property.getCode().get(responseObject.getResultCode());
|
|
|
+ log.info("resultCode:{},jkCode:{}",responseObject.getResultCode(),code);
|
|
|
+ if(code!=null){
|
|
|
+ responseObject.setResultCode(Integer.valueOf(code));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ //日志记录通道查询参数
|
|
|
+ if(customBody != null){
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,Base64.encodeBase64String(customBody.getBytes("utf-8")));
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ ExceptionUtils.handleThrowable(e);
|
|
|
+ log.error("异常信息:{}",e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_ISCHARGE_KEY,responseObject.getIsCharge());
|
|
|
+
|
|
|
+ return responseObject;
|
|
|
+ }catch(Exception ex){
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("message:{}",ex);
|
|
|
+ return responseObject;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @ApiOperation(value = "网约车从业人员查询-定制接口")
|
|
|
+ @PostMapping(value = "/onlineCarHailingQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject onlineCarHailingQuery(
|
|
|
+ @ApiParam(value = "通道ID") @RequestHeader(name = "channelId") String channelId,
|
|
|
+ @ApiParam(value = "超时时间,单位:毫秒", example = "10000") @RequestParam(name = "outTime") int outTime,
|
|
|
+ @ApiParam(value = "请求参数JSON串") @RequestParam(name = "customBody") String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_ISCHARGE_KEY,Constant.IS_NOT_CHARGE);
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, Constant.LOG_UPSTREAM_DEFAULT_RESPONSE_CODE);
|
|
|
+ request.setAttribute(Constant.CHANNEL_PRICE,request.getHeader(Constant.CHANNEL_PRICE));
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject responseObject = wycChannelService.onlineCarHailingQuery(request, outTime, customBody);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if (responseObject.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY, Base64.encodeBase64String(customBody.getBytes(ChannelConstant.PARA_ENCODE)));
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ ErrorUtils.captureException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_ISCHARGE_KEY,responseObject.getIsCharge());
|
|
|
+
|
|
|
+ return responseObject;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "网约车从业人员查询-定制接口-入参加密")
|
|
|
+ @PostMapping(value = "/encryptOnlineCarHailingQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject encryptOnlineCarHailingQuery(
|
|
|
+ @ApiParam(value = "通道ID") @RequestHeader(name = "channelId") String channelId,
|
|
|
+ @ApiParam(value = "超时时间,单位:毫秒", example = "10000") @RequestParam(name = "outTime") int outTime,
|
|
|
+ @ApiParam(value = "请求参数JSON串") @RequestParam(name = "customBody") String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_ISCHARGE_KEY,Constant.IS_NOT_CHARGE);
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, Constant.LOG_UPSTREAM_DEFAULT_RESPONSE_CODE);
|
|
|
+ request.setAttribute(Constant.CHANNEL_PRICE,request.getHeader(Constant.CHANNEL_PRICE));
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject responseObject = wycChannelService.encryptOnlineCarHailingQuery(request, outTime, customBody);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if (responseObject.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY, Base64.encodeBase64String(customBody.getBytes(ChannelConstant.PARA_ENCODE)));
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ ErrorUtils.captureException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_ISCHARGE_KEY,responseObject.getIsCharge());
|
|
|
+
|
|
|
+ return responseObject;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "网约车信息查询-拼接三传木身份证解密", notes = "")
|
|
|
+ @PostMapping(value = "/wycDriverInfoDecode.do")
|
|
|
+ public ChannelTypeHandleResponseObject wycDriverInfoDecode(
|
|
|
+ @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(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, Constant.LOG_UPSTREAM_DEFAULT_RESPONSE_CODE);
|
|
|
+ String channel_price = request.getHeader(Constant.CHANNEL_PRICE);
|
|
|
+ String channel_second_price = request.getHeader(Constant.CHANNEL_SECOND_PRICE);
|
|
|
+ log.info("channel_price:{},channel_second_price:{}",channel_price,channel_second_price);
|
|
|
+ request.setAttribute(Constant.CHANNEL_PRICE,request.getHeader(Constant.CHANNEL_PRICE));
|
|
|
+ ChannelTypeHandleResponseObject responseObject = new ChannelTypeHandleResponseObject();
|
|
|
+ try{
|
|
|
+ responseObject = wycChannelService.WycInfoDecodeRequest(
|
|
|
+ request, channelId,outTime,customBody, "MD5");
|
|
|
+ //日志记录通道响应码
|
|
|
+ if(responseObject.getCode() != 1){
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ }else{
|
|
|
+ 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 = property.getCode().get(responseObject.getResultCode());
|
|
|
+ log.info("resultCode:{},jkCode:{}",responseObject.getResultCode(),code);
|
|
|
+ if(code!=null){
|
|
|
+ responseObject.setResultCode(Integer.valueOf(code));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ //日志记录通道查询参数
|
|
|
+ if(customBody != null){
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,Base64.encodeBase64String(customBody.getBytes("utf-8")));
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ ExceptionUtils.handleThrowable(e);
|
|
|
+ log.error("异常信息:{}",e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_ISCHARGE_KEY,responseObject.getIsCharge());
|
|
|
+
|
|
|
+ return responseObject;
|
|
|
+ }catch(Exception ex){
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("message:{}",ex);
|
|
|
+ return responseObject;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "网约车信息查询-拼接三传木身份证解密-SHA256", notes = "")
|
|
|
+ @PostMapping(value = "/wycDriverInfoDecodeSHA256.do")
|
|
|
+ public ChannelTypeHandleResponseObject wycDriverInfoDecodeSHA256(
|
|
|
+ @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(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, Constant.LOG_UPSTREAM_DEFAULT_RESPONSE_CODE);
|
|
|
+ String channel_price = request.getHeader(Constant.CHANNEL_PRICE);
|
|
|
+ String channel_second_price = request.getHeader(Constant.CHANNEL_SECOND_PRICE);
|
|
|
+ log.info("channel_price:{},channel_second_price:{}",channel_price,channel_second_price);
|
|
|
+ request.setAttribute(Constant.CHANNEL_PRICE,request.getHeader(Constant.CHANNEL_PRICE));
|
|
|
+ ChannelTypeHandleResponseObject responseObject = new ChannelTypeHandleResponseObject();
|
|
|
+ try{
|
|
|
+ responseObject = wycChannelService.WycInfoDecodeRequest(
|
|
|
+ request, channelId,outTime,customBody, "SHA256");
|
|
|
+ //日志记录通道响应码
|
|
|
+ if(responseObject.getCode() != 1){
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ }else{
|
|
|
+ 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 = property.getCode().get(responseObject.getResultCode());
|
|
|
+ log.info("resultCode:{},jkCode:{}",responseObject.getResultCode(),code);
|
|
|
+ if(code!=null){
|
|
|
+ responseObject.setResultCode(Integer.valueOf(code));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ //日志记录通道查询参数
|
|
|
+ if(customBody != null){
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,Base64.encodeBase64String(customBody.getBytes("utf-8")));
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ ExceptionUtils.handleThrowable(e);
|
|
|
+ log.error("异常信息:{}",e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_ISCHARGE_KEY,responseObject.getIsCharge());
|
|
|
+
|
|
|
+ return responseObject;
|
|
|
+ }catch(Exception ex){
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("message:{}",ex);
|
|
|
+ return responseObject;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "从业车辆画像查询", notes = "")
|
|
|
+ @PostMapping(value = "/vehicleInfoQuery.do")
|
|
|
+ public ChannelTypeHandleResponseObject vehicleInfoQuery(
|
|
|
+ @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(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, Constant.LOG_UPSTREAM_DEFAULT_RESPONSE_CODE);
|
|
|
+ String channel_price = request.getHeader(Constant.CHANNEL_PRICE);
|
|
|
+ String channel_second_price = request.getHeader(Constant.CHANNEL_SECOND_PRICE);
|
|
|
+ log.info("channel_price:{},channel_second_price:{}",channel_price,channel_second_price);
|
|
|
+ request.setAttribute(Constant.CHANNEL_PRICE,request.getHeader(Constant.CHANNEL_PRICE));
|
|
|
+ ChannelTypeHandleResponseObject responseObject = new ChannelTypeHandleResponseObject();
|
|
|
+ try{
|
|
|
+ responseObject = wycChannelService.vehicleInfoQuery(
|
|
|
+ request, channelId,outTime,customBody);
|
|
|
+ //日志记录通道响应码
|
|
|
+ if(responseObject.getCode() != 1){
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ }else{
|
|
|
+ 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 = property.getCode().get(responseObject.getResultCode());
|
|
|
+ log.info("resultCode:{},jkCode:{}",responseObject.getResultCode(),code);
|
|
|
+ if(code!=null){
|
|
|
+ responseObject.setResultCode(Integer.valueOf(code));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ //日志记录通道查询参数
|
|
|
+ if(customBody != null){
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,Base64.encodeBase64String(customBody.getBytes("utf-8")));
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ ExceptionUtils.handleThrowable(e);
|
|
|
+ log.error("异常信息:{}",e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_ISCHARGE_KEY,responseObject.getIsCharge());
|
|
|
+
|
|
|
+ return responseObject;
|
|
|
+ }catch(Exception ex){
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("message:{}",ex);
|
|
|
+ return responseObject;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "网约车信息查询-拼接三传木身份证解密V2", notes = "")
|
|
|
+ @PostMapping(value = "/wycDriverInfoDecodeV2.do")
|
|
|
+ public ChannelTypeHandleResponseObject wycDriverInfoDecodeV2(
|
|
|
+ @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(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, Constant.LOG_UPSTREAM_DEFAULT_RESPONSE_CODE);
|
|
|
+ String channel_price = request.getHeader(Constant.CHANNEL_PRICE);
|
|
|
+ String channel_second_price = request.getHeader(Constant.CHANNEL_SECOND_PRICE);
|
|
|
+ log.info("channel_price:{},channel_second_price:{}",channel_price,channel_second_price);
|
|
|
+ request.setAttribute(Constant.CHANNEL_PRICE,request.getHeader(Constant.CHANNEL_PRICE));
|
|
|
+ ChannelTypeHandleResponseObject responseObject = new ChannelTypeHandleResponseObject();
|
|
|
+ try{
|
|
|
+ responseObject = wycChannelService.WycInfoDecodeRequestV2(
|
|
|
+ request, channelId,outTime,customBody, "MD5");
|
|
|
+ //日志记录通道响应码
|
|
|
+ if(responseObject.getCode() != 1){
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ }else{
|
|
|
+ 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 = property.getCode().get(responseObject.getResultCode());
|
|
|
+ log.info("resultCode:{},jkCode:{}",responseObject.getResultCode(),code);
|
|
|
+ if(code!=null){
|
|
|
+ responseObject.setResultCode(Integer.valueOf(code));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_RESPONSE_CODE_KEY,Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ //日志记录通道查询参数
|
|
|
+ if(customBody != null){
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,Base64.encodeBase64String(customBody.getBytes("utf-8")));
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ ExceptionUtils.handleThrowable(e);
|
|
|
+ log.error("异常信息:{}",e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.ACCESSLOG_MG_ISCHARGE_KEY,responseObject.getIsCharge());
|
|
|
+
|
|
|
+ return responseObject;
|
|
|
+ }catch(Exception ex){
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ log.error("message:{}",ex);
|
|
|
+ return responseObject;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|