Преглед изворни кода

增加社会信用预警-sm3接口

15810770710@163.com пре 3 година
родитељ
комит
ad59006cf9

+ 36 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000040/action/ChannelAction.java

@@ -577,6 +577,42 @@ public class ChannelAction {
         }
     }
 
+    @ApiOperation(value = "个人不良信息查询V2-评分版-SM3", notes = "")
+    @PostMapping(value = "/getIllegalInfoV2ScoreSM3.do")
+    public ChannelTypeHandleResponseObject getIllegalInfoV2ScoreSM3(
+            @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("个人不良信息查询V2-评分版SM3请求--->channelId:{}--->outTime:{},--->customBody:{}", channelId, outTime, customBody);
+        Long startTime = System.currentTimeMillis();
+        //日志记录通道类型 - 同步
+        ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        HttpServletRequest request = servletRequestAttributes.getRequest();
+        ChannelTypeHandleResponseObject responseObject = new ChannelTypeHandleResponseObject();
+        try {
+            // scm解密
+            String decodeCustomBody = channelService.getDecodeIdCard(request, customBody, outTime, ChannelConstant.DECODE_TYPE_SM3, responseObject);
+            log.info("scm解密耗时:{}", System.currentTimeMillis() - startTime);
+
+            if (StringUtils.isNotBlank(decodeCustomBody)) {
+                customBody = decodeCustomBody;
+                // 调用业务接口
+                responseObject = channelService.validateIllegalInfoV2(request, customBody, outTime, ChannelConstant.ILLEGAL_INFO_SCORE);
+            }
+            log.info("调用业务接口时延:{}", System.currentTimeMillis() - startTime);
+
+            recodeIllegalInfoV2RequestLog(responseObject, request, customBody);
+            if (System.currentTimeMillis() - startTime < delayedTime) {
+                delay();
+            }
+            log.info("action总体耗时:{}", System.currentTimeMillis() - startTime);
+            return responseObject;
+        } catch (Exception ex) {
+            log.error("message:{}", ex);
+            return responseObject;
+        }
+    }
+
     private void delay() {
         Long startTime = System.currentTimeMillis();
         try {

+ 2 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000040/constant/ChannelConstant.java

@@ -27,6 +27,8 @@ public class ChannelConstant {
 
     public static final String DECODE_TYPE_AES = "AES";
 
+    public static final String DECODE_TYPE_SM3 = "SM3";
+
     /**
      * 请求头用户Id key*/
     public static final String USER_ID_HEADER_KEY = "userid";

+ 1 - 1
src/main/java/info/aspirecn/iov/sjjh/supplier10000040/process/IllegalInfoProcessor.java

@@ -38,7 +38,7 @@ import java.util.Map;
  * @version: V1.0
  **/
 @Slf4j
-@Component
+//@Component
 public class IllegalInfoProcessor implements Processor {
     @Value("${localDir.download}")
     private String localDownloadDir;

+ 1 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000040/service/ChannelServiceImpl.java

@@ -581,6 +581,7 @@ public class ChannelServiceImpl implements ChannelService {
         if (StringUtils.isBlank(customBodyObject.getString("idCode")) || StringUtils.isBlank(customBodyObject.getString("name"))
                 || (decodeType.equals(ChannelConstant.DECODE_TYPE_SHA256) && (customBodyObject.getString("idCode").length() != 64 || customBodyObject.getString("name").length() != 64))
                 || (decodeType.equals(ChannelConstant.DECODE_TYPE_MD5) && (customBodyObject.getString("idCode").length() != 32 || customBodyObject.getString("name").length() != 32))
+                || (decodeType.equals(ChannelConstant.DECODE_TYPE_SM3) && (customBodyObject.getString("idCode").length() != 64 || customBodyObject.getString("name").length() != 64))
         ) {
             ret.setIsCharge(Constant.INTERFACE_QUERY_NO_FEE);
             ret.setResultCode(Constant.INVALID_PARAMETER_CODE);

+ 1 - 1
src/main/java/info/aspirecn/iov/sjjh/supplier10000040/sftp/IllegalInfoDownloadRoute.java

@@ -15,7 +15,7 @@ import org.springframework.stereotype.Component;
  * @version: V1.0
  **/
 @Slf4j
-@Component
+//@Component
 public class IllegalInfoDownloadRoute extends RouteBuilder {
     @Value("${ftpDownload.route}")
     private String ftpDownloadRoute;