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

Commit cb34c395 authored by 张国柄's avatar 张国柄

~api:开通数字账号实名逻辑调整;

parent a493ea88
...@@ -92,12 +92,12 @@ public class AdamRealNameServiceImpl implements IAdamRealNameService { ...@@ -92,12 +92,12 @@ public class AdamRealNameServiceImpl implements IAdamRealNameService {
delUserRealInfoObjs = CollectionUtil.linkedListObjectArr(), delUserRealInfoObjs = CollectionUtil.linkedListObjectArr(),
updateUserMobileLocateObjs = CollectionUtil.linkedListObjectArr(); updateUserMobileLocateObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("adam_real_name.add"));
initUserRealInfoObjs.add(paramList.toArray());
toMqSqls.add(SqlMapping.get("adam_real_name.del")); toMqSqls.add(SqlMapping.get("adam_real_name.del"));
if (updateFlg) { if (updateFlg) {
delUserRealInfoObjs.add(new Object[]{realName.getCreatedAt(), realName.getUid()}); delUserRealInfoObjs.add(new Object[]{realName.getCreatedAt(), realName.getUid()});
} }
toMqSqls.add(SqlMapping.get("adam_real_name.add"));
initUserRealInfoObjs.add(paramList.toArray());
String mobile = (String) CurrentUtil.getTokenClaims().get(CurrentUtil.TOKEN_MOBILE); String mobile = (String) CurrentUtil.getTokenClaims().get(CurrentUtil.TOKEN_MOBILE);
String[] mobileLocateArr = adamRdmService.getMobileLocateArr(mobile); String[] mobileLocateArr = adamRdmService.getMobileLocateArr(mobile);
...@@ -115,7 +115,7 @@ public class AdamRealNameServiceImpl implements IAdamRealNameService { ...@@ -115,7 +115,7 @@ public class AdamRealNameServiceImpl implements IAdamRealNameService {
// ); // );
queueUtils.sendMsgByRedis( queueUtils.sendMsgByRedis(
MQConst.AdamQueue.SQL_UCENTER.getKey(), MQConst.AdamQueue.SQL_UCENTER.getKey(),
SqlMapping.gets(toMqSqls, initUserRealInfoObjs, delUserRealInfoObjs, updateUserMobileLocateObjs) SqlMapping.gets(toMqSqls, delUserRealInfoObjs, initUserRealInfoObjs, updateUserMobileLocateObjs)
); );
log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s); log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s);
} }
......
...@@ -55,6 +55,26 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService { ...@@ -55,6 +55,26 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService {
} }
if (AdamEnum.BizAcct.NFT_ZX.name().equals(bizCode)) { if (AdamEnum.BizAcct.NFT_ZX.name().equals(bizCode)) {
boolean inputNameIdCardInvalidFlg = StringUtils.isBlank(name) || name.contains("*") || StringUtils.isBlank(idCard) || idCard.contains("*");
AdamRealInfoVo realInfoVo = adamRdmService.getRealInfoVoByUidPlain(uid);
if (null != realInfoVo) {// 账号已实名
if (realInfoVo.getNode() == 2) {// 二要素认证的
if (inputNameIdCardInvalidFlg) {
name = realInfoVo.getName();
idCard = realInfoVo.getIdCard();
}
adamUserService.identityForUpsert(uid, name, idCard, mobile, true);
} else {// 三要素认证的
name = realInfoVo.getName();
idCard = realInfoVo.getIdCard();
}
} else {// 账号未实名
if (inputNameIdCardInvalidFlg) {
return ResponseDto.failure(ErrorMapping.get("10101"));
}
adamUserService.identityForUpsert(uid, name, idCard, mobile, false);
}
ResponseDto<AdamUserBizAcctVo> responseDto = this.openAccountForNftZXin(uid, name, idCard, mobile); ResponseDto<AdamUserBizAcctVo> responseDto = this.openAccountForNftZXin(uid, name, idCard, mobile);
if (responseDto.isSuccess()) { if (responseDto.isSuccess()) {
AdamUserBizAcctVo userBizAcctVo = responseDto.getData(); AdamUserBizAcctVo userBizAcctVo = responseDto.getData();
...@@ -80,7 +100,7 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService { ...@@ -80,7 +100,7 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService {
} }
return responseDto; return responseDto;
} }
log.error("#开通业务账号:无效的业务码[UID={},bizCode={}]", bizCode, uid); log.warn("#开通业务账号:无效的业务码[UID={},bizCode={}]", bizCode, uid);
return ResponseDto.failure(); return ResponseDto.failure();
} }
...@@ -94,25 +114,6 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService { ...@@ -94,25 +114,6 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService {
* @return ResponseDto<AdamUserBizAcctVo> * @return ResponseDto<AdamUserBizAcctVo>
*/ */
private ResponseDto<AdamUserBizAcctVo> openAccountForNftZXin(String uid, String name, String idCard, String mobile) { private ResponseDto<AdamUserBizAcctVo> openAccountForNftZXin(String uid, String name, String idCard, String mobile) {
AdamRealInfoVo realInfoVo = adamRdmService.getRealInfoVoByUidPlain(uid);
if (StringUtils.isBlank(name) || name.contains("*")) {
if (null == realInfoVo) {
return ResponseDto.failure(ErrorMapping.get("10102"));
}
name = realInfoVo.getName();
idCard = realInfoVo.getIdCard();
if (realInfoVo.getNode() != 3) {// 非三要素认证先做认证
adamUserService.identityForUpsert(uid, name, idCard, mobile, true);
}
} else {
if (null == realInfoVo || (3 != realInfoVo.getNode() && (!realInfoVo.getName().equals(name) || !realInfoVo.getIdCard().equals(idCard)))) {
adamUserService.identityForUpsert(uid, name, idCard, mobile, true);
} else {
name = realInfoVo.getName();
idCard = realInfoVo.getIdCard();
}
}
ObjectNode postBodyNode = JsonUtils.OM().createObjectNode(); ObjectNode postBodyNode = JsonUtils.OM().createObjectNode();
postBodyNode.put("routerType", "zxinchain"); postBodyNode.put("routerType", "zxinchain");
postBodyNode.put("idCardType", "1"); postBodyNode.put("idCardType", "1");
......
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