|
@@ -0,0 +1,614 @@
|
|
|
+package info.aspirecn.iov.sjjh.shupplier10000005.action;
|
|
|
+
|
|
|
+
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
+import info.aspirecn.iov.sjjh.commons.lang.ChannelTypeHandleResponseObject;
|
|
|
+import info.aspirecn.iov.sjjh.commons.lang.Constant;
|
|
|
+import info.aspirecn.iov.sjjh.shupplier10000005.SjjhConstant;
|
|
|
+import info.aspirecn.iov.sjjh.shupplier10000005.service.Supplier10000005Service;
|
|
|
+import info.aspirecn.iov.sjjh.shupplier10000005.vo.ResponseObject;
|
|
|
+import info.aspirecn.iov.sjjh.shupplier10000005.vo.SCMIdCardCheckRespnoseObject;
|
|
|
+import info.aspirecn.rdc.aspirecloud.node.except.utils.ErrorUtils;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.codec.binary.Base64;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+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.IOException;
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @author minmin
|
|
|
+ *
|
|
|
+ */
|
|
|
+@Slf4j
|
|
|
+@RestController
|
|
|
+public class Supplier10000005Action implements Supplier10000005ActionInterface {
|
|
|
+ /**UTF-8*/
|
|
|
+ private static final String UTF8_ENCODE = "UTF-8";
|
|
|
+ /**日志参数中的错误参数名*/
|
|
|
+ private static final String LOG_ERROR_PARA = "respnoseCode";
|
|
|
+ /**日志参数中的是否收费*/
|
|
|
+ private static final String LOG_FEE_PARA = "isCharge";
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private Supplier10000005Service service;
|
|
|
+ @Autowired
|
|
|
+ private ObjectMapper objectMapper;
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @ApiOperation(value = "三传木身份证检验接口", notes = "")
|
|
|
+ public ChannelTypeHandleResponseObject scmIdCardCheck(
|
|
|
+ @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();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmIdCardCheck(request, customBody, outTime);
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @ApiOperation(value = "三传木移动三要素1号检验接口", notes = "")
|
|
|
+ public ChannelTypeHandleResponseObject scmMobileCheck(
|
|
|
+ @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();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmMobileCheck(
|
|
|
+ request, SjjhConstant.YI_DONG_ONE, customBody, outTime);
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @ApiOperation(value = "三传木移动三要素2号检验接口", notes = "")
|
|
|
+ public ChannelTypeHandleResponseObject scmMobileTwoCheck(
|
|
|
+ @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();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmMobileCheck(
|
|
|
+ request, SjjhConstant.YI_DONG_TWO, customBody, outTime);
|
|
|
+
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @ApiOperation(value = "三传木移动三要素3号检验接口", notes = "")
|
|
|
+ public ChannelTypeHandleResponseObject scmMobileThreeCheck(
|
|
|
+ @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();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmMobileCheck(
|
|
|
+ request, SjjhConstant.YI_DONG_THREE, customBody, outTime);
|
|
|
+
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @ApiOperation(value = "三传木移动三要素4号检验接口", notes = "")
|
|
|
+ public ChannelTypeHandleResponseObject scmMobileFourCheck(
|
|
|
+ @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();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmMobileCheck(
|
|
|
+ request, SjjhConstant.YI_DONG_FOUR, customBody, outTime);
|
|
|
+
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取上游返回码
|
|
|
+ * @param ret
|
|
|
+ */
|
|
|
+ public String setupUpstreamResponseCode(ResponseObject ret) {
|
|
|
+ String code = ""+Constant.LOG_UPSTREAM_DEFAULT_RESPONSE_CODE;
|
|
|
+ try {
|
|
|
+ String jsonStr = objectMapper.writeValueAsString(ret.getResultBody());
|
|
|
+ SCMIdCardCheckRespnoseObject responseObject = objectMapper.readValue(jsonStr,
|
|
|
+ SCMIdCardCheckRespnoseObject.class);
|
|
|
+
|
|
|
+ if(responseObject != null) {
|
|
|
+ code = "" + responseObject.getCode();
|
|
|
+ }
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ return code;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @ApiOperation(value = "三传木电信三要素检验接口 " , notes = "")
|
|
|
+ public ChannelTypeHandleResponseObject scmDianXinCheck(
|
|
|
+ @RequestHeader(name="channelId") String channelId,
|
|
|
+ @RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmDianXinOrLianTongCheck(request,
|
|
|
+ SjjhConstant.DIAN_XIN, customBody, outTime);
|
|
|
+
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @ApiOperation(value = "三传木联通三要素检验接口 " , notes = "")
|
|
|
+ public ChannelTypeHandleResponseObject scmLianTongCheck(
|
|
|
+ @RequestHeader(name="channelId") String channelId,
|
|
|
+ @RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmDianXinOrLianTongCheck(request,
|
|
|
+ SjjhConstant.LIAN_TONG, customBody, outTime);
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @ApiOperation(value = "三传木移动在线时长接口 " , notes = "")
|
|
|
+ public ChannelTypeHandleResponseObject scmMobileOnlineTimeCheck(
|
|
|
+ @RequestHeader(name="channelId") String channelId,
|
|
|
+ @RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmMobileOnlineTimeCheck(request, customBody, outTime);
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @ApiOperation(value = "三传木移动在线状态接口 " , notes = "")
|
|
|
+ public ChannelTypeHandleResponseObject scmMobileOnlineStatusCheck(
|
|
|
+ @RequestHeader(name="channelId") String channelId,
|
|
|
+ @RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmMobileOnlineStatusCheck(request, customBody, outTime);
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ChannelTypeHandleResponseObject scmDianXinOnlineTimeCheck(
|
|
|
+ @RequestHeader(name="channelId") String channelId,
|
|
|
+ @RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmDianXinOnlineTimeCheck(request, customBody, outTime);
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ChannelTypeHandleResponseObject scmDianXinOnlineStatusCheck(
|
|
|
+ @RequestHeader(name="channelId") String channelId,
|
|
|
+ @RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmDianXinOnlineStatusCheck(request, customBody, outTime);
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ChannelTypeHandleResponseObject scmLianTongOnlineTimeCheck(
|
|
|
+ @RequestHeader(name="channelId") String channelId,
|
|
|
+ @RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmLianTongOnlineTimeCheck(request, customBody, outTime);
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ChannelTypeHandleResponseObject scmLianTongOnlineStatusCheck(
|
|
|
+ @RequestHeader(name="channelId") String channelId,
|
|
|
+ @RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmLianTongOnlineStatusCheck(request, customBody, outTime);
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ChannelTypeHandleResponseObject scmBankThreeCheck(
|
|
|
+ @RequestHeader(name="channelId") String channelId,
|
|
|
+ @RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmBankThreeCheck(request, customBody, outTime);
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ChannelTypeHandleResponseObject scmBankFourCheck(
|
|
|
+ @RequestHeader(name="channelId") String channelId,
|
|
|
+ @RequestParam(name = "outTime", required = true) int outTime,
|
|
|
+ @RequestParam(name = "customBody", required = true) String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+ try {
|
|
|
+ //把请求参数放入
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (IOException ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ChannelTypeHandleResponseObject ret = service.scmBankFourCheck(request, customBody, outTime);
|
|
|
+
|
|
|
+ if(ret.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(LOG_FEE_PARA, ret.getIsCharge());
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY,Constant.CHANNEL_TYPE_SYNC);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ChannelTypeHandleResponseObject scmDecodeThreeElement(String channelId, int outTime, String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject responseObject = service.scmDecodeThreeElement(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if (responseObject.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, responseObject.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ org.apache.tomcat.util.codec.binary.Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY, Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return responseObject;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ChannelTypeHandleResponseObject scmCTCCThreeElementInfo(String channelId, int outTime, String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject responseObject = service.scmCTCCThreeElementInfo(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if (responseObject.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, responseObject.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ org.apache.tomcat.util.codec.binary.Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY, Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return responseObject;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ChannelTypeHandleResponseObject scmDecodeIdCode(String channelId, int outTime, String customBody) {
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
|
|
+ .getRequest();
|
|
|
+
|
|
|
+ //调用service
|
|
|
+ ChannelTypeHandleResponseObject responseObject = service.scmDecodeIdCode(request, customBody, outTime);
|
|
|
+
|
|
|
+ //把接口参数、调用结果和是否收费放入访问日志中
|
|
|
+ if (responseObject.getCode() != Constant.SUCCESS) {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_ERROR_CODE);
|
|
|
+ } else {
|
|
|
+ request.setAttribute(LOG_ERROR_PARA, Constant.CHANNEL_LOG_SUCCESS_CODE);
|
|
|
+ }
|
|
|
+ request.setAttribute(LOG_FEE_PARA, responseObject.getIsCharge());
|
|
|
+
|
|
|
+ try {
|
|
|
+ request.setAttribute(Constant.CHANNEL_LOG_QUERY,
|
|
|
+ org.apache.tomcat.util.codec.binary.Base64.encodeBase64String(customBody.getBytes(UTF8_ENCODE)));
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ErrorUtils.captureException(ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ request.setAttribute(Constant.CHANNEL_TYPE_KEY, Constant.CHANNEL_TYPE_SYNC);
|
|
|
+ return responseObject;
|
|
|
+ }
|
|
|
+}
|