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

Commit 6471aca3 authored by anjiabin's avatar anjiabin

提交galaxy系列表结构

parent 0eaacdec
......@@ -25,7 +25,7 @@ create table galaxy_series_info
series_info_id varchar(100) NOT NULL COMMENT '系列存储ID',
series_name varchar(28) NOT NULL COMMENT '本地系列唯一名称(前缀+skuid)',
series_code varchar(200) NOT NULL COMMENT '系列编码',
series_id varchar(3) COMMENT '区块链上系列ID',
series_id varchar(200) COMMENT '区块链上系列ID',
total_count varchar(50) COMMENT '系列发行总量',
crt_count varchar(200) COMMENT '系列已发行个数',
series_claim_task_id varchar(200) COMMENT '系列声明任务ID',
......@@ -47,7 +47,7 @@ create table galaxy_series_nft_info
sku_id varchar(200) NOT NULL COMMENT '本地系列nft唯一标识id',
series_name varchar(28) NOT NULL COMMENT '本地系列唯一名称(前缀+skuid)',
series_code varchar(200) NOT NULL COMMENT '本地系列唯一编码',
series_id varchar(3) COMMENT '区块链上系列ID',
series_id varchar(200) COMMENT '区块链上系列ID',
nft_total_count varchar(50) COMMENT '系列nft发行总量',
nft_crt_count varchar(200) COMMENT '系列nft已发行个数',
original_nft_url varchar(1000) COMMENT 'nft素材原始地址',
......
......@@ -202,7 +202,7 @@ public class ZxinArtworkBiz {
//等一个系列支持多个藏品后需要从请求参数获取
seriesInfoBo.setSeriesName(seriesName);
seriesInfoBo.setSeriesCode(seriesCode);
dataUtils.setSeriesInfoBo(reqDto.getRouterType(),reqDto.getSkuId(),seriesInfoBo);
dataUtils.setSeriesInfoBo(reqDto.getRouterType(),seriesCode,seriesInfoBo);
//构造系列nft信息
GalaxySeriesNftInfoBo seriesNftInfoBo = this.buildSeriesNftInfoBo(reqDto,seriesInfoBo,seriesNftUploadBo);
......@@ -316,8 +316,10 @@ public class ZxinArtworkBiz {
}
public ResponseDto<GalaxyArtSeriesClaimResultQueryRespDto> seriesClaimResultQuery(GalaxyArtSeriesClaimResultQueryReqDto reqDto) {
String seriesCode = GalaxyConstant.SERIES_NAME_PREFIX.concat(reqDto.getSkuId());
//获取任务ID
GalaxySeriesInfoBo seriesInfoBo = dataUtils.getSeriesInfoBo(reqDto.getRouterType(),reqDto.getSkuId());
GalaxySeriesInfoBo seriesInfoBo = dataUtils.getSeriesInfoBo(reqDto.getRouterType(),seriesCode);
if(StringUtil.isNull(seriesInfoBo)||StringUtil.isEmpty(seriesInfoBo.getSeriesClaimTaskId())){
return ResponseDto.failure(GalaxyErrorEnum.SERIES_NOT_EXIST.getCode(), GalaxyErrorEnum.SERIES_NOT_EXIST.getMessage());
}
......@@ -338,7 +340,7 @@ public class ZxinArtworkBiz {
String nowTimeStr = DateUtil.format(new Date(resp.getData().getChainTimestamp().longValue()*1000),DateUtil.Formatter.yyyyMMddHHmmss);
seriesInfoBo.setSeriesClaimTime(nowTimeStr);
seriesInfoBo.setSeriesId(resp.getData().getSeriesId());
dataUtils.updateSeriesClaimStatus(reqDto.getRouterType(),reqDto.getSkuId(),seriesInfoBo);
dataUtils.updateSeriesClaimStatus(reqDto.getRouterType(),seriesCode,seriesInfoBo);
//设置成功返回参数
GalaxyArtSeriesClaimResultQueryRespDto resultQueryRespDto = GalaxyArtSeriesClaimResultQueryRespDto.getNew();
......@@ -352,7 +354,7 @@ public class ZxinArtworkBiz {
return ResponseDto.success(resultQueryRespDto);
}else if(resp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())){
seriesInfoBo.setSeriesClaimStatus(GalaxyEnum.SeriesClaimStatusEnum.FAIL.getCode());
dataUtils.updateSeriesClaimStatus(reqDto.getRouterType(),reqDto.getSkuId(),seriesInfoBo);
dataUtils.updateSeriesClaimStatus(reqDto.getRouterType(),seriesCode,seriesInfoBo);
return ResponseDto.failure(GalaxyErrorEnum.SERIES_CLAIM_ERROR.getCode(), GalaxyErrorEnum.SERIES_CLAIM_ERROR.getMessage());
}
}
......
......@@ -205,8 +205,8 @@ public class DataUtils {
}
}
public void updateSeriesClaimStatus(String routerType,String skuId, GalaxySeriesInfoBo seriesInfoBo) {
redisUtil.set(GalaxyConstant.REDIS_KEY_GALAXY_SERIES.concat(routerType).concat(":") + skuId,seriesInfoBo,keyExpireTime);
public void updateSeriesClaimStatus(String routerType,String seriesCode, GalaxySeriesInfoBo seriesInfoBo) {
redisUtil.set(GalaxyConstant.REDIS_KEY_GALAXY_SERIES.concat(routerType).concat(":") + seriesCode,seriesInfoBo,keyExpireTime);
Query query = Query.query(Criteria.where("seriesCode").is(seriesInfoBo.getSeriesCode()));
Update update = Update.fromDocument(Document.parse(JsonUtils.toJson(seriesInfoBo)));
......@@ -222,9 +222,15 @@ public class DataUtils {
new Object[]{seriesInfoBo.getSeriesId(),seriesInfoBo.getSeriesClaimStatus(),nowTimeStr,seriesInfoBo.getSeriesCode()}
, MQConst.GalaxyQueue.SQL_SERIES_INFO.getKey()
);
queueUtil.sendMySqlRedis(
SqlMapping.get("galaxy_series_nft_info.updateSeriesIdAndStatus"),
new Object[]{seriesInfoBo.getSeriesId(),nowTimeStr,seriesInfoBo.getSeriesCode()}
, MQConst.GalaxyQueue.SQL_SERIES_INFO.getKey()
);
}catch(Exception e){
log.error(e.getMessage(),e);
log.error("#setNftTradeInfo error ==> MESSAGE:{}",e.getMessage());
log.error("#updateSeriesClaimStatus error ==> MESSAGE:{}",e.getMessage());
}
}
......
......@@ -11,5 +11,6 @@ galaxy_nft_trade_info.insert=insert into galaxy_nft_trade_info (nft_id, series_i
#更新信息
galaxy_series_info.updateSeriesIdAndStatus=update galaxy_series_info t set t.series_id = ?,t.series_claim_status = ? ,t.updated_at =? where t.series_code = ?
galaxy_series_nft_info.updateSeriesIdAndStatus=update galaxy_series_nft_info t set t.series_id = ? ,t.updated_at =? where t.series_code = ?
galaxy_nft_order_info.updateNftId=update galaxy_nft_order_info t set t.nft_id = ? ,t.updated_at =? where t.nft_order_pay_id = ?
galaxy_nft_order_info.updateNftBuyTaskId=update galaxy_nft_order_info t set t.nft_buy_task_id = ? ,t.updated_at =? where t.nft_order_pay_id = ?
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