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

Commit 8bd2043d authored by GaoHu's avatar GaoHu

Merge branch 'master' into dev_0507kids

parents 5a0bd493 831f4547
...@@ -15,4 +15,6 @@ public interface IAdamRealNameService { ...@@ -15,4 +15,6 @@ public interface IAdamRealNameService {
void add(AdamRealName realName); void add(AdamRealName realName);
void upsert(AdamRealName realName, boolean updateFlg); void upsert(AdamRealName realName, boolean updateFlg);
void update(AdamRealName realName, String mobile);
} }
...@@ -70,4 +70,6 @@ public interface IAdamUserService { ...@@ -70,4 +70,6 @@ public interface IAdamUserService {
AdamRealInfoVo identity(String uid, String name, String idCard, String mobile); AdamRealInfoVo identity(String uid, String name, String idCard, String mobile);
AdamRealInfoVo identityForUpsert(String uid, String name, String idCard, String mobile, boolean updateFlg); AdamRealInfoVo identityForUpsert(String uid, String name, String idCard, String mobile, boolean updateFlg);
AdamRealInfoVo identityForUpdate(String uid, String mobile, int idType, int node, String idCard, String idName);
} }
...@@ -11,6 +11,7 @@ package com.liquidnet.service.galaxy.constant; ...@@ -11,6 +11,7 @@ package com.liquidnet.service.galaxy.constant;
*/ */
public class GalaxyConstant { public class GalaxyConstant {
//可删除key //可删除key
public static final String REDIS_KEY_GALAXY_USER_ID_CARD="galaxy:user_id_card:";
public static final String REDIS_KEY_GALAXY_USER="galaxy:user:"; public static final String REDIS_KEY_GALAXY_USER="galaxy:user:";
public static final String REDIS_KEY_GALAXY_SERIES="galaxy:series:"; public static final String REDIS_KEY_GALAXY_SERIES="galaxy:series:";
public static final String REDIS_KEY_GALAXY_SERIES_NFT_UPLOAD="galaxy:series:nft:upload:"; public static final String REDIS_KEY_GALAXY_SERIES_NFT_UPLOAD="galaxy:series:nft:upload:";
...@@ -21,7 +22,8 @@ public class GalaxyConstant { ...@@ -21,7 +22,8 @@ public class GalaxyConstant {
//以下禁止删除 //以下禁止删除
public static final String REDIS_KEY_GALAXY_PUBLISH_NFT="galaxy:publish:nft:"; //nft索引递增记录 public static final String REDIS_KEY_GALAXY_PUBLISH_NFT="galaxy:publish:nft:"; //nft索引递增记录
public static final String SERIES_NAME_PREFIX="NOW_ZXL_";// 系列存储目录名称和系列声明
public static final String ADAM_USER_SYNC_URL="/adam/rsc/syn/certmeta";// adam用户开通数字账户信息同步url
public static final String SERIES_NAME_PREFIX="NOW_ZXL_";// 系列存储目录名称和系列声明
} }
...@@ -32,7 +32,8 @@ public enum GalaxyErrorEnum { ...@@ -32,7 +32,8 @@ public enum GalaxyErrorEnum {
NFT_PUBLISH_AND_BUY_QUERY_FAIL("NFT0010019","NFT发行和购买结果查询失败!"), NFT_PUBLISH_AND_BUY_QUERY_FAIL("NFT0010019","NFT发行和购买结果查询失败!"),
NFT_QUERY_FAIL_ORDER_NOT_EXIST("NFT0010020","NFT订单不存在!"), NFT_QUERY_FAIL_ORDER_NOT_EXIST("NFT0010020","NFT订单不存在!"),
NFT_QUERY_FAIL_NFT_NOT_EXIST("NFT0010021","NFT信息查询不存在!"), NFT_QUERY_FAIL_NFT_NOT_EXIST("NFT0010021","NFT信息查询不存在!"),
NFT_QUERY_FAIL_SERIES_NOT_EXIST("NFT0010022","系列信息查询不存在!"); NFT_QUERY_FAIL_SERIES_NOT_EXIST("NFT0010022","系列信息查询不存在!"),
NFT_USER_HAS_OPEN_ACCOUNT("NFT0010023","用户已经开通过数字账户!");
private String code; private String code;
......
package com.liquidnet.service.galaxy.exception;
import lombok.Data;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 自定义异常类
* @class: GalaxyNftUserException
* @Package com.liquidnet.service.galaxy.exception
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/5/12 13:44
*/
@Data
public class GalaxyNftUserException extends RuntimeException{
private static final long serialVersionUID = -3916918823313768482L;
private String code;
private String message;
public GalaxyNftUserException(String code, String message) {
super(message);
this.code = code;
this.message = message;
}
public GalaxyNftUserException(String code, String message, Throwable t) {
super(message, t);
this.code = code;
this.message = message;
}
}
...@@ -131,7 +131,14 @@ public class GoblinRedisConst { ...@@ -131,7 +131,14 @@ public class GoblinRedisConst {
public static final String REDIS_GOBLIN_NFT_ORDER_BUG_LOCK = PREFIX.concat("nft:order:lock:");// nft购买用户锁 userId public static final String REDIS_GOBLIN_NFT_ORDER_BUG_LOCK = PREFIX.concat("nft:order:lock:");// nft购买用户锁 userId
public static final String REDIS_GOBLIN_NFT_ORDER_EX_LOCK = PREFIX.concat("nft:order:exLock:");// nft兑换码锁 code public static final String REDIS_GOBLIN_NFT_ORDER_EX_LOCK = PREFIX.concat("nft:order:exLock:");// nft兑换码锁 code
public static final String REDIS_GOBLIN_NFT_GOODS_LIST = PREFIX.concat("nft:goodsList");// nft商品列表 public static final String REDIS_GOBLIN_NFT_GOODS_LIST = PREFIX.concat("nft:goodsList");// nft商品列表
public static final String REDIS_GOBLIN_NFT_GOODS_LIST_INFO = PREFIX.concat("nft:goodsList:info:");// nft商品列表单藏品详情 skuId
public static final String REDIS_GOBLIN_NFT_NUM_ACCOUNT = PREFIX.concat("nft:account:");// nft用户数字账户是否开通 userId public static final String REDIS_GOBLIN_NFT_NUM_ACCOUNT = PREFIX.concat("nft:account:");// nft用户数字账户是否开通 userId
public static final String REDIS_GOBLIN_NFT_NUM_ACCOUNT_INFO = PREFIX.concat("nft:account:info:");// nft用户数字账户开通信息 userId
/**
* {goblin:nft:certmeta:{idType+idNo},{idname,mobile}}
*/
public static final String REDIS_GOBLIN_NFT_CERTMETA = PREFIX.concat("nft:certmeta:");
public static final String REDIS_GOBLIN_NFT_CERTMETA_JUNK = PREFIX.concat("nft:certmeta_junk:");
...@@ -149,7 +156,7 @@ public class GoblinRedisConst { ...@@ -149,7 +156,7 @@ public class GoblinRedisConst {
*/ */
public static final String STORE_COUPON = PREFIX.concat("s_coupon:"); public static final String STORE_COUPON = PREFIX.concat("s_coupon:");
/** /**
* 商铺活动:优惠券适用商品ID集合 * 商铺活动:优惠券适用商品ID集合item
* {goblin:s_coupon_r:${store_coupon_id}, JsonUtils.toJson(List<String:spu_id>)} * {goblin:s_coupon_r:${store_coupon_id}, JsonUtils.toJson(List<String:spu_id>)}
*/ */
public static final String STORE_COUPON_RULE = PREFIX.concat("s_coupon_r:"); public static final String STORE_COUPON_RULE = PREFIX.concat("s_coupon_r:");
...@@ -235,6 +242,12 @@ public class GoblinRedisConst { ...@@ -235,6 +242,12 @@ public class GoblinRedisConst {
public static final String NFT_PAY_TYPE = PREFIX.concat("nft:payType"); public static final String NFT_PAY_TYPE = PREFIX.concat("nft:payType");
public static final String LIST_DETAILS = PREFIX.concat("list:");//名单列表详情 $key:$listId
public static final String REDIS_BLACK = PREFIX.concat("black:");//黑名单 key:$listId:$skuId:$mobile
public static final String REDIS_WHITE = PREFIX.concat("white:");//白名单 key:$listId:$skuId:$mobile
public static final String LIST_COLLECT = PREFIX.concat("list:collect");//名单列表详情 $key:$skuId
public static final String ADAM_IS_MEMBER = "kylin:member:uid:";//是否会员 $key:$uid
public static final String LIST_RELATION_BOX = PREFIX.concat("list:relation:box");//名单列表详情 $key:$skuId:$listId
/** /**
* nft兑换活动配置 * nft兑换活动配置
*/ */
......
package com.liquidnet.service.goblin.constant;
public class NftAccStatusEnum {
/**
* 数字账户开通状态
*/
public enum StatusAcc {
ING("1000", "开通中"),
SUCCESS("2000", "开通成功"),
FAILURE1("3000", "实名失败"),
FAILURE2("3001", "开通失败可重试"),
FAILURE3("3002", "该身份证已开通数字账号 不可重复操作"),
;
private final String code;
private final String msg;
StatusAcc(String code, String msg) {
this.code = code;
this.msg = msg;
}
public String getCode() {
return code;
}
public String getMsg() {
return msg;
}
}
}
package com.liquidnet.service.goblin.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.liquidnet.commons.lang.util.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
@ApiModel(value = "GoblinUserNftAccInfoVo", description = "数字账户开通信息")
@Data
public class GoblinUserNftAccInfoVo implements Serializable, Cloneable {
private static final long serialVersionUID = 9036417838200526658L;
@ApiModelProperty(position = 11, value = "状态码 1000开通中 2000开通成功 3000实名失败 3001开通失败可重试 3002该身份证已开通数字账号 不可重复操作")
private String code;
@ApiModelProperty(position = 12, value = "提示信息")
private String msg;
@ApiModelProperty(position = 13, value = "最后操作的时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime time;
private static final GoblinUserNftAccInfoVo obj = new GoblinUserNftAccInfoVo();
public static GoblinUserNftAccInfoVo getNew() {
try {
return (GoblinUserNftAccInfoVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinUserNftAccInfoVo();
}
}
}
package com.liquidnet.service.goblin.dto.manage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.List;
@ApiModel(value = "GoblinStoreMgtGoodsSkuArActionParam", description = "商品管理:藏品AR:管理(删除...)")
@Data
public class GoblinStoreMgtGoodsSkuArActionParam implements Serializable {
private static final long serialVersionUID = 3193592471744574048L;
@ApiModelProperty(position = 10, required = true, value = "店铺ID")
@NotBlank(message = "店铺ID不能为空")
private String storeId;
@ApiModelProperty(position = 11, required = true, value = "操作类型[REMOVE-删除]")
@Pattern(regexp = "\\b(REMOVE)\\b", message = "操作类型无效")
private String action;
@ApiModelProperty(position = 12, required = true, value = "单品ID列表")
private List<String> skuIdList;
}
package com.liquidnet.service.goblin.dto.manage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@ApiModel(value = "GoblinStoreMgtGoodsSkuArAddParam", description = "商品管理:藏品AR:新增入参")
@Data
public class GoblinStoreMgtGoodsSkuArAddParam implements Serializable {
private static final long serialVersionUID = -6002785025793722474L;
@ApiModelProperty(position = 10, required = true, value = "店铺ID")
@NotNull(message = "店铺ID不能为空")
private String storeId;
@ApiModelProperty(position = 11, required = true, value = "单品ID")
@NotNull(message = "单品ID不能为空")
private String skuId;
@ApiModelProperty(position = 12, required = true, value = "单品AR文件URL-iOS版[256]")
@NotNull(message = "iOS文件不能为空")
private String arUrlIos;
@ApiModelProperty(position = 13, required = true, value = "单品AR文件URL-android版[256]")
@NotNull(message = "android文件不能为空")
private String arUrlAndroid;
}
package com.liquidnet.service.goblin.dto.manage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
import java.io.Serializable;
@ApiModel(value = "GoblinStoreMgtGoodsSkuExtraFilterParam", description = "商品管理:藏品AR:列表筛选条件")
@Data
public class GoblinStoreMgtGoodsSkuArFilterParam implements Serializable {
private static final long serialVersionUID = -8520107197264504640L;
@ApiModelProperty(position = 10, required = true, value = "店铺ID[64]")
@NotBlank(message = "店铺ID不能为空")
private String storeId;
@ApiModelProperty(position = 11, required = true, value = "当前记录起始索引", example = "1")
@Min(value = 1, message = "起始索引无效")
@NotNull(message = "起始索引无效")
private Integer pageNum;
@ApiModelProperty(position = 12, required = true, value = "每页显示记录数", example = "20")
@Min(value = 1, message = "显示记录数不能小于1")
@Max(value = 100, message = "显示记录数不能大于100")
@NotNull(message = "显示记录数不能为空")
private Integer pageSize;
@ApiModelProperty(position = 13, required = false, value = "搜索关键字[128]")
@Size(min = 2, max = 100, message = "搜索关键字长度范围2~100")
private String keyword;
}
...@@ -25,5 +25,7 @@ public class GoblinStoreMgtGoodsSkuFilterParam implements Serializable { ...@@ -25,5 +25,7 @@ public class GoblinStoreMgtGoodsSkuFilterParam implements Serializable {
private String keyword; private String keyword;
@ApiModelProperty(position = 14, required = false, value = "商品上架状态[0-待上架|1-下架|2-违规|3-上架|4-已上架未开售]", allowableValues = "0,1,2,3") @ApiModelProperty(position = 14, required = false, value = "商品上架状态[0-待上架|1-下架|2-违规|3-上架|4-已上架未开售]", allowableValues = "0,1,2,3")
private String shelvesStatus; private String shelvesStatus;
@ApiModelProperty(position = 15, required = false, value = "类型[0-普通|1-分批购]")
private Integer type;
} }
package com.liquidnet.service.goblin.dto.manage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
@ApiModel(value = "GoblinStoreMgtGoodsSkuSimpleFilterParam", description = "商品管理:SKU列表筛选条件入参")
@Data
public class GoblinStoreMgtGoodsSkuSimpleFilterParam implements Serializable {
private static final long serialVersionUID = -2875361058424448491L;
@ApiModelProperty(position = 10, required = true, value = "店铺ID[64]")
@NotBlank(message = "店铺ID不能为空")
private String storeId;
@ApiModelProperty(position = 11, required = true, value = "当前记录起始索引", example = "1")
@Min(value = 1, message = "起始索引不能小于1")
@NotNull(message = "起始索引无效")
private Integer pageNum;
@ApiModelProperty(position = 13, required = false, value = "搜索关键字[128]")
@Size(min = 2, max = 100, message = "搜索关键字长度范围2~100")
private String keyword;
@ApiModelProperty(position = 14, required = false, value = "商品类型[0-常规|1-数字藏品],未指定则代表全部")
private Integer skuType;
// @ApiModelProperty(position = 15, required = false, value = "商品上架状态[0-待上架|1-下架|2-违规|3-上架]", allowableValues = "0,1,2,3")
// private String shelvesStatus;
}
package com.liquidnet.service.goblin.dto.manage.vo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ApiModel(value = "GoblinStoreMgtGoodsSkuArListVo", description = "商品管理:藏品AR列表信息")
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class GoblinStoreMgtGoodsSkuArListVo implements Serializable, Cloneable {
private static final long serialVersionUID = -6629148859241936997L;
@ApiModelProperty(position = 10, value = "商品单品ID")
private String skuId;
@ApiModelProperty(position = 11, value = "单品的名称[100]")
private String name;
@ApiModelProperty(position = 12, value = "单品的副标题[128]")
private String subtitle;
@ApiModelProperty(position = 13, value = "单品AR文件URL-iOS版[256]")
private String arUrlIos;
@ApiModelProperty(position = 14, value = "单品AR文件URL-android版[256]")
private String arUrlAndroid;
private static final GoblinStoreMgtGoodsSkuArListVo obj = new GoblinStoreMgtGoodsSkuArListVo();
public static GoblinStoreMgtGoodsSkuArListVo getNew() {
try {
return (GoblinStoreMgtGoodsSkuArListVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinStoreMgtGoodsSkuArListVo();
}
}
}
...@@ -48,6 +48,8 @@ public class GoblinStoreMgtGoodsSkuListVo implements Serializable, Cloneable { ...@@ -48,6 +48,8 @@ public class GoblinStoreMgtGoodsSkuListVo implements Serializable, Cloneable {
private Integer upchain; private Integer upchain;
@ApiModelProperty(position = 38, value = "盲盒命中率") @ApiModelProperty(position = 38, value = "盲盒命中率")
private BigDecimal hitRatio; private BigDecimal hitRatio;
@ApiModelProperty(position = 39, value = "系统时间")
private String sysTime;
public String getSaleStartTime() { public String getSaleStartTime() {
return DateUtil.Formatter.yyyyMMddHHmmss.format(saleStartTime); return DateUtil.Formatter.yyyyMMddHHmmss.format(saleStartTime);
......
package com.liquidnet.service.goblin.dto.manage.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ApiModel(value = "GoblinStoreMgtGoodsSkuSimpleVo", description = "商品管理:SKU列表(简版)")
@Data
public class GoblinStoreMgtGoodsSkuSimpleVo implements Serializable {
private static final long serialVersionUID = 7389835893135307728L;
@ApiModelProperty(position = 10, value = "商品ID[64]")
private String spuId;
@ApiModelProperty(position = 11, value = "单品ID[64]")
private String skuId;
@ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品]")
private int skuType;
@ApiModelProperty(position = 13, value = "单品名称[100]")
private String name;
@ApiModelProperty(position = 14, value = "单品副标题[100]")
private String subtitle;
}
package com.liquidnet.service.goblin.dto.vo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@ApiModel(value = "GoblinGoodsInfoListVo", description = "商品SPU List")
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class GoblinGoodsInfoListVoo implements Serializable, Cloneable {
private List<GoblinGoodsInfoListVo> list;
@ApiModelProperty(position = 55, value = "数量")
private long count;
private static final GoblinGoodsInfoListVoo obj = new GoblinGoodsInfoListVoo();
public static GoblinGoodsInfoListVoo getNew() {
try {
return (GoblinGoodsInfoListVoo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinGoodsInfoListVoo();
}
}
/* public int compareTo(GoblinGoodsInfoVo arg0) {
return this.getCount().compareTo(arg0.getCount());
}*/
}
...@@ -147,9 +147,14 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable { ...@@ -147,9 +147,14 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable {
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR) @JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR)
private LocalDateTime deletedAt; private LocalDateTime deletedAt;
@ApiModelProperty(position = 40, value = "单品AR文件URL-iOS版")
private String arUrlIos;
@ApiModelProperty(position = 40, value = "单品AR文件URL-android版")
private String arUrlAndroid;
@ApiModelProperty(position = 40, value = "单品规格信息") @ApiModelProperty(position = 40, value = "单品规格信息")
private List<GoblinGoodsSpecDto> skuSpecList; private List<GoblinGoodsSpecDto> skuSpecList;
@ApiModelProperty(position = 54, value = "单品音乐人标签[藏品类型时使用]") @ApiModelProperty(position = 41, value = "单品音乐人标签[藏品类型时使用]")
private List<GoblinGoodsExtagVo> extagVoList; private List<GoblinGoodsExtagVo> extagVoList;
/* -------------------------------- 只展示,不存储 -------------------------------- */ /* -------------------------------- 只展示,不存储 -------------------------------- */
......
package com.liquidnet.service.goblin.dto.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
public class GoblinListCollectVo implements Serializable, Cloneable{
@ApiModelProperty(value = "listId")
private String listId;
@ApiModelProperty(value = "spuId")
private String spuId;
@ApiModelProperty(value = "skuId")
private String skuId;
@ApiModelProperty(value = "标签[0-提前购买|1-分段购买]")
private Integer tagType;
@ApiModelProperty(value = "android价格")
private BigDecimal price;
@ApiModelProperty(value = "苹果价格")
private BigDecimal priceV;
@ApiModelProperty(value = "苹果价格id")
private String productId;
@ApiModelProperty(value = "优先购类型[0-会员|1-指定用户]")
private Integer whiteType;
@ApiModelProperty(value = "开始时间")
private LocalDateTime timeStart;
@ApiModelProperty(value = "结束时间")
private LocalDateTime timeEnd;
private static final GoblinListCollectVo obj = new GoblinListCollectVo();
public static GoblinListCollectVo getNew() {
try {
return (GoblinListCollectVo) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new GoblinListCollectVo();
}
}
package com.liquidnet.service.goblin.dto.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class GoblinListDetailsItemVo implements Serializable, Cloneable{
@ApiModelProperty(value = "spuId")
private String spuId;
@ApiModelProperty(value = "skuId")
private String skuId;
@ApiModelProperty(value = "sku名称")
private String skuName;
@ApiModelProperty(value = "剩余库存")
private Integer surplusStock;
@ApiModelProperty(value = "android价格")
private BigDecimal price;
@ApiModelProperty(value = "库存")
private Integer skuStock;
@ApiModelProperty(value = "苹果价格")
private BigDecimal priceV;
@ApiModelProperty(value = "苹果价格id")
private String productId;
private static final GoblinListDetailsItemVo obj = new GoblinListDetailsItemVo();
public static GoblinListDetailsItemVo getNew() {
try {
return (GoblinListDetailsItemVo) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new GoblinListDetailsItemVo();
}
}
package com.liquidnet.service.goblin.dto.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
@Data
public class GoblinListDetailsVo implements Serializable, Cloneable {
@ApiModelProperty(value = "名单id")
private String listId;
@ApiModelProperty(value = "用户id")
private String uid;
@ApiModelProperty(value = "优先购名称")
private String name;
@ApiModelProperty(value = "优先购类型[0-会员|1-指定用户]")
private Integer whiteType;
@ApiModelProperty(value = "优先购文件地址")
private String whiteUrl;
@ApiModelProperty(value = "标签[0-提前购买|1-分段购买]")
private Integer tagType;
@ApiModelProperty(value = "开始时间")
private String timeStart;
@ApiModelProperty(value = "结束时间")
private String timeEnd;
@ApiModelProperty(value = "黑名单文件地址")
private String blackUrl;
@ApiModelProperty(value = "商品数据")
private List<GoblinListDetailsItemVo> itemVo;
@ApiModelProperty(value = "创建时间")
private String createdAt;
@ApiModelProperty(value = "白名单文件名称")
private String whiteName;
@ApiModelProperty(value = "黑名单文件名称")
private String blackName;
private static final GoblinListDetailsVo obj = new GoblinListDetailsVo();
public static GoblinListDetailsVo getNew() {
try {
return (GoblinListDetailsVo) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new GoblinListDetailsVo();
}
}
package com.liquidnet.service.goblin.dto.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class GoblinListVo implements Serializable, Cloneable {
@ApiModelProperty(value = "名单id")
private String listId;
@ApiModelProperty(value = "优先购名称")
private String name;
@ApiModelProperty(value = "开始时间")
private String timeStart;
@ApiModelProperty(value = "结束时间")
private String timeEnd;
@ApiModelProperty(value = "是否有黑名单[1-有|2-无]")
private Integer hasBlack;
@ApiModelProperty(value = "商品数量")
private Integer skuCount;
private static final GoblinListVo obj = new GoblinListVo();
public static GoblinListVo getNew() {
try {
return (GoblinListVo) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new GoblinListVo();
}
}
...@@ -110,6 +110,7 @@ public class GoblinNftExSkuVo { ...@@ -110,6 +110,7 @@ public class GoblinNftExSkuVo {
@ApiModelProperty(position = 20,required = true,value ="修改时间") @ApiModelProperty(position = 20,required = true,value ="修改时间")
private LocalDateTime updatedAt; private LocalDateTime updatedAt;
// redis 覆盖暂时无用
private String rdStartTime; private String rdStartTime;
private String rdStopTime; private String rdStopTime;
......
...@@ -94,6 +94,21 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable { ...@@ -94,6 +94,21 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
@ApiModelProperty(position = 65, value = "是否开启兑换 1未开启 2已开启") @ApiModelProperty(position = 65, value = "是否开启兑换 1未开启 2已开启")
private int isExchange; private int isExchange;
@ApiModelProperty(position = 65, value = "单品AR文件URL-iOS版")
private String arUrlIos;
@ApiModelProperty(position = 66, value = "单品AR文件URL-Android版")
private String arUrlAndroid;
@ApiModelProperty(position = 67, value = "标签[0-提前购买|1-分段购买]")
private Integer tagType;
@ApiModelProperty(position = 68, value = "分批购活动id")
private String listId;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
@ApiModelProperty(position = 69, value = "sku正常开售时间")
private LocalDateTime baseSaleStartTime;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
@ApiModelProperty(position = 70, value = "下个分段购开始时间,如果为null则没有")
private LocalDateTime nextSaleStartTime;
private static final GoblinNftGoodsSkuInfoVo obj = new GoblinNftGoodsSkuInfoVo(); private static final GoblinNftGoodsSkuInfoVo obj = new GoblinNftGoodsSkuInfoVo();
public static GoblinNftGoodsSkuInfoVo getNew() { public static GoblinNftGoodsSkuInfoVo getNew() {
...@@ -136,6 +151,8 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable { ...@@ -136,6 +151,8 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
this.setAboutPeople(anticipateValueVo.getAboutPeople()); this.setAboutPeople(anticipateValueVo.getAboutPeople());
this.setAboutAvatarList(anticipateValueVo.getAboutAvatarList()); this.setAboutAvatarList(anticipateValueVo.getAboutAvatarList());
} }
this.setArUrlIos(source.getArUrlIos());
this.setArUrlAndroid(source.getArUrlAndroid());
return this; return this;
} }
} }
...@@ -21,6 +21,7 @@ public class GoblinNftGoodsSkuListJobVo implements Serializable { ...@@ -21,6 +21,7 @@ public class GoblinNftGoodsSkuListJobVo implements Serializable {
private String spuId; private String spuId;
@ApiModelProperty(position = 16, value = "是否盲盒[0-否|1-是]") @ApiModelProperty(position = 16, value = "是否盲盒[0-否|1-是]")
private String unbox; private String unbox;
private String listId;
@ApiModelProperty(position = 27, value = "开售时间") @ApiModelProperty(position = 27, value = "开售时间")
private LocalDateTime saleStartTime; private LocalDateTime saleStartTime;
......
...@@ -50,6 +50,8 @@ public class GoblinNftGoodsSkuListVo implements Serializable, Cloneable { ...@@ -50,6 +50,8 @@ public class GoblinNftGoodsSkuListVo implements Serializable, Cloneable {
private String aboutEndDate; private String aboutEndDate;
@ApiModelProperty(position = 61, value = "预约状态(0:未开始,1:可预约,3:已结束)") @ApiModelProperty(position = 61, value = "预约状态(0:未开始,1:可预约,3:已结束)")
private Integer state; private Integer state;
@ApiModelProperty(position = 62, value = "标签[0-提前购买|1-分段购买]")
private Integer tagType;
private static final GoblinNftGoodsSkuListVo obj = new GoblinNftGoodsSkuListVo(); private static final GoblinNftGoodsSkuListVo obj = new GoblinNftGoodsSkuListVo();
......
...@@ -61,6 +61,12 @@ public class GoblinNftOrderVo implements Serializable, Cloneable { ...@@ -61,6 +61,12 @@ public class GoblinNftOrderVo implements Serializable, Cloneable {
@ApiModelProperty(value = "用户手机号") @ApiModelProperty(value = "用户手机号")
private String userMobile; private String userMobile;
@ApiModelProperty(value = "分批购ID")
private String listId;
@ApiModelProperty(value = "兑换码")
private String exCode;
@ApiModelProperty(value = "应付金额") @ApiModelProperty(value = "应付金额")
private BigDecimal priceTotal; private BigDecimal priceTotal;
...@@ -150,6 +156,8 @@ public class GoblinNftOrderVo implements Serializable, Cloneable { ...@@ -150,6 +156,8 @@ public class GoblinNftOrderVo implements Serializable, Cloneable {
this.setUserId(source.getUserId()); this.setUserId(source.getUserId());
this.setUserName(source.getUserName()); this.setUserName(source.getUserName());
this.setUserMobile(source.getUserMobile()); this.setUserMobile(source.getUserMobile());
this.setListId(source.getListId());
this.setExCode(source.getExCode());
this.setPriceTotal(source.getPriceTotal()); this.setPriceTotal(source.getPriceTotal());
this.setPriceCoupon(source.getPriceCoupon()); this.setPriceCoupon(source.getPriceCoupon());
this.setStorePriceCoupon(source.getStorePriceCoupon()); this.setStorePriceCoupon(source.getStorePriceCoupon());
......
...@@ -30,12 +30,15 @@ public class GoblinPayOrderDetailsVo implements Serializable, Cloneable { ...@@ -30,12 +30,15 @@ public class GoblinPayOrderDetailsVo implements Serializable, Cloneable {
@ApiModelProperty(position = 22, value = "IOS商品价格[20,2]") @ApiModelProperty(position = 22, value = "IOS商品价格[20,2]")
private BigDecimal priceV; private BigDecimal priceV;
@ApiModelProperty(value = "商铺名称") @ApiModelProperty(position = 23, value = "商铺名称")
private String storeName; private String storeName;
@ApiModelProperty(position = 23, value = "数量") @ApiModelProperty(position = 24, value = "数量")
private Integer num; private Integer num;
@ApiModelProperty(position = 25, value = "分批、提前购 是否有购买权限 0没有 1有")
private Integer isListCanBuy;
private static final GoblinPayOrderDetailsVo obj = new GoblinPayOrderDetailsVo(); private static final GoblinPayOrderDetailsVo obj = new GoblinPayOrderDetailsVo();
public static GoblinPayOrderDetailsVo getNew() { public static GoblinPayOrderDetailsVo getNew() {
......
...@@ -42,6 +42,14 @@ public class GoblinUserDigitalArtworkInfoVo implements Serializable, Cloneable { ...@@ -42,6 +42,14 @@ public class GoblinUserDigitalArtworkInfoVo implements Serializable, Cloneable {
@ApiModelProperty(position = 23, value = "藏品详情") @ApiModelProperty(position = 23, value = "藏品详情")
private String details; private String details;
@ApiModelProperty(position = 24, value = "单品AR文件URL-iOS版")
private String arUrlIos;
@ApiModelProperty(position = 25, value = "单品AR文件URL-android版")
private String arUrlAndroid;
@ApiModelProperty(position = 26, value = "单品ID")
private String skuId;
private static final GoblinUserDigitalArtworkInfoVo obj = new GoblinUserDigitalArtworkInfoVo(); private static final GoblinUserDigitalArtworkInfoVo obj = new GoblinUserDigitalArtworkInfoVo();
public static GoblinUserDigitalArtworkInfoVo getNew() { public static GoblinUserDigitalArtworkInfoVo getNew() {
...@@ -66,6 +74,7 @@ public class GoblinUserDigitalArtworkInfoVo implements Serializable, Cloneable { ...@@ -66,6 +74,7 @@ public class GoblinUserDigitalArtworkInfoVo implements Serializable, Cloneable {
// this.setAuthor(); // this.setAuthor();
// this.setPublisher(); // this.setPublisher();
// this.setDetails(); // this.setDetails();
this.setSkuId(source.getSkuId());
return this; return this;
} }
} }
package com.liquidnet.service.goblin.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@Data
public class GoblinListCreateItemParam {
@ApiModelProperty(value = "spuId",required = true)
@NotNull(message = "spuId不能为空")
private String spuId;
@ApiModelProperty(value = "skuId",required = true)
@NotNull(message = "skuId不能为空")
private String skuId;
@ApiModelProperty(value = "android价格",required = true)
@NotNull(message = "price不能为空")
private BigDecimal price;
@ApiModelProperty(value = "库存",required = true)
@NotNull(message = "库存不能为空")
private Integer skuStock;
@ApiModelProperty(value = "苹果价格",required = true)
@NotNull(message = "苹果价格不能为空")
private BigDecimal priceV;
@ApiModelProperty(value = "苹果价格id",required = true)
@NotNull(message = "苹果价格id不能为空")
private String productId;
}
package com.liquidnet.service.goblin.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class GoblinListCreateParam {
@ApiModelProperty(value = "优先购名称",required = true)
@NotNull(message = "优先购名称不能为空")
private String name;
@ApiModelProperty(value = "优先购类型[0-会员|1-指定用户]",required = true)
@NotNull(message = "优先购类型不能为空")
private Integer whiteType;
@ApiModelProperty(value = "标签[0-提前购买|1-分段购买]",required = true)
@NotNull(message = "标签类型不能为空")
private Integer tagType;
@ApiModelProperty(value = "优先购文件地址")
private String whiteUrl;
@ApiModelProperty(value = "开始时间",required = true)
@NotNull(message = "开始时间不能为空")
private String timeStart;
@ApiModelProperty(value = "结束时间")
private String timeEnd;
@ApiModelProperty(value = "黑名单文件地址")
private String blackUrl;
@ApiModelProperty(value = "黑名单文件名称")
private String blackName;
@ApiModelProperty(value = "白名单文件名称")
private String whiteName;
@ApiModelProperty(value = "商品数据",required = true)
private List<GoblinListCreateItemParam> itemParams;
}
package com.liquidnet.service.goblin.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class GoblinListUpdateParam {
@ApiModelProperty(value = "名单id",required = true)
@NotNull(message = "名单id不能为空")
private String listId;
@ApiModelProperty(value = "优先购类型[0-会员|1-指定用户]",required = true)
@NotNull(message = "优先购类型不能为空")
private Integer whiteType;
@ApiModelProperty(value = "优先购文件地址")
private String whiteUrl;
@ApiModelProperty(value = "黑名单文件地址")
private String blackUrl;
@ApiModelProperty(value = "黑名单文件名称")
private String blackName;
@ApiModelProperty(value = "白名单文件名称")
private String whiteName;
}
...@@ -39,4 +39,8 @@ public class GoblinNftOrderListParam { ...@@ -39,4 +39,8 @@ public class GoblinNftOrderListParam {
private String payTimeStart; private String payTimeStart;
@ApiModelProperty(value = "支付结束时间") @ApiModelProperty(value = "支付结束时间")
private String payTimeEnd; private String payTimeEnd;
@ApiModelProperty(value = "兑换码")
private String exCode;
@ApiModelProperty(value = "用户手机号")
private String userMobile;
} }
...@@ -35,4 +35,8 @@ public class GoblinNftOrderRefundListParam { ...@@ -35,4 +35,8 @@ public class GoblinNftOrderRefundListParam {
private String payType; private String payType;
@ApiModelProperty(value = "订单状态") @ApiModelProperty(value = "订单状态")
private Integer status; private Integer status;
@ApiModelProperty(value = "支付开始时间")
private String payTimeStart;
@ApiModelProperty(value = "支付结束时间")
private String payTimeEnd;
} }
...@@ -6,6 +6,6 @@ import javax.servlet.http.HttpServletResponse; ...@@ -6,6 +6,6 @@ import javax.servlet.http.HttpServletResponse;
public interface IGoblinExportService { public interface IGoblinExportService {
//导出商城订单信息 //导出商城订单信息
ResponseDto<Boolean> exportMallOrder(HttpServletResponse response, String beginTime, String endTime, String state, Integer mailType,String storeId); ResponseDto<String> exportMallOrder(HttpServletResponse response, String beginTime, String endTime, String state, Integer mailType,String storeId);
} }
...@@ -11,5 +11,5 @@ public interface IGoblinNftOrderAppService { ...@@ -11,5 +11,5 @@ public interface IGoblinNftOrderAppService {
ResponseDto<GoblinNftOrderDetailsVo> orderDetails(String orderId); ResponseDto<GoblinNftOrderDetailsVo> orderDetails(String orderId);
GoblinPayOrderDetailsVo payOrderDetails(String skuId); ResponseDto<GoblinPayOrderDetailsVo> payOrderDetails(String skuId);
} }
package com.liquidnet.service.goblin.service; package com.liquidnet.service.goblin.service;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.GoblinUserNftAccInfoVo;
public interface IGoblinNftUserService { public interface IGoblinNftUserService {
...@@ -12,7 +13,7 @@ public interface IGoblinNftUserService { ...@@ -12,7 +13,7 @@ public interface IGoblinNftUserService {
* @param name 证件名 * @param name 证件名
* @param idCard 证件号 * @param idCard 证件号
* @param mobile 手机号 * @param mobile 手机号
* @return Integer[1-成功] * @return ResponseDto<GoblinUserNftAccInfoVo>
*/ */
ResponseDto<Integer> openNftAccount(String uid, String bizCode, String name, String idCard, String mobile); ResponseDto<GoblinUserNftAccInfoVo> openNftAccount(String uid, String bizCode, String name, String idCard, String mobile);
} }
package com.liquidnet.service.goblin.service.manage;
import com.github.pagehelper.PageInfo;
import com.liquidnet.service.base.PagedResult;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinListDetailsVo;
import com.liquidnet.service.goblin.dto.vo.GoblinListVo;
import com.liquidnet.service.goblin.param.GoblinListCreateParam;
import com.liquidnet.service.goblin.param.GoblinListUpdateParam;
import java.util.List;
/**
* <p>
* 商城-名单表 服务类
* </p>
*
* @author liquidnet
* @since 2022-04-29
*/
public interface IGoblinListService {
ResponseDto<PageInfo<GoblinListVo>> getList(String name, Integer page);
ResponseDto<GoblinListDetailsVo> getDetails(String listId);
ResponseDto<Boolean> create(GoblinListCreateParam param);
ResponseDto<Boolean> update(GoblinListUpdateParam param);
ResponseDto<Boolean> delete(String listId);
}
package com.liquidnet.service.goblin.service.manage;
import com.liquidnet.service.base.PagedResult;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsSkuArAddParam;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsSkuArFilterParam;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsSkuArListVo;
import java.util.List;
public interface IGoblinStoreMgtGoodsSkuExtraService {
/**
* 商品管理:藏品AR:列表
*
* @param mgtGoodsSkuExtraFilterParam GoblinStoreMgtGoodsSkuExtraFilterParam
* @return PagedResult<GoblinStoreMgtGoodsSkuArListVo>
*/
PagedResult<GoblinStoreMgtGoodsSkuArListVo> skuArList(GoblinStoreMgtGoodsSkuArFilterParam mgtGoodsSkuExtraFilterParam);
/**
* 商品管理:藏品AR:添加编辑
*
* @param uid UID
* @param mgtGoodsSkuArAddParam GoblinStoreMgtGoodsSkuArAddParam
* @param editFlg true-编辑|false-添加
* @return boolean
*/
boolean skuArAddEdit(String uid, GoblinStoreMgtGoodsSkuArAddParam mgtGoodsSkuArAddParam, boolean editFlg);
/**
* 商品管理:藏品AR:删除
*
* @param uid UID
* @param skuIdList List<单品ID>
* @return boolean
*/
boolean skuArDel(String uid, List<String> skuIdList);
}
...@@ -5,6 +5,7 @@ import com.liquidnet.service.goblin.dto.manage.*; ...@@ -5,6 +5,7 @@ import com.liquidnet.service.goblin.dto.manage.*;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsInfoVo; import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsInfoVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsListVo; import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsListVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsSkuListVo; import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsSkuListVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsSkuSimpleVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo; import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo; import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo;
...@@ -20,6 +21,8 @@ public interface IGoblinstoreMgtGoodsService { ...@@ -20,6 +21,8 @@ public interface IGoblinstoreMgtGoodsService {
*/ */
PagedResult<GoblinStoreMgtGoodsListVo> goodsList(GoblinStoreMgtGoodsFilterParam mgtGoodsFilterParam); PagedResult<GoblinStoreMgtGoodsListVo> goodsList(GoblinStoreMgtGoodsFilterParam mgtGoodsFilterParam);
PagedResult<GoblinStoreMgtGoodsSkuSimpleVo> skuList(GoblinStoreMgtGoodsSkuSimpleFilterParam mgtGoodsSkuSimpleFilterParam);
PagedResult<GoblinStoreMgtGoodsSkuListVo> skusList(GoblinStoreMgtGoodsSkuFilterParam mgtGoodsSkuFilterParam); PagedResult<GoblinStoreMgtGoodsSkuListVo> skusList(GoblinStoreMgtGoodsSkuFilterParam mgtGoodsSkuFilterParam);
/** /**
......
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.liquidnet.client.admin.common.core.controller.BaseController; import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.domain.AjaxResult; import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.zhengzai.goblin.service.impl.GoblinFrontCubeServiceImpl; import com.liquidnet.client.admin.zhengzai.goblin.service.impl.GoblinFrontCubeServiceImpl;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.goblin.entity.GoblinFrontCube; import com.liquidnet.service.goblin.entity.GoblinFrontCube;
import com.liquidnet.service.goblin.param.GoblinFrontCubeParam; import com.liquidnet.service.goblin.param.GoblinFrontCubeParam;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -52,6 +53,12 @@ public class GoblinFrontCubeController extends BaseController { ...@@ -52,6 +53,12 @@ public class GoblinFrontCubeController extends BaseController {
public AjaxResult updateOrCreate(@RequestBody List<GoblinFrontCubeParam> list) { public AjaxResult updateOrCreate(@RequestBody List<GoblinFrontCubeParam> list) {
List<GoblinFrontCube> list1=new ArrayList<>(); List<GoblinFrontCube> list1=new ArrayList<>();
for(GoblinFrontCubeParam goblinFrontCubeParam:list){ for(GoblinFrontCubeParam goblinFrontCubeParam:list){
if(StringUtil.isBlank(goblinFrontCubeParam.getSpuId())||goblinFrontCubeParam.getSpuId().equals("undefined")){
return error("spuId必传,请填写");
}
if(goblinFrontCubeParam.getSpuId().split(",").length==0){
return error("spuId必传,请填写");
}
GoblinFrontCube goblinFrontCube=new GoblinFrontCube(); GoblinFrontCube goblinFrontCube=new GoblinFrontCube();
BeanUtils.copyProperties(goblinFrontCubeParam,goblinFrontCube); BeanUtils.copyProperties(goblinFrontCubeParam,goblinFrontCube);
list1.add(goblinFrontCube); list1.add(goblinFrontCube);
......
...@@ -27,10 +27,6 @@ ...@@ -27,10 +27,6 @@
<label>订单编号:</label> <label>订单编号:</label>
<input type="text" name="orderCode"/> <input type="text" name="orderCode"/>
</li> </li>
<li>
<label>哈希值:</label>
<input type="text" name="nftId"/>
</li>
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12">
<li> <li>
...@@ -52,7 +48,7 @@ ...@@ -52,7 +48,7 @@
</select> </select>
</li> </li>
<li> <li>
<label>订单状态:</label> <label>退款状态:</label>
<select name="status"> <select name="status">
<option value="">全部</option> <option value="">全部</option>
<option value="1">申请退款</option> <option value="1">申请退款</option>
...@@ -60,6 +56,18 @@ ...@@ -60,6 +56,18 @@
<option value="3">退款失败</option> <option value="3">退款失败</option>
</select> </select>
</li> </li>
<li class="select-time">
<label>支付时间: </label>
<input type="text" class="time-input" placeholder="开始日期" name="payTimeStart"/>
<span>-</span>
<input type="text" class="time-input" placeholder="结束日期" name="payTimeEnd"/>
</li>
</div>
<div class="col-sm-12">
<li>
<label>哈希值:</label>
<input type="text" name="nftId"/>
</li>
<li> <li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a> class="fa fa-search"></i>&nbsp;搜索</a>
......
...@@ -27,10 +27,6 @@ ...@@ -27,10 +27,6 @@
<label>订单编号:</label> <label>订单编号:</label>
<input type="text" name="orderCode"/> <input type="text" name="orderCode"/>
</li> </li>
<li>
<label>哈希值:</label>
<input type="text" name="nftId"/>
</li>
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12">
<li> <li>
...@@ -66,6 +62,20 @@ ...@@ -66,6 +62,20 @@
<span>-</span> <span>-</span>
<input type="text" class="time-input" placeholder="结束日期" name="payTimeEnd"/> <input type="text" class="time-input" placeholder="结束日期" name="payTimeEnd"/>
</li> </li>
</div>
<div class="col-sm-12">
<li>
<label>哈希值:</label>
<input type="text" name="nftId"/>
</li>
<li>
<label>兑换码:</label>
<input type="text" name="exCode"/>
</li>
<li>
<label>用户手机号:</label>
<input type="text" name="userMobile"/>
</li>
<li> <li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a> class="fa fa-search"></i>&nbsp;搜索</a>
...@@ -135,8 +145,12 @@ ...@@ -135,8 +145,12 @@
{ {
field: 'payType', field: 'payType',
title: '支付方式', title: '支付方式',
formatter: function (value) { formatter: function (value, row) {
return $.table.selectDictLabel(payTypeDic, value); if (row.orderType == 2 || row.orderType == 4) {
return row.exCode;
} else {
return $.table.selectDictLabel(payTypeDic, value);
}
}, },
}, },
{ {
...@@ -160,7 +174,21 @@ ...@@ -160,7 +174,21 @@
}, },
{ {
field: 'name', field: 'name',
title: '藏品名称' title: '藏品名称',
formatter: function (value) {
return value.trim().split(" ")[0];
}
},
{
field: 'boxSkuId',
title: '藏品类型',
formatter: function (value) {
if (value) {
return "盲盒";
} else {
return "明盒";
}
}
}, },
{ {
field: 'tradingAt', field: 'tradingAt',
......
...@@ -24,7 +24,7 @@ public class GoblinNftOrderListExcelDto implements Serializable, Cloneable { ...@@ -24,7 +24,7 @@ public class GoblinNftOrderListExcelDto implements Serializable, Cloneable {
private String priceActual; private String priceActual;
@Excel(name = "订单状态") @Excel(name = "订单状态")
private String status; private String status;
@Excel(name = "下大美时间") @Excel(name = "下时间")
private String createdAt; private String createdAt;
@Excel(name = "支付时间") @Excel(name = "支付时间")
private String payTime; private String payTime;
...@@ -59,6 +59,9 @@ public class GoblinNftOrderListExcelDto implements Serializable, Cloneable { ...@@ -59,6 +59,9 @@ public class GoblinNftOrderListExcelDto implements Serializable, Cloneable {
case 3: case 3:
this.setOrderType("演出赠送"); this.setOrderType("演出赠送");
break; break;
case 4:
this.setOrderType("空投赠送");
break;
default: default:
this.setOrderType("未知"); this.setOrderType("未知");
break; break;
......
...@@ -67,6 +67,17 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe ...@@ -67,6 +67,17 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
public boolean updateOrCreate(List<GoblinFrontCube> list) { public boolean updateOrCreate(List<GoblinFrontCube> list) {
for(GoblinFrontCube goblinFrontCube:list){ for(GoblinFrontCube goblinFrontCube:list){
if (goblinFrontCube.getMid() == 0) { if (goblinFrontCube.getMid() == 0) {
String spuIds="";
for(String spuId:goblinFrontCube.getSpuId().split(",")){
if(spuId.equals("")||spuId.equals("undefined")){
}else{
spuIds=spuIds.concat(spuId).concat(",");
}
}
if(spuIds.length()>0){
goblinFrontCube.setSpuId(spuIds.substring(0,spuIds.length()-1));
}
this.create(goblinFrontCube); this.create(goblinFrontCube);
} else { } else {
goblinFrontCube.setUpdateTime(LocalDateTime.now()); goblinFrontCube.setUpdateTime(LocalDateTime.now());
...@@ -79,7 +90,10 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe ...@@ -79,7 +90,10 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
spuIds=spuIds.concat(spuId).concat(","); spuIds=spuIds.concat(spuId).concat(",");
} }
} }
goblinFrontCube.setSpuId(spuIds); if(spuIds.length()>0){
goblinFrontCube.setSpuId(spuIds.substring(0,spuIds.length()-1));
}
goblinFrontCubeMapper.updateById(goblinFrontCube); goblinFrontCubeMapper.updateById(goblinFrontCube);
} }
} }
...@@ -107,7 +121,9 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe ...@@ -107,7 +121,9 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
List<GoblinGoods> goodsList= goblinGoodsMapper.selectList(queryWrappers); List<GoblinGoods> goodsList= goblinGoodsMapper.selectList(queryWrappers);
GoblinFrontCubeParam goblinFrontCubeParam=new GoblinFrontCubeParam(); GoblinFrontCubeParam goblinFrontCubeParam=new GoblinFrontCubeParam();
BeanUtils.copyProperties(goblinFrontCube,goblinFrontCubeParam); BeanUtils.copyProperties(goblinFrontCube,goblinFrontCubeParam);
goblinFrontCubeParam.setGoblinGoods(goodsList.get(0)); if(null!=goodsList&&goodsList.size()>0){
goblinFrontCubeParam.setGoblinGoods(goodsList.get(0));
}
list1.add(goblinFrontCubeParam); list1.add(goblinFrontCubeParam);
} }
} }
...@@ -139,6 +155,8 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe ...@@ -139,6 +155,8 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
} }
//redis //redis
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_GOBLINFRONTCUBE,list); redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_GOBLINFRONTCUBE,list);
}else{
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_GOBLINFRONTCUBE,list);
} }
return true; return true;
...@@ -164,6 +182,8 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe ...@@ -164,6 +182,8 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
} }
//redis //redis
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_GOBLIN_RECOMMEND,list); redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_GOBLIN_RECOMMEND,list);
}else{
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_GOBLIN_RECOMMEND,list);
} }
return true; return true;
} }
......
...@@ -328,8 +328,8 @@ public class MQConst { ...@@ -328,8 +328,8 @@ public class MQConst {
SQL_NFT_ORDER_INFO("galaxy:stream:rk.sql.nftOrderInfo", "group.sql.nftOrderInfo", "订单信息"), SQL_NFT_ORDER_INFO("galaxy:stream:rk.sql.nftOrderInfo", "group.sql.nftOrderInfo", "订单信息"),
SQL_NFT_TRADE_INFO("galaxy:stream:rk.sql.nftTradeInfo", "group.sql.nftTradeInfo", "交易信息"), SQL_NFT_TRADE_INFO("galaxy:stream:rk.sql.nftTradeInfo", "group.sql.nftTradeInfo", "交易信息"),
SQL_NFT_ORDER_FAIL_LOG("galaxy:stream:rk.sql.nftOrderFailLog", "group.sql.nftOrderFailLog", "交易发行购买失败记录"), SQL_NFT_ORDER_FAIL_LOG("galaxy:stream:rk.sql.nftOrderFailLog", "group.sql.nftOrderFailLog", "交易发行购买失败记录"),
JSON_NFT_PUBLISH_AND_BUY("galaxy:stream:rk.json.nftPublishAndBuy", "group.sql.nftPublishAndBuy", "NFT发行和购买"), JSON_NFT_PUBLISH_AND_BUY("galaxy:stream:rk.json.nftPublishAndBuy", "group.json.nftPublishAndBuy", "NFT发行和购买"),
; JSON_NFT_USER_REGISTER("galaxy:stream:rk.json.userRegister", "group.json.userRegister", "NFT用户注册");
private final String key; private final String key;
private final String group; private final String group;
private final String desc; private final String desc;
......
...@@ -116,9 +116,9 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService ...@@ -116,9 +116,9 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
} }
log.info("nft003RegisterPersonPlatform--->>> response : {} ",response); log.info("nft003RegisterPersonPlatform--->>> response : {} ",response);
if (StringUtils.isEmpty(response)) { // if (StringUtils.isEmpty(response)) {
return null; // return null;
} // }
/** /**
* 构造返回结果 * 构造返回结果
...@@ -488,10 +488,6 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService ...@@ -488,10 +488,6 @@ public class ZxlnftSdkServiceImpl implements ZxlnftSdkService
} }
log.info("nft014IdentityBindSubmitByTrusted--->>> response : {} ",response); log.info("nft014IdentityBindSubmitByTrusted--->>> response : {} ",response);
if (StringUtils.isEmpty(response)) {
return null;
}
/** /**
* 构造返回结果 * 构造返回结果
*/ */
......
...@@ -2,6 +2,7 @@ package com.liquidnet.common.third.zxlnft.util; ...@@ -2,6 +2,7 @@ package com.liquidnet.common.third.zxlnft.util;
import com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz; import com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz;
import com.liquidnet.common.third.zxlnft.config.ZxlnftConfig; import com.liquidnet.common.third.zxlnft.config.ZxlnftConfig;
import com.liquidnet.common.third.zxlnft.constant.ZxlErrorEnum;
import com.liquidnet.common.third.zxlnft.dto.*; import com.liquidnet.common.third.zxlnft.dto.*;
import com.liquidnet.common.third.zxlnft.dto.nft.*; import com.liquidnet.common.third.zxlnft.dto.nft.*;
import com.liquidnet.common.third.zxlnft.exception.ZxlNftException; import com.liquidnet.common.third.zxlnft.exception.ZxlNftException;
...@@ -90,6 +91,8 @@ public class ZxlnftSdkUtil { ...@@ -90,6 +91,8 @@ public class ZxlnftSdkUtil {
BeanUtil.copy(resp,respDto); BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){ }catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage()); return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}catch(Exception e){
return ZxlnftResponseDto.failure(ZxlErrorEnum.SERVER_INNER_ERROR.getCode(),ZxlErrorEnum.SERVER_INNER_ERROR.getMsg());
} }
return ZxlnftResponseDto.success(respDto); return ZxlnftResponseDto.success(respDto);
} }
...@@ -316,6 +319,8 @@ public class ZxlnftSdkUtil { ...@@ -316,6 +319,8 @@ public class ZxlnftSdkUtil {
BeanUtil.copy(resp,respDto); BeanUtil.copy(resp,respDto);
}catch(ZxlNftException e){ }catch(ZxlNftException e){
return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage()); return ZxlnftResponseDto.failure(e.getCode()+","+e.getMessage());
}catch(Exception e){
return ZxlnftResponseDto.failure(ZxlErrorEnum.SERVER_INNER_ERROR.getCode(),ZxlErrorEnum.SERVER_INNER_ERROR.getMsg());
} }
return ZxlnftResponseDto.success(respDto); return ZxlnftResponseDto.success(respDto);
} }
......
...@@ -117,6 +117,7 @@ global-auth: ...@@ -117,6 +117,7 @@ global-auth:
- ${liquidnet.info.context}/nftTrade/** - ${liquidnet.info.context}/nftTrade/**
- ${liquidnet.info.context}/nftTradeQuery/** - ${liquidnet.info.context}/nftTradeQuery/**
- ${liquidnet.info.context}/nftUser/** - ${liquidnet.info.context}/nftUser/**
- ${liquidnet.info.context}/nftGoods/payType
oncheck-url-pattern: oncheck-url-pattern:
- -
# ----------------------------------------------------------- # -----------------------------------------------------------
......
...@@ -15,4 +15,6 @@ public class GoblinNftOrderListDto { ...@@ -15,4 +15,6 @@ public class GoblinNftOrderListDto {
private String name; private String name;
private String tradingAt; private String tradingAt;
private String nftId; private String nftId;
private String exCode;
private String boxSkuId;
} }
...@@ -249,9 +249,6 @@ public class GoblinGoodsSku implements Serializable { ...@@ -249,9 +249,6 @@ public class GoblinGoodsSku implements Serializable {
private LocalDateTime deletedAt; private LocalDateTime deletedAt;
private Integer upchain;
/** /**
* 物流模版id * 物流模版id
*/ */
......
package com.liquidnet.service.goblin.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 商品单品扩展信息
* </p>
*
* @author liquidnet
* @since 2022-05-05
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinGoodsSkuExtra implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
private String skuId;
/**
* 单品AR文件URL-iOS版
*/
private String arUrlIos;
/**
* 单品AR文件URL-android版
*/
private String arUrlAndroid;
/**
* 删除标记[0-未删除|1删除]
*/
private String delFlg;
private String createdBy;
private LocalDateTime createdAt;
private String updatedBy;
private LocalDateTime updatedAt;
private String deletedBy;
private LocalDateTime deletedAt;
private String comment;
}
package com.liquidnet.service.goblin.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 商城-名单表
* </p>
*
* @author liquidnet
* @since 2022-04-29
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinList implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* 名单id
*/
private String listId;
/**
* 用户id
*/
private String uid;
/**
* 名单名称
*/
private String name;
/**
* 白名单类型[0-会员|1-指定用户]
*/
private Integer whiteType;
/**
* 标签[0-提前购买|1-分段购买]
*/
private Integer tagType;
/**
* 白名单xls地址
*/
private String whiteUrl;
/**
* 开始时间
*/
private LocalDateTime timeStart;
/**
* 结束时间
*/
private LocalDateTime timeEnd;
/**
* 黑名单类型[0-会员|1-指定用户]
*/
private Integer blackType;
/**
* 黑名单xls地址
*/
private String blackUrl;
/**
* 删除标记
*/
private String delTag;
/**
* 补充字段
*/
private String comment;
/**
* 创建时间
*/
private LocalDateTime createdAt;
/**
* 更新时间
*/
private LocalDateTime updatedAt;
}
package com.liquidnet.service.goblin.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 商城-名单详情表
* </p>
*
* @author liquidnet
* @since 2022-04-29
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinListDetails implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* 名单id
*/
private String listId;
/**
* spuId
*/
private String spuId;
/**
* skuId
*/
private String skuId;
/**
* 补充字段
*/
private String comment;
/**
* 创建时间
*/
private LocalDateTime createdAt;
/**
* 更新时间
*/
private LocalDateTime updatedAt;
}
...@@ -85,6 +85,16 @@ public class GoblinNftOrder implements Serializable, Cloneable { ...@@ -85,6 +85,16 @@ public class GoblinNftOrder implements Serializable, Cloneable {
*/ */
private String userMobile; private String userMobile;
/**
* 分批购ID
*/
private String listId;
/**
* 兑换码
*/
private String exCode;
/** /**
* 应付金额 * 应付金额
*/ */
......
package com.liquidnet.service.goblin.mapper;
import com.liquidnet.service.goblin.entity.GoblinGoodsSkuExtra;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 商品单品扩展信息 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2022-05-05
*/
public interface GoblinGoodsSkuExtraMapper extends BaseMapper<GoblinGoodsSkuExtra> {
}
package com.liquidnet.service.goblin.mapper;
import com.liquidnet.service.goblin.entity.GoblinListDetails;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 商城-名单详情表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2022-04-29
*/
public interface GoblinListDetailsMapper extends BaseMapper<GoblinListDetails> {
}
package com.liquidnet.service.goblin.mapper;
import com.liquidnet.service.goblin.entity.GoblinList;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 商城-名单表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2022-04-29
*/
public interface GoblinListMapper extends BaseMapper<GoblinList> {
}
...@@ -94,4 +94,12 @@ public interface GoblinNftExCodeMapper extends BaseMapper<GoblinNftExCode> { ...@@ -94,4 +94,12 @@ public interface GoblinNftExCodeMapper extends BaseMapper<GoblinNftExCode> {
* @return * @return
*/ */
int updateCodeAdminUids(@Param("codes") String codes, @Param("adminUid") String adminUid); int updateCodeAdminUids(@Param("codes") String codes, @Param("adminUid") String adminUid);
/**
* excel导出打乱兑换码顺序
* @param goblinNftExCode
* @return
*/
List<GoblinNftExCode> selectGoblinNftCodeExcel(GoblinNftExCode goblinNftExCode);
} }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.goblin.mapper.GoblinGoodsSkuExtraMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.goblin.mapper.GoblinListDetailsMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.goblin.mapper.GoblinListMapper">
</mapper>
...@@ -129,6 +129,58 @@ ...@@ -129,6 +129,58 @@
</select> </select>
<select id="selectGoblinNftCodeExcel" parameterType="com.liquidnet.service.goblin.entity.GoblinNftExCode"
resultMap="BeseResult">
select
DISTINCT
gnec.code,gnec.code_id,gnec.sku_id,gnec.box_sku_id,gnec.activity_id,gnec.state,gnec.redeem_uid,gnec.redeem_at,gnec.admin_uid,gnec.created_at
from goblin_nft_ex_code gnec inner join goblin_nft_ex_sku gnes on gnec.sku_id = gnes.sku_id and gnes.activity_id
= gnec.activity_id
<where>
<if test="code != null and code != ''">
and gnec.code = #{code,jdbcType=VARCHAR}
</if>
<if test="activityId != null and activityId != ''">
and gnec.activity_id = #{activityId,jdbcType=VARCHAR}
</if>
<if test="state != null">
<choose>
<when test="state == 1">
and (now() BETWEEN gnes.ex_start_time and gnes.ex_stop_time) and
gnec.state =1
</when>
<when test="state == 2">
and gnec.state = 2
</when>
<when test="state == 3">
and (((now() &gt; gnes.ex_stop_time) AND gnec.state = 1) ||
gnec.state = 3)
</when>
</choose>
</if>
<if test="redeemUid != null and redeemUid != ''">
and gnec.redeem_uid = #{redeemUid,jdbcType=VARCHAR}
</if>
<if test="skuId != null and skuId != ''">
and gnec.sku_id in
<foreach collection="skuId.split(',')" item="sId" open="(" separator="," close=")">
#{sId,jdbcType=VARCHAR}
</foreach>
</if>
<if test="isDrivi != null">
<choose>
<when test="isDrivi == 1">
and gnec.admin_uid = ''
</when>
<when test="isDrivi == 2">
and gnec.admin_uid != ''
</when>
</choose>
</if>
</where>
ORDER BY gnec.code desc
</select>
<select id="selectCodeAvailableByActivityId" resultMap="BeseResult"> <select id="selectCodeAvailableByActivityId" resultMap="BeseResult">
select DISTINCT gnec.code, select DISTINCT gnec.code,
gnec.code_id, gnec.code_id,
......
...@@ -3,48 +3,56 @@ ...@@ -3,48 +3,56 @@
<mapper namespace="com.liquidnet.service.goblin.mapper.GoblinNftOrderMapper"> <mapper namespace="com.liquidnet.service.goblin.mapper.GoblinNftOrderMapper">
<select id="searchList" resultType="com.liquidnet.service.goblin.dto.admin.GoblinNftOrderListDto"> <select id="searchList" resultType="com.liquidnet.service.goblin.dto.admin.GoblinNftOrderListDto">
select select c.trading_at, c.nft_id, a.* from (select
a.user_id,a.order_code,a.order_type,a.pay_type,a.price_actual,a.status,a.pay_time,a.created_at, user_id,order_code,order_id,order_type,pay_type,price_actual,
b.name, status,pay_time,created_at,sku_title as name, mid, ex_code, box_sku_id
c.trading_at, c.nft_id from goblin_nft_order
from goblin_nft_order as a
left join goblin_goods_sku as b on b.sku_id = a.sku_id
left join goblin_user_digital_artwork as c on c.order_id = a.order_id and c.del_flg = '0'
<where> <where>
<if test="name!=''"> <if test="name!=''">
and b.name like concat('%', #{name}, '%') and sku_title like concat('%', #{name}, '%')
</if> </if>
<if test="userId!=''"> <if test="userId!=''">
and a.user_id = #{userId} and user_id = #{userId}
</if>
<if test="userMobile!=''">
and user_mobile = #{userMobile}
</if> </if>
<if test="shortOrderCode!=''"> <if test="shortOrderCode!=''">
and a.order_code like concat('%', #{shortOrderCode}, '%') and order_code like concat('%', #{shortOrderCode}, '%')
</if> </if>
<if test="orderCode!=''"> <if test="orderCode!=''">
and a.order_code = #{orderCode} and order_code = #{orderCode}
</if>
<if test="nftId!=''">
and c.nft_id = #{nftId}
</if> </if>
<if test="orderType != null and orderType!=''"> <if test="orderType != null and orderType!=''">
and a.order_type = #{orderType} and order_type = #{orderType}
</if> </if>
<if test="payType!=''"> <if test="payType!=''">
and a.pay_type = #{payType} and pay_type = #{payType}
</if> </if>
<if test="status != null and status!=''"> <if test="status != null and status!=''">
and a.status = #{status} and status = #{status}
</if> </if>
<if test="payTimeStart != null and payTimeStart != ''"> <if test="payTimeStart != null and payTimeStart != ''">
<!-- and amo.payment_at &gt; #{paymentAtStart} --> <!-- and amo.payment_at &gt; #{paymentAtStart} -->
and a.pay_time <![CDATA[>=]]> #{payTimeStart} and pay_time <![CDATA[>=]]> #{payTimeStart}
</if> </if>
<if test="payTimeEnd != null and payTimeEnd != ''"> <if test="payTimeEnd != null and payTimeEnd != ''">
<!-- and amo.payment_at &lt; #{paymentAtEnd} --> <!-- and amo.payment_at &lt; #{paymentAtEnd} -->
and a.pay_time <![CDATA[<=]]> #{payTimeEnd} and pay_time <![CDATA[<=]]> #{payTimeEnd}
</if>
<if test="exCode!=''">
and ex_code = #{exCode}
</if>
</where>
) as a
left join goblin_user_digital_artwork as c on c.order_id = a.order_id and c.del_flg = '0'
<where>
<if test="nftId!=''">
and c.nft_id = #{nftId}
</if> </if>
</where> </where>
group by a.order_id -- group by a.order_id
order by a.created_at desc -- order by a.created_at desc
order by a.mid desc
</select> </select>
</mapper> </mapper>
...@@ -37,8 +37,17 @@ ...@@ -37,8 +37,17 @@
<if test="status != null and status!=''"> <if test="status != null and status!=''">
and d.status = #{status} and d.status = #{status}
</if> </if>
<if test="payTimeStart != null and payTimeStart != ''">
<!-- and amo.payment_at &gt; #{paymentAtStart} -->
and a.pay_time <![CDATA[>=]]> #{payTimeStart}
</if>
<if test="payTimeEnd != null and payTimeEnd != ''">
<!-- and amo.payment_at &lt; #{paymentAtEnd} -->
and a.pay_time <![CDATA[<=]]> #{payTimeEnd}
</if>
</where> </where>
group by a.order_id -- group by a.order_id
order by d.created_at desc -- order by d.created_at desc
order by d.mid desc
</select> </select>
</mapper> </mapper>
...@@ -16,4 +16,7 @@ public interface FeignGoblinTaskClient { ...@@ -16,4 +16,7 @@ public interface FeignGoblinTaskClient {
@GetMapping("rsc/nft/job/goodsList") @GetMapping("rsc/nft/job/goodsList")
ResponseDto<Boolean> goodsList(); ResponseDto<Boolean> goodsList();
@GetMapping("rsc/nft/job/goblinNftListStock")
ResponseDto<Boolean> goblinNftListStock();
} }
...@@ -2,6 +2,8 @@ package com.liquidnet.service.adam.controller; ...@@ -2,6 +2,8 @@ package com.liquidnet.service.adam.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport; import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.commons.lang.util.DESUtils;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.adam.dto.rsc.AdamChimeUinfoDto; import com.liquidnet.service.adam.dto.rsc.AdamChimeUinfoDto;
import com.liquidnet.service.adam.dto.rsc.AdamChimeUinfoReq; import com.liquidnet.service.adam.dto.rsc.AdamChimeUinfoReq;
import com.liquidnet.service.adam.dto.vo.*; import com.liquidnet.service.adam.dto.vo.*;
...@@ -172,4 +174,31 @@ public class AdamRscController { ...@@ -172,4 +174,31 @@ public class AdamRscController {
} }
return ResponseDto.success(true); return ResponseDto.success(true);
} }
@ApiOperationSupport(order = 50)
@ApiOperation(value = "@API:NFT三要素", notes = "用于NFT认证成功的用户同步更新用户账号实名信息")
@PostMapping(value = {"syn/certmeta"})
public void syncUpdateReal(@NotBlank @RequestBody String certmeta) {
try {
String certmetaPlain = DESUtils.DES().decrypt(certmeta);// {uid},{mobile},{证件类型}{证件号},{姓名}
log.info("NFT三要素同步实名信息:加解密信息[{} => {}]", certmeta, certmetaPlain);
String[] certmetaPlainArr = certmetaPlain.split(",");
String uid = certmetaPlainArr[0], mobile = certmetaPlainArr[1], idTypeCardNo = certmetaPlainArr[2];
String uidByMobile = adamRdmService.getUidByMobile(mobile);
if (org.apache.commons.lang3.StringUtils.isEmpty(uidByMobile) || !org.apache.commons.lang3.StringUtils.equals(uidByMobile, uid)) {
log.warn("NFT三要素同步实名信息:手机号未注册/不匹配[{}]", certmetaPlain);
return;
}
AdamRealInfoVo realInfoVoByUidPlain = adamRdmService.getRealInfoVoByUidPlain(uid);
if (null == realInfoVoByUidPlain || realInfoVoByUidPlain.getNode() == 2) {
int idType = Integer.parseInt(idTypeCardNo.substring(0, 1));
adamUserService.identityForUpdate(uid, mobile, idType, 3, idTypeCardNo.substring(1), certmetaPlainArr[3]);
} else {
log.warn("NFT三要素同步实名信息:三要素信息已存在[certmetaPlain={},realInfoVoByUidPlain={}]", certmetaPlain, JsonUtils.toJson(realInfoVoByUidPlain));
}
} catch (Exception e) {
log.warn("NFT三要素同步实名信息:参数解析失败[certmeta={}]", certmeta, e);
}
}
} }
...@@ -119,4 +119,43 @@ public class AdamRealNameServiceImpl implements IAdamRealNameService { ...@@ -119,4 +119,43 @@ public class AdamRealNameServiceImpl implements IAdamRealNameService {
); );
log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s); log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s);
} }
@Override
public void update(AdamRealName realName, String mobile) {
List<Object> paramList = Arrays.asList(
realName.getRealNameId(),
realName.getUid(),
realName.getType(),
realName.getNode(),
realName.getName(),
realName.getIdCard(),
realName.getState(),
realName.getCreatedAt()
);
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
LinkedList<Object[]> initUserRealInfoObjs = CollectionUtil.linkedListObjectArr(),
delUserRealInfoObjs = CollectionUtil.linkedListObjectArr(),
updateUserMobileLocateObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("adam_real_name.del_by_nft"));
delUserRealInfoObjs.add(new Object[]{realName.getCreatedAt(), realName.getUid()});
toMqSqls.add(SqlMapping.get("adam_real_name.add"));
initUserRealInfoObjs.add(paramList.toArray());
String[] mobileLocateArr = adamRdmService.getMobileLocateArr(mobile);
toMqSqls.add(SqlMapping.get("adam_user_mobile_locate.real_name"));
if (null != mobileLocateArr && mobileLocateArr.length > 0) {
updateUserMobileLocateObjs.add(new Object[]{
realName.getName(), realName.getIdCard(), realName.getCreatedAt(), realName.getUid()
});
}
long s = System.currentTimeMillis();
queueUtils.sendMsgByRedis(
MQConst.AdamQueue.SQL_UCENTER.getKey(),
SqlMapping.gets(toMqSqls, delUserRealInfoObjs, initUserRealInfoObjs, updateUserMobileLocateObjs)
);
log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s);
}
} }
...@@ -476,4 +476,25 @@ public class AdamUserServiceImpl implements IAdamUserService { ...@@ -476,4 +476,25 @@ public class AdamUserServiceImpl implements IAdamUserService {
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s); log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
return vo; return vo;
} }
@Override
public AdamRealInfoVo identityForUpdate(String uid, String mobile, int idType, int node, String idCard, String idName) {
AdamRealName realName = new AdamRealName();
realName.setRealNameId(IDGenerator.nextSnowId() + "");
realName.setUid(uid);
realName.setType(idType);
realName.setNode(node);
realName.setName(idName);
realName.setIdCard(idCard);
realName.setState(1);
realName.setCreatedAt(LocalDateTime.now());
adamRealNameService.update(realName, mobile);
AdamRealInfoVo vo = AdamRealInfoVo.getNew().copy(realName);
long s = System.currentTimeMillis();
adamRdmService.setRealInfoVoByUid(uid, vo);
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
return vo;
}
} }
...@@ -12,7 +12,8 @@ adam_user_info.update_qr_code=UPDATE adam_user_info SET qr_code=? WHERE uid=? ...@@ -12,7 +12,8 @@ adam_user_info.update_qr_code=UPDATE adam_user_info SET qr_code=? WHERE uid=?
# ---------------------------------------------------- # ----------------------------------------------------
adam_real_name.add=INSERT INTO adam_real_name (real_name_id,`uid`,`type`,`node`,`name`,id_card,`state`,created_at) VALUES (?,?,?,?,?,?,?,?) adam_real_name.add=INSERT INTO adam_real_name (real_name_id,`uid`,`type`,`node`,`name`,id_card,`state`,created_at) VALUES (?,?,?,?,?,?,?,?)
adam_real_name.del=UPDATE adam_real_name SET `state`=2, updated_at=?, comment='三要素认证覆盖' WHERE `uid`=? and `state`=1 and node=2 adam_real_name.del=UPDATE adam_real_name SET `state`=2, updated_at=?, comment='\u4E09\u8981\u7D20\u8BA4\u8BC1\u8986\u76D6' WHERE `uid`=? and `state`=1 and node=2
adam_real_name.del_by_nft=UPDATE adam_real_name SET `state`=2, updated_at=?, comment='\u4E09\u8981\u7D20\u8BA4\u8BC1\u8986\u76D6NFT' WHERE `uid`=? and `state`=1
adam_real_name.close=UPDATE adam_real_name SET `state`=2, updated_at=?, comment='close' WHERE `uid`=? adam_real_name.close=UPDATE adam_real_name SET `state`=2, updated_at=?, comment='close' WHERE `uid`=?
# ---------------------------------------------------- # ----------------------------------------------------
......
...@@ -330,7 +330,7 @@ public class CouponBaseUtil { ...@@ -330,7 +330,7 @@ public class CouponBaseUtil {
boolean isHas = false; boolean isHas = false;
for (CandyUserCouponBasicDto dtoItem : dtoList) { for (CandyUserCouponBasicDto dtoItem : dtoList) {
if (dtoItem.getUcouponId().equals(uCouponId)) { if (dtoItem.getUcouponId().equals(uCouponId)) {
if (dtoItem.getState().equals(1)) { if (dtoItem.getState().equals(1)) {//&& dtoItem.getDuedAt().isBefore(LocalDateTime.now())
dtoItem.setState(5); dtoItem.setState(5);
dtoItem.setUsedAt(LocalDateTime.now()); dtoItem.setUsedAt(LocalDateTime.now());
dtoItem.setUsedFor(content); dtoItem.setUsedFor(content);
......
package com.liquidnet.service.consumer.kylin.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode
public class PhoneUnIdDto {
private String mobile;
}
...@@ -11,10 +11,7 @@ import com.liquidnet.service.base.constant.MQConst; ...@@ -11,10 +11,7 @@ import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.consumer.kylin.utils.GoblinNftUtils; import com.liquidnet.service.consumer.kylin.utils.GoblinNftUtils;
import com.liquidnet.service.goblin.constant.GoblinRedisConst; import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.constant.GoblinStatusConst; import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.GoblinNftOrderVo; import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.dto.vo.GoblinOrderSkuVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreOrderVo;
import com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo;
import com.liquidnet.service.goblin.param.BackCouponParam; import com.liquidnet.service.goblin.param.BackCouponParam;
import com.mongodb.BasicDBObject; import com.mongodb.BasicDBObject;
import com.mongodb.client.result.UpdateResult; import com.mongodb.client.result.UpdateResult;
...@@ -172,10 +169,17 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin ...@@ -172,10 +169,17 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
if (nftOrder.getStatus().equals(GoblinStatusConst.NftStatus.ORDER_STATUS_1.getValue())) { if (nftOrder.getStatus().equals(GoblinStatusConst.NftStatus.ORDER_STATUS_1.getValue())) {
// 库存购买数量回滚 // 库存购买数量回滚
goblinNftUtils.decrSkuCountByUid(nftOrder.getUserId(), nftOrder.getSkuId(), nftOrder.getNum()); goblinNftUtils.decrSkuCountByUid(nftOrder.getUserId(), nftOrder.getSkuId(), nftOrder.getNum());
LocalDateTime nowTime = LocalDateTime.now();
if (StringUtils.isEmpty(nftOrder.getBoxSkuId())) {// 购买藏品 if (StringUtils.isEmpty(nftOrder.getBoxSkuId())) {// 购买藏品
goblinNftUtils.incrSkuStock(nftOrder.getSkuId(), nftOrder.getNum()); GoblinListCollectVo goblinListCollectVo = goblinNftUtils.getCollectByNowNext(nowTime, nftOrder.getSkuId());
String listId = (null == goblinListCollectVo) ? null : goblinListCollectVo.getListId();
log.debug("listId : {}",listId);
goblinNftUtils.incrSkuStock(listId, nftOrder.getSkuId(), nftOrder.getNum());
} else {// 购买盲盒 } else {// 购买盲盒
goblinNftUtils.incrSkuStock(nftOrder.getBoxSkuId(), nftOrder.getNum()); GoblinListCollectVo goblinListCollectVo = goblinNftUtils.getCollectByNowNext(nowTime, nftOrder.getBoxSkuId());
String listId = (null == goblinListCollectVo) ? null : goblinListCollectVo.getListId();
log.debug("listId : {}",listId);
goblinNftUtils.incrSkuStock(listId, nftOrder.getBoxSkuId(), nftOrder.getNum());
} }
// 订单状态 // 订单状态
......
...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON; ...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
import com.liquidnet.common.cache.redis.util.RedisUtil; import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.consumer.kylin.dto.PhoneDto; import com.liquidnet.service.consumer.kylin.dto.PhoneDto;
import com.liquidnet.service.consumer.kylin.dto.PhoneUnIdDto;
import com.liquidnet.service.consumer.kylin.service.IBaseDao; import com.liquidnet.service.consumer.kylin.service.IBaseDao;
import com.liquidnet.service.goblin.constant.GoblinRedisConst; import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -16,6 +17,7 @@ import org.springframework.data.redis.stream.StreamListener; ...@@ -16,6 +17,7 @@ import org.springframework.data.redis.stream.StreamListener;
import java.net.URL; import java.net.URL;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.Map; import java.util.Map;
...@@ -35,7 +37,7 @@ public abstract class AbstractXlsRedisReceiver implements StreamListener<String, ...@@ -35,7 +37,7 @@ public abstract class AbstractXlsRedisReceiver implements StreamListener<String,
String redisStreamKey = this.getRedisStreamKey(); String redisStreamKey = this.getRedisStreamKey();
log.debug("CONSUMER MSG[streamKey:{},messageId:{},stream:{},body:{}]", redisStreamKey, message.getId(), message.getStream(), message.getValue()); log.debug("CONSUMER MSG[streamKey:{},messageId:{},stream:{},body:{}]", redisStreamKey, message.getId(), message.getStream(), message.getValue());
boolean result = this.consumerMessageHandler(message.getValue()); boolean result = this.consumerMessageHandler(message.getValue());
log.info("CONSUMER MSG RESULT:{} ==> [{}]MESSAGE_ID:{}", result, redisStreamKey, message.getId()); log.info("XLS MESSAGE CONSUMER MSG RESULT:{} ==> [{}]MESSAGE_ID:{}", result, redisStreamKey, message.getId());
try { try {
stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message); stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message);
...@@ -52,40 +54,91 @@ public abstract class AbstractXlsRedisReceiver implements StreamListener<String, ...@@ -52,40 +54,91 @@ public abstract class AbstractXlsRedisReceiver implements StreamListener<String,
private boolean consumerMessageHandler(Map<String, String> message) { private boolean consumerMessageHandler(Map<String, String> message) {
LinkedList<Object[]> objs = CollectionUtil.linkedListObjectArr(); LinkedList<Object[]> objs = CollectionUtil.linkedListObjectArr();
String xlsPath = null, skuId = null; String xlsPath = null, skuId = null;
String oXlsPath = null;
Integer type = null; Integer type = null;
boolean aBoolean = false; boolean aBoolean = false;
try { try {
xlsPath = message.get("message"); String[] path = message.get("message").split(",");
if (path.length == 0) {
xlsPath = "";
} else {
xlsPath = path[0];
}
if (path.length > 1) {
oXlsPath = path[1];
}
String finalSkuId = (skuId = message.get("skuId")); String finalSkuId = (skuId = message.get("skuId"));
String listId;
// try {
listId = message.getOrDefault("listId", "");
// }catch (Exception e){
// listId = "";
// }
Integer finalType = (type = Integer.parseInt(message.get("type"))); Integer finalType = (type = Integer.parseInt(message.get("type")));
if (finalType.equals(1) || finalType.equals(2)) {
EasyExcel.read(new URL(xlsPath).openStream(), PhoneDto.class, new PageReadListener<PhoneDto>(dataList -> { EasyExcel.read(new URL(xlsPath).openStream(), PhoneDto.class, new PageReadListener<PhoneDto>(dataList -> {
for (PhoneDto data : dataList) { for (PhoneDto data : dataList) {
if (data.getMobile() == null) { if (data.getMobile() == null) {
continue; continue;
}
String redisKey = GoblinRedisConst.REDIS_CAN_BUY.concat(finalSkuId + ":").concat(data.getMobile());
if (finalType.equals(1)) {//添加
if (log.isDebugEnabled()) {
log.debug("添加 读取到一条数据{}", JSON.toJSONString(data));
} }
redisUtil.set(redisKey, 0); String redisKey = GoblinRedisConst.REDIS_CAN_BUY.concat(finalSkuId + ":").concat(data.getMobile());
} else { if (finalType.equals(1)) {//添加
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("删除 读取到一条数据{}", JSON.toJSONString(data)); log.debug("添加 读取到一条数据{}", JSON.toJSONString(data));
}
redisUtil.set(redisKey, 0);
} else {
if (log.isDebugEnabled()) {
log.debug("删除 读取到一条数据{}", JSON.toJSONString(data));
}
redisUtil.del(redisKey);
} }
redisUtil.del(redisKey);
} }
})).sheet().doRead();
objs.add(new Object[]{skuId, xlsPath, type, 1, LocalDateTime.now()});
aBoolean = baseDao.batchSql(SQL_INSERT_GOODS_BUY_ROSTER_LOG, objs);
} else if (finalType.equals(3) || finalType.equals(4)) {
if (oXlsPath != null && !oXlsPath.equals("")) {//删除旧的黑白名单
EasyExcel.read(new URL(oXlsPath).openStream(), new PageReadListener<HashMap<String, String>>(dataList -> {
for (HashMap<String, String> data : dataList) {
if (data.get(0) == null) {
continue;
}
if (finalType.equals(3)) {
log.debug("删除 白名单 读取到一条数据{}", JSON.toJSONString(data));
redisUtil.del(GoblinRedisConst.REDIS_WHITE.concat(listId + ":").concat(finalSkuId + ":").concat(data.get(0)));
} else {
log.debug("删除 黑名单 读取到一条数据{}", JSON.toJSONString(data));
redisUtil.del(GoblinRedisConst.REDIS_BLACK.concat(listId + ":").concat(finalSkuId + ":").concat(data.get(0)));
}
}
})).sheet().doRead();
} }
})).sheet().doRead(); if (xlsPath != null && !xlsPath.equals("")) {//添加
EasyExcel.read(new URL(xlsPath).openStream(), new PageReadListener<HashMap<String, String>>(dataList -> {
objs.add(new Object[]{skuId, xlsPath, type, 1, LocalDateTime.now()}); for (HashMap<String, String> data : dataList) {
aBoolean = baseDao.batchSql(SQL_INSERT_GOODS_BUY_ROSTER_LOG, objs); if (data.get(0) == null) {
continue;
}
if (finalType.equals(3)) {
log.debug("添加 白名单 读取到一条数据{}", JSON.toJSONString(data));
redisUtil.set(GoblinRedisConst.REDIS_WHITE.concat(listId + ":").concat(finalSkuId + ":").concat(data.get(0)), 1);
} else {
log.debug("添加 黑名单 读取到一条数据{}", JSON.toJSONString(data));
redisUtil.set(GoblinRedisConst.REDIS_BLACK.concat(listId + ":").concat(finalSkuId + ":").concat(data.get(0)), 1);
}
}
})).sheet().doRead();
}
aBoolean = true;
}
} catch (Exception e) { } catch (Exception e) {
log.error("CONSUMER MSG EX_HANDLE ==> [{}]:{}", this.getRedisStreamKey(), message, e); log.error("CONSUMER MSG EX_HANDLE ==> [{}]:{}", this.getRedisStreamKey(), message, e);
try { try {
objs.add(new Object[]{skuId, xlsPath, type, 2, LocalDateTime.now()}); if (type.equals(1) || type.equals(2)) {
aBoolean = baseDao.batchSql(SQL_INSERT_GOODS_BUY_ROSTER_LOG, objs); objs.add(new Object[]{skuId, xlsPath, type, 2, LocalDateTime.now()});
aBoolean = baseDao.batchSql(SQL_INSERT_GOODS_BUY_ROSTER_LOG, objs);
}
} catch (Exception ignored) { } catch (Exception ignored) {
} }
} }
......
package com.liquidnet.service.consumer.kylin.receiver;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.consumer.kylin.service.processor.ConsumerGalaxyJsonNftUserRegisterProcessor;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.stereotype.Component;
import java.util.HashMap;
@Slf4j
@Component
public class ConsumerGalaxyJsonNftUserRegisterReceiver extends AbstractBizRedisReceiver {
@Autowired
private ConsumerGalaxyJsonNftUserRegisterProcessor jsonNftUserRegisterProcessor;
@Override
protected boolean consumerMessageHandler(String msg) {
boolean aBoolean = false;
try {
GalaxyUserRegisterReqDto textMessage = JsonUtils.fromJson(msg, GalaxyUserRegisterReqDto.class);
if (textMessage == null) {
aBoolean = true;
} else {
//执行计数
ResponseDto<GalaxyUserRegisterRespDto> responseDto = jsonNftUserRegisterProcessor.userRegister(textMessage);
// if(responseDto.isSuccess()){
aBoolean = true;
// }
}
} catch (Exception e) {
log.error("CONSUMER MSG EX_HANDLE ==> [{}]:{}", this.getRedisStreamKey(), msg, e);
} finally {
if (!aBoolean) {
HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", msg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(this.getRedisStreamKey()));
}
}
return aBoolean;
}
@Override
protected String getRedisStreamKey() {
return MQConst.GalaxyQueue.JSON_NFT_USER_REGISTER.getKey();
}
@Override
protected String getRedisStreamGroup() {
return MQConst.GalaxyQueue.JSON_NFT_USER_REGISTER.getGroup();
}
}
...@@ -103,7 +103,8 @@ ...@@ -103,7 +103,8 @@
// LocalDateTime now = LocalDateTime.now(); // LocalDateTime now = LocalDateTime.now();
// //
// GoblinUserDigitalArtworkVo digitalArtworkVo = GoblinUserDigitalArtworkVo.getNew(); // GoblinUserDigitalArtworkVo digitalArtworkVo = GoblinUserDigitalArtworkVo.getNew();
// String artworkId = IDGenerator.nextMilliId2(); //// String artworkId = IDGenerator.nextMilliId2();
// String artworkId = IDGenerator.nextSnowId();
// digitalArtworkVo.setArtworkId(artworkId); // digitalArtworkVo.setArtworkId(artworkId);
// digitalArtworkVo.setSkuId(skuId); // digitalArtworkVo.setSkuId(skuId);
// digitalArtworkVo.setUid(uid); // digitalArtworkVo.setUid(uid);
......
package com.liquidnet.service.consumer.kylin.service.processor;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
import com.liquidnet.service.galaxy.router.zxin.biz.ZxinUserCommonBiz;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: ConsumerJsonNftPublishAndBuyProcessor
* @Package com.liquidnet.service.consumer.kylin.service.processor
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/29 17:04
*/
@Slf4j
@Component
public class ConsumerGalaxyJsonNftUserRegisterProcessor {
@Autowired
private ZxinUserCommonBiz zxinUserCommonBiz;
/**
* 执行用户注册
* @param reqDto
* @return
*/
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
return zxinUserCommonBiz.userRegister(reqDto);
}
}
package com.liquidnet.service.consumer.kylin.utils; package com.liquidnet.service.consumer.kylin.utils;
import com.liquidnet.common.cache.redis.util.RedisUtil; import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.goblin.constant.GoblinRedisConst; import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinListCollectVo;
import com.liquidnet.service.goblin.dto.vo.GoblinNftOrderVo; import com.liquidnet.service.goblin.dto.vo.GoblinNftOrderVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreNoticeVo;
import com.mongodb.BasicDBObject; import com.mongodb.BasicDBObject;
import com.mongodb.client.result.UpdateResult; import com.mongodb.client.result.UpdateResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -12,6 +17,13 @@ import org.springframework.data.mongodb.core.query.Criteria; ...@@ -12,6 +17,13 @@ import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
@Component @Component
public class GoblinNftUtils { public class GoblinNftUtils {
...@@ -30,9 +42,13 @@ public class GoblinNftUtils { ...@@ -30,9 +42,13 @@ public class GoblinNftUtils {
return (int) redisUtil.decr(redisKey, stock); return (int) redisUtil.decr(redisKey, stock);
} }
public int incrSkuStock(String skuId, Integer stock) { public int incrSkuStock(String marketPre, String skuId, Integer stock) {
String redisKey = GoblinRedisConst.REAL_STOCK_SKU.concat(skuId); String rk = GoblinRedisConst.REAL_STOCK_SKU;
return (int) redisUtil.incr(redisKey, stock); if (marketPre != null && !marketPre.equals("null")) {
rk = rk.concat(marketPre + ":");
}
rk = rk.concat(skuId);
return (int) redisUtil.incr(rk, stock);
} }
// 减少 用户sku购买个数 // 减少 用户sku购买个数
...@@ -70,6 +86,59 @@ public class GoblinNftUtils { ...@@ -70,6 +86,59 @@ public class GoblinNftUtils {
object); object);
} }
/**
* 根据时间获取当前分段购vo 如果当前没有返回下一个
*
* @param now
* @param skuId
* @return
*/
public GoblinListCollectVo getCollectByNowNext(LocalDateTime now, String skuId) {
GoblinListCollectVo collectVo = null;
GoblinListCollectVo collectTemp = null;
GoblinListCollectVo collectNext = null;
List<GoblinListCollectVo> collectVos = getGoblinListCollect(skuId);
for (int i = 0; i < collectVos.size(); i++) {
GoblinListCollectVo collectVoItem = collectVos.get(i);
if (now.isAfter(collectVoItem.getTimeStart()) && collectVoItem.getTimeEnd() == null) {
if (collectTemp == null || collectTemp.getTimeStart().isBefore(collectVoItem.getTimeStart())) {
collectTemp = collectVoItem;
}
} else if (now.isAfter(collectVoItem.getTimeStart()) && now.isBefore(collectVoItem.getTimeEnd())) {
collectVo = collectVoItem;
} else if (now.isBefore(collectVoItem.getTimeStart())) {
if (collectNext == null || collectNext.getTimeStart().isAfter(collectNext.getTimeStart())) {
collectNext = collectVoItem;
}
}else if(collectVoItem.getTimeEnd() != null && now.isAfter(collectVoItem.getTimeEnd())){
collectTemp = null;
}
}
if (collectVo == null && collectTemp != null) {
collectVo = collectTemp;
} else if (collectVo == null) {
collectVo = collectNext;
}
return collectVo;
}
/**
* 分段购获取
*
* @param skuId
* @return
*/
public List<GoblinListCollectVo> getGoblinListCollect(String skuId) {
Object obj = redisUtil.get(GoblinRedisConst.LIST_COLLECT.concat(skuId));
if (obj == null) {
return new ArrayList<>();
} else {
List<GoblinListCollectVo> list = (List<GoblinListCollectVo>) obj;
list = list.stream().sorted(Comparator.comparing(GoblinListCollectVo::getTimeStart)).collect(Collectors.toList());
return list;
}
}
public static BasicDBObject cloneBasicDBObject() { public static BasicDBObject cloneBasicDBObject() {
return (BasicDBObject) basicDBObject.clone(); return (BasicDBObject) basicDBObject.clone();
} }
......
package com.liquidnet.service.consumer.nft.config;
import com.liquidnet.common.cache.redis.config.RedisStreamConfig;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.consumer.nft.receiver.ConsumerGalaxyJsonNftUserRegisterReceiver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.stream.Consumer;
import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.data.redis.connection.stream.ReadOffset;
import org.springframework.data.redis.connection.stream.StreamOffset;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.stream.StreamMessageListenerContainer;
import org.springframework.data.redis.stream.Subscription;
import java.util.ArrayList;
import java.util.List;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 区块链nft订单相关
* @class: ConsumerSqlNftOrderInfoConfig
* @Package com.liquidnet.service.consumer.galaxy.config
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/25 14:45
*/
@Configuration
public class ConsumerGalaxyJsonNftUserRegisterConfig extends RedisStreamConfig {
@Autowired
private ConsumerGalaxyJsonNftUserRegisterReceiver jsonNftUserRegisterReceiver;
@Autowired
StringRedisTemplate stringRedisTemplate;
@Bean
public List<Subscription> subscriptionJsonNftUserRegister(RedisConnectionFactory factory) {
List<Subscription> subscriptionList = new ArrayList<>();
MQConst.GalaxyQueue stream = MQConst.GalaxyQueue.JSON_NFT_USER_REGISTER;
this.initStream(stringRedisTemplate, stream.getKey(), stream.getGroup());
for (int i = 0; i < 10; i++) {
StreamMessageListenerContainer<String, MapRecord<String, String, String>> listenerContainer = this.buildStreamMessageListenerContainer(factory);
subscriptionList.add(listenerContainer.receiveAutoAck(
Consumer.from(stream.getGroup(), getConsumerName(stream.name() + i)),
StreamOffset.create(stream.getKey(), ReadOffset.lastConsumed()), jsonNftUserRegisterReceiver
));
listenerContainer.start();
}
return subscriptionList;
}
}
package com.liquidnet.service.consumer.nft.receiver;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.consumer.nft.service.processor.ConsumerGalaxyJsonNftUserRegisterProcessor;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.stereotype.Component;
import java.util.HashMap;
@Slf4j
@Component
public class ConsumerGalaxyJsonNftUserRegisterReceiver extends AbstractBizRedisReceiver {
@Autowired
private ConsumerGalaxyJsonNftUserRegisterProcessor jsonNftUserRegisterProcessor;
@Override
protected boolean consumerMessageHandler(String msg) {
boolean aBoolean = false;
try {
GalaxyUserRegisterReqDto textMessage = JsonUtils.fromJson(msg, GalaxyUserRegisterReqDto.class);
if (textMessage == null) {
aBoolean = true;
} else {
//执行计数
ResponseDto<GalaxyUserRegisterRespDto> responseDto = jsonNftUserRegisterProcessor.userRegister(textMessage);
// if(responseDto.isSuccess()){
aBoolean = true;
// }
}
} catch (Exception e) {
log.error("CONSUMER MSG EX_HANDLE ==> [{}]:{}", this.getRedisStreamKey(), msg, e);
} finally {
if (!aBoolean) {
HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", msg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(this.getRedisStreamKey()));
}
}
return aBoolean;
}
@Override
protected String getRedisStreamKey() {
return MQConst.GalaxyQueue.JSON_NFT_USER_REGISTER.getKey();
}
@Override
protected String getRedisStreamGroup() {
return MQConst.GalaxyQueue.JSON_NFT_USER_REGISTER.getGroup();
}
}
package com.liquidnet.service.consumer.nft.service.processor;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
import com.liquidnet.service.galaxy.router.zxin.biz.ZxinUserCommonBiz;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: ConsumerJsonNftPublishAndBuyProcessor
* @Package com.liquidnet.service.consumer.kylin.service.processor
* @Copyright: LightNet @ Copyright (c) 2022
* @date 2022/3/29 17:04
*/
@Slf4j
@Component
public class ConsumerGalaxyJsonNftUserRegisterProcessor {
@Autowired
private ZxinUserCommonBiz zxinUserCommonBiz;
/**
* 执行用户注册
* @param reqDto
* @return
*/
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
return zxinUserCommonBiz.userRegister(reqDto);
}
}
...@@ -11,10 +11,7 @@ import com.liquidnet.service.base.constant.MQConst; ...@@ -11,10 +11,7 @@ import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.consumer.order.utils.GoblinNftUtils; import com.liquidnet.service.consumer.order.utils.GoblinNftUtils;
import com.liquidnet.service.goblin.constant.GoblinRedisConst; import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.constant.GoblinStatusConst; import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.GoblinNftOrderVo; import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.dto.vo.GoblinOrderSkuVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreOrderVo;
import com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo;
import com.liquidnet.service.goblin.param.BackCouponParam; import com.liquidnet.service.goblin.param.BackCouponParam;
import com.mongodb.BasicDBObject; import com.mongodb.BasicDBObject;
import com.mongodb.client.result.UpdateResult; import com.mongodb.client.result.UpdateResult;
...@@ -172,10 +169,25 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin ...@@ -172,10 +169,25 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
if (nftOrder.getStatus().equals(GoblinStatusConst.NftStatus.ORDER_STATUS_1.getValue())) { if (nftOrder.getStatus().equals(GoblinStatusConst.NftStatus.ORDER_STATUS_1.getValue())) {
// 库存购买数量回滚 // 库存购买数量回滚
goblinNftUtils.decrSkuCountByUid(nftOrder.getUserId(), nftOrder.getSkuId(), nftOrder.getNum()); goblinNftUtils.decrSkuCountByUid(nftOrder.getUserId(), nftOrder.getSkuId(), nftOrder.getNum());
LocalDateTime nowTime = LocalDateTime.now();
/*if (StringUtils.isEmpty(nftOrder.getBoxSkuId())) {// 购买藏品
GoblinListCollectVo goblinListCollectVo = goblinNftUtils.getCollectByNowNext(nowTime, nftOrder.getSkuId());
String listId = (null == goblinListCollectVo) ? null : goblinListCollectVo.getListId();
log.debug("listId : {}",listId);
goblinNftUtils.incrSkuStock(listId, nftOrder.getSkuId(), nftOrder.getNum());
} else {// 购买盲盒
GoblinListCollectVo goblinListCollectVo = goblinNftUtils.getCollectByNowNext(nowTime, nftOrder.getBoxSkuId());
String listId = (null == goblinListCollectVo) ? null : goblinListCollectVo.getListId();
log.debug("listId : {}",listId);
goblinNftUtils.incrSkuStock(listId, nftOrder.getBoxSkuId(), nftOrder.getNum());
}*/
GoblinListCollectVo goblinListCollectVo = goblinNftUtils.getCollectByNowNext(nowTime, nftOrder.getSkuId());
String listId = (null == goblinListCollectVo) ? null : goblinListCollectVo.getListId();
log.debug("listId : {}",listId);
if (StringUtils.isEmpty(nftOrder.getBoxSkuId())) {// 购买藏品 if (StringUtils.isEmpty(nftOrder.getBoxSkuId())) {// 购买藏品
goblinNftUtils.incrSkuStock(nftOrder.getSkuId(), nftOrder.getNum()); goblinNftUtils.incrSkuStock(listId, nftOrder.getSkuId(), nftOrder.getNum());
} else {// 购买盲盒 } else {// 购买盲盒
goblinNftUtils.incrSkuStock(nftOrder.getBoxSkuId(), nftOrder.getNum()); goblinNftUtils.incrSkuStock(listId, nftOrder.getBoxSkuId(), nftOrder.getNum());
} }
// 订单状态 // 订单状态
......
...@@ -2,6 +2,7 @@ package com.liquidnet.service.consumer.order.utils; ...@@ -2,6 +2,7 @@ package com.liquidnet.service.consumer.order.utils;
import com.liquidnet.common.cache.redis.util.RedisUtil; import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.goblin.constant.GoblinRedisConst; import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.dto.vo.GoblinListCollectVo;
import com.liquidnet.service.goblin.dto.vo.GoblinNftOrderVo; import com.liquidnet.service.goblin.dto.vo.GoblinNftOrderVo;
import com.mongodb.BasicDBObject; import com.mongodb.BasicDBObject;
import com.mongodb.client.result.UpdateResult; import com.mongodb.client.result.UpdateResult;
...@@ -12,6 +13,12 @@ import org.springframework.data.mongodb.core.query.Criteria; ...@@ -12,6 +13,12 @@ import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
@Component @Component
public class GoblinNftUtils { public class GoblinNftUtils {
...@@ -30,9 +37,13 @@ public class GoblinNftUtils { ...@@ -30,9 +37,13 @@ public class GoblinNftUtils {
return (int) redisUtil.decr(redisKey, stock); return (int) redisUtil.decr(redisKey, stock);
} }
public int incrSkuStock(String skuId, Integer stock) { public int incrSkuStock(String marketPre, String skuId, Integer stock) {
String redisKey = GoblinRedisConst.REAL_STOCK_SKU.concat(skuId); String rk = GoblinRedisConst.REAL_STOCK_SKU;
return (int) redisUtil.incr(redisKey, stock); if (marketPre != null && !marketPre.equals("null")) {
rk = rk.concat(marketPre + ":");
}
rk = rk.concat(skuId);
return (int) redisUtil.incr(rk, stock);
} }
// 减少 用户sku购买个数 // 减少 用户sku购买个数
...@@ -63,6 +74,59 @@ public class GoblinNftUtils { ...@@ -63,6 +74,59 @@ public class GoblinNftUtils {
mongoTemplate.insert(vo, GoblinNftOrderVo.class.getSimpleName()); mongoTemplate.insert(vo, GoblinNftOrderVo.class.getSimpleName());
} }
/**
* 根据时间获取当前分段购vo 如果当前没有返回下一个
*
* @param now
* @param skuId
* @return
*/
public GoblinListCollectVo getCollectByNowNext(LocalDateTime now, String skuId) {
GoblinListCollectVo collectVo = null;
GoblinListCollectVo collectTemp = null;
GoblinListCollectVo collectNext = null;
List<GoblinListCollectVo> collectVos = getGoblinListCollect(skuId);
for (int i = 0; i < collectVos.size(); i++) {
GoblinListCollectVo collectVoItem = collectVos.get(i);
if (now.isAfter(collectVoItem.getTimeStart()) && collectVoItem.getTimeEnd() == null) {
if (collectTemp == null || collectTemp.getTimeStart().isBefore(collectVoItem.getTimeStart())) {
collectTemp = collectVoItem;
}
} else if (now.isAfter(collectVoItem.getTimeStart()) && now.isBefore(collectVoItem.getTimeEnd())) {
collectVo = collectVoItem;
} else if (now.isBefore(collectVoItem.getTimeStart())) {
if (collectNext == null || collectNext.getTimeStart().isAfter(collectNext.getTimeStart())) {
collectNext = collectVoItem;
}
}else if(collectVoItem.getTimeEnd() != null && now.isAfter(collectVoItem.getTimeEnd())){
collectTemp = null;
}
}
if (collectVo == null && collectTemp != null) {
collectVo = collectTemp;
} else if (collectVo == null) {
collectVo = collectNext;
}
return collectVo;
}
/**
* 分段购获取
*
* @param skuId
* @return
*/
public List<GoblinListCollectVo> getGoblinListCollect(String skuId) {
Object obj = redisUtil.get(GoblinRedisConst.LIST_COLLECT.concat(skuId));
if (obj == null) {
return new ArrayList<>();
} else {
List<GoblinListCollectVo> list = (List<GoblinListCollectVo>) obj;
list = list.stream().sorted(Comparator.comparing(GoblinListCollectVo::getTimeStart)).collect(Collectors.toList());
return list;
}
}
public UpdateResult updateGoblinNftOrderVo(GoblinNftOrderVo data) { public UpdateResult updateGoblinNftOrderVo(GoblinNftOrderVo data) {
BasicDBObject object = cloneBasicDBObject().append("$set", mongoConverter.convertToMongoType(data)); BasicDBObject object = cloneBasicDBObject().append("$set", mongoConverter.convertToMongoType(data));
return mongoTemplate.getCollection(GoblinNftOrderVo.class.getSimpleName()).updateOne( return mongoTemplate.getCollection(GoblinNftOrderVo.class.getSimpleName()).updateOne(
......
...@@ -44,13 +44,13 @@ public class ConsumerGoblinXlsRedisStreamConfig extends RedisStreamConfig { ...@@ -44,13 +44,13 @@ public class ConsumerGoblinXlsRedisStreamConfig extends RedisStreamConfig {
return subscription; return subscription;
} }
// @Bean @Bean
// public Subscription subscriptionGoblinXls1(RedisConnectionFactory factory) { public Subscription subscriptionGoblinXls1(RedisConnectionFactory factory) {
// var listenerContainer = this.buildStreamMessageListenerContainer(factory); var listenerContainer = this.buildStreamMessageListenerContainer(factory);
// var subscription = receiveGoblinXls(listenerContainer, 1); var subscription = receiveGoblinXls(listenerContainer, 1);
// listenerContainer.start(); listenerContainer.start();
// return subscription; return subscription;
// } }
// //
// @Bean // @Bean
// public Subscription subscriptionGoblinXls2(RedisConnectionFactory factory) { // public Subscription subscriptionGoblinXls2(RedisConnectionFactory factory) {
......
...@@ -16,6 +16,7 @@ import org.springframework.data.redis.stream.StreamListener; ...@@ -16,6 +16,7 @@ import org.springframework.data.redis.stream.StreamListener;
import java.net.URL; import java.net.URL;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.Map; import java.util.Map;
...@@ -35,7 +36,7 @@ public abstract class AbstractXlsRedisReceiver implements StreamListener<String, ...@@ -35,7 +36,7 @@ public abstract class AbstractXlsRedisReceiver implements StreamListener<String,
String redisStreamKey = this.getRedisStreamKey(); String redisStreamKey = this.getRedisStreamKey();
log.debug("CONSUMER MSG[streamKey:{},messageId:{},stream:{},body:{}]", redisStreamKey, message.getId(), message.getStream(), message.getValue()); log.debug("CONSUMER MSG[streamKey:{},messageId:{},stream:{},body:{}]", redisStreamKey, message.getId(), message.getStream(), message.getValue());
boolean result = this.consumerMessageHandler(message.getValue()); boolean result = this.consumerMessageHandler(message.getValue());
log.info("CONSUMER MSG RESULT:{} ==> [{}]MESSAGE_ID:{}", result, redisStreamKey, message.getId()); log.info("XLS MESSAGE CONSUMER MSG RESULT:{} ==> [{}]MESSAGE_ID:{}", result, redisStreamKey, message.getId());
try { try {
stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message); stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message);
...@@ -52,40 +53,91 @@ public abstract class AbstractXlsRedisReceiver implements StreamListener<String, ...@@ -52,40 +53,91 @@ public abstract class AbstractXlsRedisReceiver implements StreamListener<String,
private boolean consumerMessageHandler(Map<String, String> message) { private boolean consumerMessageHandler(Map<String, String> message) {
LinkedList<Object[]> objs = CollectionUtil.linkedListObjectArr(); LinkedList<Object[]> objs = CollectionUtil.linkedListObjectArr();
String xlsPath = null, skuId = null; String xlsPath = null, skuId = null;
String oXlsPath = null;
Integer type = null; Integer type = null;
boolean aBoolean = false; boolean aBoolean = false;
try { try {
xlsPath = message.get("message"); String[] path = message.get("message").split(",");
if (path.length == 0) {
xlsPath = "";
} else {
xlsPath = path[0];
}
if (path.length > 1) {
oXlsPath = path[1];
}
String finalSkuId = (skuId = message.get("skuId")); String finalSkuId = (skuId = message.get("skuId"));
String listId;
// try {
listId = message.getOrDefault("listId", "");
// }catch (Exception e){
// listId = "";
// }
Integer finalType = (type = Integer.parseInt(message.get("type"))); Integer finalType = (type = Integer.parseInt(message.get("type")));
if (finalType.equals(1) || finalType.equals(2)) {
EasyExcel.read(new URL(xlsPath).openStream(), PhoneDto.class, new PageReadListener<PhoneDto>(dataList -> { EasyExcel.read(new URL(xlsPath).openStream(), PhoneDto.class, new PageReadListener<PhoneDto>(dataList -> {
for (PhoneDto data : dataList) { for (PhoneDto data : dataList) {
if (data.getMobile() == null) { if (data.getMobile() == null) {
continue; continue;
}
String redisKey = GoblinRedisConst.REDIS_CAN_BUY.concat(finalSkuId + ":").concat(data.getMobile());
if (finalType.equals(1)) {//添加
if (log.isDebugEnabled()) {
log.debug("添加 读取到一条数据{}", JSON.toJSONString(data));
} }
redisUtil.set(redisKey, 0); String redisKey = GoblinRedisConst.REDIS_CAN_BUY.concat(finalSkuId + ":").concat(data.getMobile());
} else { if (finalType.equals(1)) {//添加
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("删除 读取到一条数据{}", JSON.toJSONString(data)); log.debug("添加 读取到一条数据{}", JSON.toJSONString(data));
}
redisUtil.set(redisKey, 0);
} else {
if (log.isDebugEnabled()) {
log.debug("删除 读取到一条数据{}", JSON.toJSONString(data));
}
redisUtil.del(redisKey);
} }
redisUtil.del(redisKey);
} }
})).sheet().doRead();
objs.add(new Object[]{skuId, xlsPath, type, 1, LocalDateTime.now()});
aBoolean = baseDao.batchSql(SQL_INSERT_GOODS_BUY_ROSTER_LOG, objs);
} else if (finalType.equals(3) || finalType.equals(4)) {
if (oXlsPath != null && !oXlsPath.equals("")) {//删除旧的黑白名单
EasyExcel.read(new URL(oXlsPath).openStream(), new PageReadListener<HashMap<String, String>>(dataList -> {
for (HashMap<String, String> data : dataList) {
if (data.get(0) == null) {
continue;
}
if (finalType.equals(3)) {
log.debug("删除 白名单 读取到一条数据{}", JSON.toJSONString(data));
redisUtil.del(GoblinRedisConst.REDIS_WHITE.concat(listId + ":").concat(finalSkuId + ":").concat(data.get(0)));
} else {
log.debug("删除 黑名单 读取到一条数据{}", JSON.toJSONString(data));
redisUtil.del(GoblinRedisConst.REDIS_BLACK.concat(listId + ":").concat(finalSkuId + ":").concat(data.get(0)));
}
}
})).sheet().doRead();
} }
})).sheet().doRead(); if (xlsPath != null && !xlsPath.equals("")) {//添加
EasyExcel.read(new URL(xlsPath).openStream(), new PageReadListener<HashMap<String, String>>(dataList -> {
objs.add(new Object[]{skuId, xlsPath, type, 1, LocalDateTime.now()}); for (HashMap<String, String> data : dataList) {
aBoolean = baseDao.batchSql(SQL_INSERT_GOODS_BUY_ROSTER_LOG, objs); if (data.get(0) == null) {
continue;
}
if (finalType.equals(3)) {
log.debug("添加 白名单 读取到一条数据{}", JSON.toJSONString(data));
redisUtil.set(GoblinRedisConst.REDIS_WHITE.concat(listId + ":").concat(finalSkuId + ":").concat(data.get(0)), 1);
} else {
log.debug("添加 黑名单 读取到一条数据{}", JSON.toJSONString(data));
redisUtil.set(GoblinRedisConst.REDIS_BLACK.concat(listId + ":").concat(finalSkuId + ":").concat(data.get(0)), 1);
}
}
})).sheet().doRead();
}
aBoolean = true;
}
} catch (Exception e) { } catch (Exception e) {
log.error("CONSUMER MSG EX_HANDLE ==> [{}]:{}", this.getRedisStreamKey(), message, e); log.error("CONSUMER MSG EX_HANDLE ==> [{}]:{}", this.getRedisStreamKey(), message, e);
try { try {
objs.add(new Object[]{skuId, xlsPath, type, 2, LocalDateTime.now()}); if (type.equals(1) || type.equals(2)) {
aBoolean = baseDao.batchSql(SQL_INSERT_GOODS_BUY_ROSTER_LOG, objs); objs.add(new Object[]{skuId, xlsPath, type, 2, LocalDateTime.now()});
aBoolean = baseDao.batchSql(SQL_INSERT_GOODS_BUY_ROSTER_LOG, objs);
}
} catch (Exception ignored) { } catch (Exception ignored) {
} }
} }
......
...@@ -103,7 +103,8 @@ package com.liquidnet.service.consumer.slowly.receiver;//package com.liquidnet.s ...@@ -103,7 +103,8 @@ package com.liquidnet.service.consumer.slowly.receiver;//package com.liquidnet.s
// LocalDateTime now = LocalDateTime.now(); // LocalDateTime now = LocalDateTime.now();
// //
// GoblinUserDigitalArtworkVo digitalArtworkVo = GoblinUserDigitalArtworkVo.getNew(); // GoblinUserDigitalArtworkVo digitalArtworkVo = GoblinUserDigitalArtworkVo.getNew();
// String artworkId = IDGenerator.nextMilliId2(); //// String artworkId = IDGenerator.nextMilliId2();
// String artworkId = IDGenerator.nextSnowId();
// digitalArtworkVo.setArtworkId(artworkId); // digitalArtworkVo.setArtworkId(artworkId);
// digitalArtworkVo.setSkuId(skuId); // digitalArtworkVo.setSkuId(skuId);
// digitalArtworkVo.setUid(uid); // digitalArtworkVo.setUid(uid);
......
...@@ -29,4 +29,13 @@ public class GoblinTaskHandler { ...@@ -29,4 +29,13 @@ public class GoblinTaskHandler {
} }
} }
@XxlJob(value = "sev-goblin:rollbackNftStock")
public void goblinNftListStock() {
try {
XxlJobHelper.handleSuccess("结果:" + feignGoblinTaskClient.goblinNftListStock().getData());
} catch (Exception e) {
XxlJobHelper.log(e);
XxlJobHelper.handleFail();
}
}
} }
...@@ -31,5 +31,15 @@ ...@@ -31,5 +31,15 @@
<artifactId>liquidnet-service-galaxy-api</artifactId> <artifactId>liquidnet-service-galaxy-api</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-goblin-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-adam-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -11,6 +11,8 @@ galaxy_nft_trade_info.insert=insert into galaxy_nft_trade_info (user_id, nft_id, ...@@ -11,6 +11,8 @@ galaxy_nft_trade_info.insert=insert into galaxy_nft_trade_info (user_id, nft_id,
# ------------------------数字藏品发行购买失败记录---------------------------- # ------------------------数字藏品发行购买失败记录----------------------------
galaxy_nft_order_fail_log.insert=insert into galaxy_nft_order_fail_log (nft_order_pay_id, user_id, nft_id, nft_name, series_name, series_id,series_code, taskId, fail_reason_desc, fail_reason_desc_second, deal_with_status, trade_type,router_type, created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) galaxy_nft_order_fail_log.insert=insert into galaxy_nft_order_fail_log (nft_order_pay_id, user_id, nft_id, nft_name, series_name, series_id,series_code, taskId, fail_reason_desc, fail_reason_desc_second, deal_with_status, trade_type,router_type, created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------更新用户注册信息----------------------------
galaxy_user_info.update=update galaxy_user_info set user_name = ?,id_card_type = ?,id_card = ?,mobile = ?,block_chain_address = ?,user_identification = ?,updated_at =? where router_type = ? and user_id = ?
# ------------------------更新系列声明信息---------------------------- # ------------------------更新系列声明信息----------------------------
galaxy_series_info.updateSeriesIdAndStatus=update galaxy_series_info t set t.series_id = ?,t.chain_timestamp = ?,t.trade_hash = ?,t.series_claim_status = ? ,t.updated_at =? where t.series_code = ? galaxy_series_info.updateSeriesIdAndStatus=update galaxy_series_info t set t.series_id = ?,t.chain_timestamp = ?,t.trade_hash = ?,t.series_claim_status = ? ,t.updated_at =? where t.series_code = ?
# ------------------------更新系列NFT信息---------------------------- # ------------------------更新系列NFT信息----------------------------
...@@ -26,3 +28,5 @@ galaxy_series_nft_info.updateSeriesNftCrtCount=update galaxy_series_nft_info t s ...@@ -26,3 +28,5 @@ galaxy_series_nft_info.updateSeriesNftCrtCount=update galaxy_series_nft_info t s
# ------------------------更新发行购买处理结果---------------------------- # ------------------------更新发行购买处理结果----------------------------
galaxy_nft_order_fail_log.updateDealWithStatus=update galaxy_nft_order_fail_log t set t.deal_with_status = ?,t.updated_at =? where t.nft_order_pay_id = ? and t.router_type = ? galaxy_nft_order_fail_log.updateDealWithStatus=update galaxy_nft_order_fail_log t set t.deal_with_status = ?,t.updated_at =? where t.nft_order_pay_id = ? and t.router_type = ?
# ------------------------同步用户数字账户信息到adam---------------------------
adam_user_busi_acct.add=INSERT INTO adam_user_busi_acct (`uid`, busi, uuid, `work`, ppwd, `state`, created_at) VALUES (?,?,?,?,?,?,?)
USE dev_ln_scene;
ALTER TABLE goblin_nft_order ADD list_id VARCHAR(64) NOT NULL DEFAULT '' COMMENT '分批购ID' after user_mobile;
ALTER TABLE goblin_nft_order ADD ex_code VARCHAR(64) NOT NULL DEFAULT '' COMMENT '兑换码' after list_id;
\ No newline at end of file
DROP TABLE IF EXISTS `goblin_list`;
CREATE TABLE `goblin_list`
(
`mid` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`list_id` varchar(64) DEFAULT '' COMMENT '名单id',
`uid` varchar(64) DEFAULT '' COMMENT '用户id',
`name` varchar(64) DEFAULT '' COMMENT '名单名称',
`white_type` int DEFAULT 1 COMMENT '白名单类型[0-会员|1-指定用户]',
`white_url` varchar(512) DEFAULT '' COMMENT '白名单xls地址',
`time_start` datetime DEFAULT null COMMENT '开始时间',
`time_end` datetime DEFAULT null COMMENT '结束时间',
`tag_type` int DEFAULT 0 COMMENT '标签[0-提前购买|1-分段购买]',
`black_type` int DEFAULT 1 COMMENT '黑名单类型[0-会员|1-指定用户]',
`black_url` varchar(512) DEFAULT '' COMMENT '黑名单xls地址',
`del_tag` int DEFAULT 0 COMMENT '是否删除[0-否|1-是]',
`comment` varchar(255) DEFAULT '' COMMENT '补充字段',
`created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`mid`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '商城-名单表'
ROW_FORMAT = DYNAMIC;
DROP TABLE IF EXISTS `goblin_list_details`;
CREATE TABLE `goblin_list_details`
(
`mid` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`list_id` varchar(64) DEFAULT '' COMMENT '名单id',
`spu_id` varchar(64) DEFAULT '' COMMENT 'spuId',
`sku_id` varchar(64) DEFAULT '' COMMENT 'skuId',
`price` varchar(64) DEFAULT '' COMMENT '单品现价',
`sku_stock` int DEFAULT 0 COMMENT '单品库存',
`price_v` decimal(20, 2) DEFAULT 0.00 COMMENT '苹果商品价格',
`product_id` varchar(64) DEFAULT '' COMMENT '苹果商品价格ID',
`comment` varchar(255) DEFAULT '' COMMENT '补充字段',
`created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`mid`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '商城-名单详情表'
ROW_FORMAT = DYNAMIC;
# -- >>------------------------------------------------------------------------------------
drop table if exists goblin_goods_sku_extra;
create table goblin_goods_sku_extra
(
mid bigint auto_increment primary key,
sku_id varchar(64) not null,
ar_url_ios varchar(256) null comment '单品AR文件URL-iOS版',
ar_url_android varchar(256) null comment '单品AR文件URL-android版',
del_flg char default '0' comment '删除标记[0-未删除|1删除]',
created_by varchar(64) not null,
created_at datetime not null,
updated_by varchar(64) null,
updated_at datetime null,
deleted_by varchar(64) null,
deleted_at datetime null,
comment varchar(500)
) engine = InnoDB comment '商品单品扩展信息';
create index idx_ggse_sku_id on goblin_goods_sku_extra (sku_id);
# -- >>------------------------------------------------------------------------------------
\ No newline at end of file
...@@ -160,4 +160,13 @@ sh.shardCollection("test_ln_scene.GalaxySeriesNftUploadVo",{"skuId":"hashed"}); ...@@ -160,4 +160,13 @@ sh.shardCollection("test_ln_scene.GalaxySeriesNftUploadVo",{"skuId":"hashed"});
sh.shardCollection("test_ln_scene.GalaxyNftOrderVo",{"nftOrderPayId":"hashed"}); sh.shardCollection("test_ln_scene.GalaxyNftOrderVo",{"nftOrderPayId":"hashed"});
sh.shardCollection("test_ln_scene.GalaxyNftOrderBindVo",{"nftOrderPayId":"hashed"}); sh.shardCollection("test_ln_scene.GalaxyNftOrderBindVo",{"nftOrderPayId":"hashed"});
sh.shardCollection("test_ln_scene.GalaxyNftOrderFailLogVo",{"nftOrderPayId":"hashed"}); sh.shardCollection("test_ln_scene.GalaxyNftOrderFailLogVo",{"nftOrderPayId":"hashed"});
sh.shardCollection("test_ln_scene.GalaxyNftTradeVo",{"nftId":"hashed"}); sh.shardCollection("test_ln_scene.GalaxyNftTradeVo",{"nftId":"hashed"});
\ No newline at end of file
# 集合
db.createCollection("GoblinListDetailsVo");
# 索引
db.GoblinListDetailsVo.createIndex({listId:"hashed"});
# 分片
sh.enableSharding("prod_ln_scene");
sh.shardCollection("prod_ln_scene.GoblinListDetailsVo",{"listId":"hashed"});
\ No newline at end of file
...@@ -96,7 +96,7 @@ public class MybatisPlusCodeGenerator { ...@@ -96,7 +96,7 @@ public class MybatisPlusCodeGenerator {
String resourcePath = "/Users/hujiachen/Downloads/tmp"; String resourcePath = "/Users/hujiachen/Downloads/tmp";
String directory = "com.liquidnet.service.goblin"; String directory = "com.liquidnet.service.goblin";
String[] dbTableArray = new String[]{ String[] dbTableArray = new String[]{
"goblin_marketing_zhengzai_relation" "goblin_marketing_zhengzai_relation"
}; };
doGenerator(resourcePath, dsc, directory, dbTableArray); doGenerator(resourcePath, dsc, directory, dbTableArray);
......
...@@ -67,6 +67,11 @@ public class GalaxyTradeController { ...@@ -67,6 +67,11 @@ public class GalaxyTradeController {
@ApiOperation(value = "NFT发行购买结果查询") @ApiOperation(value = "NFT发行购买结果查询")
@PostMapping(value = {"nftPublishAndBuyResultQuery"}) @PostMapping(value = {"nftPublishAndBuyResultQuery"})
public ResponseDto<GalaxyNftPublishAndBuyResultQueryRespDto> nftPublishAndBuyResultQuery(@Valid @RequestBody GalaxyNftPublishAndBuyResultQueryReqDto reqDto){ public ResponseDto<GalaxyNftPublishAndBuyResultQueryRespDto> nftPublishAndBuyResultQuery(@Valid @RequestBody GalaxyNftPublishAndBuyResultQueryReqDto reqDto){
try {
Thread.sleep(2000l);
} catch (InterruptedException e) {
e.printStackTrace();
}
return galaxyTradeService.nftPublishAndBuyResultQuery(reqDto); return galaxyTradeService.nftPublishAndBuyResultQuery(reqDto);
} }
......
...@@ -353,7 +353,12 @@ public class ZxinArtworkBiz { ...@@ -353,7 +353,12 @@ public class ZxinArtworkBiz {
seriesInfoBo.setTradeHash(resp.getData().getTxHash()); seriesInfoBo.setTradeHash(resp.getData().getTxHash());
seriesInfoBo.setSeriesId(resp.getData().getSeriesId()); seriesInfoBo.setSeriesId(resp.getData().getSeriesId());
seriesInfoBo.setUpdatedAt(LocalDateTime.now()); seriesInfoBo.setUpdatedAt(LocalDateTime.now());
dataUtils.updateSeriesClaimStatus(reqDto.getRouterType(),seriesCode,seriesInfoBo);
//根据系列编号更新系列声明状态 1对多skuId
// dataUtils.updateSeriesClaimStatus(reqDto.getRouterType(),seriesCode,seriesInfoBo);
//根据skuId更新系列声明状态 1对1
dataUtils.updateSeriesClaimStatus(reqDto.getRouterType(),seriesCode,seriesInfoBo,reqDto.getSkuId());
//设置成功返回参数 //设置成功返回参数
GalaxyArtSeriesClaimResultQueryRespDto resultQueryRespDto = this.buildGalaxyArtSeriesClaimResultQueryRespDto(reqDto,seriesInfoBo,ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getCode()); GalaxyArtSeriesClaimResultQueryRespDto resultQueryRespDto = this.buildGalaxyArtSeriesClaimResultQueryRespDto(reqDto,seriesInfoBo,ZxlnftEnum.TaskStatusEnum.TASK_SUCCESS.getCode());
...@@ -362,7 +367,14 @@ public class ZxinArtworkBiz { ...@@ -362,7 +367,14 @@ public class ZxinArtworkBiz {
}else if(resp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())){ }else if(resp.getData().getTaskStatus().toString().equals(ZxlnftEnum.TaskStatusEnum.TASK_FAIL.getCode())){
seriesInfoBo.setSeriesClaimStatus(GalaxyEnum.SeriesClaimStatusEnum.FAIL.getCode()); seriesInfoBo.setSeriesClaimStatus(GalaxyEnum.SeriesClaimStatusEnum.FAIL.getCode());
seriesInfoBo.setUpdatedAt(LocalDateTime.now()); seriesInfoBo.setUpdatedAt(LocalDateTime.now());
dataUtils.updateSeriesClaimStatus(reqDto.getRouterType(),seriesCode,seriesInfoBo);
//根据系列编号更新系列声明状态 1对多skuId
// dataUtils.updateSeriesClaimStatus(reqDto.getRouterType(),seriesCode,seriesInfoBo);
//根据skuId更新系列声明状态 1对1
dataUtils.updateSeriesClaimStatus(reqDto.getRouterType(),seriesCode,seriesInfoBo,reqDto.getSkuId());
return ResponseDto.failure(GalaxyErrorEnum.SERIES_CLAIM_ERROR.getCode(), GalaxyErrorEnum.SERIES_CLAIM_ERROR.getMessage()); return ResponseDto.failure(GalaxyErrorEnum.SERIES_CLAIM_ERROR.getCode(), GalaxyErrorEnum.SERIES_CLAIM_ERROR.getMessage());
} }
} }
......
package com.liquidnet.service.galaxy.router.zxin.biz; package com.liquidnet.service.galaxy.router.zxin.biz;
import com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz; import com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz;
import com.liquidnet.common.third.zxlnft.constant.ZxlErrorEnum; import com.liquidnet.common.third.zxlnft.dto.Nft016IdentityBindQueryReqDto;
import com.liquidnet.common.third.zxlnft.dto.*; import com.liquidnet.common.third.zxlnft.dto.Nft016IdentityBindQueryRespDto;
import com.liquidnet.common.third.zxlnft.dto.ZxlnftResponseDto;
import com.liquidnet.common.third.zxlnft.dto.nft.Nft016QueryRsData; import com.liquidnet.common.third.zxlnft.dto.nft.Nft016QueryRsData;
import com.liquidnet.common.third.zxlnft.dto.wallet.CreateMnemonicReq;
import com.liquidnet.common.third.zxlnft.dto.wallet.CreateMnemonicResp;
import com.liquidnet.common.third.zxlnft.dto.wallet.DeriveKeyPairReq;
import com.liquidnet.common.third.zxlnft.dto.wallet.DeriveKeyPairResp;
import com.liquidnet.common.third.zxlnft.exception.ZxlNftException;
import com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil; import com.liquidnet.common.third.zxlnft.util.ZxlWalletSdkUtil;
import com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil; import com.liquidnet.common.third.zxlnft.util.ZxlnftSdkUtil;
import com.liquidnet.commons.lang.util.BASE64Util;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
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.dto.bo.GalaxyUserInfoBo;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryReqDto; import com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryRespDto; import com.liquidnet.service.galaxy.dto.param.GalaxyUserBindStatusQueryRespDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto; import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto;
...@@ -26,9 +18,6 @@ import lombok.extern.slf4j.Slf4j; ...@@ -26,9 +18,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.io.UnsupportedEncodingException;
import java.util.List;
/** /**
* @author AnJiabin <anjiabin@zhengzai.tv> * @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0 * @version V1.0
...@@ -53,132 +42,11 @@ public class ZxinUserBiz { ...@@ -53,132 +42,11 @@ public class ZxinUserBiz {
@Autowired @Autowired
private GalaxyDataUtils dataUtils; private GalaxyDataUtils dataUtils;
public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) { @Autowired
String userId = reqDto.getUserId(); private ZxinUserCommonBiz zxinUserCommonBiz;
String userName = reqDto.getUserName();
String mobile = reqDto.getMobile();
String idCardType = reqDto.getIdCardType();
String idCard = reqDto.getIdCard();
String mnemonic = null;
Long index = 0L;
String userIdentification = null;
String address = null;
String userPubKey = null;
String userPriKey = null;
GalaxyUserInfoBo userInfoBo = dataUtils.getGalaxyUserInfo(reqDto.getRouterType(),userId);
if(userInfoBo!=null){
mnemonic = userInfoBo.getMnemonic();
}else{
try{
//生成助记词
CreateMnemonicReq req = CreateMnemonicReq.getNew();
CreateMnemonicResp createMnemonicResp = zxlWalletSdkUtil.createMnemonic(req);
mnemonic = createMnemonicResp.getMnemonic();
}catch(Exception e){
throw new ZxlNftException(ZxlErrorEnum.FAILURE.getCode(),"生成助记词失败!");
}
}
/**
* todo 把助记词进行redis存储 key=userID mnemonic/index/userIdentification/address
*/
if(StringUtil.isNotEmpty(mnemonic)){
//生成公私钥
DeriveKeyPairReq deriveKeyPairReq = DeriveKeyPairReq.getNew();
deriveKeyPairReq.setMnemonic(mnemonic);
// deriveKeyPairReq.setMnemonic(createMnemonicResp.getMnemonic());
deriveKeyPairReq.setIndex(index);
try{
DeriveKeyPairResp deriveKeyPairResp = zxlWalletSdkUtil.deriveKeyPair(deriveKeyPairReq);
if(!deriveKeyPairResp.getErr().equals("")) throw new Exception("生成公私钥失败!");
userPubKey = BASE64Util.encoded(deriveKeyPairResp.getPubKey());
userPriKey = BASE64Util.encoded(deriveKeyPairResp.getPriKey());
}catch(Exception e){
throw new ZxlNftException(ZxlErrorEnum.FAILURE.getCode(),e.getMessage());
}
}
//1.2.1调用自然人注册实名(使用NFT平台签名)接口
Nft003RegisterPersonPlatformReqDto nft003ReqDto = Nft003RegisterPersonPlatformReqDto.getNew();
nft003ReqDto.setPersonName(userName);
// reqDto.setEmail("");
nft003ReqDto.setMobile(mobile);
nft003ReqDto.setIdCard(idCard);
nft003ReqDto.setCardType(Integer.valueOf(idCardType));
ZxlnftResponseDto<Nft003RegisterPersonPlatformRespDto> nft003Resp = zxlnftSdkUtil.nft003RegisterPersonPlatform(nft003ReqDto);
if(nft003Resp.isSuccess()){
userIdentification = nft003Resp.getData().getUserIdentification();
}else{
return ResponseDto.failure(nft003Resp.getCode(),nft003Resp.getMessage());
}
GalaxyUserRegisterRespDto respDto = GalaxyUserRegisterRespDto.getNew();
if(StringUtil.isNotEmpty(userPubKey)&&StringUtil.isNotEmpty(userPriKey)&&StringUtil.isNotEmpty(userIdentification)){
//1.2.2调用授信平台NFT地址绑定接口
Nft014IdentityBindSubmitByTrustedReqDto nft014ReqDto = Nft014IdentityBindSubmitByTrustedReqDto.getNew();
try {
nft014ReqDto.setUserPubKey(BASE64Util.decode(userPubKey));
nft014ReqDto.setUserIdentification(nft003Resp.getData().getUserIdentification());
String signature = zxlnftBiz.createSign(BASE64Util.decode(userPriKey),nft014ReqDto.getUserIdentification());
nft014ReqDto.setUserSignData(signature);
} catch (UnsupportedEncodingException e) {
log.error("公私钥解密错误!");
}
ZxlnftResponseDto<Nft014IdentityBindSubmitByTrustedRespDto> nft014Resp = zxlnftSdkUtil.nft014IdentityBindSubmitByTrusted(nft014ReqDto);
ZxlnftResponseDto<Nft016IdentityBindQueryRespDto> nft016Resp = null;
if(nft014Resp.isSuccess()){
//1.2.3调用绑定状态批量查询
Nft016IdentityBindQueryReqDto nft016ReqDto = Nft016IdentityBindQueryReqDto.getNew();
nft016ReqDto.setAddressList(nft014Resp.getData().getAddress());
nft016Resp = zxlnftSdkUtil.nft016IdentityBindQuery(nft016ReqDto);
}else{
log.info("nft014Resp 返回结果:{}",nft014Resp.toJson());
return ResponseDto.failure(nft014Resp.getCode(),nft014Resp.getMessage());
}
if(StringUtil.isNotNull(nft016Resp)&&nft016Resp.isSuccess()){
List<Nft016QueryRsData> queryRsDataList = nft016Resp.getData().getList();
Nft016QueryRsData queryRsData = queryRsDataList.get(0);
address = queryRsData.getAddress();
log.info("nft016Resp 返回结果:{}",nft016Resp.toJson());
//构造返回参数
respDto.setUserId(userId);
respDto.setBlockChainType(GalaxyEnum.RouterTypeEnum.ZXINCHAIN.getCode());
respDto.setBlockChainAddress(address);
}else{
return ResponseDto.failure(nft016Resp.getMessage());
}
//构造缓存数据 public ResponseDto<GalaxyUserRegisterRespDto> userRegister(GalaxyUserRegisterReqDto reqDto) {
if(userInfoBo==null){ return zxinUserCommonBiz.userRegister(reqDto);
userInfoBo = GalaxyUserInfoBo.getNew();
userInfoBo.setUserId(userId);
userInfoBo.setUserName(userName);
userInfoBo.setMobile(mobile);
userInfoBo.setIdCardType(idCardType);
userInfoBo.setIdCard(idCard);
userInfoBo.setMnemonic(mnemonic);
userInfoBo.setIndex(index.toString());
userInfoBo.setUserIdentification(userIdentification);
userInfoBo.setUserPubKey(userPubKey);
userInfoBo.setUserPriKey(userPriKey);
userInfoBo.setRouterType(GalaxyEnum.RouterTypeEnum.ZXINCHAIN.getCode());
userInfoBo.setBlockChainAddress(address);
dataUtils.setGalaxyUserInfo(reqDto.getRouterType(),reqDto.getUserId(),userInfoBo);
}
}
return ResponseDto.success(respDto);
} }
public ResponseDto<GalaxyUserBindStatusQueryRespDto> userBindStatusQuery(GalaxyUserBindStatusQueryReqDto reqDto){ public ResponseDto<GalaxyUserBindStatusQueryRespDto> userBindStatusQuery(GalaxyUserBindStatusQueryReqDto reqDto){
......
package com.liquidnet.service.goblin.controller; package com.liquidnet.service.goblin.controller;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.StringUtil; import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.*; import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.entity.GoblinFrontHotWord; import com.liquidnet.service.goblin.entity.GoblinFrontHotWord;
import com.liquidnet.service.goblin.service.GoblinFrontService;
import com.liquidnet.service.goblin.service.impl.GoblinFrontServiceImpl; import com.liquidnet.service.goblin.service.impl.GoblinFrontServiceImpl;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -134,9 +131,9 @@ public class GoblinFrontController { ...@@ -134,9 +131,9 @@ public class GoblinFrontController {
@GetMapping("searchGoodesName") @GetMapping("searchGoodesName")
@ApiOperation("搜索商品名字、或商铺名字") @ApiOperation("搜索商品名字、或商铺名字")
public ResponseDto<List<GoblinGoodsInfoListVo>> searchGoodesName(@RequestParam(name = "name", required = true) String name) throws ParseException { public ResponseDto<GoblinGoodsInfoListVoo> searchGoodesName(@RequestParam(name = "name", required = true) String name,@RequestParam(name = "page", required = true) int page,@RequestParam(name = "pageSize", required = true) int pageSize) throws ParseException {
if (StringUtil.isNotBlank(name)) { if (StringUtil.isNotBlank(name)) {
return ResponseDto.success(goblinFrontService.searchGoodesName(name)); return ResponseDto.success(goblinFrontService.searchGoodesName(name,page,pageSize));
} }
return ResponseDto.success(null); return ResponseDto.success(null);
} }
......
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