Kaynağa Gözat

当刷身份证是 身份证问题 格式后缀为x 是处理问题

cuimengchao 3 yıl önce
ebeveyn
işleme
df9f3ef1ee

+ 6 - 2
src/main/java/com/yx/face/service/impl/FaceTBServiceImpl.java

@@ -555,7 +555,7 @@ public class FaceTBServiceImpl implements FaceTBService {
             }
 //            if (verifytype == 2) {
             Map<String, Object> map = (Map<String, Object>) data.get("idCard");
-            if (map!=null && !map.isEmpty()) {
+            if (map != null && !map.isEmpty()) {
                 log.info("verifytype==2 代表刷身份证解析身份证 ;{}", data.get("idCard"));
                 //身份证信息
 //                Map<String, Object> map = (Map<String, Object>) data.get("idCard");
@@ -606,7 +606,11 @@ public class FaceTBServiceImpl implements FaceTBService {
             if (StringUtils.hasText(photo)) {
                 photo = buildImage(photo, sn + pin);
             }
-            userId = Long.valueOf(pin);
+            if (verifytype == 0) {
+                userId = Long.valueOf(pin);
+            } else {
+                userId = 0L;
+            }
             if (verifytype == 0) {
                 if (facePassDao.getFacePassBySn(sn, userId, DateUtils.addMinutes(now, -2)) == null) {
                     continue;