Browse Source

七大类管控人员整合

FanQun 2 years ago
parent
commit
0f964a5b23

+ 51 - 43
src/main/java/com/rshy/project/hy/manager/impl/RshyJkManagerImpl.java

@@ -60,7 +60,9 @@ public class RshyJkManagerImpl implements RshyJkManager {
         rshyParam.setTimeout(rshyParam.getTimeout() * 1000);
         log.info("普通核验接口请求参数:{}", JSON.toJSONString(rshyParam));
         RshyVo rshyVo = new RshyVo();
+        PctgkryDTO gkryDTO = new PctgkryDTO();
         ResultDTO resultDTO = new ResultDTO();
+        resultDTO.setPctgkryDTO(gkryDTO);
         DateTime beginDate = DateTime.now();
         PctjkmInfoDTO barCodes = null;
 
@@ -100,13 +102,13 @@ public class RshyJkManagerImpl implements RshyJkManager {
         };
 
         if (rshyParam.getScreenLocked() == 0 && (barCodes == null || PassStatusEnum.GREEN_CODE.getDesc().equals(barCodes.getCOLOR_CODE_LABEL()))) {
-            taskList.add(() -> resultDTO.setPctdfkDTO(itfwServer.getPctdfk(rshyParam.getSfzh(), "", rshyParam.getTimeout())));
-            taskList.add(() -> resultDTO.setPctjsryDTO(itfwServer.getPctjsry(rshyParam.getSfzh(), rshyParam.getTimeout())));
-            taskList.add(() -> resultDTO.setPctztDTO(itfwServer.getPctzt(rshyParam.getSfzh(), rshyParam.getTimeout())));
-            taskList.add(() -> resultDTO.setPctzfbaDTO(itfwServer.getPctzfba(rshyParam.getSfzh(), rshyParam.getTimeout())));
-            taskList.add(() -> resultDTO.setPctqkryDTO(itfwServer.getPctqkry(rshyParam.getSfzh(), rshyParam.getTimeout())));
-            taskList.add(() -> resultDTO.setPctxdryDTO(itfwServer.getPctxdry(rshyParam.getSfzh(), "", rshyParam.getTimeout())));
-            taskList.add(() -> resultDTO.setPctzdryDTO(itfwServer.getPctzdry(rshyParam.getSfzh(), rshyParam.getTimeout())));
+            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())));
+            taskList.add(() -> resultDTO.getPctgkryDTO().setPctzfbaDTO(itfwServer.getPctzfba(rshyParam.getSfzh(), rshyParam.getTimeout())));
+            taskList.add(() -> resultDTO.getPctgkryDTO().setPctqkryDTO(itfwServer.getPctqkry(rshyParam.getSfzh(), rshyParam.getTimeout())));
+            taskList.add(() -> resultDTO.getPctgkryDTO().setPctxdryDTO(itfwServer.getPctxdry(rshyParam.getSfzh(), "", rshyParam.getTimeout())));
+            taskList.add(() -> resultDTO.getPctgkryDTO().setPctzdryDTO(itfwServer.getPctzdry(rshyParam.getSfzh(), rshyParam.getTimeout())));
             taskList.add(() -> resultDTO.setPctrchlDTO(itfwServer.getPctrchl(rshyParam.getSfzh(), rshyParam.getTimeout())));
         }
 
@@ -132,37 +134,43 @@ public class RshyJkManagerImpl implements RshyJkManager {
         Date date = DateUtil.parse(IdcardUtil.getBirthByIdCard(rshyParam.getSfzh()));
         rshyVo.setBirthday(DateUtil.format(date, "yyyy-M-d"));
         PctrchlDTO pctrchlDTO = resultDTO.getPctrchlDTO();
-        resultDTO.setPctrchlDTO(null);
+        //resultDTO.setPctrchlDTO(null);
         String hcjg = "";
         if (pctrchlDTO != null) {
             hcjg = pctrchlDTO.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 (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.setPass(PassStatusEnum.NO_MATCHED.getCode()).setTimes(times(rshyParam.getSfzh())).setTts(PassStatusEnum.NO_MATCHED.getTts()).setDisplayMsg(PassStatusEnum.NO_MATCHED.getDesc()).setWarning(PassStatusEnum.NO_MATCHED.getDesc()).setKind(PassStatusEnum.NO_MATCHED.getDesc());
-            } else if (barCodes != null && PassStatusEnum.RED_CODE.getDesc().equalsIgnoreCase(barCodes.getCOLOR_CODE_LABEL())) {
-                rshyVo.setPass(PassStatusEnum.RED_CODE.getCode()).setTimes(times(rshyParam.getSfzh())).setTts(PassStatusEnum.RED_CODE.getTts()).setDisplayMsg(PassStatusEnum.RED_CODE.getDesc()).setWarning(PassStatusEnum.RED_CODE.getDesc()).setKind("健康码" + PassStatusEnum.RED_CODE.getDesc());
-            } else if (barCodes != null && PassStatusEnum.YELLOW_CODE.getDesc().equalsIgnoreCase(barCodes.getCOLOR_CODE_LABEL())) {
-                rshyVo.setPass(PassStatusEnum.YELLOW_CODE.getCode()).setTimes(times(rshyParam.getSfzh())).setTts(PassStatusEnum.YELLOW_CODE.getTts()).setDisplayMsg(PassStatusEnum.YELLOW_CODE.getDesc()).setWarning(PassStatusEnum.YELLOW_CODE.getDesc()).setKind("健康码" + PassStatusEnum.YELLOW_CODE.getDesc());
-            } else if (resultDTO.getPctztDTO() != null || StrUtil.containsAnyIgnoreCase(hcjg, "抓捕")) {
-                rshyVo.setPass(PassStatusEnum.NO_PASSING.getCode()).setTts(PassStatusEnum.NO_PASSING.getTts()).setDisplayMsg(PassStatusEnum.NO_PASSING.getDesc()).setWarning("在逃人员:" + resultDTO.getPctztDTO().getJyaq()).setKind(resultDTO.getPctztDTO().getZtrylxmc());
-            } else if (ObjectUtils.allFieldIsNULL(resultDTO) || StrUtil.containsAnyIgnoreCase(hcjg, "通过")) {
-                rshyVo.setPass(PassStatusEnum.NORMAL_TRAFFIC.getCode()).setDisplayMsg(PassStatusEnum.NORMAL_TRAFFIC.getDesc()).setTts(PassStatusEnum.NORMAL_TRAFFIC.getTts());
-            } else if (quickRshyVo.get() != null && StrUtil.isNotEmpty(quickRshyVo.get().getSfzh())) {
-                //快速通行
-                rshyVo = quickRshyVo.get();
-            } else {
-                rshyVo.setPass(PassStatusEnum.RIGHT_WAY.getCode()).setKind(kind(resultDTO)).setWarning(warning(resultDTO)).setDisplayMsg(PassStatusEnum.RIGHT_WAY.getDesc()).setTts(PassStatusEnum.RIGHT_WAY.getTts());
-            }
+        if (resultDTO.getPersonIdentifyDTO() != null && !rshyParam.getSfzh().equals(resultDTO.getPersonIdentifyDTO().getIdNumber())) {
+            //认证或者人码不符
+            rshyVo.setPass(PassStatusEnum.NO_MATCHED.getCode()).setTimes(times(rshyParam.getSfzh())).setTts(PassStatusEnum.NO_MATCHED.getTts()).setDisplayMsg(PassStatusEnum.NO_MATCHED.getDesc()).setWarning(PassStatusEnum.NO_MATCHED.getDesc()).setKind(PassStatusEnum.NO_MATCHED.getDesc());
+        } else if (barCodes != null && PassStatusEnum.RED_CODE.getDesc().equalsIgnoreCase(barCodes.getCOLOR_CODE_LABEL())) {
+            //红码
+            rshyVo.setPass(PassStatusEnum.RED_CODE.getCode()).setTimes(times(rshyParam.getSfzh())).setTts(PassStatusEnum.RED_CODE.getTts()).setDisplayMsg(PassStatusEnum.RED_CODE.getDesc()).setWarning(PassStatusEnum.RED_CODE.getDesc()).setKind("健康码" + PassStatusEnum.RED_CODE.getDesc());
+        } else if (barCodes != null && PassStatusEnum.YELLOW_CODE.getDesc().equalsIgnoreCase(barCodes.getCOLOR_CODE_LABEL())) {
+            //黄码
+            rshyVo.setPass(PassStatusEnum.YELLOW_CODE.getCode()).setTimes(times(rshyParam.getSfzh())).setTts(PassStatusEnum.YELLOW_CODE.getTts()).setDisplayMsg(PassStatusEnum.YELLOW_CODE.getDesc()).setWarning(PassStatusEnum.YELLOW_CODE.getDesc()).setKind("健康码" + PassStatusEnum.YELLOW_CODE.getDesc());
+        } else if (resultDTO.getPctgkryDTO().getPctztDTO() != null || StrUtil.containsAnyIgnoreCase(hcjg, "抓捕") || StrUtil.containsAnyIgnoreCase(hcjg, "拦截")) {
+            //在逃 或者 人车核录接口返回 抓捕或者拦截
+            rshyVo.setPass(PassStatusEnum.NO_PASSING.getCode()).setTts(PassStatusEnum.NO_PASSING.getTts()).setDisplayMsg(PassStatusEnum.NO_PASSING.getDesc()).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());
+        } else if (!ObjectUtils.allFieldIsNULL(resultDTO.getPctgkryDTO()) || StrUtil.containsAnyIgnoreCase(hcjg, "存疑")) {
+            rshyVo.setPass(PassStatusEnum.RIGHT_WAY.getCode()).setKind(kind(resultDTO)).setWarning(warning(resultDTO)).setDisplayMsg(PassStatusEnum.RIGHT_WAY.getDesc()).setTts(PassStatusEnum.RIGHT_WAY.getTts());
+        } else if (quickRshyVo.get() != null && StrUtil.isNotEmpty(quickRshyVo.get().getSfzh())) {
+            //快速通行
+            rshyVo = quickRshyVo.get();
+        } else {
+            rshyVo.setPass(PassStatusEnum.NORMAL_TRAFFIC.getCode()).setDisplayMsg(PassStatusEnum.NORMAL_TRAFFIC.getDesc()).setTts(PassStatusEnum.NORMAL_TRAFFIC.getTts());
+        }
 
-            if (rshyVo.getHealthCode() != null) {
-                rshyVo.setTts(rshyVo.getHealthCode());
-            }
+        if (rshyVo.getHealthCode() != null) {
+            rshyVo.setTts(rshyVo.getHealthCode());
         }
+        //}
         log.info("普通核验响应内容:{}", JSON.toJSONString(rshyVo));
         return rshyVo;
     }
@@ -252,13 +260,13 @@ public class RshyJkManagerImpl implements RshyJkManager {
      */
     private String kind(ResultDTO resultDTO) {
         StringBuilder stringBuilder = new StringBuilder();
-        stringBuilder.append(resultDTO.getPctdfkDTO() != null ? HyTypeEnum.pctdfk.getDesc() : StrUtil.EMPTY);
-        stringBuilder.append(resultDTO.getPctjsryDTO() != null ? HyTypeEnum.pctjsry.getDesc() : StrUtil.EMPTY);
-        stringBuilder.append(resultDTO.getPctxdryDTO() != null ? HyTypeEnum.pctxdry.getDesc() : StrUtil.EMPTY);
-        stringBuilder.append(resultDTO.getPctqkryDTO() != null ? HyTypeEnum.pctqkry.getDesc() : StrUtil.EMPTY);
-        stringBuilder.append(resultDTO.getPctjkmInfoDTO() != null ? HyTypeEnum.pctjkm.getDesc() : StrUtil.EMPTY);
-        stringBuilder.append(resultDTO.getPctzfbaDTO() != null ? HyTypeEnum.pctzfba.getDesc() : StrUtil.EMPTY);
-        stringBuilder.append(resultDTO.getPctzdryDTO() != null ? HyTypeEnum.pctzdry.getDesc() : StrUtil.EMPTY);
+        stringBuilder.append(resultDTO.getPctgkryDTO().getPctdfkDTO() != null ? HyTypeEnum.pctdfk.getDesc() : StrUtil.EMPTY);
+        stringBuilder.append(resultDTO.getPctgkryDTO().getPctjsryDTO() != null ? HyTypeEnum.pctjsry.getDesc() : StrUtil.EMPTY);
+        stringBuilder.append(resultDTO.getPctgkryDTO().getPctxdryDTO() != null ? HyTypeEnum.pctxdry.getDesc() : StrUtil.EMPTY);
+        stringBuilder.append(resultDTO.getPctgkryDTO().getPctqkryDTO() != null ? HyTypeEnum.pctqkry.getDesc() : StrUtil.EMPTY);
+        //stringBuilder.append(resultDTO.getPctjkmInfoDTO() != null ? HyTypeEnum.pctjkm.getDesc() : StrUtil.EMPTY);
+        stringBuilder.append(resultDTO.getPctgkryDTO().getPctzfbaDTO() != null ? HyTypeEnum.pctzfba.getDesc() : StrUtil.EMPTY);
+        stringBuilder.append(resultDTO.getPctgkryDTO().getPctzdryDTO() != null ? HyTypeEnum.pctzdry.getDesc() : StrUtil.EMPTY);
         stringBuilder.append(resultDTO.getPctrchlDTO() != null ? resultDTO.getPctrchlDTO().getRylb() : StrUtil.EMPTY);
         return stringBuilder.toString();
     }
@@ -271,12 +279,12 @@ public class RshyJkManagerImpl implements RshyJkManager {
      */
     private String warning(ResultDTO resultDTO) {
         StringBuilder stringBuilder = new StringBuilder();
-        stringBuilder.append(resultDTO.getPctdfkDTO() != null ? resultDTO.getPctdfkDTO().getJyaq() : StrUtil.EMPTY);
-        stringBuilder.append(resultDTO.getPctjsryDTO() != null ? resultDTO.getPctjsryDTO().getJyaq() : StrUtil.EMPTY);
-        stringBuilder.append(resultDTO.getPctxdryDTO() != null ? resultDTO.getPctxdryDTO().getXdcsmc() : StrUtil.EMPTY);
-        stringBuilder.append(resultDTO.getPctqkryDTO() != null ? resultDTO.getPctqkryDTO().getLsqkqk() : StrUtil.EMPTY);
-        stringBuilder.append(resultDTO.getPctzfbaDTO() != null ? resultDTO.getPctzfbaDTO().getAjmc() : StrUtil.EMPTY);
-        stringBuilder.append(resultDTO.getPctzdryDTO() != null ? resultDTO.getPctzdryDTO().getAjlbmc() : StrUtil.EMPTY);
+        stringBuilder.append(resultDTO.getPctgkryDTO().getPctdfkDTO() != null ? resultDTO.getPctgkryDTO().getPctdfkDTO().getJyaq() : StrUtil.EMPTY);
+        stringBuilder.append(resultDTO.getPctgkryDTO().getPctjsryDTO() != null ? resultDTO.getPctgkryDTO().getPctjsryDTO().getJyaq() : StrUtil.EMPTY);
+        stringBuilder.append(resultDTO.getPctgkryDTO().getPctxdryDTO() != null ? resultDTO.getPctgkryDTO().getPctxdryDTO().getXdcsmc() : StrUtil.EMPTY);
+        stringBuilder.append(resultDTO.getPctgkryDTO().getPctqkryDTO() != null ? resultDTO.getPctgkryDTO().getPctqkryDTO().getLsqkqk() : StrUtil.EMPTY);
+        stringBuilder.append(resultDTO.getPctgkryDTO().getPctzfbaDTO() != null ? resultDTO.getPctgkryDTO().getPctzfbaDTO().getAjmc() : StrUtil.EMPTY);
+        stringBuilder.append(resultDTO.getPctgkryDTO().getPctzdryDTO() != null ? resultDTO.getPctgkryDTO().getPctzdryDTO().getAjlbmc() : StrUtil.EMPTY);
         stringBuilder.append(resultDTO.getPctrchlDTO() != null ? resultDTO.getPctrchlDTO().getBjxx() : StrUtil.EMPTY);
         return stringBuilder.toString();
     }

+ 27 - 0
src/main/java/com/rshy/project/hy/server/dto/PctgkryDTO.java

@@ -0,0 +1,27 @@
+package com.rshy.project.hy.server.dto;
+
+import lombok.Data;
+
+/**
+ * 七大类管控人员
+ * <p>
+ * Created by fanqun on 2022/5/5.
+ */
+
+@Data
+public class PctgkryDTO {
+    private PctdfkDTO pctdfkDTO;
+
+    private PctjsryDTO pctjsryDTO;
+
+    private PctqkryDTO pctqkryDTO;
+
+    private PctxdryDTO pctxdryDTO;
+
+    private PctzdryDTO pctzdryDTO;
+
+    private PctzfbaDTO pctzfbaDTO;
+
+    private PctztDTO pctztDTO;
+
+}

+ 10 - 8
src/main/java/com/rshy/project/hy/server/dto/ResultDTO.java

@@ -1,6 +1,5 @@
 package com.rshy.project.hy.server.dto;
 
-import com.rshy.project.hy.server.vo.RshyVo;
 import lombok.Data;
 
 import java.util.List;
@@ -12,21 +11,24 @@ import java.util.List;
  */
 @Data
 public class ResultDTO {
-    private PctdfkDTO pctdfkDTO;
+    //private PctdfkDTO pctdfkDTO;
 
     private PctjkmInfoDTO pctjkmInfoDTO;
 
-    private PctjsryDTO pctjsryDTO;
+    //private PctjsryDTO pctjsryDTO;
 
-    private PctqkryDTO pctqkryDTO;
+    //private PctqkryDTO pctqkryDTO;
 
-    private PctxdryDTO pctxdryDTO;
+    //private PctxdryDTO pctxdryDTO;
 
-    private PctzdryDTO pctzdryDTO;
+    //private PctzdryDTO pctzdryDTO;
 
-    private PctzfbaDTO pctzfbaDTO;
+    //private PctzfbaDTO pctzfbaDTO;
 
-    private PctztDTO pctztDTO;
+    //private PctztDTO pctztDTO;
+
+    //七大类管控人员接口返回数据
+    private PctgkryDTO pctgkryDTO;
 
     private PctrchlDTO pctrchlDTO;
 

+ 12 - 0
src/main/java/com/rshy/project/hy/server/param/RshyParam.java

@@ -36,4 +36,16 @@ public class RshyParam {
 
     @ApiModelProperty("锁屏状态")
     private Integer screenLocked;
+
+    @Override
+    public String toString() {
+        return "RshyParam{" +
+                "sfzh='" + sfzh + '\'' +
+                ", xm='" + xm + '\'' +
+                ", barCode='" + barCode + '\'' +
+                ", timeout=" + timeout +
+                ", photo='" + '\'' +
+                ", screenLocked=" + screenLocked +
+                '}';
+    }
 }