Browse Source

缓存优化

FanQun 2 years ago
parent
commit
d40ea0e0a4

+ 9 - 8
src/main/java/com/rshy/project/hy/web/controller/RshyController.java

@@ -50,7 +50,7 @@ public class RshyController {
 
     @GetMapping(value = "/version")
     public String version() {
-        return "1.2.4.220607";
+        return "1.2.4.220613";
     }
 
     @ApiOperation("普通核验模式")
@@ -75,17 +75,18 @@ public class RshyController {
 
         log.info("普通核验接口请求参数:{}", JSON.toJSONString(rshyParam));
 
+        RshyVo rshyVo = new RshyVo().setPassStatus(PassStatusEnum.NORMAL_TRAFFIC);
         String sfz = rshyParam.getSfzh();
         if (StrUtil.isNotBlank(rshyParam.getBarCode())) {
             sfz = identityService.getIdNum(rshyParam.getBarCode());
         }
-        Identity identity = identityService.getIdentity(sfz);
-
-        RshyVo rshyVo = new RshyVo().setPassStatus(PassStatusEnum.NORMAL_TRAFFIC);
-        if (identity != null) {
-            rshyVo.setXm(identity.getName()).setSfzh(identity.getIdNum()).setPhone(identity.getPhone());
-            rshyParam.setSfzh(identity.getIdNum());
-            rshyParam.setIdentity(identity);
+        if (StrUtil.isNotBlank(sfz)) {
+            Identity identity = identityService.getIdentity(sfz);
+            if (identity != null) {
+                rshyVo.setXm(identity.getName()).setSfzh(identity.getIdNum()).setPhone(identity.getPhone());
+                rshyParam.setSfzh(identity.getIdNum());
+                rshyParam.setIdentity(identity);
+            }
         }
         try {
             //RshyVo rshyVo = rshyJkManager.getRshyInfo(rshyParam);