Browse Source

人员劣迹接口 返回增加 xm 字段

FanQun 2 years ago
parent
commit
dccf10bfe2

+ 37 - 25
src/main/java/com/rshy/project/hy/manager/impl/RshyJkManagerImpl.java

@@ -82,13 +82,17 @@ public class RshyJkManagerImpl implements RshyJkManager {
                 //e.printStackTrace();
             }
         }
-        if (jkmInfo == null) {
+        if (jkmInfo == null && StrUtil.isBlank(rshyParam.getSfzh())) {
             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());
-        rshyVo.setSfzh(jkmInfo.getId_num()).setXm(jkmInfo.getUser_name()).setHealthCode(jkmInfo.getColor_code_label()).setPhone(jkmInfo.getPn());
+        if (jkmInfo != null) {
+            rshyParam.setSfzh(jkmInfo.getId_num());
+            rshyVo.setSfzh(jkmInfo.getId_num()).setXm(jkmInfo.getUser_name()).setHealthCode(jkmInfo.getColor_code_label()).setPhone(jkmInfo.getPn());
+        } else {
+            rshyVo.setSfzh(rshyParam.getSfzh());
+        }
         int jkmUsedTime = (int) DateUtil.between(beginDate, DateTime.now(), DateUnit.MS);
         System.out.println("健康码接口用时: " + jkmUsedTime + "毫秒");
 
@@ -117,17 +121,17 @@ 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())) {
-            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())));
-            taskList.add(() -> resultDTO.setPctzdrydkResultDTO(itfwServer.getPctzdrydk(rshyParam.getSfzh(), rshyParam.getTimeout())));
-        }
+        //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())));
+        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())));
+        taskList.add(() -> resultDTO.setPctzdrydkResultDTO(itfwServer.getPctzdrydk(rshyParam.getSfzh(), rshyParam.getTimeout())));
+        //}
 
         //异步流并发处理
         taskList.parallelStream().forEach(v -> {
@@ -154,10 +158,11 @@ 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 (resultDTO.getPctsfzResult() != null) {
-                //有警察叔叔身份证接口返回数据,取地址
+                //有警察叔叔身份证接口返回数据
+                rshyVo.setXm(resultDTO.getPctsfzResult().getCZRKXM());
                 rshyVo.setAddress(resultDTO.getPctsfzResult().getCZRKZZ());
                 rshyVo.setMz(resultDTO.getPctsfzResult().getCZRKMZ());
             } else {
@@ -176,15 +181,22 @@ public class RshyJkManagerImpl implements RshyJkManager {
 //            //行程码到过中高风险地区
 //            rshyVo.setPassStatus(PassStatusEnum.ABNORMAL_TRAVEL_CARD).setKind(PassStatusEnum.ABNORMAL_TRAVEL_CARD.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())) {
-            //黄码
-            rshyVo.setPassStatus(PassStatusEnum.YELLOW_CODE).setKind("健康码" + PassStatusEnum.YELLOW_CODE.getDesc()).setWarning(PassStatusEnum.YELLOW_CODE.getDesc());
-        } else if ((resultDTO.getPctgkryDTO().getPctztDTO() != null && resultDTO.getPctgkryDTO().getPctztDTO().getRyztmc().equalsIgnoreCase("在逃"))
-                || StrUtil.containsAnyIgnoreCase(hcjg, RchljgEnum.CAPTURE.getDesc()) || StrUtil.containsAnyIgnoreCase(hcjg, RchljgEnum.INTERCEPT.getDesc())) {
-            //在逃接口返回并且ryztmc字段为在逃 或 人车核录接口返回抓捕或者拦截
+        if (jkmInfo != null) {
+            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())) {
+                //黄码
+                rshyVo.setPassStatus(PassStatusEnum.YELLOW_CODE).setKind("健康码" + PassStatusEnum.YELLOW_CODE.getDesc()).setWarning(PassStatusEnum.YELLOW_CODE.getDesc());
+            }
+        } else if (resultDTO.getPctgkryDTO().getPctztDTO() != null && resultDTO.getPctgkryDTO().getPctztDTO().getRyztmc().equalsIgnoreCase("在逃")) {
+            //在逃接口返回并且ryztmc字段为在逃
+            rshyVo.setXm(resultDTO.getPctgkryDTO().getPctztDTO().getXm());
+            rshyVo.setPassStatus(PassStatusEnum.NO_PASSING).setKind(kind(resultDTO)).setWarning(warning(resultDTO));
+        } else if (StrUtil.containsAnyIgnoreCase(hcjg, RchljgEnum.CAPTURE.getDesc()) || StrUtil.containsAnyIgnoreCase(hcjg, RchljgEnum.INTERCEPT.getDesc())) {
+            //人车核录接口返回抓捕或者拦截
+            if (StrUtil.isNotBlank(resultDTO.getPctrchlDTO().getXm()))
+                rshyVo.setXm(resultDTO.getPctrchlDTO().getXm());
             rshyVo.setPassStatus(PassStatusEnum.NO_PASSING).setKind(kind(resultDTO)).setWarning(warning(resultDTO));
         } else if (!ObjectUtils.allFieldIsNULL(resultDTO.getPctgkryDTO()) || StrUtil.containsAnyIgnoreCase(hcjg, RchljgEnum.IN_DOUBT.getDesc())) {
             //七大类管控人员和人车核录接口返回存疑人员

+ 2 - 0
src/main/java/com/rshy/project/hy/server/dto/PctztDTO.java

@@ -9,6 +9,8 @@ import lombok.Data;
  */
 @Data
 public class PctztDTO {
+    private String xm;
+
     private String ztrylxmc;
 
     private String jyaq;