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

Commit 5f6ada01 authored by anjiabin's avatar anjiabin

实现xuper相关艺术品上传

parent 77a1e8fa
package com.liquidnet.service.galaxy.router.xuper.biz; package com.liquidnet.service.galaxy.router.xuper.biz;
import com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz; import com.liquidnet.common.exception.constant.ErrorCode;
import com.liquidnet.common.third.zxlnft.config.ZxlnftConfig; import com.liquidnet.common.third.xuper.config.XuperConfig;
import com.liquidnet.common.third.xuper.dto.*;
import com.liquidnet.common.third.xuper.exception.XupterException;
import com.liquidnet.common.third.xuper.util.XuperSdkUtil;
import com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum; import com.liquidnet.common.third.zxlnft.constant.ZxlnftEnum;
import com.liquidnet.common.third.zxlnft.dto.Nft044BuyResultReqDto; import com.liquidnet.common.third.zxlnft.dto.Nft044BuyResultReqDto;
import com.liquidnet.common.third.zxlnft.dto.Nft044BuyResultRespDto;
import com.liquidnet.common.third.zxlnft.dto.ZxlnftResponseDto;
import com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil;
import com.liquidnet.commons.lang.util.BeanUtil; import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.commons.lang.util.StringUtil; import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.biz.GalaxyBeanTransferBiz; import com.liquidnet.service.galaxy.biz.GalaxyBeanTransferBiz;
import com.liquidnet.service.galaxy.biz.GalaxyEnumBiz; import com.liquidnet.service.galaxy.biz.GalaxyEnumBiz;
import com.liquidnet.service.galaxy.constant.GalaxyEnum; import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.constant.GalaxyErrorEnum; 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.GalaxyNftOrderBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftInfoBo; import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftInfoBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo; import com.liquidnet.service.galaxy.dto.bo.GalaxyUserInfoBo;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftBuyRespDto; import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyRespDto;
import com.liquidnet.service.galaxy.dto.vo.mongo.GalaxyNftOrderFailLogVo; import com.liquidnet.service.galaxy.dto.vo.mongo.GalaxyNftOrderFailLogVo;
import com.liquidnet.service.galaxy.exception.GalaxyNftBuyException; import com.liquidnet.service.galaxy.exception.GalaxyNftBuyException;
import com.liquidnet.service.galaxy.utils.GalaxyDataUtils; import com.liquidnet.service.galaxy.utils.GalaxyDataUtils;
...@@ -43,13 +44,10 @@ import java.util.Date; ...@@ -43,13 +44,10 @@ import java.util.Date;
@Component @Component
public class XuperTradeCommonBiz { public class XuperTradeCommonBiz {
@Autowired @Autowired
private ZxlnftSdkUtil zxlnftSdkUtil; private XuperSdkUtil xuperSdkUtil;
@Autowired @Autowired
private ZxlnftBiz zxlnftBiz; private XuperConfig xuperConfig;
@Autowired
private ZxlnftConfig zxlnftConfig;
@Autowired @Autowired
private GalaxyDataUtils dataUtils; private GalaxyDataUtils dataUtils;
...@@ -94,45 +92,53 @@ public class XuperTradeCommonBiz { ...@@ -94,45 +92,53 @@ public class XuperTradeCommonBiz {
private GalaxyNftBuyRespDto nftBuyBusinessSync(String routerType,String nftId,GalaxyUserInfoBo userInfoBo, GalaxySeriesNftInfoBo seriesNftInfoBo,GalaxyNftOrderBo nftOrderBo){ private GalaxyNftBuyRespDto nftBuyBusinessSync(String routerType,String nftId,GalaxyUserInfoBo userInfoBo, GalaxySeriesNftInfoBo seriesNftInfoBo,GalaxyNftOrderBo nftOrderBo){
//定义返回参数 //定义返回参数
String nftBuyTaskId = null; String nftBuyTaskId = null;
Long nftBuyChainTimestamp = null; String nftBuyChainTimestamp = null;
Integer nftBuyStatus = null; Integer nftBuyStatus = null;
String nftBuyTradeHash = null; String nftBuyTradeHash = null;
String nftBuyPayTaskId = null; String nftBuyPayTaskId = null;
/**
* 获取订单和nft绑定信息
*/
Long shardId = -1l;
GalaxyNftOrderBindBo nftOrderBindBo = dataUtils.getGalaxyNftOrderBindBo(routerType,nftOrderBo.getNftOrderPayId());
if(StringUtil.isNotNull(nftOrderBindBo)){
shardId = nftOrderBindBo.getNftIdIndex().longValue();
}
//如果购买任务不为空,则直接进行购买任务查询 //如果购买任务不为空,则直接进行购买任务查询
if(StringUtil.isNotEmpty(nftOrderBo.getNftBuyTaskId())){ if(StringUtil.isNotEmpty(nftOrderBo.getNftBuyTaskId())){
nftBuyTaskId = nftOrderBo.getNftBuyTaskId(); nftBuyTaskId = nftOrderBo.getNftBuyTaskId();
} }
if(StringUtil.isEmpty(nftBuyTaskId)){ if(StringUtil.isEmpty(nftBuyTaskId)){
// //购买 //购买
// Xuper007GrantShardReqDto xuper007GrantShardReqDto = Xuper007GrantShardReqDto.getNew(); Xuper007GrantShardReqDto xuper007GrantShardReqDto = Xuper007GrantShardReqDto.getNew();
// // 定义返回结果对象 // 定义返回结果对象
// Xuper007GrantShardRespDto xuper007GrantShardRespDto = null; Xuper007GrantShardRespDto xuper007GrantShardRespDto = null;
// long assetId = 171095615845019437l; long assetId = Long.parseLong(seriesNftInfoBo.getSeriesId());
//// long assetId = 1532351545249738541l; try {
// xuper007GrantShardReqDto.setMnemonic(xuperConfig.getNftPlatformMnemonic());
// try { xuper007GrantShardReqDto.setAssetId(assetId);
// xuper007GrantShardReqDto.setMnemonic(creatorMnemonic); xuper007GrantShardReqDto.setShardId(shardId);
// xuper007GrantShardReqDto.setAssetId(assetId); xuper007GrantShardReqDto.setToAddr(xuperSdkUtil.getAccount(userInfoBo.getMnemonic()).getAddress());
// xuper007GrantShardReqDto.setShardId(1l); xuper007GrantShardReqDto.setToUserId(100000l);
// xuper007GrantShardReqDto.setToAddr(xuperSdkUtil.getAccount(customerMnemonic).getAddress()); xuper007GrantShardReqDto.setPrice(seriesNftInfoBo.getSellCount().longValue());
// xuper007GrantShardReqDto.setToUserId(100000l); XuperResponseDto<Xuper007GrantShardRespDto> xuperResponseDto = xuperSdkUtil.xuper007GrantShard(xuper007GrantShardReqDto);
// xuper007GrantShardReqDto.setPrice(1234l); if(xuperResponseDto.isSuccess()){
// XuperResponseDto<Xuper007GrantShardRespDto> xuperResponseDto = xuperSdkUtil.xuper007GrantShard(reqDto); xuper007GrantShardRespDto = xuperResponseDto.getParseData(Xuper007GrantShardRespDto.class);
// if(xuperResponseDto.isSuccess()){ }
// xuper007GrantShardRespDto = xuperResponseDto.getParseData(Xuper007GrantShardRespDto.class); }catch (XupterException e) {
// } log.error("biz error msg "+e.getMessage(),e);
// }catch (XupterException e) { }catch (Exception e) {
// log.error("biz error msg "+e.getMessage(),e); log.error("sys error msg "+e.getMessage(),e);
// }catch (Exception e) { }
// log.error("sys error msg "+e.getMessage(),e); log.info("testXuper007GrantShard resp : "+ JsonUtils.toJson(xuper007GrantShardRespDto));
// } if(StringUtil.isNotNull(xuper007GrantShardRespDto)&&xuper007GrantShardRespDto.getErrNo()==0){
// log.info("testXuper007GrantShard resp : "+ JsonUtils.toJson(respDto)); nftBuyTaskId = String.valueOf(assetId);
// if(nft043RespDto.isSuccess()){ nftOrderBo.setNftBuyTaskId(nftBuyTaskId);
// nftBuyTaskId = nft043RespDto.getData().getTaskId(); }
// nftOrderBo.setNftBuyTaskId(nftBuyTaskId);
// }
} }
//如果购买任务id不为空 //如果购买任务id不为空
...@@ -149,22 +155,28 @@ public class XuperTradeCommonBiz { ...@@ -149,22 +155,28 @@ public class XuperTradeCommonBiz {
Thread.sleep(500l); Thread.sleep(500l);
count++; count++;
log.info("=======执行第{}次查询,taskId:{}",count,nft044ReqDto.getTaskId()); log.info("=======执行第{}次查询,taskId:{}",count,nft044ReqDto.getTaskId());
ZxlnftResponseDto<Nft044BuyResultRespDto> nft044RespDto = zxlnftSdkUtil.nft044BuyResult(nft044ReqDto); //执行nft购买结果查询
if(nft044RespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getCode())){ GalaxyNftBuyResultQueryReqDto nftBuyResultQueryReqDto = GalaxyNftBuyResultQueryReqDto.getNew();
nftBuyPayTaskId = nft044RespDto.getData().getPayTaskId(); nftBuyResultQueryReqDto.setNftOrderPayId(nftOrderBo.getNftOrderPayId());
nftBuyChainTimestamp = nft044RespDto.getData().getChainTimestamp(); nftBuyResultQueryReqDto.setRouterType(routerType);
nftBuyStatus = nft044RespDto.getData().getTaskStatus(); ResponseDto<GalaxyNftBuyResultQueryRespDto> buyResultQueryRespDto= this.nftBuyResultQuery(nftBuyResultQueryReqDto);
nftBuyTradeHash = nft044RespDto.getData().getTxHash(); if(buyResultQueryRespDto.isSuccess()){
}else if(nft044RespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())){ if(buyResultQueryRespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getCode())){
log.info("任务执行失败!taskId:{}",nft044ReqDto.getTaskId()); nftBuyPayTaskId = buyResultQueryRespDto.getData().getPayTaskId();
nftBuyStatus = nft044RespDto.getData().getTaskStatus(); nftBuyChainTimestamp = buyResultQueryRespDto.getData().getChainTimestamp();
nftBuyStatus = buyResultQueryRespDto.getData().getTaskStatus();
//购买失败 nftBuyTradeHash = buyResultQueryRespDto.getData().getTxHash();
throw new GalaxyNftBuyException(GalaxyErrorEnum.NFT_BUY_FAIL.getCode(), "nft044BuyResult_resp:"+GalaxyErrorEnum.NFT_BUY_FAIL.getMessage()); }else if(buyResultQueryRespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())){
}else if(nft044RespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.PROCESSING.getCode())){ log.info("任务执行失败!taskId:{}",nft044ReqDto.getTaskId());
log.info("任务执行中!taskId:{}",nft044ReqDto.getTaskId()); nftBuyStatus = buyResultQueryRespDto.getData().getTaskStatus();
nftBuyStatus = nft044RespDto.getData().getTaskStatus(); //购买失败
throw new GalaxyNftBuyException(GalaxyErrorEnum.NFT_BUY_FAIL.getCode(), "nft044BuyResult_resp:"+GalaxyErrorEnum.NFT_BUY_FAIL.getMessage());
}else if(buyResultQueryRespDto.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.PROCESSING.getCode())){
log.info("任务执行中!taskId:{}",nft044ReqDto.getTaskId());
nftBuyStatus = buyResultQueryRespDto.getData().getTaskStatus();
}
} }
if(count==20){ if(count==20){
//查询超过20次,则把nftId设置为空,为后续重新入队 //查询超过20次,则把nftId设置为空,为后续重新入队
nftId = null; nftId = null;
...@@ -173,12 +185,6 @@ public class XuperTradeCommonBiz { ...@@ -173,12 +185,6 @@ public class XuperTradeCommonBiz {
} }
} }
log.info("总共执行了多少次查询:{} 总耗时:{}",count,System.currentTimeMillis() - timeStart); log.info("总共执行了多少次查询:{} 总耗时:{}",count,System.currentTimeMillis() - timeStart);
// if(StringUtil.isNotEmpty(payTaskId)){
// //3.2.5查询NFT购买支付结果
// Nft045BuyPayResultReqDto nft045ReqDto = Nft045BuyPayResultReqDto.getNew();
// nft045ReqDto.setTaskId(payTaskId);
// ZxlnftResponseDto<Nft045BuyPayResultRespDto> nft045RespDto = zxlnftSdkUtil.nft045BuyPayResult(nft045ReqDto);
// }
}catch (GalaxyNftBuyException e){ }catch (GalaxyNftBuyException e){
throw new GalaxyNftBuyException(e.getCode(),e.getMessage()); throw new GalaxyNftBuyException(e.getCode(),e.getMessage());
}catch(Exception e){ }catch(Exception e){
...@@ -190,7 +196,7 @@ public class XuperTradeCommonBiz { ...@@ -190,7 +196,7 @@ public class XuperTradeCommonBiz {
//更新订单缓存数据状态 //更新订单缓存数据状态
if(StringUtil.isNotNull(nftBuyChainTimestamp)){ if(StringUtil.isNotNull(nftBuyChainTimestamp)){
//设置时间 //设置时间
String nftBuyChainTimestampStr = DateUtil.format(new Date(nftBuyChainTimestamp*1000),DateUtil.Formatter.yyyyMMddHHmmss); String nftBuyChainTimestampStr = DateUtil.format(new Date(),DateUtil.Formatter.yyyyMMddHHmmss);
nftOrderBo.setNftBuyChainTimestamp(nftBuyChainTimestampStr); nftOrderBo.setNftBuyChainTimestamp(nftBuyChainTimestampStr);
} }
if(StringUtil.isNotNull(nftBuyStatus)){ if(StringUtil.isNotNull(nftBuyStatus)){
...@@ -214,4 +220,47 @@ public class XuperTradeCommonBiz { ...@@ -214,4 +220,47 @@ public class XuperTradeCommonBiz {
nftBuyRespDto.setNftId(nftId); nftBuyRespDto.setNftId(nftId);
return nftBuyRespDto; return nftBuyRespDto;
} }
public ResponseDto<GalaxyNftBuyResultQueryRespDto> nftBuyResultQuery(GalaxyNftBuyResultQueryReqDto reqDto) {
//获取订单信息
GalaxyNftOrderBo nftOrderBo = dataUtils.getNftOrderBo(reqDto.getRouterType(),reqDto.getNftOrderPayId());
if(StringUtil.isNull(nftOrderBo)){
return ResponseDto.failure(GalaxyErrorEnum.PUBLISH_ORDER_NOT_EXIST.getCode(), GalaxyErrorEnum.PUBLISH_ORDER_NOT_EXIST.getMessage());
}
if(StringUtil.isEmpty(nftOrderBo.getNftBuyTaskId())){
return ResponseDto.failure(GalaxyErrorEnum.NFT_BUY_TASK_NOT_EXIST.getCode(), GalaxyErrorEnum.NFT_BUY_TASK_NOT_EXIST.getMessage());
}
//执行资产碎片授予查询
Xuper010QuerySdsReqDto xuper010QuerySdsReqDto = Xuper010QuerySdsReqDto.getNew();
// 定义返回结果对象
Xuper010QuerySdsRespDto xuper010QuerySdsRespDto = null;
long shardId = 1l;
try {
xuper010QuerySdsReqDto.setAssetId(Long.parseLong(nftOrderBo.getSeriesId()));
xuper010QuerySdsReqDto.setShardId(shardId);
XuperResponseDto<Xuper010QuerySdsRespDto> xuperResponseDto = xuperSdkUtil.xuper010QuerySds(xuper010QuerySdsReqDto);
if(xuperResponseDto.isSuccess()){
xuper010QuerySdsRespDto = xuperResponseDto.getParseData(Xuper010QuerySdsRespDto.class);
}
}catch (XupterException e) {
log.error("biz error msg "+e.getMessage(),e);
}catch (Exception e) {
log.error("sys error msg "+e.getMessage(),e);
}
log.info("testXuper010QuerySds resp : "+ JsonUtils.toJson(xuper010QuerySdsRespDto));
if(String.valueOf(xuper010QuerySdsRespDto.getErrNo()).equalsIgnoreCase(ErrorCode.SUCCESS.getCode())){
GalaxyNftBuyResultQueryRespDto resultQueryRespDto = GalaxyNftBuyResultQueryRespDto.getNew();
String nowTimeStr = DateUtil.getNowTime();
//转换任务状态
Integer taskStatus = Integer.valueOf(GalaxyEnumBiz.getGrantStatusEnum(reqDto.getRouterType(),String.valueOf(xuper010QuerySdsRespDto.getMeta().getStatus())).getCode());
resultQueryRespDto.setTaskStatus(taskStatus);
resultQueryRespDto.setChainTimestamp(nowTimeStr);
resultQueryRespDto.setPayTaskId(xuper010QuerySdsRespDto.getMeta().getTxId());
return ResponseDto.success(resultQueryRespDto);
}else{
return ResponseDto.failure(GalaxyErrorEnum.NFT_PUBLISH_AND_BUY_QUERY_FAIL.getCode(),GalaxyErrorEnum.NFT_PUBLISH_AND_BUY_QUERY_FAIL.getMessage());
}
}
} }
package com.liquidnet.service.galaxy.controller; //package com.liquidnet.service.galaxy.controller;
//
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; //import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.liquidnet.service.base.ResponseDto; //import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.aop.annotation.ControllerLog; //import com.liquidnet.service.galaxy.aop.annotation.ControllerLog;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishReqDto; //import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishRespDto; //import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishRespDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishResultQueryReqDto; //import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishResultQueryReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishResultQueryRespDto; //import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishResultQueryRespDto;
import com.liquidnet.service.galaxy.service.IGalaxyPublishService; //import com.liquidnet.service.galaxy.service.IGalaxyPublishService;
import io.swagger.annotations.Api; //import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; //import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated; //import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; //import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; //import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; //import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; //import org.springframework.web.bind.annotation.RestController;
//
import javax.annotation.Resource; //import javax.annotation.Resource;
import javax.validation.Valid; //import javax.validation.Valid;
//
/** ///**
* @author AnJiabin <anjiabin@zhengzai.tv> // * @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0 // * @version V1.0
* @Description: TODO // * @Description: TODO
* @class: GalaxyPublishController // * @class: GalaxyPublishController
* @Package com.liquidnet.service.galaxy.controller // * @Package com.liquidnet.service.galaxy.controller
* @Copyright: LightNet @ Copyright (c) 2021 // * @Copyright: LightNet @ Copyright (c) 2021
* @date 2022/3/15 12:11 // * @date 2022/3/15 12:11
*/ // */
@Api(tags = "NFT发行相关") //@Api(tags = "NFT发行相关")
@RestController //@RestController
@RequestMapping("nftPublish") //@RequestMapping("nftPublish")
@Validated //@Validated
@Slf4j //@Slf4j
public class GalaxyPublishController { //public class GalaxyPublishController {
@Resource(name = "galaxyPublishServiceImpl") // @Resource(name = "galaxyPublishServiceImpl")
private IGalaxyPublishService galaxyPublishService; // private IGalaxyPublishService galaxyPublishService;
//
@ControllerLog(description = "NFT发行") // @ControllerLog(description = "NFT发行")
@ApiOperationSupport(order = 1) // @ApiOperationSupport(order = 1)
@ApiOperation(value = "NFT发行") // @ApiOperation(value = "NFT发行")
@PostMapping(value = {"nftPublish"}) // @PostMapping(value = {"nftPublish"})
public ResponseDto<GalaxyNftPublishRespDto> nftPublish(@Valid @RequestBody GalaxyNftPublishReqDto reqDto){ // public ResponseDto<GalaxyNftPublishRespDto> nftPublish(@Valid @RequestBody GalaxyNftPublishReqDto reqDto){
return galaxyPublishService.nftPublish(reqDto); // return galaxyPublishService.nftPublish(reqDto);
} // }
//
@ControllerLog(description = "NFT发行结果查询") // @ControllerLog(description = "NFT发行结果查询")
@ApiOperationSupport(order = 3) // @ApiOperationSupport(order = 3)
@ApiOperation(value = "NFT发行结果查询") // @ApiOperation(value = "NFT发行结果查询")
@PostMapping(value = {"nftPublishResultQuery"}) // @PostMapping(value = {"nftPublishResultQuery"})
public ResponseDto<GalaxyNftPublishResultQueryRespDto> nftPublishResultQuery(@Valid @RequestBody GalaxyNftPublishResultQueryReqDto reqDto) { // public ResponseDto<GalaxyNftPublishResultQueryRespDto> nftPublishResultQuery(@Valid @RequestBody GalaxyNftPublishResultQueryReqDto reqDto) {
return galaxyPublishService.nftPublishResultQuery(reqDto); // return galaxyPublishService.nftPublishResultQuery(reqDto);
} // }
} //}
...@@ -112,19 +112,8 @@ public class XuperTradeBiz { ...@@ -112,19 +112,8 @@ public class XuperTradeBiz {
} }
} }
String author = seriesNftInfoBo.getAuthor();
String nftName = seriesNftInfoBo.getNftName();
String nftUrl = seriesNftInfoBo.getNftUrl();
String displayUrl = seriesNftInfoBo.getDisplayUrl();
String nftDesc = seriesNftInfoBo.getNftDesc();
String nftFlag = seriesNftInfoBo.getNftFlag();
//发行个数
Long publishCount = 1L;
//开始索引 //开始索引
Integer seriesBeginIndex = null; Integer seriesBeginIndex = null;
//发行金额
Long sellCount = seriesNftInfoBo.getSellCount().longValue(); //积分
/** /**
* 根据sku获取系列Id * 根据sku获取系列Id
*/ */
...@@ -322,7 +311,7 @@ public class XuperTradeBiz { ...@@ -322,7 +311,7 @@ public class XuperTradeBiz {
GalaxyNftBuyResultQueryReqDto nftBuyResultQueryReqDto = GalaxyNftBuyResultQueryReqDto.getNew(); GalaxyNftBuyResultQueryReqDto nftBuyResultQueryReqDto = GalaxyNftBuyResultQueryReqDto.getNew();
nftBuyResultQueryReqDto.setNftOrderPayId(reqDto.getNftOrderPayId()); nftBuyResultQueryReqDto.setNftOrderPayId(reqDto.getNftOrderPayId());
nftBuyResultQueryReqDto.setRouterType(reqDto.getRouterType()); nftBuyResultQueryReqDto.setRouterType(reqDto.getRouterType());
ResponseDto<GalaxyNftBuyResultQueryRespDto> buyResultQueryRespDto= this.nftBuyResultQuery(nftBuyResultQueryReqDto); ResponseDto<GalaxyNftBuyResultQueryRespDto> buyResultQueryRespDto= xuperTradeCommonBiz.nftBuyResultQuery(nftBuyResultQueryReqDto);
if(buyResultQueryRespDto.isSuccess()){ if(buyResultQueryRespDto.isSuccess()){
GalaxyNftBuyResultQueryRespDto nftBuyResultQueryRespDtoTemp = buyResultQueryRespDto.getData(); GalaxyNftBuyResultQueryRespDto nftBuyResultQueryRespDtoTemp = buyResultQueryRespDto.getData();
BeanUtil.copy(nftBuyResultQueryRespDtoTemp,nftOrderBo); BeanUtil.copy(nftBuyResultQueryRespDtoTemp,nftOrderBo);
...@@ -346,42 +335,4 @@ public class XuperTradeBiz { ...@@ -346,42 +335,4 @@ public class XuperTradeBiz {
} }
return ResponseDto.failure(GalaxyErrorEnum.NFT_PUBLISH_AND_BUY_QUERY_FAIL.getCode(),GalaxyErrorEnum.NFT_PUBLISH_AND_BUY_QUERY_FAIL.getMessage(),resultQueryRespDto); return ResponseDto.failure(GalaxyErrorEnum.NFT_PUBLISH_AND_BUY_QUERY_FAIL.getCode(),GalaxyErrorEnum.NFT_PUBLISH_AND_BUY_QUERY_FAIL.getMessage(),resultQueryRespDto);
} }
public ResponseDto<GalaxyNftBuyResultQueryRespDto> nftBuyResultQuery(GalaxyNftBuyResultQueryReqDto reqDto) {
//获取订单信息
GalaxyNftOrderBo nftOrderBo = dataUtils.getNftOrderBo(reqDto.getRouterType(),reqDto.getNftOrderPayId());
if(StringUtil.isNull(nftOrderBo)){
return ResponseDto.failure(GalaxyErrorEnum.PUBLISH_ORDER_NOT_EXIST.getCode(), GalaxyErrorEnum.PUBLISH_ORDER_NOT_EXIST.getMessage());
}
if(StringUtil.isEmpty(nftOrderBo.getNftBuyTaskId())){
return ResponseDto.failure(GalaxyErrorEnum.NFT_BUY_TASK_NOT_EXIST.getCode(), GalaxyErrorEnum.NFT_BUY_TASK_NOT_EXIST.getMessage());
}
//执行资产碎片授予查询
Xuper010QuerySdsReqDto xuper010QuerySdsReqDto = Xuper010QuerySdsReqDto.getNew();
// 定义返回结果对象
Xuper010QuerySdsRespDto xuper010QuerySdsRespDto = null;
long shardId = 1l;
try {
xuper010QuerySdsReqDto.setAssetId(Long.parseLong(nftOrderBo.getSeriesId()));
xuper010QuerySdsReqDto.setShardId(shardId);
XuperResponseDto<Xuper010QuerySdsRespDto> xuperResponseDto = xuperSdkUtil.xuper010QuerySds(xuper010QuerySdsReqDto);
if(xuperResponseDto.isSuccess()){
xuper010QuerySdsRespDto = xuperResponseDto.getParseData(Xuper010QuerySdsRespDto.class);
}
}catch (XupterException e) {
log.error("biz error msg "+e.getMessage(),e);
}catch (Exception e) {
log.error("sys error msg "+e.getMessage(),e);
}
log.info("testXuper010QuerySds resp : "+ JsonUtils.toJson(xuper010QuerySdsRespDto));
GalaxyNftBuyResultQueryRespDto resultQueryRespDto = GalaxyNftBuyResultQueryRespDto.getNew();
String nowTimeStr = DateUtil.getNowTime();
//转换任务状态
Integer taskStatus = Integer.valueOf(GalaxyEnumBiz.getGrantStatusEnum(reqDto.getRouterType(),String.valueOf(xuper010QuerySdsRespDto.getMeta().getStatus())).getCode());
resultQueryRespDto.setTaskStatus(taskStatus);
resultQueryRespDto.setChainTimestamp(nowTimeStr);
return ResponseDto.success(resultQueryRespDto);
}
} }
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