Browse Source

普通核验接口异步处理,提高并发能力

FanQun 2 years ago
parent
commit
f166fbca8d

+ 48 - 0
src/main/java/com/rshy/project/hy/config/ThreadPoolTaskConfig.java

@@ -0,0 +1,48 @@
+package com.rshy.project.hy.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.AsyncConfigurer;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.ThreadPoolExecutor;
+
+/**
+ * 线程池配置文件
+ *
+ * @author fanqun
+ * Created on 2022-05-10 11:17 AM
+ **/
+@Configuration
+@EnableAsync
+public class ThreadPoolTaskConfig implements AsyncConfigurer {
+
+    /* 核心线程数(默认线程数) */
+    private static final int CORE_POOL_SIZE = 10;
+    /* 最大线程数 */
+    private static final int MAX_POOL_SIZE = 20;
+    /* 允许线程空闲时间(单位:默认为秒) */
+    private static final int KEEP_ALIVE_TIME = 30;
+    /* 缓冲队列数 */
+    private static final int QUEUE_CAPACITY = 200;
+    // 线程池名前缀
+    private static final String THREAD_NAME_PREFIX = "HS-Async-";
+
+    @Bean(name = "hstTaskExecutor") // bean的名称,默认为首字母小写的方法名
+    public ThreadPoolTaskExecutor taskExecutor() {
+        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        executor.setCorePoolSize(CORE_POOL_SIZE);
+        executor.setMaxPoolSize(MAX_POOL_SIZE);
+        executor.setQueueCapacity(QUEUE_CAPACITY);
+        executor.setKeepAliveSeconds(KEEP_ALIVE_TIME);
+        executor.setThreadNamePrefix(THREAD_NAME_PREFIX);
+        executor.setWaitForTasksToCompleteOnShutdown(true);
+        executor.setAwaitTerminationSeconds(60);
+        // 线程池对拒绝任务的处理策略
+        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+        // 初始化
+        executor.initialize();
+        return executor;
+    }
+}

+ 3 - 1
src/main/java/com/rshy/project/hy/manager/RshyJkManager.java

@@ -4,6 +4,8 @@ import com.rshy.project.hy.server.param.RshyParam;
 import com.rshy.project.hy.server.param.RshyQuickParam;
 import com.rshy.project.hy.server.vo.RshyVo;
 
+import java.util.concurrent.Future;
+
 /**
  * @author: lileilei
  * @date: 2022/4/23 20:12
@@ -16,7 +18,7 @@ public interface RshyJkManager {
      * @param rshyParam
      * @return
      */
-    RshyVo getRshyInfo(RshyParam rshyParam);
+    Future<RshyVo> getRshyInfo(RshyParam rshyParam);
 
     /**
      * 人脸快速核验模式

+ 27 - 12
src/main/java/com/rshy/project/hy/manager/impl/RshyJkManagerImpl.java

@@ -27,12 +27,15 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.AsyncResult;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
@@ -55,7 +58,8 @@ public class RshyJkManagerImpl implements RshyJkManager {
     private StringRedisTemplate stringRedisTemplate;
 
     @Override
-    public RshyVo getRshyInfo(RshyParam rshyParam) {
+    @Async("hstTaskExecutor")
+    public Future<RshyVo> getRshyInfo(RshyParam rshyParam) {
         // timeout 转成毫秒
         rshyParam.setTimeout(rshyParam.getTimeout() * 1000 - 800);
         RshyVo rshyVo = new RshyVo();
@@ -64,7 +68,6 @@ public class RshyJkManagerImpl implements RshyJkManager {
         resultDTO.setPctgkryDTO(gkryDTO);
         DateTime beginDate = DateTime.now();
         PctjkmInfoDTO jkmInfo = null;
-        String name;
 
         if (StringUtils.isNotBlank(rshyParam.getBarCode()) || StringUtils.isNotBlank(rshyParam.getSfzh())) {
             try {
@@ -76,11 +79,12 @@ public class RshyJkManagerImpl implements RshyJkManager {
             }
         }
         if (jkmInfo == null) {
-            return rshyVo.setPassStatus(PassStatusEnum.NO_CODE).setSfzh(rshyParam.getSfzh()).setXm(rshyParam.getXm())
-                    .setNucleic_acid(new NucleicAcidDTO().setStatus(NucleicAcidEnum.NO_DATA.getCode()).setResults(NucleicAcidEnum.NO_DATA.getDesc()));
+            return new AsyncResult<>(rshyVo.setPassStatus(PassStatusEnum.NO_CODE).setSfzh(rshyParam.getSfzh()).setXm(rshyParam.getXm())
+                    .setNucleic_acid(new NucleicAcidDTO().setStatus(NucleicAcidEnum.NO_DATA.getCode()).setResults(NucleicAcidEnum.NO_DATA.getDesc())));
         }
 
-        rshyVo.setSfzh(jkmInfo.getId_num()).setXm(jkmInfo.getUser_name()).setHealthCode(jkmInfo.getCOLOR_CODE_LABEL()).setPhone(jkmInfo.getPn());
+        rshyParam.setSfzh(jkmInfo.getId_num());
+        rshyVo.setSfzh(jkmInfo.getId_num()).setXm(jkmInfo.getUser_name()).setHealthCode(jkmInfo.getColor_code_label()).setPhone(jkmInfo.getPn());
 
         rshyParam.setTimeout((int) (rshyParam.getTimeout() - DateUtil.between(beginDate, DateTime.now(), DateUnit.MS)));
 
@@ -89,7 +93,7 @@ public class RshyJkManagerImpl implements RshyJkManager {
             {
                 add(() -> resultDTO.setPctymDataDTOS(itfwServer.getPctym(rshyParam.getSfzh(), rshyParam.getTimeout())));
                 add(() -> resultDTO.setPcthsResultDTO(itfwServer.getPcths(rshyParam.getSfzh(), rshyParam.getTimeout())));
-                if (StrUtil.isBlank(rshyParam.getXm())) {   // 刷健康码或者收到输入身份证号码
+                if (StrUtil.isBlank(rshyParam.getXm())) {   // 刷健康码或者手动输入身份证号码
                     add(() -> resultDTO.setPctzjzpResultDTO(itfwServer.getPctzjzp(rshyParam.getSfzh(), rshyParam.getTimeout())));
                 }
                 if (StrUtil.isNotBlank(rshyParam.getPhoto())) {
@@ -101,7 +105,7 @@ public class RshyJkManagerImpl implements RshyJkManager {
 
         //if (rshyParam.getScreenLocked() == 0 && (barCodes == null || PassStatusEnum.GREEN_CODE.getDesc().equals(barCodes.getCOLOR_CODE_LABEL()))) {
         //绿码人员继续进行七大类管控接口和人车核录接口比对
-        if (PassStatusEnum.GREEN_CODE.getDesc().equals(jkmInfo.getCOLOR_CODE_LABEL())) {
+        if (PassStatusEnum.GREEN_CODE.getDesc().equals(jkmInfo.getColor_code_label())) {
             taskList.add(() -> resultDTO.getPctgkryDTO().setPctdfkDTO(itfwServer.getPctdfk(rshyParam.getSfzh(), "", rshyParam.getTimeout())));
             taskList.add(() -> resultDTO.getPctgkryDTO().setPctjsryDTO(itfwServer.getPctjsry(rshyParam.getSfzh(), rshyParam.getTimeout())));
             taskList.add(() -> resultDTO.getPctgkryDTO().setPctztDTO(itfwServer.getPctzt(rshyParam.getSfzh(), rshyParam.getTimeout())));
@@ -123,10 +127,11 @@ public class RshyJkManagerImpl implements RshyJkManager {
         });
 
         log.info("IT服务平台接口调用完成");
-        //进入进站次数
+        //今日进站次数
         rshyVo.setTimes(times(rshyVo.getSfzh()));
         //疫苗
         rshyVo.setVaccine(CollectionUtil.isEmpty(resultDTO.getPctymDataDTOS()) ? 0 : resultDTO.getPctymDataDTOS().size());
+
         //核酸报告
         rshyVo.setNucleic_acid(nucleicAcid(resultDTO.getPcthsResultDTO()));
         //行程卡(暂时没接口,默认0)
@@ -136,7 +141,17 @@ public class RshyJkManagerImpl implements RshyJkManager {
         //出生日期 从身份证号码中获取
         Date date = DateUtil.parse(IdcardUtil.getBirthByIdCard(rshyVo.getSfzh()));
         rshyVo.setBirthday(DateUtil.format(date, "yyyy-M-d"));
-
+        //不是刷身份证,取地址
+        if (StrUtil.isBlank(rshyParam.getXm())) {
+            if (rshyVo.getVaccine() != 0) {
+                //有疫苗信息,从接种疫苗信息里取地址
+                rshyVo.setAddress(resultDTO.getPctymDataDTOS().get(rshyVo.getVaccine() - 1).getResidentialAddress());
+            } else {
+                //户籍省份 从身份证号码中获取
+                rshyVo.setAddress(IdcardUtil.getProvinceByIdCard(rshyVo.getSfzh()));
+            }
+        }
+        //人车核录核查结果
         String hcjg = resultDTO.getPctrchlDTO() == null ? "" : resultDTO.getPctrchlDTO().getHcjg();
 
 
@@ -149,10 +164,10 @@ public class RshyJkManagerImpl implements RshyJkManager {
         //人证或者人码不符
         //  rshyVo.setPassStatus(PassStatusEnum.NO_MATCHED).setWarning(PassStatusEnum.NO_MATCHED.getDesc()).setKind(PassStatusEnum.NO_MATCHED.getDesc());
         //} else
-        if (PassStatusEnum.RED_CODE.getDesc().equalsIgnoreCase(jkmInfo.getCOLOR_CODE_LABEL())) {
+        if (PassStatusEnum.RED_CODE.getDesc().equalsIgnoreCase(jkmInfo.getColor_code_label())) {
             //红码
             rshyVo.setPass(PassStatusEnum.RED_CODE.getCode()).setTts(PassStatusEnum.RED_CODE.getTts()).setDisplayMsg(PassStatusEnum.RED_CODE.getDesc()).setWarning(PassStatusEnum.RED_CODE.getDesc()).setKind("健康码" + PassStatusEnum.RED_CODE.getDesc());
-        } else if (PassStatusEnum.YELLOW_CODE.getDesc().equalsIgnoreCase(jkmInfo.getCOLOR_CODE_LABEL())) {
+        } else if (PassStatusEnum.YELLOW_CODE.getDesc().equalsIgnoreCase(jkmInfo.getColor_code_label())) {
             //黄码
             rshyVo.setPassStatus(PassStatusEnum.YELLOW_CODE).setKind("健康码" + PassStatusEnum.YELLOW_CODE.getDesc());
         } else if (resultDTO.getPctgkryDTO().getPctztDTO() != null || StrUtil.containsAnyIgnoreCase(hcjg, "抓捕") || StrUtil.containsAnyIgnoreCase(hcjg, "拦截")) {
@@ -179,7 +194,7 @@ public class RshyJkManagerImpl implements RshyJkManager {
             rshyVo.setPhoto(resultDTO.getPctzjzpResultDTO().getPhoto());
         }
 
-        return rshyVo;
+        return new AsyncResult<>(rshyVo);
     }
 
     private NucleicAcidDTO nucleicAcid(PcthsResultDTO pcthsResultDTO) {

+ 24 - 16
src/main/java/com/rshy/project/hy/server/ItfwServer.java

@@ -141,6 +141,7 @@ public class ItfwServer {
      */
     public PctzdryDTO getPctzdry(String idNumber, Integer timeout) {
         if (StringUtils.isBlank(idNumber)) {
+            log.warn("身份证号码为空");
             return null;
         }
 
@@ -165,7 +166,7 @@ public class ItfwServer {
         try {
             body = this.baseAgentApi(properties, timeout);
         } catch (Exception e) {
-            if (times(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
+            if (exceptionTimes(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
                 stringRedisTemplate.opsForValue().set(cacheStatusKey, cacheStatusKey, WebConstant.STATUS_TIMEOUT, TimeUnit.MINUTES);
             }
             log.error("请求重点人员服务接口超时异常:{}", e.getMessage());
@@ -198,6 +199,7 @@ public class ItfwServer {
      */
     public PctztDTO getPctzt(String idNumber, Integer timeout) {
         if (StringUtils.isBlank(idNumber)) {
+            log.warn("身份证号码为空");
             return null;
         }
 
@@ -223,7 +225,7 @@ public class ItfwServer {
         try {
             body = this.baseAgentApi(properties, timeout);
         } catch (Exception e) {
-            if (times(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
+            if (exceptionTimes(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
                 stringRedisTemplate.opsForValue().set(cacheStatusKey, cacheStatusKey, WebConstant.STATUS_TIMEOUT, TimeUnit.MINUTES);
             }
             log.error("请求人员劣迹服务接口异常:{}", e.getMessage());
@@ -256,6 +258,7 @@ public class ItfwServer {
      */
     public PctzfbaDTO getPctzfba(String idNumber, Integer timeout) {
         if (StringUtils.isBlank(idNumber)) {
+            log.warn("身份证号码为空");
             return null;
         }
 
@@ -281,7 +284,7 @@ public class ItfwServer {
         try {
             body = this.baseAgentApi(properties, timeout);
         } catch (Exception e) {
-            if (times(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
+            if (exceptionTimes(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
                 stringRedisTemplate.opsForValue().set(cacheStatusKey, cacheStatusKey, WebConstant.STATUS_TIMEOUT, TimeUnit.MINUTES);
             }
             log.error("请求执法办案服务接口异常:{}", e.getMessage());
@@ -317,6 +320,7 @@ public class ItfwServer {
      */
     public PctdfkDTO getPctdfk(String idNumber, String ajbh, Integer timeout) {
         if (StringUtils.isBlank(idNumber)) {
+            log.warn("身份证号码为空");
             return null;
         }
 
@@ -341,7 +345,7 @@ public class ItfwServer {
         try {
             body = this.baseAgentApi(properties, timeout);
         } catch (Exception e) {
-            if (times(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
+            if (exceptionTimes(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
                 stringRedisTemplate.opsForValue().set(cacheStatusKey, cacheStatusKey, WebConstant.STATUS_TIMEOUT, TimeUnit.MINUTES);
             }
             log.error("请求打防控信息服务接口异常:{}", e.getMessage());
@@ -374,6 +378,7 @@ public class ItfwServer {
      */
     public PctjsryDTO getPctjsry(String idNumber, Integer timeout) {
         if (StringUtils.isBlank(idNumber)) {
+            log.warn("身份证号码为空");
             return null;
         }
 
@@ -399,7 +404,7 @@ public class ItfwServer {
         try {
             body = this.baseAgentApi(properties, timeout);
         } catch (Exception e) {
-            if (times(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
+            if (exceptionTimes(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
                 stringRedisTemplate.opsForValue().set(cacheStatusKey, cacheStatusKey, WebConstant.STATUS_TIMEOUT, TimeUnit.MINUTES);
             }
             log.error("请求监所人员服务接口异常:{}", e.getMessage());
@@ -434,6 +439,7 @@ public class ItfwServer {
      */
     public PctxdryDTO getPctxdry(String idNumber, String xm, Integer timeout) {
         if (StringUtils.isBlank(idNumber)) {
+            log.warn("身份证号码为空");
             return null;
         }
 
@@ -460,7 +466,7 @@ public class ItfwServer {
         try {
             body = this.baseAgentApi(properties, timeout);
         } catch (Exception e) {
-            if (times(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
+            if (exceptionTimes(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
                 stringRedisTemplate.opsForValue().set(cacheStatusKey, cacheStatusKey, WebConstant.STATUS_TIMEOUT, TimeUnit.MINUTES);
             }
             log.error("请求吸毒人员服务接口异常:{}", e.getMessage());
@@ -495,6 +501,7 @@ public class ItfwServer {
      */
     public PctqkryDTO getPctqkry(String idNumber, Integer timeout) {
         if (StringUtils.isBlank(idNumber)) {
+            log.warn("身份证号码为空");
             return null;
         }
 
@@ -520,7 +527,7 @@ public class ItfwServer {
         try {
             body = this.baseAgentApi(properties, timeout);
         } catch (Exception e) {
-            if (times(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
+            if (exceptionTimes(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
                 stringRedisTemplate.opsForValue().set(cacheStatusKey, cacheStatusKey, WebConstant.STATUS_TIMEOUT, TimeUnit.MINUTES);
             }
             log.error("请求前科人员服务接口异常:{}", e.getMessage());
@@ -551,7 +558,7 @@ public class ItfwServer {
      * @param key
      * @return
      */
-    private Integer times(String key) {
+    private Integer exceptionTimes(String key) {
         String cacheKey = key + ":times";
         int times = 1;
         String timesStr = stringRedisTemplate.opsForValue().get(cacheKey);
@@ -578,6 +585,7 @@ public class ItfwServer {
      */
     public PctrchlDTO getPctrchl(String idNumber, Integer timeout) {
         if (StringUtils.isBlank(idNumber)) {
+            log.warn("身份证号码为空");
             return null;
         }
 
@@ -606,7 +614,7 @@ public class ItfwServer {
         try {
             body = this.baseAgentApi(properties, timeout);
         } catch (Exception e) {
-            if (times(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
+            if (exceptionTimes(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
                 stringRedisTemplate.opsForValue().set(cacheStatusKey, cacheStatusKey, WebConstant.STATUS_TIMEOUT, TimeUnit.MINUTES);
             }
 
@@ -641,6 +649,7 @@ public class ItfwServer {
      */
     public List<PctymDataDTO> getPctym(String idNumber, Integer timeout) {
         if (StringUtils.isBlank(idNumber)) {
+            log.warn("身份证号码为空");
             return null;
         }
 
@@ -666,7 +675,7 @@ public class ItfwServer {
         try {
             body = this.baseAgentApi(properties, timeout);
         } catch (Exception e) {
-            if (times(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
+            if (exceptionTimes(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
                 stringRedisTemplate.opsForValue().set(cacheStatusKey, cacheStatusKey, WebConstant.STATUS_TIMEOUT, TimeUnit.MINUTES);
             }
 
@@ -702,6 +711,7 @@ public class ItfwServer {
      */
     public PcthsResultDTO getPcths(String idNumber, Integer timeout) {
         if (StringUtils.isBlank(idNumber)) {
+            log.warn("身份证号码为空");
             return null;
         }
 
@@ -726,12 +736,10 @@ public class ItfwServer {
         }
         PcthsVO pcthsVO = JSON.parseObject(body, PcthsVO.class);
         if (CollectionUtil.isEmpty(pcthsVO.getData().getResult())) {
-//            stringRedisTemplate.opsForValue().set(cacheKey, JSON.toJSONString(null), DateUtil.endOfDay(DateUtil.date()).getTime() - DateUtil.date().getTime(), TimeUnit.MILLISECONDS);
             return null;
         }
 
         PcthsResultDTO pcthsResultDTO = pcthsVO.getData().getResult().stream().findFirst().get();
-//        stringRedisTemplate.opsForValue().set(cacheKey, JSON.toJSONString(pcthsResultDTO), DateUtil.endOfDay(DateUtil.date()).getTime() - DateUtil.date().getTime(), TimeUnit.MILLISECONDS);
         return pcthsResultDTO;
     }
 
@@ -745,6 +753,7 @@ public class ItfwServer {
      */
     public PctzjzpResultDTO getPctzjzp(String idNumber, Integer timeout) {
         if (StringUtils.isBlank(idNumber)) {
+            log.warn("身份证号码为空");
             return null;
         }
 
@@ -770,7 +779,7 @@ public class ItfwServer {
         try {
             body = this.baseAgentApi(properties, timeout - 200);
         } catch (Exception e) {
-            if (times(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
+            if (exceptionTimes(cacheStatusKey) > WebConstant.TIMEOUT_TIMES) {
                 stringRedisTemplate.opsForValue().set(cacheStatusKey, cacheStatusKey, WebConstant.STATUS_TIMEOUT, TimeUnit.MINUTES);
             }
 
@@ -785,12 +794,11 @@ public class ItfwServer {
             return null;
         }
         PctzjzpResultDTO pctzjzpResultDTO = JSON.parseObject(body, PctzjzpResultDTO.class);
+        Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
+        stringRedisTemplate.delete(keys);
         if (Integer.parseInt(pctzjzpResultDTO.getStatus()) != 200) {
-//            stringRedisTemplate.opsForValue().set(cacheKey, JSON.toJSONString(null), DateUtil.endOfDay(DateUtil.date()).getTime() - DateUtil.date().getTime(), TimeUnit.MILLISECONDS);
             return null;
         }
-        Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
-        stringRedisTemplate.delete(keys);
 
         byte[] bytes = HttpRequest.get(pctzjzpResultDTO.getZjzUrl()).timeout(200).execute().bodyBytes();
         pctzjzpResultDTO.setPhoto(Base64.encode(bytes));

+ 1 - 1
src/main/java/com/rshy/project/hy/server/dto/PctjkmInfoDTO.java

@@ -23,7 +23,7 @@ public class PctjkmInfoDTO {
 
     private String user_name;
 
-    private String COLOR_CODE_LABEL;
+    private String color_code_label;
 
     /**
      * 手机号

+ 14 - 1
src/main/java/com/rshy/project/hy/web/controller/RshyController.java

@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSON;
 import com.rshy.project.hy.baseRe.ResultCode;
 import com.rshy.project.hy.baseRe.Ret;
 import com.rshy.project.hy.manager.RshyJkManager;
+import com.rshy.project.hy.model.enums.PassStatusEnum;
 import com.rshy.project.hy.server.param.RshyParam;
 import com.rshy.project.hy.server.param.RshyQuickParam;
 import com.rshy.project.hy.server.vo.RshyVo;
@@ -23,6 +24,11 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
 /**
  * @ProjectName: rshy
  * @Package: com.rshy.project.hy.web.controller
@@ -58,7 +64,14 @@ public class RshyController {
 
         DateTime time1 = DateTime.now();
         log.info("普通核验接口请求参数:{}", JSON.toJSONString(rshyParam));
-        RshyVo rshyVo = rshyJkManager.getRshyInfo(rshyParam);
+        RshyVo rshyVo = new RshyVo().setPassStatus(PassStatusEnum.NORMAL_TRAFFIC);
+        try {
+            Future<RshyVo> future = rshyJkManager.getRshyInfo(rshyParam);
+            rshyVo = future.get(rshyParam.getTimeout() * 1000 - 150, TimeUnit.MILLISECONDS);
+        } catch (InterruptedException | ExecutionException | TimeoutException e) {
+            log.error("普通核验接口异常: {}", e.getMessage());
+            e.printStackTrace();
+        }
         log.info("普通核验响应内容:{}", JSON.toJSONString(rshyVo));
         System.out.println("普通核验接口用时: " + DateUtil.between(time1, DateTime.now(), DateUnit.MS) + "毫秒\n");
         return Ret.success(rshyVo);