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

Commit 08643646 authored by anjiabin's avatar anjiabin

修改nft用户注册

parent 8e3e70bf
......@@ -23,6 +23,6 @@ public class GalaxyConstant {
public static final String SERIES_NAME_PREFIX="NOW_ZXL_";// 系列存储目录名称和系列声明
public static final String ADAM_USER_SYNC_URL="/rsc/syn/certmeta";// adam用户开通数字账户信息同步url
public static final String ADAM_USER_SYNC_URL="/adam/rsc/syn/certmeta";// adam用户开通数字账户信息同步url
}
......@@ -86,11 +86,14 @@ public class ZxinUserCommonBiz {
//是否绑定区块链地址
boolean isBindBlockAddressSuccess = false;
GalaxyUserRegisterRespDto respDto = GalaxyUserRegisterRespDto.getNew();
//用户信息
GalaxyUserInfoBo userInfoBo = null;
try{
/**
* todo 把助记词进行redis存储 key=userID mnemonic/index/userIdentification/address
*/
GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouterType(),userId);
userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouterType(),userId);
if(userInfoBo!=null){
mnemonic = userInfoBo.getMnemonic();
if(StringUtil.isNotEmpty(userInfoBo.getBlockChainAddress())){
......@@ -211,6 +214,7 @@ public class ZxinUserCommonBiz {
respDto.setBlockChainAddress(address);
isBindBlockAddressSuccess = true;
userInfoBo.setBlockChainAddress(address);
}else{
throw new GalaxyNftUserException(nft016Resp.getCode(),nft016Resp.getMessage());
}
......@@ -226,6 +230,17 @@ public class ZxinUserCommonBiz {
log.error(e.getMessage(),e);
}
//如果实名认证成功-更新数据库
if(isRealNameAuthSuccess){
if(StringUtil.isNotNull(userInfoBo)){
userInfoBo.setUserName(userName);
userInfoBo.setMobile(mobile);
userInfoBo.setIdCardType(idCardType);
userInfoBo.setIdCard(idCard);
dataUtils.updateGalaxyUserInfo(reqDto.getRouterType(),reqDto.getUserId(),userInfoBo);
}
}
try{
//同步用户数字账户开通信息
boolean isOpenAccount = syncOpenAccount(reqDto,respDto.getBlockChainAddress(),bizFailDesc,sysFailDesc,isRealNameAuthSuccess,isBindBlockAddressSuccess);
......@@ -319,7 +334,7 @@ public class ZxinUserCommonBiz {
}
//设置错误信息到redis
if(StringUtil.isNotEmpty(resultCode)){
if(StringUtil.isNotEmpty(resultCode)&&!resultCode.equalsIgnoreCase(NftAccStatusEnum.StatusAcc.SUCCESS.getCode())){
//开户失败记录缓存 {goblin:nft:certmeta:{idType+idNo},{idname,mobile}}
dataUtils.getRedisUtil().set(GoblinRedisConst.REDIS_GOBLIN_NFT_CERTMETA_JUNK.concat(reqDto.getIdCardType().concat(reqDto.getIdCard()))
,reqDto.getUserName().concat(",").concat(reqDto.getMobile()),openAccFailKeyExpireTime);
......
......@@ -2,7 +2,6 @@ package com.liquidnet.service.galaxy.utils;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.galaxy.biz.GalaxyBeanTransferBiz;
......@@ -11,17 +10,11 @@ import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.dto.bo.*;
import com.liquidnet.service.galaxy.dto.vo.mongo.GalaxyNftOrderFailLogVo;
import com.liquidnet.service.galaxy.dto.vo.mongo.GalaxyNftTradeVo;
import com.liquidnet.service.galaxy.dto.vo.mongo.GalaxySeriesNftInfoVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 该类为redis+mysql
......@@ -62,15 +55,12 @@ public abstract class AbstractDataUtils {
String userType = GalaxyEnum.RegisterTypeEnum.PERSON.getCode();
this.getRedisUtil().set(GalaxyConstant.REDIS_KEY_GALAXY_USER.concat(routerType).concat(":") + userId,userInfoBo);
// insert into galaxy_user_info (mid, user_id, user_name, user_type, mobile, id_card_type
// , id_card, mnemonic, index,user_identification, user_pub_key
// , user_pri_key, block_chain_address, router_type,created_at, updated_at)
// update galaxy_user_info set user_name = ?,id_card_type = ?,id_card = ?,mobile = ?,block_chain_address = ? where router_type = ? and user_id = ?
try{
this.getQueueUtil().sendMySqlRedis(
SqlMapping.get("galaxy_user_info.insert"),
new Object[]{userId,userInfoBo.getUserName(),userType,userInfoBo.getMobile(),userInfoBo.getIdCardType()
,userInfoBo.getIdCard(),userInfoBo.getMnemonic(),userInfoBo.getIndex(),userInfoBo.getUserIdentification(),userInfoBo.getUserPubKey()
,userInfoBo.getUserPriKey(),userInfoBo.getBlockChainAddress(),userInfoBo.getRouterType(),new Date(),null
SqlMapping.get("galaxy_user_info.update"),
new Object[]{userInfoBo.getUserName(),userInfoBo.getIdCardType(),userInfoBo.getIdCard(),userInfoBo.getMobile()
,userInfoBo.getBlockChainAddress(),new Date(),userInfoBo.getRouterType(),userInfoBo.getUserId()
}
, MQConst.GalaxyQueue.SQL_USER_INFO.getKey()
);
......@@ -190,28 +180,28 @@ public abstract class AbstractDataUtils {
}
public void updateSeriesClaimStatus(String routerType,String seriesCode, GalaxySeriesInfoBo seriesInfoBo) {
this.getRedisUtil().set(GalaxyConstant.REDIS_KEY_GALAXY_SERIES.concat(routerType).concat(":") + seriesCode,seriesInfoBo);
String nowTimeStr = DateUtil.Formatter.yyyyMMddHHmmss.format(LocalDateTime.now());
try{
this.getQueueUtil().sendMySqlRedis(
SqlMapping.get("galaxy_series_info.updateSeriesIdAndStatus"),
new Object[]{seriesInfoBo.getSeriesId(),seriesInfoBo.getChainTimestamp(),seriesInfoBo.getTradeHash(),seriesInfoBo.getSeriesClaimStatus(),nowTimeStr,seriesInfoBo.getSeriesCode()}
, MQConst.GalaxyQueue.SQL_SERIES_INFO.getKey()
);
}catch(Exception e){
log.error(e.getMessage(),e);
log.error("#updateSeriesClaimStatus error ==> MESSAGE:{}",e.getMessage());
}
//更新系列对应的系列nft状态
List<String> skuIdList = this.getSkuIdListBySeriesCode(seriesCode);
skuIdList.stream().forEach(skuId -> {
GalaxySeriesNftInfoBo seriesNftInfoBo = this.getSeriesNftInfoBo(routerType,skuId);
seriesNftInfoBo.setSeriesId(seriesInfoBo.getSeriesId());
seriesNftInfoBo.setUpdatedAt(LocalDateTime.now());
this.updateSeriesNftStatus(routerType,skuId,seriesNftInfoBo);
});
// this.getRedisUtil().set(GalaxyConstant.REDIS_KEY_GALAXY_SERIES.concat(routerType).concat(":") + seriesCode,seriesInfoBo);
//
// String nowTimeStr = DateUtil.Formatter.yyyyMMddHHmmss.format(LocalDateTime.now());
// try{
// this.getQueueUtil().sendMySqlRedis(
// SqlMapping.get("galaxy_series_info.updateSeriesIdAndStatus"),
// new Object[]{seriesInfoBo.getSeriesId(),seriesInfoBo.getChainTimestamp(),seriesInfoBo.getTradeHash(),seriesInfoBo.getSeriesClaimStatus(),nowTimeStr,seriesInfoBo.getSeriesCode()}
// , MQConst.GalaxyQueue.SQL_SERIES_INFO.getKey()
// );
// }catch(Exception e){
// log.error(e.getMessage(),e);
// log.error("#updateSeriesClaimStatus error ==> MESSAGE:{}",e.getMessage());
// }
//
// //更新系列对应的系列nft状态
// List<String> skuIdList = this.getSkuIdListBySeriesCode(seriesCode);
// skuIdList.stream().forEach(skuId -> {
// GalaxySeriesNftInfoBo seriesNftInfoBo = this.getSeriesNftInfoBo(routerType,skuId);
// seriesNftInfoBo.setSeriesId(seriesInfoBo.getSeriesId());
// seriesNftInfoBo.setUpdatedAt(LocalDateTime.now());
// this.updateSeriesNftStatus(routerType,skuId,seriesNftInfoBo);
// });
}
public void updateSeriesNftStatus(String routerType,String skuId, GalaxySeriesNftInfoBo seriesNftInfoBo) {
......@@ -232,28 +222,7 @@ public abstract class AbstractDataUtils {
}
}
//根据系列Id获取
public List<String> getSkuIdListBySeriesCode(String seriesCode){
//根据演出id获取用户信息 只查询5条
List<String> skuIdList = new ArrayList<>();
//获取总数
Criteria criteria = Criteria.where("seriesCode").is(seriesCode);
Query query = Query.query(criteria);
long startTime = System.currentTimeMillis();
List<GalaxySeriesNftInfoVo> seriesNftInfoVoList = this.getMongoTemplate().find(query, GalaxySeriesNftInfoVo.class, GalaxySeriesNftInfoVo.class.getSimpleName());
long endTime = System.currentTimeMillis();
log.info("getSkuIdListBySeriesCode 根据系列code获取skuId 耗时:{}ms",endTime-startTime);
//根据用户id获取头像信息
if(StringUtil.isNotNull(seriesNftInfoVoList)){
skuIdList = seriesNftInfoVoList.stream().map(GalaxySeriesNftInfoVo::getSkuId).collect(Collectors.toList());
}
return skuIdList;
}
// //根据系列Id获取 一个系列对应多个skuId
//根据系列Id获取 一个系列对应多个skuId
// public List<String> getSkuIdListBySeriesCode(String seriesCode){
// //根据演出id获取用户信息 只查询5条
// List<String> skuIdList = new ArrayList<>();
......
......@@ -11,6 +11,8 @@ galaxy_nft_trade_info.insert=insert into galaxy_nft_trade_info (user_id, nft_id,
# ------------------------数字藏品发行购买失败记录----------------------------
galaxy_nft_order_fail_log.insert=insert into galaxy_nft_order_fail_log (nft_order_pay_id, user_id, nft_id, nft_name, series_name, series_id,series_code, taskId, fail_reason_desc, fail_reason_desc_second, deal_with_status, trade_type,router_type, created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------更新用户注册信息----------------------------
galaxy_user_info.update=update galaxy_user_info set user_name = ?,id_card_type = ?,id_card = ?,mobile = ?,block_chain_address = ?,updated_at =? where router_type = ? and user_id = ?
# ------------------------更新系列声明信息----------------------------
galaxy_series_info.updateSeriesIdAndStatus=update galaxy_series_info t set t.series_id = ?,t.chain_timestamp = ?,t.trade_hash = ?,t.series_claim_status = ? ,t.updated_at =? where t.series_code = ?
# ------------------------更新系列NFT信息----------------------------
......
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