Browse Source

身份信息持久化

FanQun 2 years ago
parent
commit
dc1fbbd09e

+ 8 - 4
src/main/java/com/rshy/project/hy/manager/impl/RshyJkManagerImpl.java

@@ -89,7 +89,7 @@ public class RshyJkManagerImpl implements RshyJkManager {
         if (StringUtils.isNotBlank(rshyParam.getBarCode()) && StringUtils.isBlank(rshyParam.getSfzh())) {
             try {
                 //查询健康码信息
-                jkmInfo = itfwServer.getPctjkm(rshyParam.getBarCode(), rshyParam.getSfzh(), jkmTimeout);
+                jkmInfo = itfwServer.getPctjkm(rshyParam.getBarCode(), StrUtil.EMPTY, jkmTimeout);
             } catch (Exception e) {
                 log.error("查询健康码信息异常:{}", e.getMessage());
                 //e.printStackTrace();
@@ -104,6 +104,7 @@ public class RshyJkManagerImpl implements RshyJkManager {
             rshyParam.setSfzh(jkmInfo.getId_num());
             rshyVo.setSfzh(jkmInfo.getId_num()).setXm(jkmInfo.getUser_name()).setHealthCode(jkmInfo.getColor_code_label()).setPhone(jkmInfo.getPn());
             saveIdentity(rshyParam.getBarCode(), rshyVo);
+            resultDTO.setPctjkmInfoDTO(jkmInfo);
         } else {
             rshyVo.setSfzh(rshyParam.getSfzh());
             if (rshyParam.getIdentity() != null) {
@@ -125,7 +126,7 @@ public class RshyJkManagerImpl implements RshyJkManager {
         AtomicReference<RshyVo> quickRshyVo = new AtomicReference<>(new RshyVo());
         List<Runnable> taskList = new ArrayList<Runnable>() {
             {
-                if (StrUtil.isBlank(rshyParam.getBarCode())) {
+                if (resultDTO.getPctjkmInfoDTO() == null) {
                     add(() -> resultDTO.setPctjkmInfoDTO(itfwServer.getPctjkm("", rshyParam.getSfzh(), rshyParam.getTimeout())));
                 }
                 add(() -> resultDTO.setPctsfzResult(itfwServer.getPctsfz(rshyParam.getSfzh(), rshyParam.getTimeout())));
@@ -256,8 +257,9 @@ public class RshyJkManagerImpl implements RshyJkManager {
         }
 
         //System.out.println(JSONObject.toJSONString(resultDTO));
-        saveIdentity(StrUtil.EMPTY, rshyVo);
-
+        if (resultDTO.getPctjkmInfoDTO() != null) {
+            saveIdentity(resultDTO.getPctjkmInfoDTO().getBar_code(), rshyVo);
+        }
         return new AsyncResult<>(rshyVo);
     }
 
@@ -278,6 +280,8 @@ public class RshyJkManagerImpl implements RshyJkManager {
             executorService.submit(() -> {
                 try {
                     r.run();
+                } catch (Exception e) {
+                    log.error("异常信息:{}", e.getMessage());
                 } finally {
                     latch.countDown();
                 }