Browse Source

增加核酸结果是否判断核验结果的开关
人车核录接口填入登录警员的信息

FanQun 2 years ago
parent
commit
59269e7a91

+ 11 - 10
src/main/java/com/rshy/project/hy/manager/impl/RshyJkManagerImpl.java

@@ -30,6 +30,7 @@ import com.rshy.project.hy.util.ObjectUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.context.annotation.DependsOn;
+import org.springframework.core.env.Environment;
 import org.springframework.core.task.support.ExecutorServiceAdapter;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.scheduling.annotation.Async;
@@ -72,6 +73,8 @@ public class RshyJkManagerImpl implements RshyJkManager {
     private ThreadPoolTaskExecutor poolTaskExecutor;
     @Resource
     private IdentityService identityService;
+    @Resource
+    private Environment environment;
 
     @Override
     @Async("hstTaskExecutor")
@@ -166,7 +169,7 @@ public class RshyJkManagerImpl implements RshyJkManager {
             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.setPctrchlDTO(itfwServer.getPctrchl(rshyParam.getSfzh(), rshyParam.getLoginInfo(), rshyParam.getTimeout())));
             taskList.add(() -> resultDTO.setPctzdrydkResultDTO(itfwServer.getPctzdrydk(rshyParam.getSfzh(), rshyParam.getTimeout())));
         }
 
@@ -224,16 +227,14 @@ public class RshyJkManagerImpl implements RshyJkManager {
         //人车核录核查结果
         String hcjg = resultDTO.getPctrchlDTO() == null ? "" : resultDTO.getPctrchlDTO().getHcjg();
 
+        boolean hsenable = Boolean.parseBoolean(environment.getProperty("zmt.hshy", "true"));
 
-//        if (rshyVo.getNucleic_acid().getStatus() == 0) {
-//            rshyVo.setPassStatus(PassStatusEnum.NON_CONFORMANCE).setKind(PassStatusEnum.NON_CONFORMANCE.getDesc()).setWarning(PassStatusEnum.NON_CONFORMANCE.getDesc());
-//        } else
-//        if (rshyVo.getTravel_card() != 0) {
-//            //行程码到过中高风险地区
-//            rshyVo.setPassStatus(PassStatusEnum.ABNORMAL_TRAVEL_CARD).setKind(PassStatusEnum.ABNORMAL_TRAVEL_CARD.getDesc());
-//        } else
-
-        if (jkmInfo != null && PassStatusEnum.RED_CODE.getDesc().equalsIgnoreCase(jkmInfo.getColor_code_label())) {
+        if (hsenable && rshyVo.getNucleic_acid().getStatus() == 0) {
+            rshyVo.setPassStatus(PassStatusEnum.NON_CONFORMANCE).setKind(PassStatusEnum.NON_CONFORMANCE.getDesc()).setWarning(PassStatusEnum.NON_CONFORMANCE.getDesc());
+        } else if (hsenable && rshyVo.getTravel_card() != 0) {
+            //行程码到过中高风险地区
+            rshyVo.setPassStatus(PassStatusEnum.ABNORMAL_TRAVEL_CARD).setKind(PassStatusEnum.ABNORMAL_TRAVEL_CARD.getDesc());
+        } else if (jkmInfo != null && 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 (jkmInfo != null && PassStatusEnum.YELLOW_CODE.getDesc().equalsIgnoreCase(jkmInfo.getColor_code_label())) {

+ 19 - 4
src/main/java/com/rshy/project/hy/server/ItfwServer.java

@@ -4,18 +4,18 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.codec.Base64;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson.JSON;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.rshy.project.hy.config.properties.*;
 import com.rshy.project.hy.model.constant.ItfwConstant;
 import com.rshy.project.hy.model.constant.WebConstant;
-import com.rshy.project.hy.model.entity.Identity;
 import com.rshy.project.hy.server.dto.*;
 import com.rshy.project.hy.server.param.AgentApiParam;
 import com.rshy.project.hy.server.param.IdphotoParam;
+import com.rshy.project.hy.server.param.LoginInfo;
 import com.rshy.project.hy.server.vo.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -589,7 +589,7 @@ public class ItfwServer {
      * @param idNumber
      * @param timeout
      */
-    public PctrchlDTO getPctrchl(String idNumber, Integer timeout) {
+    public PctrchlDTO getPctrchl(String idNumber, LoginInfo loginInfo, Integer timeout) {
         if (StringUtils.isBlank(idNumber)) {
             log.warn("身份证号码为空");
             return null;
@@ -611,7 +611,22 @@ public class ItfwServer {
         PctrchlProperties properties = new PctrchlProperties();
         BeanUtil.copyProperties(pctrchlProperties, properties);
         PctrchlBodyDTO pctrchlBodyDTO = new PctrchlBodyDTO();
-        pctrchlBodyDTO.setDlxx(new PctrchlDlxxDTO());
+        pctrchlBodyDTO.setExamineCode(RandomUtil.randomNumbers(12));
+        PctrchlDlxxDTO dlxx = new PctrchlDlxxDTO();
+        if (loginInfo != null) {
+            pctrchlBodyDTO.setDeviceIp(loginInfo.getIp());
+            dlxx.setDlip(loginInfo.getIp());
+            dlxx.setHcdz("杭州地铁 " + loginInfo.getLocation());
+            dlxx.setJyCode(loginInfo.getId());
+            dlxx.setJyName(loginInfo.getName());
+            dlxx.setXm(loginInfo.getName());
+            dlxx.setSfzh(loginInfo.getIdNum());
+            dlxx.setZsbh(loginInfo.getIdNum());
+            dlxx.setUserCode(loginInfo.getIdNum());
+            dlxx.setSjhm(loginInfo.getPhone());
+            dlxx.setOrgCode(loginInfo.getOrgCode());
+        }
+        pctrchlBodyDTO.setDlxx(dlxx);
         pctrchlBodyDTO.setRyxx(new PctrchlRyxxDTO().setZjhm(idNumber));
         properties.setBody(pctrchlBodyDTO);
         log.info("人车核录服务请求入参:{}", JSON.toJSONString(properties));

+ 9 - 9
src/main/java/com/rshy/project/hy/server/dto/PctrchlDlxxDTO.java

@@ -11,15 +11,15 @@ import lombok.experimental.Accessors;
 @Data
 @Accessors(chain = true)
 public class PctrchlDlxxDTO {
-    private String xm = "陈云刚";
-    private String sfzh = "331081198709099418";
-    private String sjhm = "13616542978";
+    private String xm = "倪建剑";
+    private String sfzh = "33900519851101511X";
+    private String sjhm = "13777581937";
     private String jgdm = "";
-    private String zsbh = "331081198709099418";
+    private String zsbh = "33900519851101511X";
     private String dlip = "41.196.218.11";
-    private String hcdz = "定安路地铁口";
-    private String userCode = "331081198709099418";
-    private String orgCode = "330103590000";
-    private String jyCode = "113826";
-    private String jyName = "陈云刚";
+    private String hcdz = "杭州地铁";
+    private String userCode = "33900519851101511X";
+    private String orgCode = "330196040000";
+    private String jyCode = "113829";
+    private String jyName = "倪建剑";
 }

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

@@ -32,7 +32,8 @@ swagger:
   application-description: 智能证码通核验接口
   try-host: http://localhost:${server.port}/${server.servlet.context-path}
 
-
+zmt:
+  hshy: false
 
 base:
   url: "http://10.118.128.114/agentProxy/agent/agentApi"