记得上下班打卡 | git大法好,push需谨慎

Commit f8ee052d authored by jiangxiulong's avatar jiangxiulong

Merge remote-tracking branch 'origin/dev_nft_411' into dev_nft_411

parents 8dc130d7 7408674a
...@@ -23,7 +23,7 @@ public class IdentityUtils { ...@@ -23,7 +23,7 @@ public class IdentityUtils {
try { try {
return HttpUtil.post(aliThirdUrl, params, header); return HttpUtil.post(aliThirdUrl, params, header);
} catch (Exception e) { } catch (Exception e) {
log.error("###实名认证异常:{}", e.getLocalizedMessage(), e); log.error("###实名认证异常:{}", params, e);
if (e instanceof UnknownHttpStatusCodeException) { if (e instanceof UnknownHttpStatusCodeException) {
UnknownHttpStatusCodeException unknownHttpStatusCodeException = (UnknownHttpStatusCodeException) e; UnknownHttpStatusCodeException unknownHttpStatusCodeException = (UnknownHttpStatusCodeException) e;
...@@ -52,7 +52,7 @@ public class IdentityUtils { ...@@ -52,7 +52,7 @@ public class IdentityUtils {
try { try {
return HttpUtil.get(ALI_MOBILE_CERT_HOST.concat(ALI_MOBILE_CERT3_META_URI), paramsMap, headersMap); return HttpUtil.get(ALI_MOBILE_CERT_HOST.concat(ALI_MOBILE_CERT3_META_URI), paramsMap, headersMap);
} catch (Exception e) { } catch (Exception e) {
log.error("###实名认证异常:{}", e.getLocalizedMessage(), e); log.error("###实名认证异常:{}", paramsMap, e);
if (e instanceof UnknownHttpStatusCodeException) { if (e instanceof UnknownHttpStatusCodeException) {
UnknownHttpStatusCodeException unknownHttpStatusCodeException = (UnknownHttpStatusCodeException) e; UnknownHttpStatusCodeException unknownHttpStatusCodeException = (UnknownHttpStatusCodeException) e;
return unknownHttpStatusCodeException.getMessage(); return unknownHttpStatusCodeException.getMessage();
......
...@@ -220,15 +220,6 @@ public class AdamRdmService { ...@@ -220,15 +220,6 @@ public class AdamRdmService {
return !StringUtils.isEmpty(o) && o.equals(idName); return !StringUtils.isEmpty(o) && o.equals(idName);
} }
public boolean setCertmetaJunk(int idType, String idNo, String idName, String mobile) {
return redisUtil.set(AdamRedisConst.INFO_CERTMETA_JUNK + idType + idNo, idName.concat(",").concat(mobile), 604800);
}
public boolean isCertmetaJunk(int idType, String idNo, String idName, String mobile) {
String val = (String) redisUtil.get(AdamRedisConst.INFO_CERTMETA_JUNK + idType + idNo);
return !StringUtils.isEmpty(val) && val.equals(idName.concat(",").concat(mobile));
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 认证成功的<ID_TYPE+ID_NO, ID_NAME> */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 认证成功的<ID_TYPE+ID_NO, ID_NAME> */
/** /**
...@@ -311,19 +302,52 @@ public class AdamRdmService { ...@@ -311,19 +302,52 @@ public class AdamRdmService {
* @param mobile * @param mobile
*/ */
public void identityHandler3(String name, String idCard, String mobile) { public void identityHandler3(String name, String idCard, String mobile) {
if (this.isCertmetaJunk(1, idCard, name, mobile)) { switch (this.isCertmeta(1, idCard, name, mobile)) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10112"); case -1:// 本地不存在
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage()); if (this.isCertmetaJunk(1, idCard, name, mobile)) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10112");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
String respStr = IdentityUtils.ali3Meta(name, idCard, mobile);
JsonNode respJNode = JsonUtils.fromJson(respStr, JsonNode.class);
if (null == respJNode || !"200".equals(respJNode.get("code").asText())
|| !respJNode.get("data").get("bizCode").asText().equals("1")) {
log.warn("###实名认证失败[{}]", respStr);
this.setCertmetaJunk(1, idCard, name, mobile);
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10112");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
this.setCertmeta(1, idCard, name, mobile);
break;
case 0:// 本地存在,验证不通过
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10112");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
case 1:// 本地存在,验证通过
break;
} }
String respStr = IdentityUtils.ali3Meta(name, idCard, mobile); }
JsonNode respJNode = JsonUtils.fromJson(respStr, JsonNode.class);
if (null == respJNode || !"200".equals(respJNode.get("code").asText()) /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 三要素认证缓存的<ID_TYPE+ID_NO, "ID_NAME,MOBILE"> */
|| !respJNode.get("data").get("bizCode").asText().equals("1")) {
log.warn("###实名认证失败[{}]", respStr); public boolean setCertmetaJunk(int idType, String idNo, String idName, String mobile) {
this.setCertmetaJunk(1, idCard, name, mobile); return redisUtil.set(AdamRedisConst.INFO_CERTMETA_JUNK + idType + idNo, idName.concat(",").concat(mobile), 604800);
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10112"); }
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
public boolean isCertmetaJunk(int idType, String idNo, String idName, String mobile) {
String val = (String) redisUtil.get(AdamRedisConst.INFO_CERTMETA_JUNK + idType + idNo);
return !StringUtils.isEmpty(val) && val.equals(idName.concat(",").concat(mobile));
}
public boolean setCertmeta(int idType, String idNo, String idName, String mobile) {
return redisUtil.set(AdamRedisConst.INFO_CERTMETA + idType + idNo, idName.concat(",").concat(mobile));
}
public int isCertmeta(int idType, String idNo, String idName, String mobile) {
String o = (String) redisUtil.get(AdamRedisConst.INFO_CERTMETA + idType + idNo);
if (StringUtils.isEmpty(o)) {
return -1;
} }
return o.equals(idName.concat(",").concat(mobile)) ? 1 : 0;
} }
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <UID, List<AdamThirdPartInfoVo>> */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <UID, List<AdamThirdPartInfoVo>> */
......
...@@ -54,7 +54,8 @@ public class AdamEntersServiceImpl implements IAdamEntersService { ...@@ -54,7 +54,8 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
// //
// adamRdmService.setCertification(1, parameter.getIdCard(), parameter.getName()); // adamRdmService.setCertification(1, parameter.getIdCard(), parameter.getName());
// } // }
adamRdmService.identityHandler1(currentUid, parameter.getName(), parameter.getIdCard()); // adamRdmService.identityHandler1(currentUid, parameter.getName(), parameter.getIdCard());
adamRdmService.identityHandler3(parameter.getName(), parameter.getIdCard(), parameter.getMobile());
} }
...@@ -134,7 +135,8 @@ public class AdamEntersServiceImpl implements IAdamEntersService { ...@@ -134,7 +135,8 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
// //
// adamRdmService.setCertification(1, parameter.getIdCard(), parameter.getName()); // adamRdmService.setCertification(1, parameter.getIdCard(), parameter.getName());
// } // }
adamRdmService.identityHandler1(currentUid, parameter.getName(), parameter.getIdCard()); // adamRdmService.identityHandler1(currentUid, parameter.getName(), parameter.getIdCard());
adamRdmService.identityHandler3(parameter.getName(), parameter.getIdCard(), parameter.getMobile());
} }
List<AdamEntersVo> vos = adamRdmService.getEntersVoByUid(currentUid); List<AdamEntersVo> vos = adamRdmService.getEntersVoByUid(currentUid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment