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

Commit 6264715d authored by 胡佳晨's avatar 胡佳晨

Merge remote-tracking branch 'origin/20240123_COUPON_SPU' into 20240123_COUPON_SPU

parents 6a3b8734 b8778575
......@@ -38,4 +38,17 @@ public class CandyRedisConst {
* </value>
*/
public static final String BASIC_COMMON_COUPON = PREFIX.concat("basic:common_coupon");
/**
* <key>
* candy:basic:user_coupon_assoc:${ucouponId}
* </key>
* <value>
* com.liquidnet.service.candy.dto.CandyUserCouponAssocDto
* </value>
*/
public static final String BASIC_USER_COUPON_ASSOC = PREFIX.concat("basic:user_coupon_assoc:");
/**
* 发放券操作人-券类商品下单
*/
public static final String OPERATOR_MGT_COUPON_BY_SKU = "COUPON_SKU";
}
......@@ -16,4 +16,10 @@ public class GoblinOrderSkuParam {
private String spuId;
@ApiModelProperty(required = true, value = "数量")
private Integer number;
@ApiModelProperty(required = false, value = "关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证")
private Integer idType;
@ApiModelProperty(required = false, value = "关联人姓名")
private String idName;
@ApiModelProperty(required = false, value = "关联人证件号码")
private String idNo;
}
package com.liquidnet.service.goblin.dto.manage;
import com.liquidnet.commons.lang.constant.LnsRegex;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@ApiModel(value = "GoblinStoreMgtGoodsCouponAddSkuParam", description = "商品管理:添加券类商品:添加券SKU入参")
@Data
public class GoblinStoreMgtGoodsCouponAddSkuParam implements Serializable {
private static final long serialVersionUID = 7886534346305369761L;
@ApiModelProperty(position = 10, required = false, value = "单品ID[编辑时必传]")
private String skuId;
// @ApiModelProperty(position = 11, required = false, value = "单品编码[默认为系统编码,也可手动输入商家自己的编码]")
// @Pattern(regexp = LnsRegex.Valid.ALPHABET_NUMBER_UNDER_50, message = "单品编码格式或长度有误")
// private String skuNo;
// @ApiModelProperty(position = 12, required = false, value = "单品条码")
// @Pattern(regexp = LnsRegex.Valid.ALPHABET_NUMBER_32, message = "单品条码格式或长度有误")
// private String skuBarCode;
// @ApiModelProperty(position = 13, required = false, value = "ERP商家编码")
// @Size(max = 40, message = "ERP商家编码长度限制40")
// private String skuErpCode;//-
// @ApiModelProperty(position = 14, required = false, value = "ERP托管[0-否|1-是],默认0")
// @Pattern(regexp = "\\b(0|1)\\b", message = "ERP托管参数无效")
// private String erpHosting;//-
// @ApiModelProperty(position = 15, required = false, value = "ERP仓库编号")
// @Size(max = 40, message = "ERP仓库编号长度限制40")
// private String erpWarehouseNo;//-
// @ApiModelProperty(position = 16, required = false, value = "单品默认图片的url[256]")
// @NotBlank(message = "单品图片不能为空")
// private String skuPic;
@ApiModelProperty(position = 12, required = false, value = "单品规格信息")
// @NotNull(message = "规格信息不能为空")
// @Valid// 初始化写死['规格':'张']
private List<GoblinGoodsSpecDto> skuSpecList;
// @ApiModelProperty(position = 18, required = false, value = "单品销售价-原价[20,2]")
// private BigDecimal sellPrice;
@ApiModelProperty(position = 19, required = true, value = "单品现价[20,2]")
@Digits(integer = 6, fraction = 2, message = "参数'单品现价'无效")
@DecimalMin(value = "0.01", message = "参数'单品现价'必须为大于0")
private BigDecimal price;
// @ApiModelProperty(position = 20, required = false, value = "单品会员价格[20,2]")
// @NotNull(message = "单品会员价格不能为空")
// @Min(value = 0, message = "单品会员价格不能小于0")
// private BigDecimal priceMember;
// @ApiModelProperty(position = 21, required = false, value = "单品的重量[20,2]")
// private BigDecimal weight;//-
@ApiModelProperty(position = 20, required = true, value = "总库存")
@Min(value = 0, message = "总库存不能小于0")
private Integer stock;
// @ApiModelProperty(position = 21, required = false, value = "预警库存")
// private Integer warningStock;
// @ApiModelProperty(position = 22, required = false, value = "ISBN,针对CD/图书等[100]")
// private String skuIsbn;//-
// @ApiModelProperty(position = 23, required = false, value = "购买限制[0-全部用户|1-仅会员|2-指定用户]")
// @NotNull(message = "购买限制不能为空")
// private String buyFactor;
// @ApiModelProperty(position = 24, required = false, value = "购买限制人员名单[购买限制为2-指定用户时必填]")
// private String buyRoster;
@ApiModelProperty(position = 25, required = false, value = "限量[0-无限制|X:限购数量]")
private Integer buyLimit;
// @ApiModelProperty(position = 26, required = false, value = "单品有效期[yyyy-MM-dd HH:mm:ss]")
// @Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "单品有效期格式有误")
// private String skuValidity;
@ApiModelProperty(position = 27, required = false, value = "自定义展示[0-默认展示|1-隐藏不可购买]")
private String skuAppear;
/**
* ---------------------------- 券类商品-代金券属性 ----------------------------
*/
@ApiModelProperty(position = 28, required = true, value = "是否实名[0-否|1-是,表示该商品需要实名关联]", allowableValues = "0,1", example = "1")
@Pattern(regexp = "\\b(0|1)\\b", message = "参数'是否实名'无效")
private String isTrueName;
@ApiModelProperty(position = 29, required = true, value = "适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]", allowableValues = "101,102,103", example = "101")
@Pattern(regexp = "\\b(101|102|103)\\b", message = "参数'适用范围'无效")
private String useScope;
@ApiModelProperty(position = 30, required = true, value = "面值", example = "99.00")
@Digits(integer = 3, fraction = 2, message = "参数'面值'无效")
@DecimalMin(value = "0.01", message = "参数'面值'必须为大于0")
private BigDecimal valFace;
@ApiModelProperty(position = 31, required = true, value = "开始时间[yyyy-MM-dd HH:mm:ss]", example = "2024-01-01 00:00:00")
@Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "开始时间格式有误")
@NotNull(message = "参数'开始时间'不可为空")
private String effectTime;
@ApiModelProperty(position = 32, required = true, value = "结束时间[yyyy-MM-dd HH:mm:ss]", example = "2024-12-31 00:00:00")
@Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "结束时间格式有误")
@NotNull(message = "参数'结束时间'不可为空")
private String expireTime;
}
package com.liquidnet.service.goblin.dto.manage;
import com.liquidnet.commons.lang.constant.LnsRegex;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
@ApiModel(value = "GoblinStoreMgtGoodsCouponEditSkuParam", description = "商品管理:编辑券类商品:编辑券SKU入参")
@Data
public class GoblinStoreMgtGoodsCouponEditSkuParam implements Serializable {
private static final long serialVersionUID = 8174428924922310702L;
@ApiModelProperty(position = 10, required = true, value = "店铺ID[64]")
@NotBlank(message = "店铺ID不能为空")
private String storeId;
@ApiModelProperty(position = 11, required = true, value = "商品ID[64]")
@NotNull(message = "商品ID不能为空")
private String spuId;
@ApiModelProperty(position = 12, required = true, value = "单品ID[编辑时必传]")
@NotNull(message = "商品SKU_ID不能为空")
private String skuId;
@ApiModelProperty(position = 13, required = true, value = "单品现价[20,2]")
@Digits(integer = 3, fraction = 2, message = "参数'单品现价'无效")
@DecimalMin(value = "0.01", message = "参数'单品现价'必须为大于0")
private BigDecimal price;
@ApiModelProperty(position = 14, required = false, value = "总库存")
private Integer stock;
@ApiModelProperty(position = 14, required = false, value = "总库存")
private Integer skuStock;
@ApiModelProperty(position = 14, required = false, value = "加减库存")
private Integer operStock;
/**
* ---------------------------- 券类商品-代金券属性 ----------------------------
*/
@ApiModelProperty(position = 15, required = true, value = "是否实名[0-否|1-是,表示该商品需要实名关联]", example = "1")
@Pattern(regexp = "\\b(0|1)\\b", message = "参数'是否实名'无效")
private Integer isTrueName;
@ApiModelProperty(position = 16, required = true, value = "适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]")
@Pattern(regexp = "\\b(101|102|103)\\b", message = "参数'适用范围'无效")
private Integer useScope;
@ApiModelProperty(position = 17, required = true, value = "面值", example = "99.00")
@Digits(integer = 3, fraction = 2, message = "参数'面值'无效")
@DecimalMin(value = "0.01", message = "参数'面值'必须为大于0")
private BigDecimal valFace;
@ApiModelProperty(position = 18, required = true, value = "结束时间[yyyy-MM-dd HH:mm:ss]", example = "2024-01-01 00:00:00")
@Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "开始时间格式有误")
@NotNull(message = "参数'开始时间'不可为空")
private String effectTime;
@ApiModelProperty(position = 19, required = true, value = "结束时间[yyyy-MM-dd HH:mm:ss]", example = "2024-12-31 00:00:00")
@Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "结束时间格式有误")
@NotNull(message = "参数'结束时间'不可为空")
private String expireTime;
public GoblinGoodsSkuInfoVo initEditGoodsSkuInfoVo() {
GoblinGoodsSkuInfoVo goodsSkuInfoVo = GoblinGoodsSkuInfoVo.getNew();
goodsSkuInfoVo.setSkuId(this.getSkuId());
goodsSkuInfoVo.setPrice(this.getPrice());
goodsSkuInfoVo.setPriceMember(this.getPrice());
goodsSkuInfoVo.setStock(this.getStock());
goodsSkuInfoVo.setSkuStock(this.getSkuStock());
goodsSkuInfoVo.setIsTrueName(this.getIsTrueName());
goodsSkuInfoVo.setUseScope(this.getUseScope());
goodsSkuInfoVo.setValFace(this.getValFace());
goodsSkuInfoVo.setEffectAt(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getEffectTime()));
goodsSkuInfoVo.setExpireAt(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getExpireTime()));
return goodsSkuInfoVo;
}
}
......@@ -14,6 +14,8 @@ import java.util.List;
@JsonIgnoreProperties(ignoreUnknown = true)
public class GoblinGoodsInfoDetailVo implements Serializable, Cloneable {
private static final long serialVersionUID = -4712015317981742851L;
@ApiModelProperty(position = 1, value = "商品类型[0-常规|1-数字藏品|2-券类商品]")
private int spuType;
@ApiModelProperty(position = 22, value = "规格展现方式[1-常规|2-组合]")
private String specMode;
@ApiModelProperty(position = 51, value = "规格信息")
......
......@@ -45,6 +45,8 @@ public class GoblinGoodsSkuInfoDetailVo implements Serializable, Cloneable {
private Integer buyLimit;
@ApiModelProperty(position = 27, value = "剩余库存")
private Integer restStock;
@ApiModelProperty(position = 51, value = "是否实名[0-否|1-是,表示该商品需要实名关联]")
private Integer isTrueName;
private static final GoblinGoodsSkuInfoDetailVo obj = new GoblinGoodsSkuInfoDetailVo();
......
package com.liquidnet.service.goblin.dto.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
......@@ -137,6 +136,30 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable {
private String nftHash;
@ApiModelProperty(position = 33, value = "NFT系列声明时间")
private String declareAt;
/**
* ---------------------------- 券类商品-代金券属性 ----------------------------
*/
@ApiModelProperty(position = 33, value = "是否实名[0-否|1-是,表示该商品需要实名关联]")
private Integer isTrueName;
@ApiModelProperty(position = 33, value = "业务类别[0-全场|1-演出|2-商品|3-优先购]")
private Integer busiType;
@ApiModelProperty(position = 33, value = "券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]")
private Integer couType;
@ApiModelProperty(position = 33, value = "适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]")
private Integer useScope;
@ApiModelProperty(position = 33, value = "面值")
private BigDecimal valFace;
@ApiModelProperty(position = 33, value = "购买后(单位天)有效期,与生效/过期时间二选一")
private Integer validity;
@ApiModelProperty(position = 33, value = "生效时间[yyyy-MM-dd HH:mm:ss]")
private LocalDateTime effectAt;
@ApiModelProperty(position = 33, value = "过期时间[yyyy-MM-dd HH:mm:ss]")
private LocalDateTime expireAt;
/**
* ---------------------------- 以上为券类商品-代金券属性 ----------------------------
*/
@ApiModelProperty(position = 34, value = "删除标记[0-未删除|1-删除]")
private String delFlg;
@ApiModelProperty(position = 35, value = "上架时间")
......
......@@ -78,6 +78,17 @@ public class GoblinOrderSkuVo implements Serializable, Cloneable {
@ApiModelProperty(value = "erp-仓库号")
private String erpWarehouseNo;
@ApiModelProperty(value = "商品类型[0-常规|1-数字藏品|2-券类商品]")
private int skuType;
@ApiModelProperty(value = "是否实名[0-否|1-是,表示该商品需要实名关联],这里默认0")
private int isTrueName;
@ApiModelProperty(value = "关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证")
private Integer idType;
@ApiModelProperty(value = "关联人姓名")
private String idName;
@ApiModelProperty(value = "关联人证件号码")
private String idNo;
public String getPushTime() {
return pushTime == null ? "" : pushTime;
}
......
package com.liquidnet.service.goblin.param;
import com.liquidnet.service.goblin.dto.manage.GoblinOrderSkuParam;
import com.liquidnet.service.goblin.entity.GoblinOrderAttr;
import com.liquidnet.service.goblin.entity.GoblinOrderSku;
import com.liquidnet.service.goblin.entity.GoblinStoreOrder;
......@@ -9,6 +10,7 @@ import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ApiModel(value = "GoblinOrderPreParam")
......@@ -48,6 +50,7 @@ public class GoblinOrderPreParam implements Cloneable{
private List<GoblinOrderSku> orderSkuList;
private List<String> storeSpuIds;
private List<String> platformSpuIds;
private Map<String, GoblinOrderSkuParam> orderSkuParamMap;
private static final GoblinOrderPreParam obj = new GoblinOrderPreParam();
......
package com.liquidnet.service.goblin.param;
import com.liquidnet.service.goblin.dto.manage.GoblinOrderSkuParam;
import com.liquidnet.service.goblin.entity.GoblinOrderAttr;
import com.liquidnet.service.goblin.entity.GoblinOrderSku;
import com.liquidnet.service.goblin.entity.GoblinStoreOrder;
......@@ -9,6 +10,7 @@ import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ApiModel(value = "GoblinOrderSqlParam")
......@@ -18,6 +20,7 @@ public class GoblinOrderSqlParam implements Cloneable{
private GoblinStoreOrder storeOrder;
private GoblinOrderAttr orderAttr;
private List<GoblinOrderSku> orderSkuList;
private Map<String, GoblinOrderSkuParam> orderSkuParamMap;
private static final GoblinOrderSqlParam obj = new GoblinOrderSqlParam();
......
......@@ -40,6 +40,14 @@ public interface IGoblinstoreMgtGoodsService {
*/
void digitalGoodsAdd(GoblinGoodsInfoVo goodsInfoVo);
/**
* 商品管理:SPU添加-券类商品
*
* @param goodsInfoVo GoblinGoodsInfoVo
* @param goodsSkuInfoVoList List<GoblinGoodsSkuInfoVo>
*/
void couponGoodsAdd(GoblinGoodsInfoVo goodsInfoVo, List<GoblinGoodsSkuInfoVo> goodsSkuInfoVoList);
/**
* 商品管理:SPU详情
*
......@@ -69,6 +77,16 @@ public interface IGoblinstoreMgtGoodsService {
*/
boolean digitalGoodsEditSpu(String uid, GoblinStoreMgtDigitalGoodsAddParam mgtDigitalGoodsAddParam, GoblinGoodsInfoVo goodsInfoVo);
/**
* 商品管理:商品编辑:SPU编辑
*
* @param uid UID
* @param mgtGoodsCouponAddParam GoblinStoreMgtGoodsCouponAddParam
* @param goodsInfoVo GoblinGoodsInfoVo
* @return boolean
*/
boolean couponGoodsEditSpu(String uid, GoblinStoreMgtGoodsCouponAddParam mgtGoodsCouponAddParam, GoblinGoodsInfoVo goodsInfoVo);
/**
* 商品管理:商品编辑:SKU编辑
*
......@@ -93,6 +111,16 @@ public interface IGoblinstoreMgtGoodsService {
*/
boolean digitalGoodsEditSku(String uid, GoblinStoreMgtDigitalGoodsAddSkuParam mgtDigitalGoodsAddSkuParam, GoblinGoodsInfoVo mgtGoodsInfoVo);
/**
* 商品管理:商品编辑:SKU编辑-券类商品
*
* @param uid UID
* @param mgtGoodsEditSkuParam GoblinStoreMgtGoodsCouponEditSkuParam
* @param goodsInfoVo GoblinGoodsInfoVo
* @return boolean
*/
boolean couponGoodsEditSku(String uid, GoblinStoreMgtGoodsCouponEditSkuParam mgtGoodsEditSkuParam, GoblinGoodsInfoVo goodsInfoVo);
/**
* 商品管理:商品编辑:SKU添加
*
......
package com.liquidnet.service.candy.dto;
import com.liquidnet.service.candy.entity.CandyUserCouponAssoc;
import lombok.Data;
import java.io.Serializable;
@Data
public class CandyUserCouponAssocDto implements Serializable, Cloneable {
private static final long serialVersionUID = -5500626839150118876L;
/**
* 关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证
*/
private Integer idType;
/**
* 关联人姓名
*/
private String idName;
/**
* 关联人证件号码
*/
private String idNo;
private static final CandyUserCouponAssocDto obj = new CandyUserCouponAssocDto();
public static CandyUserCouponAssocDto getNew() {
try {
return (CandyUserCouponAssocDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new CandyUserCouponAssocDto();
}
}
public CandyUserCouponAssocDto copy(CandyUserCouponAssoc userCouponAssoc) {
if (null == userCouponAssoc) return this;
this.setIdType(userCouponAssoc.getIdType());
this.setIdName(userCouponAssoc.getIdName());
this.setIdName(userCouponAssoc.getIdNo());
return this;
}
}
......@@ -30,6 +30,7 @@ public class CandyUserCouponBasicDto implements Serializable, Cloneable {
private Integer overlay;
private Integer overlayLevel;
private Integer validity;
private Integer isTrueName;
private Integer redeemValidity;
private LocalDateTime redeemStart;
private LocalDateTime redeemStop;
......@@ -60,7 +61,6 @@ public class CandyUserCouponBasicDto implements Serializable, Cloneable {
/* com.liquidnet.service.candy.entity.CandyCommonCoupon */
private String ccouponId;
private static final CandyUserCouponBasicDto obj = new CandyUserCouponBasicDto();
public static CandyUserCouponBasicDto getNew() {
......@@ -89,6 +89,7 @@ public class CandyUserCouponBasicDto implements Serializable, Cloneable {
this.setOverlay(coupon.getOverlay());
this.setOverlayLevel(coupon.getOverlayLevel());
this.setValidity(coupon.getValidity());
this.setIsTrueName(coupon.getIsTrueName());
this.setRedeemValidity(coupon.getRedeemValidity());
this.setRedeemStart(coupon.getRedeemStart());
this.setRedeemStop(coupon.getRedeemStop());
......
......@@ -104,6 +104,11 @@ public class CandyCoupon implements Serializable {
*/
private Integer validity;
/**
* 是否实名[0-否|1-是,表示该商品需要实名关联]
*/
private Integer isTrueName;
/**
* 兑换有效期(单位天)
*/
......
package com.liquidnet.service.candy.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 券关联适用人信息
* </p>
*
* @author liquidnet
* @since 2024-01-26
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class CandyUserCouponAssoc implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* ~candy_user_coupon.ucoupon_id
*/
private String ucouponId;
/**
* 关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证
*/
private Integer idType;
/**
* 关联人姓名
*/
private String idName;
/**
* 关联人证件号码
*/
private String idNo;
private String comment;
}
package com.liquidnet.service.candy.mapper;
import com.liquidnet.service.candy.entity.CandyUserCouponAssoc;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 券关联适用人信息 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2024-01-26
*/
public interface CandyUserCouponAssocMapper extends BaseMapper<CandyUserCouponAssoc> {
}
<?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.candy.mapper.CandyUserCouponAssocMapper">
</mapper>
......@@ -30,6 +30,11 @@ public class GoblinGoodsSkuCoupon implements Serializable {
*/
private String skuId;
/**
* 是否实名[0-否|1-是,表示该商品需要实名关联]
*/
private Integer isTrueName;
/**
* 业务类别[1-演出]
*/
......@@ -45,11 +50,6 @@ public class GoblinGoodsSkuCoupon implements Serializable {
*/
private Integer useScope;
/**
* 注意/须知
*/
private String notice;
/**
* 面值
*/
......
......@@ -30,19 +30,24 @@ public class GoblinOrderSkuAssoc implements Serializable {
private String orderSkuId;
/**
* 1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证
* 是否实名[0-否|1-是,表示该商品需要实名关联]
*/
private Integer idType;
private Integer isTrueName;
/**
* 关联人证件号码
* 关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证
*/
private String idCard;
private Integer idType;
/**
* 关联人姓名
*/
private String personName;
private String idName;
/**
* 关联人证件号码
*/
private String idNo;
/**
* 操作人
......
......@@ -182,7 +182,40 @@ create table candy_coupon_relate
) engine InnoDB comment '券适用关联配置';
create index idx_ccr_coupon_id on candy_coupon_relate (coupon_id);
# -- >>------------------------------------------------------------------------------------ |20240123 商品券业务
alter table candy_coupon add is_true_name smallint default 0 comment '是否实名[0-否|1-是,表示该商品需要实名关联]' after validity;
alter table candy_coupon_rule modify use_scope smallint null comment '适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演|100-全场|90-演出|91-场次|92-票|80-商品|81-款式]';
drop table if exists candy_user_coupon_assoc;
create table candy_user_coupon_assoc
(
mid bigint unsigned auto_increment primary key,
ucoupon_id varchar(64) not null comment '~candy_user_coupon.ucoupon_id',
id_type tinyint not null comment '关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证',
id_name varchar(30) not null comment '关联人姓名',
id_no varchar(30) not null comment '关联人证件号码',
comment text
) engine InnoDB comment '券关联适用人信息';
create index idx_cuca_ucoupon_id on candy_user_coupon_assoc (ucoupon_id);
drop table if exists candy_mgt_coupon_snapshot;
create table candy_mgt_coupon_snapshot
(
mid bigint unsigned auto_increment primary key,
mcoupon_id varchar(64) not null comment '~candy_coupon.coupon_id',
coupon_template text,
operator varchar(64) not null comment '操作人',
created_at datetime(3) not null,
updated_at datetime(3),
comment text
) engine InnoDB comment '券适用关联配置';
create index idx_cmcs_mcoupon_id on candy_mgt_coupon_snapshot (mcoupon_id);
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
\ No newline at end of file
......@@ -1253,11 +1253,11 @@ create table goblin_goods_sku_coupon
busi_type smallint null comment '业务类别[1-演出]',
cou_type smallint null comment '券类型[1-代金券]',
use_scope smallint null comment '适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]',
notice varchar(200) null comment '注意/须知',
val_face decimal(8, 2) comment '面值',
validity int null comment '购买后(单位天)有效期,与生效/过期时间二选一',
is_true_name smallint default 0 comment '是否实名[0-否|1-是,表示该商品需要实名关联]',
validity int default 0 comment '购买后(单位天)有效期,与生效/过期时间二选一',
effect_at datetime(3) null comment '生效时间',
expire_at datetime(3) null comment '过期时间',
......@@ -1272,12 +1272,13 @@ create table goblin_order_sku_assoc
mid bigint unsigned auto_increment primary key,
order_sku_id varchar(64) default '' null comment '订单sku_id',
id_type tinyint not null comment '1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证',
id_card varchar(30) not null comment '关联人证件号码',
person_name varchar(60) not null comment '关联人姓名',
is_true_name smallint default 0 comment '是否实名[0-否|1-是,表示该商品需要实名关联]',
id_type tinyint not null comment '关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证',
id_name varchar(30) not null comment '关联人姓名',
id_no varchar(30) not null comment '关联人证件号码',
operator varchar(64) not null comment '操作人',
created_at datetime(3) not null,
operator varchar(64) not null comment '操作人',
created_at datetime(3) not null,
updated_at datetime(3),
comment varchar(255)
......
......@@ -57,6 +57,7 @@ goblin_goods_sku.insert=INSERT INTO goblin_goods_sku (sku_id,spu_id,sku_no,sku_b
goblin_goods_sku.insert_for_digital=INSERT INTO goblin_goods_sku (sku_id,spu_id,sku_no,sku_type,name,subtitle,sku_pic,sku_watch,watch_type,sku_watch_pic,stock,sku_stock,hit_ratio,price,price_v,product_id,price_member,intro,details,buy_factor,buy_limit,store_id,shelves_handle,shelves_time,sale_start_time,virtual_flg,status,shelves_status,sku_appear,sku_canbuy,unbox,opening_time,shelves_at,created_by,created_at,sku_erp_code,erp_type,erp_hosting,erp_warehouse_no)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
#goblin_goods_sku.update_by_edit_for_market=UPDATE goblin_goods_sku SET sku_bar_code=?,name=?,sku_pic=?,sell_price=?,weight=?,stock=?,warning_stock=?,sku_appear=?,sku_isbn=?,sku_validity=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
goblin_goods_sku.update_by_edit_for_market=UPDATE goblin_goods_sku SET sku_bar_code=?,name=?,sku_pic=?,sell_price=?,weight=?,stock=?,warning_stock=?,sku_appear=?,sku_isbn=?,sku_validity=?,updated_by=?,updated_at=?,sku_erp_code=?,erp_hosting=?,erp_warehouse_no=? WHERE sku_id=? AND del_flg='0'
goblin_goods_sku.update_by_edit_for_market2=UPDATE goblin_goods_sku SET stock=?,is_true_name=?,use_scope=?,val_face=?,effect_at=?,expire_at=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
#goblin_goods_sku.update_by_edit=UPDATE goblin_goods_sku SET name=?,sku_pic=?,sell_price=?,price=?,price_member=?,weight=?,stock=?,sku_stock=?,warning_stock=?,sku_appear=?,sku_isbn=?,buy_factor=?,buy_roster=?,buy_limit=?,sku_validity=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
goblin_goods_sku.update_by_edit=UPDATE goblin_goods_sku SET name=?,sku_pic=?,sell_price=?,price=?,price_member=?,weight=?,stock=?,sku_stock=?,warning_stock=?,sku_appear=?,sku_isbn=?,buy_factor=?,buy_roster=?,buy_limit=?,sku_validity=?,updated_by=?,updated_at=?,sku_erp_code=?,erp_hosting=?,erp_warehouse_no=? WHERE sku_id=? AND del_flg='0'
#goblin_goods_sku.update_by_edit_for_digital=UPDATE goblin_goods_sku SET hit_ratio=?,buy_factor=?,buy_limit=?,sku_appear=?,sku_canbuy=?,shelves_handle=?,shelves_time=?,sale_start_time=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
......@@ -66,6 +67,7 @@ goblin_goods_sku.update_by_edit_box_digital=UPDATE goblin_goods_sku SET name=?,s
goblin_goods_sku.update_by_edit_spu=UPDATE goblin_goods_sku SET sku_no=?,virtual_flg=?,logistics_template=?,updated_by=?,updated_at=? WHERE spu_id=? AND del_flg='0'
goblin_goods_sku.update_by_shelves=UPDATE goblin_goods_sku SET shelves_status=?,shelves_at=?,updated_by=?,updated_at=? WHERE sku_id=? AND store_id=? AND del_flg='0'
goblin_goods_sku.update_by_soldout=UPDATE goblin_goods_sku SET soldout_status=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
goblin_goods_sku.update_by_edit_for_coupon=UPDATE goblin_goods_sku SET price=?,price_member=?,stock=?,sku_stock=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
goblin_goods_sku.update_by_del_store=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE store_id=? AND del_flg='0'
goblin_goods_sku.update_by_del_spu=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE spu_id=? AND del_flg='0'
goblin_goods_sku.update_by_del=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE sku_id=? AND del_flg='0'
......@@ -75,6 +77,13 @@ goblin_goods_sku_extra.del_ar=UPDATE goblin_goods_sku_extra SET del_flg='1',upda
#goblin_goods_sku_nft.insert_for_digital=INSERT INTO goblin_goods_sku_nft (sku_id,route_type,material_type,material_url,upchain,display_url,nft_url,series_id,series_hash,nft_hash,declare_at,created_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?)
goblin_goods_sku_nft.insert_for_digital=INSERT INTO goblin_goods_sku_nft (sku_id,route_type,material_type,material_url,upchain,display_url,nft_url,created_at)VALUES(?,?,?,?,?,?,?,?)
#goblin_goods_sku_nft.update_for_digital=UPDATE goblin_goods_sku_nft SET upchain=?,series_id=?,series_hash=?,nft_hash=?,declare_at=?,updated_at=? WHERE skuId=? AND upchain=9
goblin_goods_sku_coupon.insert=INSERT INTO goblin_goods_sku_coupon (sku_id,busi_type,cou_type,use_scope,val_face,is_true_name,validity,effect_at,expire_at)VALUES(?,?,?,?,?,?,?,?,?)
goblin_goods_sku_coupon.update=UPDATE goblin_goods_sku_coupon SET use_scope=?,val_face=?,is_true_name=?,effect_at=?,expire_at=? WHERE sku_id=? AND del_flg='0'
candy_coupon.goods_insert=INSERT INTO candy_coupon (coupon_id,state,title,notice,`exclusive`,busi_type,cou_type,bind_type,val_face,validity,is_true_name,effect_at,expire_at,operator,created_at) VALUES (?,1,?,?,0,?,?,1,?,?,?,?,?,?,?)
candy_coupon.goods_spu_update=UPDATE candy_coupon SET title=?,notice=?,operator=?,updated_at=? WHERE coupon_id=?
candy_coupon.goods_sku_update=UPDATE candy_coupon SET val_face=?,is_true_name=?,effect_at=?,expire_at=?,operator=?,updated_at=? WHERE coupon_id=?
candy_coupon_rule.goods_insert=INSERT INTO candy_coupon_rule (crule_id,coupon_id,use_scope,busi_name,busi_id,state) VALUES (?,?,?,?,?,1)
candy_coupon_rule.goods_sku_update=UPDATE candy_coupon_rule SET use_scope=?,busi_name=? WHERE coupon_id=?
goblin_goods_image.insert_byreplace=REPLACE INTO goblin_goods_image (spu_id,url,del_flg)VALUES(?,?,'0')
goblin_goods_image.delete=UPDATE goblin_goods_image SET del_flg='1' WHERE spu_id=? AND del_flg='0'
goblin_goods_tag.insert_byreplace=REPLACE INTO goblin_goods_tag (spu_id,tag_id,sort,tag_belong,del_flg)VALUES(?,?,?,?,'0')
......
package com.liquidnet.service.order.utils;
import com.liquidnet.service.adam.dto.vo.AdamEntersVo;
import com.liquidnet.service.goblin.dto.manage.GoblinOrderSkuParam;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.entity.GoblinNftOrder;
import com.liquidnet.service.goblin.entity.GoblinOrderSku;
......@@ -59,6 +60,7 @@ public class ObjectUtil {
private static final HashMap<String, List<GoblinGoodsSkuInfoVo>> goblinGoodsSkuInfoVoMap = new HashMap();
private static final HashMap<String, String[]> mixIdMap = new HashMap();
private static final ArrayList<CouponOutLineVo> couponOutLineVo = new ArrayList<>();
private static final HashMap<String, GoblinOrderSkuParam> goblinOrderSkuParamMap = new HashMap();
public static Object[] objectsArray;
public static final Integer[] integerArray2 = new Integer[2];
......@@ -185,4 +187,8 @@ public class ObjectUtil {
public static ArrayList<WriteModel<Document>> getWriteModelDocumentArrayList() {
return (ArrayList<WriteModel<Document>>) writeModelDocumentArrayList.clone();
}
public static HashMap<String, GoblinOrderSkuParam> cloneGoblinOrderSkuParamMap() {
return (HashMap<String, GoblinOrderSkuParam>) goblinOrderSkuParamMap.clone();
}
}
......@@ -33,11 +33,13 @@ kylin_order_refund_entities.overtimeRefund=INSERT INTO kylin_order_refund_entiti
goblin.order.create.order_insert=INSERT INTO goblin_store_order (`master_order_code`,`order_id`,`store_id`,`store_name`,`order_code`,`user_id`,`user_name`,`user_mobile`,`price_total`,`pay_code`,`price_actual`,`price_refund`,`price_express`,`price_coupon`,`store_price_coupon`,`price_voucher`,`status`,`ucoupon_id`,`store_coupon_id`,`pay_type`,`device_from`,`source`,`version`,`is_member`,`order_type`,`write_off_code`,`pay_countdown_minute`,`ip_address`,`market_id`,`market_type`,`created_at`,`mix_id`,`mix_code`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin.order.create.attr_insert=INSERT INTO goblin_order_attr (`order_attr_id`,`order_id`,`express_contacts`,`express_address`,`express_address_detail`,`express_phone`,`express_type`,`created_at`) VALUES (?,?,?,?,?,?,?,?)
goblin.order.create.sku_insert=INSERT INTO goblin_order_sku (`order_sku_id`,`order_id`,`spu_id`,`spu_name`,`spu_pic`,`sku_id`,`num`,`sku_price`,`sku_price_actual`,`sku_name`,`sku_no`,`sku_image`,`sku_specs`,`price_voucher`,`spu_erp_code`,`sku_erp_code`,`erp_type`,`erp_warehouse_no`,`erp_hosting`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_order_sku_assoc.insert=INSERT INTO goblin_order_sku_assoc (order_sku_id,is_true_name,id_type,id_name,id_no,operator,created_at) VALUES (?,?,?,?,?,?,?)
#---- \u518D\u6B21\u652F\u4ED8
goblin_order.pay.again=UPDATE goblin_store_order SET pay_type = ? ,device_from = ? ,pay_code = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
#---- \u8BA2\u5355\u521B\u5EFA&\u652F\u4ED8
goblin_order.pay.order=UPDATE goblin_store_order SET payment_type = ? ,payment_id=?,pay_code = ? ,pay_time = ?,write_off_code = ? ,zhengzai_status =?,status = ? ,updated_at = ?,push_time = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.pay.sku=UPDATE goblin_order_sku SET status = ? ,updated_at = ? ,push_time = ? WHERE order_sku_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
candy_mgt_coupon.pay.sku=INSERT INTO candy_mgt_coupon (mcoupon_id,coupon_id,state,event_amt,event_type,event_limit,event_at,operator,created_at) VALUES (?,?,0,1,2,?,?,?,?)
goblin_order.store.refundPrice=UPDATE goblin_store_order SET price_refund = ? ,status = ? , updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.refundSkuPrice=UPDATE goblin_order_sku SET price_refund = ? ,status = ? , updated_at = ? WHERE order_sku_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.store.refundBackOrder=UPDATE goblin_back_order SET status = ? ,refund_at=?, updated_at = ? WHERE back_order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
......
......@@ -11,12 +11,11 @@ import com.liquidnet.service.adam.constant.AdamRedisConst;
import com.liquidnet.service.adam.dto.vo.AdamUserMemberVo;
import com.liquidnet.service.adam.entity.AdamUserMember;
import com.liquidnet.service.candy.constant.CandyRedisConst;
import com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto;
import com.liquidnet.service.candy.dto.CandyCouponCodeDto;
import com.liquidnet.service.candy.dto.CandyCouponRuleDto;
import com.liquidnet.service.candy.dto.CandyUserCouponBasicDto;
import com.liquidnet.service.candy.dto.*;
import com.liquidnet.service.candy.entity.*;
import com.liquidnet.service.candy.mapper.CandyCouponMapper;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.dto.vo.GoblinOrderSkuVo;
import com.liquidnet.service.platform.service.impl.adam.PlatformAdamUserMemberService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
......@@ -27,9 +26,8 @@ import org.springframework.util.CollectionUtils;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Service
......@@ -41,6 +39,8 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
@Autowired
private PlatformCandyUserCouponService platformCandyUserCouponService;
@Autowired
private PlatformCandyUserCouponAssocService platformCandyUserCouponAssocService;
@Autowired
private PlatformCandyCommonCouponService platformCandyCommonCouponService;
@Autowired
private PlatformAdamUserMemberService platformAdamUserMemberService;
......@@ -300,7 +300,6 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
* @param couponRuleDtoList List<CandyCouponRuleDto>
*/
private void processForUserCoupon(CandyMgtCoupon mgtCoupon, CandyCoupon coupon, List<CandyCouponRuleDto> couponRuleDtoList) {
List<CandyUserCoupon> initUserCouponList = new ArrayList<>();
LocalDateTime now = LocalDateTime.now();
String eventLimit = mgtCoupon.getEventLimit();
......@@ -309,6 +308,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
log.info("发放券处理中:{}-目标指定手机号[总数:{},发放量:{}]", mgtCoupon.getMcouponId(), limitSize, eventAmt);
AbstractRedisUtil redisAdamUtil = redisDataSourceUtil.getRedisAdamUtil();
AbstractRedisUtil redisGoblinUtil = redisDataSourceUtil.getRedisGoblinUtil();
if (coupon.getBindType() == 2) {// 券领取方式[2-积分商品],实际发放至用户时计算有效期
coupon.setEffectAt(now);
......@@ -324,6 +324,9 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
// 指定手机号发放券中,会员权益券失效时间duedAt需要同步会员到期时间expiryAt
Integer exclusively = mgtCoupon.getExclusively();
boolean isMemberRightsCoupon = exclusively == 1;
List<CandyUserCoupon> initUserCouponList = new ArrayList<>();
List<CandyUserCouponAssoc> initUserCouponAssocList = new ArrayList<>();
for (int i = 0; i < eventAmt; i++) {
for (String r : eventLimitArr) {
String uid = (String) redisAdamUtil.get(AdamRedisConst.IDENTITY_MOBILE.concat(r));
......@@ -353,6 +356,23 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
log.warn("发放券处理中:{}-目标指定手机号,该券生效日期或失效日期无效[couponId:{},effectAt:{},expireAt:{}]", mcouponId, couponId, couponEffectAt, couponExpireAt);
continue;
}
// 判定为券类商品支付后发放券业务&&需要关联实名人时,提取关联人信息绑定到用户券信息中
if (Objects.equals(mgtCoupon.getEventDriven(), 0)
&& Objects.equals(operator, CandyRedisConst.OPERATOR_MGT_COUPON_BY_SKU)
&& Objects.equals(coupon.getIsTrueName(), 1)) {
GoblinOrderSkuVo goblinOrderSkuVo = (GoblinOrderSkuVo) redisGoblinUtil.get(GoblinRedisConst.REDIS_GOBLIN_ORDER_SKU.concat(mgtCoupon.getMcouponId()));
if (!Objects.isNull(goblinOrderSkuVo)) {
CandyUserCouponAssoc userCouponAssoc = new CandyUserCouponAssoc();
userCouponAssoc.setUcouponId(userCoupon.getUcouponId());
userCouponAssoc.setIdType(goblinOrderSkuVo.getIdType());
userCouponAssoc.setIdName(goblinOrderSkuVo.getIdName());
userCouponAssoc.setIdNo(goblinOrderSkuVo.getIdNo());
initUserCouponAssocList.add(userCouponAssoc);
} else {
log.warn("");
}
}
userCoupon.setOperator(operator);
userCoupon.setCreatedAt(now);
......@@ -366,6 +386,14 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
AbstractRedisUtil redisCandyUtil = redisDataSourceUtil.getRedisCandyUtil();
if (!initUserCouponList.isEmpty()) {
if (platformCandyUserCouponService.saveBatch(initUserCouponList)) {
if (!initUserCouponAssocList.isEmpty()) {
boolean assocSaveFlg = platformCandyUserCouponAssocService.saveBatch(initUserCouponAssocList);
initUserCouponAssocList.forEach(c -> {
CandyUserCouponAssocDto assocDto = CandyUserCouponAssocDto.getNew().copy(c);
boolean assocRdsSetFlg = redisCandyUtil.set(CandyRedisConst.BASIC_USER_COUPON_ASSOC.concat(c.getUcouponId()), assocDto);
log.info("发放券-券类商品-记录关联人信息:[mcouponId={}, ucouponId={},assocSaveFlg={},assocRdsSetFlg={}]", mcouponId, c.getUcouponId(), assocSaveFlg, assocRdsSetFlg);
});
}
initUserCouponList.forEach(r -> {
String uckey = CandyRedisConst.BASIC_USER_COUPON.concat(r.getUid());
......
package com.liquidnet.service.platform.service.impl.candy;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.service.candy.entity.CandyUserCouponAssoc;
import com.liquidnet.service.candy.mapper.CandyUserCouponAssocMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class PlatformCandyUserCouponAssocService extends ServiceImpl<CandyUserCouponAssocMapper, CandyUserCouponAssoc> {
}
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