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

Commit 84972e08 authored by anjiabin's avatar anjiabin

实现百度链转让

parent 38c752fb
......@@ -9,6 +9,7 @@ import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftInfoBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxyTransferNftInfoBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftTransferQueryRespDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftTransferReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftTransferRespDto;
import com.liquidnet.service.galaxy.dto.vo.mongo.GalaxyNftOrderFailLogVo;
......@@ -186,4 +187,22 @@ public class GalaxyBeanTransferBiz {
respDto.setTransferHash(transferNftInfoBo.getTransferHash());
return respDto;
}
/**
* 构造nft转让结果查询
* @param transferNftInfoBo
* @return
*/
public GalaxyNftTransferQueryRespDto buildNftTransferQueryRespDto(GalaxyTransferNftInfoBo transferNftInfoBo){
GalaxyNftTransferQueryRespDto nftTransferQueryRespDto = GalaxyNftTransferQueryRespDto.getNew();
nftTransferQueryRespDto.setNftId(transferNftInfoBo.getNftId());
nftTransferQueryRespDto.setOwnerUserId(transferNftInfoBo.getOwnerUserId());
nftTransferQueryRespDto.setOwnerAddress(transferNftInfoBo.getOwnerAddress());
nftTransferQueryRespDto.setFromUserId(transferNftInfoBo.getUserId());
nftTransferQueryRespDto.setFromAddress(transferNftInfoBo.getAddress());
nftTransferQueryRespDto.setTransferTime(transferNftInfoBo.getCreatedAt());
nftTransferQueryRespDto.setRouterType(transferNftInfoBo.getRouterType());
nftTransferQueryRespDto.setTransferHash(transferNftInfoBo.getTransferHash());
return nftTransferQueryRespDto;
}
}
......@@ -261,17 +261,8 @@ public class XuperTradeBiz {
if(transferResponseDto.isSuccess()){
xuper008TransferShardRespDto = transferResponseDto.getParseData(Xuper008TransferShardRespDto.class);
if(String.valueOf(xuper008TransferShardRespDto.getErrNo()).equalsIgnoreCase(ErrorCode.SUCCESS.getCode())){
//查询获取交易hash
String transferHash = this.getTransferHash(receiveUserInfoBo,reqDto.getNftId());
//更新转让状态和拥有者信息(只有成功才更新拥有者信息)
transferNftInfoBo.setOwnerUserId(transferNftInfoBo.getReceiveUserId());
transferNftInfoBo.setOwnerAddress(transferNftInfoBo.getReceiveAddress());
transferNftInfoBo.setSeriesId(null);
transferNftInfoBo.setTransferStatus(GalaxyEnum.NftTransferStatusEnum.PROCESSING.getCode());
transferNftInfoBo.setTransferHash(transferHash);
transferNftInfoBo.setErrorCode(null);
transferNftInfoBo.setErrorMsg(null);
transferNftInfoBo.setUpdatedAt(DateUtil.getNowTime());
dataUtils.updateTransferNftInfoBo(reqDto.getRouterType(),reqDto.getTransOrderId(),transferNftInfoBo);
......@@ -311,15 +302,7 @@ public class XuperTradeBiz {
return ResponseDto.failure(GalaxyErrorEnum.NFT_TRANSFER_QUERY_ERROR.getCode(),GalaxyErrorEnum.NFT_TRANSFER_QUERY_ERROR.getMessage());
}
if(transferNftInfoBo.getTransferStatus().equalsIgnoreCase(GalaxyEnum.NftTransferStatusEnum.SUCCESS.getCode())){
GalaxyNftTransferQueryRespDto nftTransferQueryRespDto = GalaxyNftTransferQueryRespDto.getNew();
nftTransferQueryRespDto.setNftId(transferNftInfoBo.getNftId());
nftTransferQueryRespDto.setOwnerUserId(transferNftInfoBo.getOwnerUserId());
nftTransferQueryRespDto.setOwnerAddress(transferNftInfoBo.getOwnerAddress());
nftTransferQueryRespDto.setFromUserId(transferNftInfoBo.getUserId());
nftTransferQueryRespDto.setFromAddress(transferNftInfoBo.getAddress());
nftTransferQueryRespDto.setTransferTime(transferNftInfoBo.getCreatedAt());
nftTransferQueryRespDto.setRouterType(transferNftInfoBo.getRouterType());
nftTransferQueryRespDto.setTransferHash(transferNftInfoBo.getTransferHash());
GalaxyNftTransferQueryRespDto nftTransferQueryRespDto = galaxyBeanTransferBiz.buildNftTransferQueryRespDto(transferNftInfoBo);
return ResponseDto.success(nftTransferQueryRespDto);
}else if(transferNftInfoBo.getTransferStatus().equalsIgnoreCase(GalaxyEnum.NftTransferStatusEnum.PROCESSING.getCode())){
//获取用户信息
......@@ -330,28 +313,19 @@ public class XuperTradeBiz {
}
//查询获取交易hash
String transferHash = this.getTransferHash(receiveUserInfoBo,transferNftInfoBo.getNftId());
if(StringUtil.isNotEmpty(transferHash)){
//更新转让成功信息
transferNftInfoBo.setOwnerUserId(transferNftInfoBo.getReceiveUserId());
transferNftInfoBo.setOwnerAddress(transferNftInfoBo.getReceiveAddress());
transferNftInfoBo.setTransferStatus(GalaxyEnum.NftTransferStatusEnum.SUCCESS.getCode());
transferNftInfoBo.setTransferHash(transferHash);
transferNftInfoBo.setUpdatedAt(DateUtil.getNowTime());
dataUtils.updateTransferNftInfoBo(reqDto.getRouterType(),reqDto.getTransOrderId(),transferNftInfoBo);
//更新转让成功信息
transferNftInfoBo.setOwnerUserId(transferNftInfoBo.getReceiveUserId());
transferNftInfoBo.setOwnerAddress(transferNftInfoBo.getReceiveAddress());
transferNftInfoBo.setSeriesId(null);
transferNftInfoBo.setTransferStatus(GalaxyEnum.NftTransferStatusEnum.SUCCESS.getCode());
transferNftInfoBo.setTransferHash(transferHash);
transferNftInfoBo.setErrorCode(null);
transferNftInfoBo.setErrorMsg(null);
transferNftInfoBo.setUpdatedAt(DateUtil.getNowTime());
dataUtils.updateTransferNftInfoBo(reqDto.getRouterType(),reqDto.getTransOrderId(),transferNftInfoBo);
GalaxyNftTransferQueryRespDto nftTransferQueryRespDto = GalaxyNftTransferQueryRespDto.getNew();
nftTransferQueryRespDto.setNftId(transferNftInfoBo.getNftId());
nftTransferQueryRespDto.setOwnerUserId(transferNftInfoBo.getOwnerUserId());
nftTransferQueryRespDto.setOwnerAddress(transferNftInfoBo.getOwnerAddress());
nftTransferQueryRespDto.setFromUserId(transferNftInfoBo.getUserId());
nftTransferQueryRespDto.setFromAddress(transferNftInfoBo.getAddress());
nftTransferQueryRespDto.setTransferTime(transferNftInfoBo.getCreatedAt());
nftTransferQueryRespDto.setRouterType(transferNftInfoBo.getRouterType());
nftTransferQueryRespDto.setTransferHash(transferHash);
return ResponseDto.success(nftTransferQueryRespDto);
GalaxyNftTransferQueryRespDto nftTransferQueryRespDto = galaxyBeanTransferBiz.buildNftTransferQueryRespDto(transferNftInfoBo);
nftTransferQueryRespDto.setTransferHash(transferHash);
return ResponseDto.success(nftTransferQueryRespDto);
}
}else {
return ResponseDto.failure(GalaxyErrorEnum.NFT_TRANSFER_QUERY_ERROR.getCode(),GalaxyErrorEnum.NFT_TRANSFER_QUERY_ERROR.getMessage());
}
......
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