Selaa lähdekoodia

身份信息存在证件照片的情况下 不调用接口

FanQun 2 vuotta sitten
vanhempi
commit
8acf32d970

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

@@ -107,16 +107,18 @@ public class RshyJkManagerImpl implements RshyJkManager {
             resultDTO.setPctjkmInfoDTO(jkmInfo);
             if (rshyParam.getIdentity() == null) {
                 saveBarcode2DB(jkmInfo.getBar_code(), jkmInfo.getId_num());
+            } else {
+                rshyVo.setPhoto(rshyParam.getIdentity().getPhoto());
             }
         } else {
             rshyVo.setSfzh(rshyParam.getSfzh());
-            if (rshyParam.getIdentity() != null) {
+            if (rshyParam.getIdentity() == null) {
+                saveBarcode2DB(StrUtil.EMPTY, rshyParam.getSfzh());
+            } else {
                 rshyVo.setXm(rshyParam.getIdentity().getName());
                 rshyVo.setPhone(rshyParam.getIdentity().getPhone());
                 rshyVo.setAddress(rshyParam.getIdentity().getAddress());
                 rshyVo.setPhoto(rshyParam.getIdentity().getPhoto());
-            } else {
-                saveBarcode2DB(StrUtil.EMPTY, rshyParam.getSfzh());
             }
         }
         int jkmUsedTime = (int) DateUtil.between(beginDate, DateTime.now(), DateUnit.MS);
@@ -141,7 +143,9 @@ public class RshyJkManagerImpl implements RshyJkManager {
                 add(() -> resultDTO.setPcthsResultDTO(itfwServer.getPcths(rshyParam.getSfzh(), rshyParam.getTimeout())));
                 add(() -> resultDTO.setPctxcmResultDTO(itfwServer.getPctxcm(rshyParam.getSfzh(), rshyParam.getTimeout())));
                 if (StrUtil.isBlank(rshyParam.getXm())) {   // 刷健康码或者手动输入身份证号码,获取证件照片
-                    add(() -> resultDTO.setPctzjzpResultDTO(itfwServer.getPctzjzp(rshyParam.getSfzh(), rshyParam.getTimeout())));
+                    if (rshyVo.getPhoto() == null) {
+                        add(() -> resultDTO.setPctzjzpResultDTO(itfwServer.getPctzjzp(rshyParam.getSfzh(), rshyParam.getTimeout())));
+                    }
                 } else {
                     add(() -> itfwServer.savePhoto2DB(rshyParam.getSfzh(), rshyParam.getPhoto()));
                     rshyVo.setPhoto(null);