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

Commit f9e52db0 authored by anjiabin's avatar anjiabin

nft修改购买逻辑

parent ef5a6c77
......@@ -9,6 +9,7 @@ import com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil;
import com.liquidnet.commons.lang.util.*;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.constant.GalaxyErrorEnum;
import com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBindBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftInfoBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo;
......@@ -95,6 +96,26 @@ public class ZxinTradeBiz {
//初始化订单数据
if(nftOrderBo==null){
nftOrderBo = zxinCommonBiz.buildNftOrderBo(reqDto.getNftOrderPayId(),userInfoBo,seriesNftInfoBo);
dataUtils.setNftOrderBo(reqDto.getRouterType(),reqDto.getNftOrderPayId(),nftOrderBo);
}
/**
* 获取订单和nft绑定信息
*/
GalaxyNftOrderBindBo nftOrderBindBo = dataUtils.getGalaxyNftOrderBindBo(reqDto.getRouterType(),reqDto.getNftOrderPayId());
if(StringUtil.isNull(nftOrderBindBo)){
//获取发行索引
long nftIdNo = dataUtils.incrNftIdNo(reqDto.getRouterType(),reqDto.getSkuId());
nftOrderBindBo = GalaxyNftOrderBindBo.getNew();
nftOrderBindBo.setNftOrderPayId(reqDto.getNftOrderPayId());
nftOrderBindBo.setSeriesId(seriesNftInfoBo.getSeriesId());
nftOrderBindBo.setSeriesCode(seriesNftInfoBo.getSeriesCode());
nftOrderBindBo.setNftIdIndex(Integer.valueOf(String.valueOf(nftIdNo)));
nftOrderBindBo.setRouterType(reqDto.getRouterType());
String nowTimeStr = DateUtil.Formatter.yyyyMMddHHmmss.format(LocalDateTime.now());
nftOrderBindBo.setCreatedAt(nowTimeStr);
dataUtils.setGalaxyNftOrderBindBo(reqDto.getRouterType(),reqDto.getNftOrderPayId(),nftOrderBindBo);
}
......@@ -108,7 +129,7 @@ public class ZxinTradeBiz {
//发行个数
Long publishCount = 1L;
//开始索引
Integer seriesBeginIndex = 0;
Integer seriesBeginIndex = nftOrderBindBo.getNftIdIndex();
//发行金额
Long sellCount = seriesNftInfoBo.getSellCount().longValue(); //积分
/**
......@@ -123,18 +144,18 @@ public class ZxinTradeBiz {
String nftPublishTradeHash = null;
//查询系列信息
Nft032SeriesReqDto nft032ReqDto = Nft032SeriesReqDto.getNew();
nft032ReqDto.setSeriesId(seriesId);
ZxlnftResponseDto<Nft032SeriesRespDto> resp = zxlnftSdkUtil.nft032Series(nft032ReqDto);
if(resp.isSuccess()){
//该系列已经发行多少个nft
Long crtCount = resp.getData().getSeriesInfo().getCrtCount();
log.info("系列:{} 已发行 :{}", seriesId, crtCount);
//设置开始索引
seriesBeginIndex = Integer.parseInt(String.valueOf(crtCount.longValue() + 1));
}
// //查询系列信息(暂时不通过系列查询获取发行序列号)
// Nft032SeriesReqDto nft032ReqDto = Nft032SeriesReqDto.getNew();
// nft032ReqDto.setSeriesId(seriesId);
// ZxlnftResponseDto<Nft032SeriesRespDto> resp = zxlnftSdkUtil.nft032Series(nft032ReqDto);
//
// if(resp.isSuccess()){
// //该系列已经发行多少个nft
// Long crtCount = resp.getData().getSeriesInfo().getCrtCount();
// log.info("系列:{} 已发行 :{}", seriesId, crtCount);
// //设置开始索引
// seriesBeginIndex = Integer.parseInt(String.valueOf(crtCount.longValue() + 1));
// }
//3.1.2调用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