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

Commit 118915b6 authored by Administrator's avatar Administrator 🎨

Merge branch 'pre' into 'master'

Pre

See merge request !261
parents 6876d3a2 b45b725b
......@@ -20,7 +20,6 @@ public enum GalaxyErrorEnum {
SERIES_CLAIM_PROCESSING("NFT0010008","系列声明正在处理中,不允许重复声明!"),
SERIES_CLAIM_SUCCESSED("NFT0010009","系列已声明成功,不允许重复声明!"),
SERIES_CLAIM_NOT_EXIST("NFT0010010","系列声明初始化信息不存在,请检查是否已上传对应素材!"),
SERIES_NFT_INFO_NOT_EXIST("NFT0010015","系列NFT信息查询不存在!"),
PUBLISH_ORDER_NOT_EXIST("NFT0010011","NFT购买订单不存在!"),
NFT_BUY_TASK_NOT_EXIST("NFT0010012","NFT购买执行任务不存在"),
NFT_BUY_TASK_HAVE_EXIST("NFT0010013","NFT购买执行任务已存在,不可以重复购买!"),
......@@ -33,7 +32,9 @@ public enum GalaxyErrorEnum {
NFT_QUERY_FAIL_ORDER_NOT_EXIST("NFT0010020","NFT订单不存在!"),
NFT_QUERY_FAIL_NFT_NOT_EXIST("NFT0010021","NFT信息查询不存在!"),
NFT_QUERY_FAIL_SERIES_NOT_EXIST("NFT0010022","系列信息查询不存在!"),
NFT_USER_HAS_OPEN_ACCOUNT("NFT0010023","用户已经开通过数字账户!");
NFT_USER_HAS_OPEN_ACCOUNT("NFT0010023","用户已经开通过数字账户!"),
SERIES_NFT_INFO_NOT_EXIST("NFT0010024","系列NFT信息查询不存在!"),
SERIES_NFT_HASH_CREATE_FAIL("NFT0010025","系列NFT的介质hash生成失败!");
private String code;
......
......@@ -243,11 +243,24 @@
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
if (dataInfo.freightPrice > 0) {
/*if (dataInfo.freightPrice > 0) {
LODOP.ADD_PRINT_TEXT(233, 26, 105, 20, "到付 " + dataInfo.freightPrice + "元");
} else {
LODOP.ADD_PRINT_TEXT(233, 26, 105, 20, "到付");
}*/
var orderExpressTypeName = "";
switch (dataInfo.orderExpressType) {
case 1:
orderExpressTypeName = '寄付';
break;
case 2:
orderExpressTypeName = '到付';
break;
case 3:
orderExpressTypeName = '寄付';
break;
}
LODOP.ADD_PRINT_TEXT(233, 26, 105, 20, orderExpressTypeName);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1)
......
......@@ -177,11 +177,24 @@
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
if (dataInfo.freightPrice > 0) {
/*if (dataInfo.freightPrice > 0) {
LODOP.ADD_PRINT_TEXT(233, 26, 105, 20, "到付 " + dataInfo.freightPrice + "元");
} else {
LODOP.ADD_PRINT_TEXT(233, 26, 105, 20, "到付");
}*/
var orderExpressTypeName = "";
switch (dataInfo.orderExpressType) {
case 1:
orderExpressTypeName = '寄付';
break;
case 2:
orderExpressTypeName = '到付';
break;
case 3:
orderExpressTypeName = '寄付';
break;
}
LODOP.ADD_PRINT_TEXT(233, 26, 105, 20, orderExpressTypeName);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1)
......
......@@ -135,11 +135,18 @@ public class ZxlnftBiz {
* @return
*/
public String getHashString(String data){
SM3HashEncodeReq req = SM3HashEncodeReq.getNew();
byte[] fileByteArray = this.getNftFileByteArray(data);
req.setData(fileByteArray);
SM3HashEncodeResp sm3HashEncodeResp = walletSdkService.sM3HashEncode(req);
return sm3HashEncodeResp.getDigest();
SM3HashEncodeResp sm3HashEncodeResp = null;
try {
SM3HashEncodeReq req = SM3HashEncodeReq.getNew();
byte[] fileByteArray = this.getNftFileByteArray(data);
req.setData(fileByteArray);
sm3HashEncodeResp = walletSdkService.sM3HashEncode(req);
return sm3HashEncodeResp.getDigest();
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(),e);
}
return null;
}
/**
......
......@@ -63,6 +63,7 @@ public class OrderExpressListDao implements Serializable {
private String city;
private String county;
private String number;
private Integer orderExpressType;
private String useStart;
private String timeTitle;
......
......@@ -4,12 +4,13 @@
<select id="selectPrintList" resultType="com.liquidnet.service.kylin.dao.OrderExpressListDao">
SELECT a.*,
b.express_contacts, b.express_address, b.express_phone, b.province, b.city, b.county, b.number,
b.express_contacts, b.express_address, b.express_phone, b.province, b.city, b.county, b.number, kots.express_type AS order_express_type,
d.use_start, d.title AS time_title, d.type AS time_type,
e.title AS tickets_title, e.type AS tickets_type
FROM kylin_order_express a
INNER JOIN kylin_order_tickets b ON a.order_tickets_id = b.order_tickets_id
INNER JOIN kylin_order_ticket_relations c ON b.order_tickets_id = c.order_id
LEFT JOIN kylin_order_ticket_status kots ON a.order_tickets_id = kots.order_id
LEFT JOIN kylin_ticket_times d ON c.time_id = d.ticket_times_id
LEFT JOIN kylin_tickets e ON c.ticket_id = e.tickets_id
<where>
......@@ -24,12 +25,13 @@
</select>
<select id="selectPrintListOfPerformanceId" resultType="com.liquidnet.service.kylin.dao.OrderExpressListDao">
SELECT a.*,
b.express_contacts, b.express_address, b.express_phone, b.province, b.city, b.county, b.number,
b.express_contacts, b.express_address, b.express_phone, b.province, b.city, b.county, b.number, kots.express_type AS order_express_type,
d.use_start, d.title AS time_title, d.type AS time_type,
e.title AS tickets_title, e.type AS tickets_type
FROM kylin_order_express a
INNER JOIN kylin_order_tickets b ON a.order_tickets_id = b.order_tickets_id
INNER JOIN kylin_order_ticket_relations c ON b.order_tickets_id = c.order_id
LEFT JOIN kylin_order_ticket_status kots ON a.order_tickets_id = kots.order_id
LEFT JOIN kylin_ticket_times d ON c.time_id = d.ticket_times_id
LEFT JOIN kylin_tickets e ON c.ticket_id = e.tickets_id
<where>
......
......@@ -30,27 +30,25 @@
<select id="selectProjectList" resultType="com.liquidnet.service.smile.entity.dto.SmileVolunteersProjectListDto">
select a.project_id,
title,
a.time_start,
a.time_end,
a.created_at,
select a.project_id,
title,
a.time_start,
a.time_end,
a.created_at,
a.status,
IF(now() >time_end,2,1) as 'time_status',
-- count(b0.project_id) + count(b1.project_id) + count(b2.project_id) as 'all',
(select count(0) as 'count'from smile_volunteers as b0 where a.project_id = b0.project_id and b0.status = 0) as 'un_audit',
(select count(0) as 'count'from smile_volunteers as b0 where a.project_id = b0.project_id and b0.status = 1) as 'audit',
(select count(0) as 'count'from smile_volunteers as b0 where a.project_id = b0.project_id and b0.status = 2) as 'refuse'
from smile_volunteers_project as a
-- LEFT JOIN smile_volunteers as b0 on a.project_id = b0.project_id and b0.status = 0
-- LEFT JOIN smile_volunteers as b1 on a.project_id = b1.project_id and b1.status = 1
-- LEFT JOIN smile_volunteers as b2 on a.project_id = b2.project_id and b2.status = 2
IF(now() > time_end, 2, 1) as 'time_status',
count(b0.status) as 'all',
sum(IF(b0.status = 0, 1, 0)) as 'un_audit',
sum(IF(b0.status = 1, 1, 0)) as 'audit',
sum(IF(b0.status = 2, 1, 0)) as 'refuse'
from smile_volunteers_project as a
LEFT JOIN smile_volunteers as b0 on a.project_id = b0.project_id
<where>
<if test="title!='' and title !=null">
AND title Like concat('%',#{title},'%')
</if>
</where>
GROUP BY a.project_id
ORDER BY a.created_at desc
GROUP BY a.project_id
ORDER BY a.created_at desc
</select>
</mapper>
......@@ -25,6 +25,7 @@ import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftInfoBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftUploadBo;
import com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftUploadTempSecretBo;
import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.exception.GalaxyNftUserException;
import com.liquidnet.service.galaxy.utils.GalaxyDataUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -168,59 +169,82 @@ public class ZxinArtworkBiz {
}
}
/**
* 进行系列声明
*/
Nft030SeriesClaimReqDto nft030ReqDto = Nft030SeriesClaimReqDto.getNew();
nft030ReqDto.setPubKey(zxlnftConfig.getNftPlatformPubKey());
nft030ReqDto.setSeriesName(seriesName);
//无限制系列 设置为0
nft030ReqDto.setTotalCount(totalCount);
nft030ReqDto.setOperateId(IDGenerator.get32UUID());
//系列封面
nft030ReqDto.setCoverUrl(coverUrl);
nft030ReqDto.setDesc(seriesDesc);
nft030ReqDto.setMaxPublishCount(0);
nft030ReqDto.setSeriesBeginFromZero(false);
ZxlnftResponseDto<Nft030SeriesClaimRespDto> nft30RespDto = zxlnftSdkUtil.nft030SeriesClaim(nft030ReqDto);
//返回参数
String seriesId = null;
String taskId = null;
GalaxyArtSeriesClaimRespDto seriesClaimRespDto = GalaxyArtSeriesClaimRespDto.getNew();
if(nft30RespDto.isSuccess()){
//第零个系列 无限制系列
taskId = nft30RespDto.getData().getTaskId();
//构造缓存数据
if(StringUtil.isNull(seriesInfoBo)){
//
String publishStatus = GalaxyEnum.SeriesClaimStatusEnum.PROCESSING.getCode();
//设置系列声明状态
seriesClaimRespDto.setSeriesClaimStatus(publishStatus);
//构造系列信息
seriesInfoBo = this.buildSeriesInfoBo(reqDto,taskId,publishStatus);
//等一个系列支持多个藏品后需要从请求参数获取
seriesInfoBo.setSeriesName(seriesName);
seriesInfoBo.setSeriesCode(seriesCode);
dataUtils.setSeriesInfoBo(reqDto.getRouterType(),seriesCode,seriesInfoBo);
//构造系列nft信息
GalaxySeriesNftInfoBo seriesNftInfoBo = this.buildSeriesNftInfoBo(reqDto,seriesInfoBo,seriesNftUploadBo);
dataUtils.setSeriesNftInfoBo(reqDto.getRouterType(),reqDto.getSkuId(),seriesInfoBo,seriesNftInfoBo);
//业务失败信息
String bizFailDesc = null;
//系统失败信息
String sysFailDesc = null;
GalaxyArtSeriesClaimRespDto seriesClaimRespDto = null;
try {
/**
* 进行系列声明
*/
Nft030SeriesClaimReqDto nft030ReqDto = Nft030SeriesClaimReqDto.getNew();
nft030ReqDto.setPubKey(zxlnftConfig.getNftPlatformPubKey());
nft030ReqDto.setSeriesName(seriesName);
//无限制系列 设置为0
nft030ReqDto.setTotalCount(totalCount);
nft030ReqDto.setOperateId(IDGenerator.get32UUID());
//系列封面
nft030ReqDto.setCoverUrl(coverUrl);
nft030ReqDto.setDesc(seriesDesc);
nft030ReqDto.setMaxPublishCount(0);
nft030ReqDto.setSeriesBeginFromZero(false);
ZxlnftResponseDto<Nft030SeriesClaimRespDto> nft30RespDto = zxlnftSdkUtil.nft030SeriesClaim(nft030ReqDto);
//返回参数
String seriesId = null;
String taskId = null;
seriesClaimRespDto = GalaxyArtSeriesClaimRespDto.getNew();
if(nft30RespDto.isSuccess()){
//第零个系列 无限制系列
taskId = nft30RespDto.getData().getTaskId();
//构造缓存数据
if(StringUtil.isNull(seriesInfoBo)){
//
String publishStatus = GalaxyEnum.SeriesClaimStatusEnum.PROCESSING.getCode();
//设置系列声明状态
seriesClaimRespDto.setSeriesClaimStatus(publishStatus);
//构造系列信息
seriesInfoBo = this.buildSeriesInfoBo(reqDto,taskId,publishStatus);
//等一个系列支持多个藏品后需要从请求参数获取
seriesInfoBo.setSeriesName(seriesName);
seriesInfoBo.setSeriesCode(seriesCode);
dataUtils.setSeriesInfoBo(reqDto.getRouterType(),seriesCode,seriesInfoBo);
//构造系列nft信息
GalaxySeriesNftInfoBo seriesNftInfoBo = this.buildSeriesNftInfoBo(reqDto,seriesInfoBo,seriesNftUploadBo);
dataUtils.setSeriesNftInfoBo(reqDto.getRouterType(),reqDto.getSkuId(),seriesInfoBo,seriesNftInfoBo);
if(StringUtil.isEmpty(seriesNftInfoBo.getNftHash())){
log.error("生成nftHash error skuId:{} nftUrl is :{} ",seriesNftInfoBo.getSkuId(),seriesNftInfoBo.getNftUrl());
throw new ZxlNftException(GalaxyErrorEnum.SERIES_NFT_HASH_CREATE_FAIL.getCode(),GalaxyErrorEnum.SERIES_NFT_HASH_CREATE_FAIL.getMessage());
}
}
}else{
return ResponseDto.failure(GalaxyErrorEnum.SERIES_CLAIM_ERROR.getCode(),GalaxyErrorEnum.SERIES_CLAIM_ERROR.getMessage());
}
}else{
return ResponseDto.failure(GalaxyErrorEnum.SERIES_CLAIM_ERROR.getCode(),GalaxyErrorEnum.SERIES_CLAIM_ERROR.getMessage());
}
seriesClaimRespDto.setSkuId(skuId);
seriesClaimRespDto.setNftUrl(seriesNftUploadBo.getNftUrl());
seriesClaimRespDto.setDisplayUrl(seriesNftUploadBo.getDisplayUrl());
seriesClaimRespDto.setSeriesId(seriesId);
seriesClaimRespDto.setSeriesName(seriesName);
seriesClaimRespDto.setSkuId(skuId);
seriesClaimRespDto.setNftUrl(seriesNftUploadBo.getNftUrl());
seriesClaimRespDto.setDisplayUrl(seriesNftUploadBo.getDisplayUrl());
seriesClaimRespDto.setSeriesId(seriesId);
seriesClaimRespDto.setSeriesName(seriesName);
}catch(ZxlNftException e){
sysFailDesc = e.getMessage();
log.error(e.getMessage(),e);
}catch(Exception e){
sysFailDesc = e.getMessage();
log.error(e.getMessage(),e);
}
if(StringUtil.isNotEmpty(sysFailDesc)){
return ResponseDto.failure(sysFailDesc);
}
if(StringUtil.isNotEmpty(bizFailDesc)){
return ResponseDto.failure(bizFailDesc);
}
return ResponseDto.success(seriesClaimRespDto);
}
......@@ -329,6 +353,13 @@ public class ZxinArtworkBiz {
}
String seriesCode = seriesNftInfoBo.getSeriesCode();
//如果nftUrl介质hash为空,则重新生成
if(StringUtil.isEmpty(seriesNftInfoBo.getNftHash())){
//更新系列对应的系列nft状态
seriesNftInfoBo.setNftHash(zxlnftBiz.getHashString(seriesNftInfoBo.getNftUrl()));
dataUtils.updateSeriesNftStatus(reqDto.getRouterType(),reqDto.getSkuId(),seriesNftInfoBo);
}
//获取任务ID
GalaxySeriesInfoBo seriesInfoBo = dataUtils.getSeriesInfoBo(reqDto.getRouterType(),seriesCode);
if(StringUtil.isNull(seriesInfoBo)||StringUtil.isEmpty(seriesInfoBo.getSeriesClaimTaskId())){
......
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