Browse Source

更新新的核酸接口

FanQun 2 years ago
parent
commit
c65be2be7f

+ 5 - 0
pom.xml

@@ -30,6 +30,11 @@
             <artifactId>knife4j-spring-boot-starter</artifactId>
             <version>2.0.7</version>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
 
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 1 - 4
src/main/java/com/rshy/project/hy/aop/ExceptionAdvice.java

@@ -63,9 +63,6 @@ public class ExceptionAdvice {
     @ExceptionHandler(value = BaseException.class)
     public Ret<?> handle(BaseException e) {
         log.error(e.getMessage(), e);
-        if (e.getCode() != null) {
-            return Ret.error(e.getCode(), e.getMessage());
-        }
         return Ret.error(e.getCode(), e.getMessage());
     }
 
@@ -86,7 +83,7 @@ public class ExceptionAdvice {
     }
 
     @ExceptionHandler(HttpMessageNotReadableException.class)
-    public Ret<?> httperrMsgNotReadableExceptionHandler(HttpMessageNotReadableException e) {
+    public Ret<?> httpMsgNotReadableExceptionHandler(HttpMessageNotReadableException e) {
         log.error("参数格式错误:" + e.getMessage(), e);
         if (env.equals(EnvEnum.PRODUCT.getCode())) {
             return Ret.error(10001, "参数错误");

+ 1 - 1
src/main/java/com/rshy/project/hy/baseRe/BaseException.java

@@ -21,7 +21,7 @@ public class BaseException extends RuntimeException {
     /**
      * 错误明细,内部调试错误
      * <p>
-     * 和 {@link Ret#getDetailerrMsg()} 一致的设计
+     * 和 {@link Ret#getErrDetailMsg()} 一致的设计
      */
     private String detailerrMsg;
 

+ 7 - 7
src/main/java/com/rshy/project/hy/baseRe/Ret.java

@@ -33,7 +33,7 @@ public final class Ret<T> implements Serializable {
     /**
      * 错误明细,内部调试错误
      */
-    private String detailerrMsg;
+    private String errDetailMsg;
 
     /**
      * 返回数据
@@ -63,17 +63,17 @@ public final class Ret<T> implements Serializable {
         return error(code, errMsg, null);
     }
 
-    public static <T> Ret<T> error(Integer code, String errMsg, String detailerrMsg) {
+    public static <T> Ret<T> error(Integer code, String errMsg, String detailedMsg) {
         Assert.isTrue(!SUCCESSFUL_CODE.equals(code), "code 必须是错误的!");
         Ret<T> result = new Ret<>();
         result.errCode = code;
         result.errMsg = errMsg;
-        result.detailerrMsg = detailerrMsg;
+        result.errDetailMsg = detailedMsg;
         return result;
     }
 
-    public Ret<T> setDetailerrMsg(String detailerrMsg) {
-        this.detailerrMsg = detailerrMsg;
+    public Ret<T> setErrDetailMsg(String errDetailMsg) {
+        this.errDetailMsg = errDetailMsg;
         return this;
     }
 
@@ -105,7 +105,7 @@ public final class Ret<T> implements Serializable {
             return;
         }
         // 业务异常
-        throw new ServiceException(errCode, errMsg).setDetailerrMsg(detailerrMsg);
+        throw new ServiceException(errCode, errMsg).setDetailerrMsg(errDetailMsg);
     }
 
     public static <T> Ret<T> error(BaseException baseException) {
@@ -119,7 +119,7 @@ public final class Ret<T> implements Serializable {
                 "errCode=" + errCode +
                 ", data=" + data +
                 ", errMsg='" + errMsg + '\'' +
-                ", detailerrMsg='" + detailerrMsg + '\'' +
+                ", detailedMsg='" + errDetailMsg + '\'' +
                 '}';
     }
 

+ 17 - 36
src/main/java/com/rshy/project/hy/manager/impl/RshyJkManagerImpl.java

@@ -26,7 +26,6 @@ import com.rshy.project.hy.server.vo.RshyVo;
 import com.rshy.project.hy.util.ObjectUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.DependsOn;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.scheduling.annotation.Async;
@@ -56,7 +55,7 @@ public class RshyJkManagerImpl implements RshyJkManager {
     private YituFaceServer yituFaceServer;
     @Resource
     private ItfwServer itfwServer;
-    @Autowired
+    @Resource
     private VIIDServer viidServer;
     @Resource
     private StringRedisTemplate stringRedisTemplate;
@@ -84,8 +83,8 @@ public class RshyJkManagerImpl implements RshyJkManager {
             }
         }
         if (jkmInfo == null) {
-            return new AsyncResult<>(rshyVo.setPassStatus(PassStatusEnum.NO_CODE).setSfzh(rshyParam.getSfzh()).setXm(rshyParam.getXm()).setWarning(PassStatusEnum.NO_CODE.getDesc())
-                    .setNucleic_acid(new NucleicAcidDTO().setStatus(NucleicAcidEnum.NO_DATA.getCode()).setResults(NucleicAcidEnum.NO_DATA.getDesc())));
+            return new AsyncResult<>(rshyVo.setPassStatus(PassStatusEnum.NO_HEALTH_CODE).setSfzh(rshyParam.getSfzh()).setXm(rshyParam.getXm()).setWarning(PassStatusEnum.NO_HEALTH_CODE.getDesc())
+                    .setNucleic_acid(new NucleicAcidDTO().set(NucleicAcidEnum.NO_DATA)));
         }
 
         rshyParam.setSfzh(jkmInfo.getId_num());
@@ -103,7 +102,7 @@ public class RshyJkManagerImpl implements RshyJkManager {
         List<Runnable> taskList = new ArrayList<Runnable>() {
             {
                 add(() -> resultDTO.setPctymDataDTOS(itfwServer.getPctym(rshyParam.getSfzh(), rshyParam.getTimeout())));
-                //add(() -> resultDTO.setPcthsResultDTO(itfwServer.getPcths(rshyParam.getSfzh(), rshyParam.getTimeout())));
+                add(() -> resultDTO.setPcthsResultDTO(itfwServer.getPcths(rshyParam.getSfzh(), rshyParam.getTimeout())));
                 if (StrUtil.isBlank(rshyParam.getXm())) {   // 刷健康码或者手动输入身份证号码,获取证件照片
                     add(() -> resultDTO.setPctzjzpResultDTO(itfwServer.getPctzjzp(rshyParam.getSfzh(), rshyParam.getTimeout())));
                 }
@@ -167,16 +166,9 @@ public class RshyJkManagerImpl implements RshyJkManager {
         String hcjg = resultDTO.getPctrchlDTO() == null ? "" : resultDTO.getPctrchlDTO().getHcjg();
 
 
-        //if (rshyVo.getNucleic_acid().getStatus() == 0) {
-        //    rshyVo.setPass(PassStatusEnum.NO_COMPLIANCE.getCode()).setTts(PassStatusEnum.NO_COMPLIANCE.getTts()).setDisplayMsg(PassStatusEnum.NO_COMPLIANCE.getDesc());
-        //}else {
-
-
-        //if (resultDTO.getPersonIdentifyDTO() != null && !rshyParam.getSfzh().equals(resultDTO.getPersonIdentifyDTO().getIdNumber())) {
-        //人证或者人码不符
-        //  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 (rshyVo.getNucleic_acid().getStatus() == 0) {
+            rshyVo.setPassStatus(PassStatusEnum.NON_CONFORMANCE).setKind(PassStatusEnum.NON_CONFORMANCE.getDesc()).setWarning(PassStatusEnum.NON_CONFORMANCE.getDesc());
+        } else 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())) {
@@ -184,9 +176,7 @@ public class RshyJkManagerImpl implements RshyJkManager {
             rshyVo.setPassStatus(PassStatusEnum.YELLOW_CODE).setKind("健康码" + PassStatusEnum.YELLOW_CODE.getDesc()).setWarning(PassStatusEnum.YELLOW_CODE.getDesc());
         } else if (resultDTO.getPctgkryDTO().getPctztDTO() != null || StrUtil.containsAnyIgnoreCase(hcjg, RchljgEnum.CAPTURE.getDesc()) || StrUtil.containsAnyIgnoreCase(hcjg, RchljgEnum.INTERCEPT.getDesc())) {
             //在逃 或者 人车核录接口返回 抓捕或者拦截
-            rshyVo.setPassStatus(PassStatusEnum.NO_PASSING).setKind(kind(resultDTO)).setWarning(warning(resultDTO));//.setWarning("在逃人员:" + resultDTO.getPctgkryDTO().getPctztDTO().getJyaq()).setKind(resultDTO.getPctgkryDTO().getPctztDTO().getZtrylxmc());
-            //} else if (ObjectUtils.allFieldIsNULL(resultDTO.getPctgkryDTO()) || StrUtil.containsAnyIgnoreCase(hcjg, "通过")) {
-            //    rshyVo.setPass(PassStatusEnum.NORMAL_TRAFFIC.getCode()).setDisplayMsg(PassStatusEnum.NORMAL_TRAFFIC.getDesc()).setTts(PassStatusEnum.NORMAL_TRAFFIC.getTts());
+            rshyVo.setPassStatus(PassStatusEnum.NO_PASSING).setKind(kind(resultDTO)).setWarning(warning(resultDTO));
         } else if (!ObjectUtils.allFieldIsNULL(resultDTO.getPctgkryDTO()) || StrUtil.containsAnyIgnoreCase(hcjg, RchljgEnum.IN_DOUBT.getDesc())) {
             //七大类管控人员(在逃除外)和人车核录接口返回存疑人员
             rshyVo.setPassStatus(PassStatusEnum.RIGHT_WAY).setKind(kind(resultDTO)).setWarning(warning(resultDTO));
@@ -222,32 +212,23 @@ public class RshyJkManagerImpl implements RshyJkManager {
     private NucleicAcidDTO nucleicAcid(PcthsResultDTO pcthsResultDTO) {
         NucleicAcidDTO nucleicAcidDTO = new NucleicAcidDTO();
         if (pcthsResultDTO == null) {
-            nucleicAcidDTO.setStatus(NucleicAcidEnum.NO_SAMPLING.getCode()).setResults(NucleicAcidEnum.NO_SAMPLING.getDesc());
+            nucleicAcidDTO.setStatus(NucleicAcidEnum.NO_DATA.getCode()).setResults(NucleicAcidEnum.NO_DATA.getDesc());
             return nucleicAcidDTO;
         }
 
-        if (pcthsResultDTO.getSHE_RQSJ() != null) {
-            DateTime parse = DateUtil.parse(String.valueOf(Integer.valueOf(pcthsResultDTO.getSHE_RQSJ()) * 1000));
+        if (pcthsResultDTO.getYU_CJSJ() != null) {
+            DateTime parse = DateUtil.date(Long.parseLong(pcthsResultDTO.getYU_CJSJ()) * 1000);
             long betweenMs = DateUtil.betweenMs(parse, DateUtil.date());
-            //48h防疫规则
-            if (betweenMs > 48 * 60 * 60 * 1000) {
-                nucleicAcidDTO.setStatus(NucleicAcidEnum.NOT_CONFORM.getCode()).setResults(new StringBuilder("48小时之外已出结果,结果").append(pcthsResultDTO.getJGU_MC()).toString()).setTime(DateUtil.format(parse, "MM-dd HH:mm"));
-                return nucleicAcidDTO;
+            //72h防疫规则
+            if (betweenMs > 72 * 60 * 60 * 1000) {
+                nucleicAcidDTO.set(NucleicAcidEnum.NOT_CONFORM);
+            } else {
+                nucleicAcidDTO.set(NucleicAcidEnum.CONFORM);
             }
-
-            nucleicAcidDTO.setStatus(NucleicAcidEnum.CONFORM.getCode()).setResults(new StringBuilder("采样48h内 结果").append(pcthsResultDTO.getJGU_MC()).toString()).setTime(DateUtil.format(parse, "MM-dd HH:mm"));
-            return nucleicAcidDTO;
-        }
-
-        DateTime parse = DateUtil.parse(String.valueOf(Integer.valueOf(pcthsResultDTO.getCJSJ()) * 1000));
-        long betweenMs = DateUtil.betweenMs(parse, DateUtil.date());
-        //48h防疫规则
-        if (betweenMs > 48 * 60 * 60 * 1000) {
-            nucleicAcidDTO.setStatus(NucleicAcidEnum.NOT_CONFORM.getCode()).setResults("48小时之外未出结果");
             return nucleicAcidDTO;
         }
 
-        nucleicAcidDTO.setStatus(NucleicAcidEnum.CONFORM.getCode()).setResults("48小时之内未出结果");
+        nucleicAcidDTO.set(NucleicAcidEnum.NO_DATA_TIME);
         return nucleicAcidDTO;
     }
 

+ 5 - 0
src/main/java/com/rshy/project/hy/model/dto/NucleicAcidDTO.java

@@ -1,5 +1,6 @@
 package com.rshy.project.hy.model.dto;
 
+import com.rshy.project.hy.model.enums.NucleicAcidEnum;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.experimental.Accessors;
@@ -20,4 +21,8 @@ public class NucleicAcidDTO {
 
     @ApiModelProperty("状态,是否符合当前防疫政策 1 符合 0 不符合")
     private Integer status;
+
+    public NucleicAcidDTO set(NucleicAcidEnum data) {
+        return this.setStatus(data.getCode()).setResults(data.getDesc());
+    }
 }

+ 6 - 4
src/main/java/com/rshy/project/hy/model/enums/NucleicAcidEnum.java

@@ -11,10 +11,12 @@ import lombok.Getter;
 @Getter
 @AllArgsConstructor
 public enum NucleicAcidEnum {
-    CONFORM(1, "符合"),
-    NOT_CONFORM(0, "不符合"),
-    NO_SAMPLING(0, "48h内未采样"),
-    NO_DATA(0, "无核酸采样数据");
+    CONFORM(1, "72h内已采样"),
+    SAMPLING(1, "72h内已采样"),
+    NOT_CONFORM(0, "72h内未采样"),
+    NO_SAMPLING(0, "72h内未采样"),
+    NO_DATA(0, "无核酸数据"),
+    NO_DATA_TIME(0, "无核酸采样时间数据");
 
     private Integer code;
 

+ 2 - 2
src/main/java/com/rshy/project/hy/model/enums/PassStatusEnum.java

@@ -18,11 +18,11 @@ public enum PassStatusEnum {
     GREEN_CODE(2, "绿码", "通过"),
     RED_CODE(3, "红码", "健康码异常"),
     YELLOW_CODE(3, "黄码", "健康码异常"),
-    NO_CODE(3, "无健康码", "健康码异常"),
+    NO_HEALTH_CODE(3, "无健康码", "健康码异常"),
     //人证或人码不符
     NO_MATCHED(3, "人证(码)不符", "健康码异常"),
     //不符合防疫要求
-    NO_COMPLIANCE(3, "核酸未采集", "核酸48小时未采集");
+    NON_CONFORMANCE(3, "核酸未符合", "健康码异常");
 
     private Integer code;
     private String desc;

+ 72 - 52
src/main/java/com/rshy/project/hy/server/ItfwServer.java

@@ -22,6 +22,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
+import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
@@ -174,8 +175,9 @@ public class ItfwServer {
             return null;
         }
         log.info("重点人员服务响应信息:{}", body);
-        Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
-        stringRedisTemplate.delete(keys);
+        deleteKeys(cacheStatusKey);
+        //Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
+        //stringRedisTemplate.delete(keys);
         if (StrUtil.isEmpty(body)) {
             return null;
         }
@@ -236,15 +238,16 @@ public class ItfwServer {
             return null;
         }
         log.info("人员劣迹服务响应信息:{}", body);
-        Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
-        stringRedisTemplate.delete(keys);
+        deleteKeys(cacheStatusKey);
+        //Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
+        //stringRedisTemplate.delete(keys);
         PctztVO pctztVO = JSON.parseObject(body, PctztVO.class);
         if (CollectionUtil.isEmpty(pctztVO.getData())) {
             stringRedisTemplate.opsForValue().set(cacheKey, JSON.toJSONString(null), DateUtil.endOfDay(DateUtil.date()).getTime() - DateUtil.date().getTime(), TimeUnit.MILLISECONDS);
             return null;
         }
 
-        PctztDTO pctztDTO = pctztVO.getData().stream().findFirst().get();
+        PctztDTO pctztDTO = pctztVO.getData().stream().findFirst().orElse(null);
         stringRedisTemplate.opsForValue().set(cacheKey, JSON.toJSONString(pctztDTO), DateUtil.endOfDay(DateUtil.date()).getTime() - DateUtil.date().getTime(), TimeUnit.MILLISECONDS);
         return pctztDTO;
     }
@@ -293,8 +296,9 @@ public class ItfwServer {
         }
 
         log.info("新的执法办案服务响应信息:{}", body);
-        Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
-        stringRedisTemplate.delete(keys);
+        deleteKeys(cacheStatusKey);
+        //Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
+        //stringRedisTemplate.delete(keys);
         if (StrUtil.isEmpty(body)) {
             return null;
         }
@@ -353,8 +357,9 @@ public class ItfwServer {
             return null;
         }
         log.info("打防控信息服务响应信息:{}", body);
-        Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
-        stringRedisTemplate.delete(keys);
+        deleteKeys(cacheStatusKey);
+        //Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
+        //stringRedisTemplate.delete(keys);
         if (StrUtil.isEmpty(body)) {
             return null;
         }
@@ -413,8 +418,9 @@ public class ItfwServer {
         }
 
         log.info("监所人员服务响应信息:{}", body);
-        Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
-        stringRedisTemplate.delete(keys);
+        deleteKeys(cacheStatusKey);
+        //Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
+        //stringRedisTemplate.delete(keys);
         if (StrUtil.isEmpty(body)) {
             return null;
         }
@@ -475,8 +481,9 @@ public class ItfwServer {
         }
 
         log.info("吸毒人员服务响应信息:{}", body);
-        Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
-        stringRedisTemplate.delete(keys);
+        deleteKeys(cacheStatusKey);
+        //Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
+        //stringRedisTemplate.delete(keys);
         if (StrUtil.isEmpty(body)) {
             return null;
         }
@@ -536,8 +543,9 @@ public class ItfwServer {
         }
 
         log.info("前科人员服务响应信息:{}", body);
-        Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
-        stringRedisTemplate.delete(keys);
+        deleteKeys(cacheStatusValue);
+        //Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
+        //stringRedisTemplate.delete(keys);
         if (StrUtil.isEmpty(body)) {
             return null;
         }
@@ -552,31 +560,6 @@ public class ItfwServer {
         return pctqkryDTO;
     }
 
-    /**
-     * 异常次数
-     *
-     * @param key
-     * @return
-     */
-    private Integer exceptionTimes(String key) {
-        String cacheKey = key + ":times";
-        int times = 1;
-        String timesStr = stringRedisTemplate.opsForValue().get(cacheKey);
-        if (timesStr == null) {
-            stringRedisTemplate.opsForValue().set(cacheKey, String.valueOf(times));//,DateUtil.endOfDay(DateUtil.date()).getTime() - DateUtil.date().getTime(), TimeUnit.MILLISECONDS);
-        } else {
-            times = Integer.parseInt(timesStr) + 1;
-            if (times > WebConstant.TIMEOUT_TIMES) {
-                Set<String> keys = stringRedisTemplate.keys(cacheKey + "*");
-                stringRedisTemplate.delete(keys);
-            } else {
-                stringRedisTemplate.opsForValue().increment(cacheKey);
-            }
-        }
-
-        return times;
-    }
-
     /**
      * 人车核录
      *
@@ -624,8 +607,9 @@ public class ItfwServer {
         }
 
         log.info("人车核录服务响应信息:{}", body);
-        Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
-        stringRedisTemplate.delete(keys);
+        deleteKeys(cacheStatusKey);
+        //Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
+        //stringRedisTemplate.delete(keys);
 
         if (StrUtil.isEmpty(body) || !StrUtil.containsAnyIgnoreCase(body, "datas")) {
             return null;
@@ -685,8 +669,9 @@ public class ItfwServer {
         }
 
         log.info("浙江省疫苗注射数据服务响应信息:{}", body);
-        Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
-        stringRedisTemplate.delete(keys);
+        deleteKeys(cacheStatusKey);
+        //Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
+        //stringRedisTemplate.delete(keys);
 
         if (StrUtil.isEmpty(body) || !StrUtil.containsAnyIgnoreCase(body, "datas")) {
             return null;
@@ -731,7 +716,7 @@ public class ItfwServer {
 
         log.info("核酸接口数据服务响应信息:{}", body);
 
-        if (StrUtil.isEmpty(body) || !StrUtil.containsAnyIgnoreCase(body, "datas")) {
+        if (StrUtil.isEmpty(body) || !StrUtil.containsAnyIgnoreCase(body, "data")) {
             return null;
         }
         PcthsVO pcthsVO = JSON.parseObject(body, PcthsVO.class);
@@ -739,8 +724,7 @@ public class ItfwServer {
             return null;
         }
 
-        PcthsResultDTO pcthsResultDTO = pcthsVO.getData().getResult().stream().findFirst().get();
-        return pcthsResultDTO;
+        return pcthsVO.getData().getResult().stream().findFirst().orElse(null);
     }
 
 
@@ -794,8 +778,9 @@ public class ItfwServer {
             return null;
         }
         PctzjzpResultDTO pctzjzpResultDTO = JSON.parseObject(body, PctzjzpResultDTO.class);
-        Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
-        stringRedisTemplate.delete(keys);
+        deleteKeys(cacheStatusKey);
+        //Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
+        //stringRedisTemplate.delete(keys);
         if (Integer.parseInt(pctzjzpResultDTO.getStatus()) != 200) {
             return null;
         }
@@ -852,13 +837,13 @@ public class ItfwServer {
         }
 
         log.info("杭州市重点人员底库数据查询接口服务响应信息:{}", body);
-
+        deleteKeys(cacheStatusKey);
         if (StrUtil.isEmpty(body)) {
             return null;
         }
         PctzdrydkResultDTO pctzdrydkResultDTO = JSON.parseObject(body, PctzdrydkResultDTO.class);
-        Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
-        stringRedisTemplate.delete(keys);
+        //Set<String> keys = stringRedisTemplate.keys(cacheStatusKey + "*");
+        //stringRedisTemplate.delete(keys);
         stringRedisTemplate.opsForValue().set(cacheKey, JSON.toJSONString(pctzdrydkResultDTO), DateUtil.endOfDay(DateUtil.date()).getTime() - DateUtil.date().getTime(), TimeUnit.MILLISECONDS);
         //if (pctzdrydkResultDTO.getErrCode() == 0 && pctzdrydkResultDTO.getTotal() == 0) {
         //    return null;
@@ -866,4 +851,39 @@ public class ItfwServer {
 
         return pctzdrydkResultDTO;
     }
+
+    /**
+     * 异常次数
+     *
+     * @param key
+     * @return
+     */
+    private Integer exceptionTimes(String key) {
+        String cacheKey = key + ":times";
+        int times = 1;
+        String timesStr = stringRedisTemplate.opsForValue().get(cacheKey);
+        if (timesStr == null) {
+            stringRedisTemplate.opsForValue().set(cacheKey, String.valueOf(times));//,DateUtil.endOfDay(DateUtil.date()).getTime() - DateUtil.date().getTime(), TimeUnit.MILLISECONDS);
+        } else {
+            times = Integer.parseInt(timesStr) + 1;
+            if (times > WebConstant.TIMEOUT_TIMES) {
+                deleteKeys(cacheKey);
+            } else {
+                stringRedisTemplate.opsForValue().increment(cacheKey);
+            }
+        }
+
+        return times;
+    }
+
+    /**
+     * 删除redis 缓存
+     *
+     * @param key
+     */
+    private void deleteKeys(String key) {
+        Set<String> keys = stringRedisTemplate.keys(key + "*");
+        Optional.ofNullable(keys).ifPresent(k -> stringRedisTemplate.delete(k));
+    }
+
 }

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

@@ -12,4 +12,5 @@ import java.util.List;
 @Data
 public class PcthsDTO {
     private List<PcthsResultDTO> result;
+    private int excuteTime;
 }

+ 24 - 24
src/main/java/com/rshy/project/hy/server/dto/PcthsResultDTO.java

@@ -9,30 +9,30 @@ import lombok.Data;
  */
 @Data
 public class PcthsResultDTO {
-    private String FHXTSJWYBSID;
-    private String SHE_RQSJ;
-    private String SJMGJBBM;
-    private String CYZJDM;
-    private String SJCJLYBM;
-    private String SJCJLYXTBZ;
-    private String XWBQBS;
-    private String SJC;
-    private String YL_JJIN_DM;
-    private String YAB_CJSJ;
-    private String YSXTJRZJ;
-    private String CYZJMC;
-    private String XXSC_PDBZ;
-    private String SJCJLYXT;
-    private String ZJHM;
-    private String CJSJ;
-    private String SJCJLYD;
-    private String GXSJ;
-    private String JGU_MC;
-    private String SJKHSBSF;
-    private String JY_YIY_MC;
+    //private String FHXTSJWYBSID;
+    //private String SHE_RQSJ;
+    //private String SJMGJBBM;
+    //private String CYZJDM;
+    //private String SJCJLYBM;
+    //private String SJCJLYXTBZ;
+    //private String XWBQBS;
+    //private String SJC;
+    //private String YL_JJIN_DM;
+    //private String YAB_CJSJ;
+    //private String YSXTJRZJ;
+    //private String CYZJMC;
+    //private String XXSC_PDBZ;
+    //private String SJCJLYXT;
+    //private String ZJHM;
+    private String YU_CJSJ;
+    //private String SJCJLYD;
+    //private String GXSJ;
+    //private String JGU_MC;
+    //private String SJKHSBSF;
+    //private String JY_YIY_MC;
     private String GMSFHM;
     private String XM;
-    private String YWBQBS;
-    private String PIC_ID;
-    private String SJCJLYBM1;
+    //private String YWBQBS;
+    //private String PIC_ID;
+    //private String SJCJLYBM1;
 }

+ 1 - 1
src/main/resources/application-local.yml

@@ -95,7 +95,7 @@ itfw:
       APP_KEY: 1618208939768204
       APP_SECRET: 9d98c9d9d14d4d298f4408c0338c1af5
     appCode: pcths
-    apiPath: /1642499133568
+    apiPath: /165275993242
     apiConfig: 1618208939768204,9d98c9d9d14d4d298f4408c0338c1af5,5cf7f9ec93964f8a86e1a819dbb54c5b.apigateway.cn-deqing-zjzfy01-zjga01.hzs.zj,HTTPS
     method: GET
   #证件照片服务

+ 1 - 1
src/main/resources/application-prod.yml

@@ -99,7 +99,7 @@ itfw:
       APP_KEY: 1618208939768204
       APP_SECRET: 9d98c9d9d14d4d298f4408c0338c1af5
     appCode: pcths
-    apiPath: /1642499133568
+    apiPath: /165275993242
     apiConfig: 1618208939768204,9d98c9d9d14d4d298f4408c0338c1af5,5cf7f9ec93964f8a86e1a819dbb54c5b.apigateway.cn-deqing-zjzfy01-zjga01.hzs.zj,HTTPS
     method: GET
   #证件照片服务