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

Commit 3f7e5b0e authored by 胡佳晨's avatar 胡佳晨

Merge branch '20240123_COUPON_SPU' into 阶梯退票_羊毛券_合并分支

parents caf35730 b3a47a0a
...@@ -10,7 +10,7 @@ import java.io.Serializable; ...@@ -10,7 +10,7 @@ import java.io.Serializable;
@Data @Data
public class AdamMemberRightsCouponRuleVo implements Serializable, Cloneable { public class AdamMemberRightsCouponRuleVo implements Serializable, Cloneable {
private static final long serialVersionUID = 4282440130223655255L; private static final long serialVersionUID = 4282440130223655255L;
@ApiModelProperty(value = "适用范围[100-全场|90-演出|91-场次|92-票|80-商品|81-款式]", example = "90") @ApiModelProperty(value = "适用范围[101-音乐节|102-小型演出(livehouse演出) |103-巡演|100-全场|90-演出|91-场次|92-票|80-商品|81-款式]", example = "90")
private Integer useScope; private Integer useScope;
@ApiModelProperty(value = "适用名称", example = "北京草莓") @ApiModelProperty(value = "适用名称", example = "北京草莓")
private String busiName; private String busiName;
......
...@@ -38,4 +38,17 @@ public class CandyRedisConst { ...@@ -38,4 +38,17 @@ public class CandyRedisConst {
* </value> * </value>
*/ */
public static final String BASIC_COMMON_COUPON = PREFIX.concat("basic:common_coupon"); 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";
} }
...@@ -9,7 +9,7 @@ import javax.validation.constraints.Pattern; ...@@ -9,7 +9,7 @@ import javax.validation.constraints.Pattern;
@ApiModel(value = "CandyCouponRuleBuildParam", description = "添加券规则入参") @ApiModel(value = "CandyCouponRuleBuildParam", description = "添加券规则入参")
public class CandyCouponRuleBuildParam { public class CandyCouponRuleBuildParam {
@Pattern(regexp = "\\b(100|90|91|92|80|81)\\b", message = "适用范围无效") @Pattern(regexp = "\\b(100|90|91|92|80|81)\\b", message = "适用范围无效")
@ApiModelProperty(required = true, value = "适用范围[100-全场|90-演出|91-场次|92-票|80-商品|81-款式]", allowableValues = "100,90,91,92,80,81") @ApiModelProperty(required = true, value = "适用范围[101-音乐节|102-小型演出(livehouse演出) |103-巡演|100-全场|90-演出|91-场次|92-票|80-商品|81-款式]", allowableValues = "100,90,91,92,80,81")
private Integer useScope; private Integer useScope;
@ApiModelProperty(required = true, value = "适用名称", allowableValues = "适用名称") @ApiModelProperty(required = true, value = "适用名称", allowableValues = "适用名称")
private String busiName; private String busiName;
......
...@@ -28,9 +28,9 @@ public interface ICandyCouponService { ...@@ -28,9 +28,9 @@ public interface ICandyCouponService {
List<CandyCouponVo> memberCoupon(String mCouponId); List<CandyCouponVo> memberCoupon(String mCouponId);
CandyMyCouponListVo preUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId, Integer type); CandyMyCouponListVo preUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId, Integer type,int perType,int isTrueName);
Integer preCanUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId); Integer preCanUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId,int perType,int isTrueName);
CandyMyCouponListVo preUseGoodCoupon(BigDecimal priceTotal, String goodId, Integer type,String uid); CandyMyCouponListVo preUseGoodCoupon(BigDecimal priceTotal, String goodId, Integer type,String uid);
...@@ -40,7 +40,7 @@ public interface ICandyCouponService { ...@@ -40,7 +40,7 @@ public interface ICandyCouponService {
Integer stateCoupon(String uCouponId); Integer stateCoupon(String uCouponId);
CandyUseResultVo useCoupon(String uCouponId, String content, String totalPrice, String performanceId, String timesId, String ticketId, String goodIds,String uid); CandyUseResultVo useCoupon(String uCouponId, String content, String totalPrice, String performanceId, String timesId, String ticketId, String goodIds,String uid,int perType);
Boolean useBackCoupon(List<BackCouponParam> backCouponParam); Boolean useBackCoupon(List<BackCouponParam> backCouponParam);
......
...@@ -12,7 +12,7 @@ public class CandyCouponRulesVo implements Serializable,Cloneable { ...@@ -12,7 +12,7 @@ public class CandyCouponRulesVo implements Serializable,Cloneable {
private static final long serialVersionUID = 4073256621782131607L; private static final long serialVersionUID = 4073256621782131607L;
@ApiModelProperty(value = "适用范围[100-全场|90-演出|91-场次|92-票|80-商品|81-款式]",example = "90") @ApiModelProperty(value = "适用范围[101-音乐节|102-小型演出(livehouse演出) |103-巡演|100-全场|90-演出|91-场次|92-票|80-商品|81-款式]",example = "90")
private Integer useScope; private Integer useScope;
@ApiModelProperty(value = "适用名称",example = "北京草莓") @ApiModelProperty(value = "适用名称",example = "北京草莓")
private String busiName; private String busiName;
......
...@@ -16,4 +16,10 @@ public class GoblinOrderSkuParam { ...@@ -16,4 +16,10 @@ public class GoblinOrderSkuParam {
private String spuId; private String spuId;
@ApiModelProperty(required = true, value = "数量") @ApiModelProperty(required = true, value = "数量")
private Integer number; private Integer number;
@ApiModelProperty(required = false, value = "关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照")
private Integer idType;
@ApiModelProperty(required = false, value = "关联人姓名")
private String idName;
@ApiModelProperty(required = false, value = "关联人证件号码")
private String idNo;
} }
...@@ -169,6 +169,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable { ...@@ -169,6 +169,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable {
} else { } else {
vo.setSpuNo(this.getSpuNo()); vo.setSpuNo(this.getSpuNo());
} }
vo.setSpuType(0);
vo.setName(this.getName()); vo.setName(this.getName());
vo.setSubtitle(this.getSubtitle()); vo.setSubtitle(this.getSubtitle());
vo.setSellPrice(this.getSellPrice()); vo.setSellPrice(this.getSellPrice());
...@@ -227,6 +228,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable { ...@@ -227,6 +228,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable {
vo.setStoreId(this.getStoreId()); vo.setStoreId(this.getStoreId());
vo.setSpuId(this.getSpuId()); vo.setSpuId(this.getSpuId());
vo.setSpuNo(this.getSpuNo()); vo.setSpuNo(this.getSpuNo());
vo.setSpuType(0);
vo.setName(this.getName()); vo.setName(this.getName());
vo.setSubtitle(this.getSubtitle()); vo.setSubtitle(this.getSubtitle());
vo.setSellPrice(this.getSellPrice()); vo.setSellPrice(this.getSellPrice());
......
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 effectAt;
@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 expireAt;
}
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 = true, value = "限量[0-无限制|X:限购数量]")
@Min(value = 0, message = "参数'限购数量'不能小于0")
@NotNull(message = "参数'限购数量'不可为空")
private Integer buyLimit;
@ApiModelProperty(position = 15, required = false, value = "总库存")
private Integer stock;
@ApiModelProperty(position = 16, required = false, value = "总库存")
private Integer skuStock;
@ApiModelProperty(position = 17, required = false, value = "加减库存")
private Integer operStock;
/**
* ---------------------------- 券类商品-代金券属性 ----------------------------
*/
@ApiModelProperty(position = 18, required = true, value = "是否实名[0-否|1-是,表示该商品需要实名关联]", example = "1")
@Pattern(regexp = "\\b(0|1)\\b", message = "参数'是否实名'无效")
private String isTrueName;
@ApiModelProperty(position = 19, required = true, value = "适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]")
@Pattern(regexp = "\\b(101|102|103)\\b", message = "参数'适用范围'无效")
private String useScope;
@ApiModelProperty(position = 20, required = true, value = "面值", example = "99.00")
@Digits(integer = 3, fraction = 2, message = "参数'面值'无效")
@DecimalMin(value = "0.01", message = "参数'面值'必须为大于0")
private BigDecimal valFace;
@ApiModelProperty(position = 21, 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 effectAt;
@ApiModelProperty(position = 22, 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 expireAt;
public GoblinGoodsSkuInfoVo initEditGoodsSkuInfoVo() {
GoblinGoodsSkuInfoVo goodsSkuInfoVo = GoblinGoodsSkuInfoVo.getNew();
goodsSkuInfoVo.setSkuType(2);
goodsSkuInfoVo.setSkuId(this.getSkuId());
goodsSkuInfoVo.setPrice(this.getPrice());
goodsSkuInfoVo.setPriceMember(this.getPrice());
goodsSkuInfoVo.setBuyLimit(this.getBuyLimit());
goodsSkuInfoVo.setStock(this.getStock());
goodsSkuInfoVo.setSkuStock(this.getSkuStock());
goodsSkuInfoVo.setIsTrueName(Integer.valueOf(this.getIsTrueName()));
goodsSkuInfoVo.setUseScope(Integer.valueOf(this.getUseScope()));
goodsSkuInfoVo.setValFace(this.getValFace());
goodsSkuInfoVo.setEffectAt(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getEffectAt()));
goodsSkuInfoVo.setExpireAt(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getExpireAt()));
return goodsSkuInfoVo;
}
}
...@@ -108,6 +108,7 @@ public class GoblinStoreMgtGoodsEditSkuParam implements Serializable { ...@@ -108,6 +108,7 @@ public class GoblinStoreMgtGoodsEditSkuParam implements Serializable {
goodsSkuInfoVo.setName(mgtGoodsSkuInfoVo.getName()); goodsSkuInfoVo.setName(mgtGoodsSkuInfoVo.getName());
goodsSkuInfoVo.setSkuSpecList(mgtGoodsSkuInfoVo.getSkuSpecList()); goodsSkuInfoVo.setSkuSpecList(mgtGoodsSkuInfoVo.getSkuSpecList());
} }
goodsSkuInfoVo.setSkuType(0);
goodsSkuInfoVo.setSkuId(this.getSkuId()); goodsSkuInfoVo.setSkuId(this.getSkuId());
goodsSkuInfoVo.setSkuBarCode(this.getSkuBarCode()); goodsSkuInfoVo.setSkuBarCode(this.getSkuBarCode());
goodsSkuInfoVo.setSkuPic(this.getSkuPic()); goodsSkuInfoVo.setSkuPic(this.getSkuPic());
...@@ -133,6 +134,7 @@ public class GoblinStoreMgtGoodsEditSkuParam implements Serializable { ...@@ -133,6 +134,7 @@ public class GoblinStoreMgtGoodsEditSkuParam implements Serializable {
public GoblinGoodsSkuInfoVo initEditAddGoodsSkuInfoVo() { public GoblinGoodsSkuInfoVo initEditAddGoodsSkuInfoVo() {
GoblinGoodsSkuInfoVo vo = GoblinGoodsSkuInfoVo.getNew(); GoblinGoodsSkuInfoVo vo = GoblinGoodsSkuInfoVo.getNew();
List<GoblinGoodsSpecDto> skuSpecList = this.getSkuSpecList(); List<GoblinGoodsSpecDto> skuSpecList = this.getSkuSpecList();
vo.setSkuType(0);
vo.setName(""); vo.setName("");
for (GoblinGoodsSpecDto goblinGoodsSpecDto : skuSpecList) { for (GoblinGoodsSpecDto goblinGoodsSpecDto : skuSpecList) {
vo.setName(vo.getName().concat(goblinGoodsSpecDto.getSpecVname())); vo.setName(vo.getName().concat(goblinGoodsSpecDto.getSpecVname()));
......
...@@ -41,6 +41,6 @@ public class GoblinStoreMgtGoodsFilterParam implements Serializable { ...@@ -41,6 +41,6 @@ public class GoblinStoreMgtGoodsFilterParam implements Serializable {
private BigDecimal priceGe; private BigDecimal priceGe;
@ApiModelProperty(position = 20, required = false, value = "价格区间MAX") @ApiModelProperty(position = 20, required = false, value = "价格区间MAX")
private BigDecimal priceLe; private BigDecimal priceLe;
@ApiModelProperty(position = 21, required = false, value = "商品类型[0-常规|1-数字藏品]") @ApiModelProperty(position = 21, required = false, value = "商品类型[0-常规|1-数字藏品|2-券类商品]")
private Integer spuType; private Integer spuType;
} }
...@@ -24,7 +24,7 @@ public class GoblinStoreMgtGoodsSkuSimpleFilterParam implements Serializable { ...@@ -24,7 +24,7 @@ public class GoblinStoreMgtGoodsSkuSimpleFilterParam implements Serializable {
@ApiModelProperty(position = 13, required = false, value = "搜索关键字[128]") @ApiModelProperty(position = 13, required = false, value = "搜索关键字[128]")
@Size(min = 2, max = 100, message = "搜索关键字长度范围2~100") @Size(min = 2, max = 100, message = "搜索关键字长度范围2~100")
private String keyword; private String keyword;
@ApiModelProperty(position = 14, required = false, value = "商品类型[0-常规|1-数字藏品],未指定则代表全部") @ApiModelProperty(position = 14, required = false, value = "商品类型[0-常规|1-数字藏品|2-券类商品],未指定则代表全部")
private Integer skuType; private Integer skuType;
// @ApiModelProperty(position = 15, required = false, value = "商品上架状态[0-待上架|1-下架|2-违规|3-上架]", allowableValues = "0,1,2,3") // @ApiModelProperty(position = 15, required = false, value = "商品上架状态[0-待上架|1-下架|2-违规|3-上架]", allowableValues = "0,1,2,3")
// private String shelvesStatus; // private String shelvesStatus;
......
...@@ -19,7 +19,7 @@ public class GoblinStoreMgtGoodsListVo implements Serializable, Cloneable { ...@@ -19,7 +19,7 @@ public class GoblinStoreMgtGoodsListVo implements Serializable, Cloneable {
private String spuId; private String spuId;
@ApiModelProperty(position = 12, value = "商品编码[45]") @ApiModelProperty(position = 12, value = "商品编码[45]")
private String spuNo; private String spuNo;
@ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品]") @ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品|2-券类商品]")
private int spuType; private int spuType;
@ApiModelProperty(position = 13, value = "封面图片地址[256]") @ApiModelProperty(position = 13, value = "封面图片地址[256]")
private String coverPic; private String coverPic;
......
...@@ -14,7 +14,7 @@ public class GoblinStoreMgtGoodsSkuSimpleVo implements Serializable { ...@@ -14,7 +14,7 @@ public class GoblinStoreMgtGoodsSkuSimpleVo implements Serializable {
private String spuId; private String spuId;
@ApiModelProperty(position = 11, value = "单品ID[64]") @ApiModelProperty(position = 11, value = "单品ID[64]")
private String skuId; private String skuId;
@ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品]") @ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品|2-券类商品]")
private int skuType; private int skuType;
@ApiModelProperty(position = 13, value = "单品名称[100]") @ApiModelProperty(position = 13, value = "单品名称[100]")
private String name; private String name;
......
package com.liquidnet.service.goblin.dto.vo; package com.liquidnet.service.goblin.dto.vo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
...@@ -17,6 +18,7 @@ import java.math.BigDecimal; ...@@ -17,6 +18,7 @@ import java.math.BigDecimal;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@JsonIgnoreProperties(ignoreUnknown = true)
public class GoblinBackOrderSkuVo implements Serializable,Cloneable { public class GoblinBackOrderSkuVo implements Serializable,Cloneable {
@ApiModelProperty(value = "orderSkuId") @ApiModelProperty(value = "orderSkuId")
...@@ -42,6 +44,9 @@ public class GoblinBackOrderSkuVo implements Serializable,Cloneable { ...@@ -42,6 +44,9 @@ public class GoblinBackOrderSkuVo implements Serializable,Cloneable {
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private String createdAt; private String createdAt;
@ApiModelProperty(value = "商品类型[0-常规|1-数字藏品|2-券类商品]")
private Integer skuType;
private static final GoblinBackOrderSkuVo obj = new GoblinBackOrderSkuVo(); private static final GoblinBackOrderSkuVo obj = new GoblinBackOrderSkuVo();
public static GoblinBackOrderSkuVo getNew() { public static GoblinBackOrderSkuVo getNew() {
......
...@@ -14,6 +14,8 @@ import java.util.List; ...@@ -14,6 +14,8 @@ import java.util.List;
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class GoblinGoodsInfoDetailVo implements Serializable, Cloneable { public class GoblinGoodsInfoDetailVo implements Serializable, Cloneable {
private static final long serialVersionUID = -4712015317981742851L; private static final long serialVersionUID = -4712015317981742851L;
@ApiModelProperty(position = 1, value = "商品类型[0-常规|1-数字藏品|2-券类商品]")
private Integer spuType;
@ApiModelProperty(position = 22, value = "规格展现方式[1-常规|2-组合]") @ApiModelProperty(position = 22, value = "规格展现方式[1-常规|2-组合]")
private String specMode; private String specMode;
@ApiModelProperty(position = 51, value = "规格信息") @ApiModelProperty(position = 51, value = "规格信息")
......
...@@ -30,7 +30,7 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable { ...@@ -30,7 +30,7 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable {
private String spuErpCode; private String spuErpCode;
@ApiModelProperty(position = 12, value = "ERP类型[WANGDIAN-旺店通]") @ApiModelProperty(position = 12, value = "ERP类型[WANGDIAN-旺店通]")
private String erpType; private String erpType;
@ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品]") @ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品|2-券类商品]")
private int spuType; private int spuType;
@ApiModelProperty(position = 13, value = "商品名称[100]") @ApiModelProperty(position = 13, value = "商品名称[100]")
private String name; private String name;
......
...@@ -45,6 +45,8 @@ public class GoblinGoodsSkuInfoDetailVo implements Serializable, Cloneable { ...@@ -45,6 +45,8 @@ public class GoblinGoodsSkuInfoDetailVo implements Serializable, Cloneable {
private Integer buyLimit; private Integer buyLimit;
@ApiModelProperty(position = 27, value = "剩余库存") @ApiModelProperty(position = 27, value = "剩余库存")
private Integer restStock; private Integer restStock;
@ApiModelProperty(position = 51, value = "是否实名[0-否|1-是,表示该商品需要实名关联]")
private Integer isTrueName;
private static final GoblinGoodsSkuInfoDetailVo obj = new GoblinGoodsSkuInfoDetailVo(); private static final GoblinGoodsSkuInfoDetailVo obj = new GoblinGoodsSkuInfoDetailVo();
......
package com.liquidnet.service.goblin.dto.vo; package com.liquidnet.service.goblin.dto.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto; import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
...@@ -35,7 +34,7 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable { ...@@ -35,7 +34,7 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable {
private int erpHosting; private int erpHosting;
@ApiModelProperty(position = 12, value = "ERP仓库编号") @ApiModelProperty(position = 12, value = "ERP仓库编号")
private String erpWarehouseNo; private String erpWarehouseNo;
@ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品]") @ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品|2-券类商品]")
private int skuType; private int skuType;
@ApiModelProperty(position = 13, value = "单品的名称[100]") @ApiModelProperty(position = 13, value = "单品的名称[100]")
private String name; private String name;
...@@ -137,6 +136,32 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable { ...@@ -137,6 +136,32 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable {
private String nftHash; private String nftHash;
@ApiModelProperty(position = 33, value = "NFT系列声明时间") @ApiModelProperty(position = 33, value = "NFT系列声明时间")
private String declareAt; 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]")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime effectAt;
@ApiModelProperty(position = 33, value = "过期时间[yyyy-MM-dd HH:mm:ss]")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime expireAt;
/**
* ---------------------------- 以上为券类商品-代金券属性 ----------------------------
*/
@ApiModelProperty(position = 34, value = "删除标记[0-未删除|1-删除]") @ApiModelProperty(position = 34, value = "删除标记[0-未删除|1-删除]")
private String delFlg; private String delFlg;
@ApiModelProperty(position = 35, value = "上架时间") @ApiModelProperty(position = 35, value = "上架时间")
...@@ -175,7 +200,7 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable { ...@@ -175,7 +200,7 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable {
private static final GoblinGoodsSkuInfoVo obj = new GoblinGoodsSkuInfoVo(); private static final GoblinGoodsSkuInfoVo obj = new GoblinGoodsSkuInfoVo();
public String getUnbox() { public String getUnbox() {
if (skuType == 0) { if (skuType == 0 || skuType == 2) {
return unbox == null ? "0" : unbox; return unbox == null ? "0" : unbox;
} else { } else {
return unbox; return unbox;
...@@ -189,4 +214,10 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable { ...@@ -189,4 +214,10 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable {
return new GoblinGoodsSkuInfoVo(); return new GoblinGoodsSkuInfoVo();
} }
} }
public String getCouponSnapshot() {
String str = "skuId=%s,price=%s,valFace=%s,buyLimit=%d,useScope=%s,effectAt=%s,expireAt=%s,isTrueName=%s;";
return String.format(str, this.getSkuId(), this.getPrice(), this.getValFace(),
this.getBuyLimit(), this.getUseScope(), this.getEffectAt(), this.getExpireAt(), this.getIsTrueName());
}
} }
package com.liquidnet.service.goblin.dto.vo; package com.liquidnet.service.goblin.dto.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.SensitizeUtil;
import com.liquidnet.service.goblin.entity.GoblinOrderSku; import com.liquidnet.service.goblin.entity.GoblinOrderSku;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Objects;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
/** /**
* <p> * <p>
...@@ -78,6 +74,25 @@ public class GoblinOrderSkuVo implements Serializable, Cloneable { ...@@ -78,6 +74,25 @@ public class GoblinOrderSkuVo implements Serializable, Cloneable {
@ApiModelProperty(value = "erp-仓库号") @ApiModelProperty(value = "erp-仓库号")
private String erpWarehouseNo; private String erpWarehouseNo;
/**
* ---------------------------- 以下为券类商品-代金券属性 ----------------------------
*/
@ApiModelProperty(value = "商品类型[0-常规|1-数字藏品|2-券类商品]")
private Integer skuType;
@ApiModelProperty(value = "是否实名[0-否|1-是,表示该商品需要实名关联],这里默认0")
private Integer isTrueName;
@ApiModelProperty(value = "关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照")
private Integer idType;
@ApiModelProperty(value = "关联人姓名")
private String idName;
@ApiModelProperty(value = "关联人证件号码")
private String idNo;
/**
* ---------------------------- 以上为券类商品-代金券属性 ----------------------------
*/
public String getPushTime() { public String getPushTime() {
return pushTime == null ? "" : pushTime; return pushTime == null ? "" : pushTime;
} }
...@@ -122,4 +137,17 @@ public class GoblinOrderSkuVo implements Serializable, Cloneable { ...@@ -122,4 +137,17 @@ public class GoblinOrderSkuVo implements Serializable, Cloneable {
return new GoblinOrderSkuVo(); return new GoblinOrderSkuVo();
} }
} }
/**
* 脱敏处理-关联人信息
*
* @return AdamUserIdentityVo
*/
public void desensitize() {
this.setIdName(SensitizeUtil.chineseName(this.getIdName()));
this.setIdNo(SensitizeUtil.custom(this.getIdNo(), 3, 2));
if (!Objects.isNull(this.idNo) && StringUtils.length(this.getIdNo()) < 9) {
this.setIdNo(SensitizeUtil.custom(this.getIdNo(), 2, 2));
}
}
} }
...@@ -32,6 +32,24 @@ public class GoblinStoreOrderListSkuVo implements Cloneable { ...@@ -32,6 +32,24 @@ public class GoblinStoreOrderListSkuVo implements Cloneable {
@ApiModelProperty(value = "优惠价") @ApiModelProperty(value = "优惠价")
private BigDecimal priceVoucher; private BigDecimal priceVoucher;
/**
* ---------------------------- 以下为券类商品-代金券属性 ----------------------------
*/
@ApiModelProperty(value = "商品类型[0-常规|1-数字藏品|2-券类商品]")
private Integer skuType;
@ApiModelProperty(value = "是否实名[0-否|1-是,表示该商品需要实名关联],这里默认0")
private Integer isTrueName;
@ApiModelProperty(value = "关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照")
private Integer idType;
@ApiModelProperty(value = "关联人姓名")
private String idName;
@ApiModelProperty(value = "关联人证件号码")
private String idNo;
/**
* ---------------------------- 以上为券类商品-代金券属性 ----------------------------
*/
private static final GoblinStoreOrderListSkuVo obj = new GoblinStoreOrderListSkuVo(); private static final GoblinStoreOrderListSkuVo obj = new GoblinStoreOrderListSkuVo();
public static GoblinStoreOrderListSkuVo getNew() { public static GoblinStoreOrderListSkuVo getNew() {
......
...@@ -25,7 +25,7 @@ public class NoticeGoblinGoodsSkuInfoVo implements Serializable, Cloneable { ...@@ -25,7 +25,7 @@ public class NoticeGoblinGoodsSkuInfoVo implements Serializable, Cloneable {
private String spuId; private String spuId;
@ApiModelProperty(value = "单品的编号[45]") @ApiModelProperty(value = "单品的编号[45]")
private String skuNo; private String skuNo;
@ApiModelProperty(value = "商品类型[0-常规|1-数字藏品]") @ApiModelProperty(value = "商品类型[0-常规|1-数字藏品|2-券类商品]")
private int skuType; private int skuType;
@ApiModelProperty(value = "单品的名称[100]") @ApiModelProperty(value = "单品的名称[100]")
private String name; private String name;
......
package com.liquidnet.service.goblin.param; 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.GoblinOrderAttr;
import com.liquidnet.service.goblin.entity.GoblinOrderSku; import com.liquidnet.service.goblin.entity.GoblinOrderSku;
import com.liquidnet.service.goblin.entity.GoblinStoreOrder; import com.liquidnet.service.goblin.entity.GoblinStoreOrder;
...@@ -9,6 +10,7 @@ import lombok.Data; ...@@ -9,6 +10,7 @@ import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Map;
@ApiModel(value = "GoblinOrderPreParam") @ApiModel(value = "GoblinOrderPreParam")
...@@ -48,6 +50,7 @@ public class GoblinOrderPreParam implements Cloneable{ ...@@ -48,6 +50,7 @@ public class GoblinOrderPreParam implements Cloneable{
private List<GoblinOrderSku> orderSkuList; private List<GoblinOrderSku> orderSkuList;
private List<String> storeSpuIds; private List<String> storeSpuIds;
private List<String> platformSpuIds; private List<String> platformSpuIds;
private Map<String, GoblinOrderSkuParam> orderSkuParamMap;
private static final GoblinOrderPreParam obj = new GoblinOrderPreParam(); private static final GoblinOrderPreParam obj = new GoblinOrderPreParam();
......
package com.liquidnet.service.goblin.param; 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.GoblinOrderAttr;
import com.liquidnet.service.goblin.entity.GoblinOrderSku; import com.liquidnet.service.goblin.entity.GoblinOrderSku;
import com.liquidnet.service.goblin.entity.GoblinStoreOrder; import com.liquidnet.service.goblin.entity.GoblinStoreOrder;
...@@ -9,6 +10,7 @@ import lombok.Data; ...@@ -9,6 +10,7 @@ import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Map;
@ApiModel(value = "GoblinOrderSqlParam") @ApiModel(value = "GoblinOrderSqlParam")
...@@ -18,6 +20,7 @@ public class GoblinOrderSqlParam implements Cloneable{ ...@@ -18,6 +20,7 @@ public class GoblinOrderSqlParam implements Cloneable{
private GoblinStoreOrder storeOrder; private GoblinStoreOrder storeOrder;
private GoblinOrderAttr orderAttr; private GoblinOrderAttr orderAttr;
private List<GoblinOrderSku> orderSkuList; private List<GoblinOrderSku> orderSkuList;
private Map<String, GoblinOrderSkuParam> orderSkuParamMap;
private static final GoblinOrderSqlParam obj = new GoblinOrderSqlParam(); private static final GoblinOrderSqlParam obj = new GoblinOrderSqlParam();
......
...@@ -40,6 +40,14 @@ public interface IGoblinstoreMgtGoodsService { ...@@ -40,6 +40,14 @@ public interface IGoblinstoreMgtGoodsService {
*/ */
void digitalGoodsAdd(GoblinGoodsInfoVo goodsInfoVo); void digitalGoodsAdd(GoblinGoodsInfoVo goodsInfoVo);
/**
* 商品管理:SPU添加-券类商品
*
* @param goodsInfoVo GoblinGoodsInfoVo
* @param goodsSkuInfoVoList List<GoblinGoodsSkuInfoVo>
*/
void couponGoodsAdd(GoblinGoodsInfoVo goodsInfoVo, List<GoblinGoodsSkuInfoVo> goodsSkuInfoVoList);
/** /**
* 商品管理:SPU详情 * 商品管理:SPU详情
* *
...@@ -69,6 +77,16 @@ public interface IGoblinstoreMgtGoodsService { ...@@ -69,6 +77,16 @@ public interface IGoblinstoreMgtGoodsService {
*/ */
boolean digitalGoodsEditSpu(String uid, GoblinStoreMgtDigitalGoodsAddParam mgtDigitalGoodsAddParam, GoblinGoodsInfoVo goodsInfoVo); 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编辑 * 商品管理:商品编辑:SKU编辑
* *
...@@ -93,6 +111,16 @@ public interface IGoblinstoreMgtGoodsService { ...@@ -93,6 +111,16 @@ public interface IGoblinstoreMgtGoodsService {
*/ */
boolean digitalGoodsEditSku(String uid, GoblinStoreMgtDigitalGoodsAddSkuParam mgtDigitalGoodsAddSkuParam, GoblinGoodsInfoVo mgtGoodsInfoVo); 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添加 * 商品管理:商品编辑:SKU添加
* *
......
...@@ -23,7 +23,7 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable { ...@@ -23,7 +23,7 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable {
private String spuId; private String spuId;
@ApiModelProperty(position = 12, value = "商品编码[默认为系统编码,也可手动输入商家自己的编码]") @ApiModelProperty(position = 12, value = "商品编码[默认为系统编码,也可手动输入商家自己的编码]")
private String spuNo; private String spuNo;
@ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品]") @ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品|2-券类商品]")
private int spuType; private int spuType;
@ApiModelProperty(position = 13, value = "商品名称[100]") @ApiModelProperty(position = 13, value = "商品名称[100]")
private String name; private String name;
......
...@@ -39,7 +39,7 @@ public class GoblinCommonController extends BaseController { ...@@ -39,7 +39,7 @@ public class GoblinCommonController extends BaseController {
@GetMapping("goods") @GetMapping("goods")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "title", value = "商品名称[模糊]"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "title", value = "商品名称[模糊]"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "type", value = "商品类型[0-常规|1-数字藏品]"), @ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "type", value = "商品类型[0-常规|1-数字藏品|2-券类商品]"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "shelvesStatus", value = "上线状态"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "shelvesStatus", value = "上线状态"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuAppear", value = "显示状态"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuAppear", value = "显示状态"),
}) })
...@@ -58,7 +58,7 @@ public class GoblinCommonController extends BaseController { ...@@ -58,7 +58,7 @@ public class GoblinCommonController extends BaseController {
@GetMapping("sku") @GetMapping("sku")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "title", value = "商品名称[模糊]"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "title", value = "商品名称[模糊]"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "type", value = "商品类型[0-常规|1-数字藏品]"), @ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "type", value = "商品类型[0-常规|1-数字藏品|2-券类商品]"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "shelvesStatus", value = "上线状态"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "shelvesStatus", value = "上线状态"),
}) })
@ResponseBody @ResponseBody
......
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.setIdNo(userCouponAssoc.getIdNo());
return this;
}
}
...@@ -30,6 +30,7 @@ public class CandyUserCouponBasicDto implements Serializable, Cloneable { ...@@ -30,6 +30,7 @@ public class CandyUserCouponBasicDto implements Serializable, Cloneable {
private Integer overlay; private Integer overlay;
private Integer overlayLevel; private Integer overlayLevel;
private Integer validity; private Integer validity;
private Integer isTrueName;
private Integer redeemValidity; private Integer redeemValidity;
private LocalDateTime redeemStart; private LocalDateTime redeemStart;
private LocalDateTime redeemStop; private LocalDateTime redeemStop;
...@@ -60,7 +61,6 @@ public class CandyUserCouponBasicDto implements Serializable, Cloneable { ...@@ -60,7 +61,6 @@ public class CandyUserCouponBasicDto implements Serializable, Cloneable {
/* com.liquidnet.service.candy.entity.CandyCommonCoupon */ /* com.liquidnet.service.candy.entity.CandyCommonCoupon */
private String ccouponId; private String ccouponId;
private static final CandyUserCouponBasicDto obj = new CandyUserCouponBasicDto(); private static final CandyUserCouponBasicDto obj = new CandyUserCouponBasicDto();
public static CandyUserCouponBasicDto getNew() { public static CandyUserCouponBasicDto getNew() {
...@@ -89,6 +89,7 @@ public class CandyUserCouponBasicDto implements Serializable, Cloneable { ...@@ -89,6 +89,7 @@ public class CandyUserCouponBasicDto implements Serializable, Cloneable {
this.setOverlay(coupon.getOverlay()); this.setOverlay(coupon.getOverlay());
this.setOverlayLevel(coupon.getOverlayLevel()); this.setOverlayLevel(coupon.getOverlayLevel());
this.setValidity(coupon.getValidity()); this.setValidity(coupon.getValidity());
this.setIsTrueName(coupon.getIsTrueName());
this.setRedeemValidity(coupon.getRedeemValidity()); this.setRedeemValidity(coupon.getRedeemValidity());
this.setRedeemStart(coupon.getRedeemStart()); this.setRedeemStart(coupon.getRedeemStart());
this.setRedeemStop(coupon.getRedeemStop()); this.setRedeemStop(coupon.getRedeemStop());
......
...@@ -104,6 +104,11 @@ public class CandyCoupon implements Serializable { ...@@ -104,6 +104,11 @@ public class CandyCoupon implements Serializable {
*/ */
private Integer validity; private Integer validity;
/**
* 是否实名[0-否|1-是,表示该商品需要实名关联]
*/
private Integer isTrueName;
/** /**
* 兑换有效期(单位天) * 兑换有效期(单位天)
*/ */
......
...@@ -28,7 +28,7 @@ public class CandyCouponRule implements Serializable { ...@@ -28,7 +28,7 @@ public class CandyCouponRule implements Serializable {
private String couponId; private String couponId;
/** /**
* 适用范围[100-全场|90-演出|91-场次|92-票|80-商品|81-款式] * 适用范围[101-音乐节|102-小型演出(livehouse演出) |103-巡演|100-全场|90-演出|91-场次|92-票|80-商品|81-款式]
*/ */
private Integer useScope; private Integer useScope;
......
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>
...@@ -51,7 +51,7 @@ public class GoblinGoods implements Serializable { ...@@ -51,7 +51,7 @@ public class GoblinGoods implements Serializable {
private String erpType; private String erpType;
/** /**
* 商品类型[0-常规|1-数字藏品] * 商品类型[0-常规|1-数字藏品|2-券类商品]
*/ */
private Integer spuType; private Integer spuType;
......
...@@ -58,7 +58,7 @@ public class GoblinGoodsSku implements Serializable { ...@@ -58,7 +58,7 @@ public class GoblinGoodsSku implements Serializable {
private String erpWarehouseNo; private String erpWarehouseNo;
/** /**
* 商品类型[0-常规|1-数字藏品] * 商品类型[0-常规|1-数字藏品|2-券类商品]
*/ */
private Integer skuType; private Integer skuType;
......
package com.liquidnet.service.goblin.entity;
import java.math.BigDecimal;
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 2024-01-23
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinGoodsSkuCoupon implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* 单品id
*/
private String skuId;
/**
* 是否实名[0-否|1-是,表示该商品需要实名关联]
*/
private Integer isTrueName;
/**
* 业务类别[1-演出]
*/
private Integer busiType;
/**
* 券类型[1-代金券]
*/
private Integer couType;
/**
* 适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]
*/
private Integer useScope;
/**
* 面值
*/
private BigDecimal valFace;
/**
* 购买后(单位天)有效期,与生效/过期时间二选一
*/
private Integer validity;
/**
* 生效时间
*/
private LocalDateTime effectAt;
/**
* 过期时间
*/
private LocalDateTime expireAt;
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 2024-01-23
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinOrderSkuAssoc implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* 订单sku_id
*/
private String orderSkuId;
/**
* 是否实名[0-否|1-是,表示该商品需要实名关联]
*/
private Integer isTrueName;
/**
* 关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证
*/
private Integer idType;
/**
* 关联人姓名
*/
private String idName;
/**
* 关联人证件号码
*/
private String idNo;
/**
* 操作人
*/
private String operator;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
private String comment;
}
package com.liquidnet.service.goblin.mapper;
import com.liquidnet.service.goblin.entity.GoblinGoodsSkuCoupon;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 商品券信息 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2024-01-23
*/
public interface GoblinGoodsSkuCouponMapper extends BaseMapper<GoblinGoodsSkuCoupon> {
}
package com.liquidnet.service.goblin.mapper;
import com.liquidnet.service.goblin.entity.GoblinOrderSkuAssoc;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 商品券关联人信息 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2024-01-23
*/
public interface GoblinOrderSkuAssocMapper extends BaseMapper<GoblinOrderSkuAssoc> {
}
<?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.GoblinGoodsSkuCouponMapper">
</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.GoblinOrderSkuAssocMapper">
</mapper>
...@@ -181,6 +181,24 @@ create table candy_coupon_relate ...@@ -181,6 +181,24 @@ create table candy_coupon_relate
comment text comment text
) engine InnoDB comment '券适用关联配置'; ) engine InnoDB comment '券适用关联配置';
create index idx_ccr_coupon_id on candy_coupon_relate (coupon_id); 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);
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
\ No newline at end of file
...@@ -99,14 +99,24 @@ public class CandyCouponController { ...@@ -99,14 +99,24 @@ public class CandyCouponController {
@ApiImplicitParam(type = "form", dataType = "String", name = "timeId", value = "场次id", required = true), @ApiImplicitParam(type = "form", dataType = "String", name = "timeId", value = "场次id", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "ticketId", value = "票id", required = true), @ApiImplicitParam(type = "form", dataType = "String", name = "ticketId", value = "票id", required = true),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "type", value = "类型 1可用 2过期/已使用 ", required = true), @ApiImplicitParam(type = "form", dataType = "Integer", name = "type", value = "类型 1可用 2过期/已使用 ", required = true),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "perType", value = "演出类型", required = false),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "isTrueName", value = "是否实名", required = false),
}) })
public ResponseDto<CandyMyCouponListVo> preUsePerformanceCoupon(@RequestParam("priceTotal") @NotNull BigDecimal priceTotal, public ResponseDto<CandyMyCouponListVo> preUsePerformanceCoupon(@RequestParam("priceTotal") @NotNull BigDecimal priceTotal,
@RequestParam("performanceId") @NotNull @NotBlank String performanceId, @RequestParam("performanceId") @NotNull @NotBlank String performanceId,
@RequestParam("timeId") @NotNull @NotBlank String timeId, @RequestParam("timeId") @NotNull @NotBlank String timeId,
@RequestParam("ticketId") @NotNull @NotBlank String ticketId, @RequestParam("ticketId") @NotNull @NotBlank String ticketId,
@RequestParam("type") @NotNull Integer type, @RequestParam("type") @NotNull Integer type,
@RequestParam(required = false, name = "page") Integer page) { @RequestParam(required = false, name = "page") Integer page,
CandyMyCouponListVo vo = candyCouponService.preUsePerformanceCoupon(priceTotal, performanceId, timeId, ticketId, type); @RequestParam(required = false, name = "perType") Integer perType,
@RequestParam(required = false, name = "isTrueName") Integer isTrueName) {
if (perType == null) {
perType = -1;
}
if (isTrueName == null) {
isTrueName = 1;
}
CandyMyCouponListVo vo = candyCouponService.preUsePerformanceCoupon(priceTotal, performanceId, timeId, ticketId, type,perType,isTrueName);
List<CandyCouponVo> list = vo.getMyCoupon(); List<CandyCouponVo> list = vo.getMyCoupon();
List<CandyCouponVo> listVo = ObjectUtil.getCandyCouponVoArrayList(); List<CandyCouponVo> listVo = ObjectUtil.getCandyCouponVoArrayList();
if (page == null || page == 0) { if (page == null || page == 0) {
...@@ -133,13 +143,23 @@ public class CandyCouponController { ...@@ -133,13 +143,23 @@ public class CandyCouponController {
@ApiImplicitParam(type = "form", dataType = "String", name = "performanceId", value = "演出id", required = true), @ApiImplicitParam(type = "form", dataType = "String", name = "performanceId", value = "演出id", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "timeId", value = "场次id", required = true), @ApiImplicitParam(type = "form", dataType = "String", name = "timeId", value = "场次id", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "ticketId", value = "票id", required = true), @ApiImplicitParam(type = "form", dataType = "String", name = "ticketId", value = "票id", required = true),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "perType", value = "演出类型", required = false),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "isTrueName", value = "是否实名", required = false),
}) })
public ResponseDto<HashMap<String, Integer>> preCanUsePerformanceCoupon(@RequestParam("priceTotal") @NotNull BigDecimal priceTotal, public ResponseDto<HashMap<String, Integer>> preCanUsePerformanceCoupon(@RequestParam("priceTotal") @NotNull BigDecimal priceTotal,
@RequestParam("performanceId") @NotNull @NotBlank String performanceId, @RequestParam("performanceId") @NotNull @NotBlank String performanceId,
@RequestParam("timeId") @NotNull @NotBlank String timeId, @RequestParam("timeId") @NotNull @NotBlank String timeId,
@RequestParam("ticketId") @NotNull @NotBlank String ticketId) { @RequestParam("ticketId") @NotNull @NotBlank String ticketId,
@RequestParam(required = false, name = "perType") Integer perType,
@RequestParam(required = false, name = "isTrueName") Integer isTrueName) {
if (perType == null) {
perType = -1;
}
if (isTrueName == null) {
isTrueName = 1;
}
HashMap<String, Integer> hashMap = CollectionUtil.mapStringInteger(); HashMap<String, Integer> hashMap = CollectionUtil.mapStringInteger();
hashMap.put("canUse", candyCouponService.preCanUsePerformanceCoupon(priceTotal, performanceId, timeId, ticketId)); hashMap.put("canUse", candyCouponService.preCanUsePerformanceCoupon(priceTotal, performanceId, timeId, ticketId,perType,isTrueName));
return ResponseDto.success(hashMap); return ResponseDto.success(hashMap);
} }
...@@ -255,6 +275,7 @@ public class CandyCouponController { ...@@ -255,6 +275,7 @@ public class CandyCouponController {
@ApiImplicitParam(type = "form", dataType = "String", name = "timeId", value = "场次id", required = true), @ApiImplicitParam(type = "form", dataType = "String", name = "timeId", value = "场次id", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "ticketId", value = "票id", required = true), @ApiImplicitParam(type = "form", dataType = "String", name = "ticketId", value = "票id", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "uid", value = "uid", required = false), @ApiImplicitParam(type = "form", dataType = "String", name = "uid", value = "uid", required = false),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "perType", value = "演出类型", required = false),
}) })
public ResponseDto<CandyUseResultVo> useCoupon(@RequestParam("uCouponId") @NotNull @NotBlank String uCouponId, public ResponseDto<CandyUseResultVo> useCoupon(@RequestParam("uCouponId") @NotNull @NotBlank String uCouponId,
@RequestParam("content") @NotNull @NotBlank String content, @RequestParam("content") @NotNull @NotBlank String content,
...@@ -263,12 +284,16 @@ public class CandyCouponController { ...@@ -263,12 +284,16 @@ public class CandyCouponController {
@RequestParam("performanceId") @NotNull @NotBlank String performanceId, @RequestParam("performanceId") @NotNull @NotBlank String performanceId,
@RequestParam("timeId") @NotNull @NotBlank String timeId, @RequestParam("timeId") @NotNull @NotBlank String timeId,
@RequestParam("ticketId") @NotNull @NotBlank String ticketId, @RequestParam("ticketId") @NotNull @NotBlank String ticketId,
@RequestParam(value = "uid", required = false) String uid @RequestParam(value = "uid", required = false) String uid,
@RequestParam(required = false, name = "perType") Integer perType
) { ) {
if (uid == null) { if (uid == null) {
uid = CurrentUtil.getCurrentUid(); uid = CurrentUtil.getCurrentUid();
} }
CandyUseResultVo result = candyCouponService.useCoupon(uCouponId, content, totalPrice, performanceId, timeId, ticketId, goodId, uid); if (perType == null) {
perType = -1;
}
CandyUseResultVo result = candyCouponService.useCoupon(uCouponId, content, totalPrice, performanceId, timeId, ticketId, goodId, uid,perType);
if (result == null) { if (result == null) {
return ResponseDto.failure(); return ResponseDto.failure();
} }
......
...@@ -67,7 +67,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService { ...@@ -67,7 +67,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
continue; continue;
} }
if (type == 1) { if (type == 1) {
if (baseVo.getState().equals(3) || dtoItem.getState().equals(5)) { if (baseVo.getState().equals(3) || baseVo.getState().equals(5)|| dtoItem.getState().equals(2)) {
continue; continue;
} }
} else if (type == 2) { } else if (type == 2) {
...@@ -139,7 +139,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService { ...@@ -139,7 +139,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
} }
@Override @Override
public CandyMyCouponListVo preUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId, Integer type) { public CandyMyCouponListVo preUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId, Integer type,int perType,int isTrueName) {
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
LocalDateTime userCreateTime; LocalDateTime userCreateTime;
try { try {
...@@ -153,9 +153,9 @@ public class CandyCouponServiceImpl implements ICandyCouponService { ...@@ -153,9 +153,9 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
List<CandyCouponVo> myCoupon = ObjectUtil.getCandyCouponVoArrayList(); List<CandyCouponVo> myCoupon = ObjectUtil.getCandyCouponVoArrayList();
for (CandyUserCouponBasicDto dtoItem : dtoList) { for (CandyUserCouponBasicDto dtoItem : dtoList) {
CandyCouponVo baseVo = CouponBaseUtil.getPerformanceCouponUserVo(dtoItem, priceTotal, performanceId, timeId, ticketId); CandyCouponVo baseVo = CouponBaseUtil.getPerformanceCouponUserVo(dtoItem, priceTotal, performanceId, timeId, ticketId,perType,isTrueName);
if (type == 1) { if (type == 1) {
if (baseVo.getState().equals(3) || dtoItem.getState().equals(5) || baseVo.getState().equals(21)) { if (baseVo.getState().equals(3) || baseVo.getState().equals(5) || baseVo.getState().equals(21)|| baseVo.getState().equals(31)|| baseVo.getState().equals(2)) {
continue; continue;
} }
} else if (type == 2) { } else if (type == 2) {
...@@ -182,7 +182,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService { ...@@ -182,7 +182,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
} }
@Override @Override
public Integer preCanUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId) { public Integer preCanUsePerformanceCoupon(BigDecimal priceTotal, String performanceId, String timeId, String ticketId,int perType,int isTrueName) {
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
LocalDateTime userCreateTime; LocalDateTime userCreateTime;
try { try {
...@@ -193,7 +193,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService { ...@@ -193,7 +193,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
List<CandyUserCouponBasicDto> dtoList = redisDataUtils.getCouponByUid(uid, userCreateTime); List<CandyUserCouponBasicDto> dtoList = redisDataUtils.getCouponByUid(uid, userCreateTime);
int canUse = 0; int canUse = 0;
for (CandyUserCouponBasicDto dtoItem : dtoList) { for (CandyUserCouponBasicDto dtoItem : dtoList) {
CandyCouponVo baseVo = CouponBaseUtil.getPerformanceCouponUserVo(dtoItem, priceTotal, performanceId, timeId, ticketId); CandyCouponVo baseVo = CouponBaseUtil.getPerformanceCouponUserVo(dtoItem, priceTotal, performanceId, timeId, ticketId,perType,isTrueName);
if (baseVo.getCouType().equals(101) || baseVo.getCouType().equals(3) || baseVo.getBusiType() == 2) { if (baseVo.getCouType().equals(101) || baseVo.getCouType().equals(3) || baseVo.getBusiType() == 2) {
continue; continue;
} }
...@@ -287,7 +287,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService { ...@@ -287,7 +287,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
List<CandyCouponVo> advanceCoupon = ObjectUtil.getCandyCouponVoArrayList(); List<CandyCouponVo> advanceCoupon = ObjectUtil.getCandyCouponVoArrayList();
for (CandyUserCouponBasicDto dtoItem : dtoList) { for (CandyUserCouponBasicDto dtoItem : dtoList) {
if (dtoItem.getBusiType().equals(3)) { if (dtoItem.getBusiType().equals(3)) {
CandyCouponVo baseVo = CouponBaseUtil.getPerformanceCouponUserVo(dtoItem, BigDecimal.ZERO, performanceId, "-1", "-1"); CandyCouponVo baseVo = CouponBaseUtil.getPerformanceCouponUserVo(dtoItem, BigDecimal.ZERO, performanceId, "-1", "-1",-1,0);
if (baseVo.getState().equals(1)) { if (baseVo.getState().equals(1)) {
advanceCoupon.add(baseVo); advanceCoupon.add(baseVo);
} else { } else {
...@@ -317,7 +317,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService { ...@@ -317,7 +317,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
} }
@Override @Override
public CandyUseResultVo useCoupon(String uCouponId, String content, String totalPrice, String performanceId, String timesId, String ticketId, String goodId, String uid) { public CandyUseResultVo useCoupon(String uCouponId, String content, String totalPrice, String performanceId, String timesId, String ticketId, String goodId, String uid,int perType) {
LocalDateTime userCreateTime; LocalDateTime userCreateTime;
try { try {
userCreateTime = getCreatedAt(uid); userCreateTime = getCreatedAt(uid);
...@@ -380,9 +380,15 @@ public class CandyCouponServiceImpl implements ICandyCouponService { ...@@ -380,9 +380,15 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
case 92://票 case 92://票
isTarget = CouponBaseUtil.isTargetCoupon(ruleItem.getBusiId(), dto.getCouType(), ticketId, new BigDecimal(totalPrice), dto.getValOver()); isTarget = CouponBaseUtil.isTargetCoupon(ruleItem.getBusiId(), dto.getCouType(), ticketId, new BigDecimal(totalPrice), dto.getValOver());
break; break;
case 100:// case 100://全场
isTarget = true; isTarget = true;
break; break;
//TODO 胡佳晨 20240123
case 101:
case 102:
case 103:
isTarget = ruleItem.getUseScope()==perType;
break;
default: default:
isTarget = false; isTarget = false;
break; break;
......
...@@ -74,7 +74,8 @@ public class CouponBaseUtil { ...@@ -74,7 +74,8 @@ public class CouponBaseUtil {
BigDecimal priceTotal, BigDecimal priceTotal,
String performanceId, String performanceId,
String timeId, String timeId,
String ticketId) { String ticketId,
int perType,int isTrueName) {
boolean isTarget = false; boolean isTarget = false;
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
CandyCouponVo vo = CandyCouponVo.getNew(); CandyCouponVo vo = CandyCouponVo.getNew();
...@@ -126,6 +127,12 @@ public class CouponBaseUtil { ...@@ -126,6 +127,12 @@ public class CouponBaseUtil {
isTarget = true; isTarget = true;
} }
break; break;
//TODO 胡佳晨 20240123
case 101:
case 102:
case 103:
isTarget = ruleItem.getUseScope() == perType && isTrueName ==1;
break;
default: default:
isTarget = false; isTarget = false;
break; break;
......
...@@ -1240,6 +1240,50 @@ create table goblin_store_erp_config ...@@ -1240,6 +1240,50 @@ create table goblin_store_erp_config
) engine = InnoDB comment '店铺ERP配置'; ) engine = InnoDB comment '店铺ERP配置';
create unique index idx_gsec_store_id on goblin_store_erp_config (store_id); create unique index idx_gsec_store_id on goblin_store_erp_config (store_id);
# -- >>------------------------------------------------------------------------------------ |20240123 商品券业务
alter table goblin_goods modify spu_type tinyint default 0 not null comment '商品类型[0-常规|1-数字藏品|2-券类商品]';
drop table if exists goblin_goods_sku_coupon;
create table goblin_goods_sku_coupon
(
mid bigint auto_increment primary key,
sku_id varchar(64) not null comment '单品id',
busi_type smallint null comment '业务类别[1-演出]',
cou_type smallint null comment '券类型[1-代金券]',
use_scope smallint null comment '适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]',
val_face decimal(8, 2) 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 '过期时间',
comment varchar(255)
) engine = InnoDB comment '商品券信息';
create unique index uidx_ggsc_sku_id on goblin_goods_sku_coupon (sku_id);
drop table if exists goblin_order_sku_assoc;
create table goblin_order_sku_assoc
(
mid bigint unsigned auto_increment primary key,
order_sku_id varchar(64) default '' null comment '订单sku_id',
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,
updated_at datetime(3),
comment varchar(255)
) engine InnoDB comment '商品券关联人信息';
create index idx_gosa_order_sku_id on goblin_order_sku_assoc (order_sku_id);
# -- >>------------------------------------------------------------------------------------ # -- >>------------------------------------------------------------------------------------
# -- >>------------------------------------------------------------------------------------ # -- >>------------------------------------------------------------------------------------
# -- >>------------------------------------------------------------------------------------ # -- >>------------------------------------------------------------------------------------
......
...@@ -563,7 +563,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -563,7 +563,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
Criteria.where("storeId").in(listStore), Criteria.where("storeId").in(listStore),
Criteria.where("extagVoList.tagName").is(name) Criteria.where("extagVoList.tagName").is(name)
), ),
new Criteria().orOperator(Criteria.where("spuType").exists(false), (Criteria.where("spuType").is(0))) new Criteria().orOperator(Criteria.where("spuType").exists(false), (Criteria.where("spuType").in(0, 2)))
)); ));
long count = mongoTemplate.count(query, GoblinGoodsInfoVo.class.getSimpleName()); long count = mongoTemplate.count(query, GoblinGoodsInfoVo.class.getSimpleName());
query.with(PageRequest.of(page, pageSize)).with(Sort.by( query.with(PageRequest.of(page, pageSize)).with(Sort.by(
......
...@@ -9,6 +9,8 @@ import com.liquidnet.service.base.ErrorMapping; ...@@ -9,6 +9,8 @@ import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping; import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst; import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.candy.constant.CandyRedisConst;
import com.liquidnet.service.candy.dto.CandyUserCouponBasicDto;
import com.liquidnet.service.goblin.constant.GoblinStatusConst; import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.*; import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.entity.GoblinBackOrder; import com.liquidnet.service.goblin.entity.GoblinBackOrder;
...@@ -28,6 +30,8 @@ import java.time.LocalDateTime; ...@@ -28,6 +30,8 @@ import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.IntStream;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS; import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
import static com.liquidnet.commons.lang.util.DateUtil.DTFYMDHMS; import static com.liquidnet.commons.lang.util.DateUtil.DTFYMDHMS;
...@@ -116,6 +120,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -116,6 +120,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
List<GoblinOrderSkuVo> skuVos = ObjectUtil.getGoblinOrderSkuVoArrayList(); List<GoblinOrderSkuVo> skuVos = ObjectUtil.getGoblinOrderSkuVoArrayList();
for (String orderSkuId : orderVo.getOrderSkuVoIds()) { for (String orderSkuId : orderVo.getOrderSkuVoIds()) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuId); GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuId);
orderSkuVo.desensitize();// 商品订单页面展示-关联人信息脱敏
skuVos.add(orderSkuVo); skuVos.add(orderSkuVo);
} }
LocalDateTime canRefundTime = getCanRefundTime(orderVo); LocalDateTime canRefundTime = getCanRefundTime(orderVo);
...@@ -207,11 +212,13 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -207,11 +212,13 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
sqls.add(SqlMapping.get("goblin_order.store.orderStatus")); sqls.add(SqlMapping.get("goblin_order.store.orderStatus"));
sqls.add(SqlMapping.get("goblin_order.store.orderSkuStatus")); sqls.add(SqlMapping.get("goblin_order.store.orderSkuStatus"));
sqls.add(SqlMapping.get("goblin_order.store.refundLog")); sqls.add(SqlMapping.get("goblin_order.store.refundLog"));
sqls.add(SqlMapping.get("candy_user_coupon.update_apply_refund"));
LinkedList<Object[]> applyRefund = CollectionUtil.linkedListObjectArr(); LinkedList<Object[]> applyRefund = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> orderStatus = CollectionUtil.linkedListObjectArr(); LinkedList<Object[]> orderStatus = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> orderSkuStatus = CollectionUtil.linkedListObjectArr(); LinkedList<Object[]> orderSkuStatus = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> refundLog = CollectionUtil.linkedListObjectArr(); LinkedList<Object[]> refundLog = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> updateCandyUserCouponObjs = CollectionUtil.linkedListObjectArr();
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
...@@ -331,6 +338,25 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -331,6 +338,25 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
} else if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_4.getValue()) { } else if (orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_4.getValue()) {
if (param.getOrderSkuId() != null) { if (param.getOrderSkuId() != null) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(param.getOrderSkuId()); GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(param.getOrderSkuId());
if (Objects.equals(orderSkuVo.getSkuType(), 2)) {// 券类商品-校验发放的券是否已使用
// 券类商品默认一个商品对应一个券,下单只可购买一张
String ucKey = CandyRedisConst.BASIC_USER_COUPON.concat(orderVo.getUserId());
List<CandyUserCouponBasicDto> vos = (List<CandyUserCouponBasicDto>) redisUtils.get(ucKey);
int idx = IntStream.range(0, vos.size())
.filter(i -> vos.get(i).getUcouponId().equals(orderSkuVo.getOrderSkuId())).findFirst().orElse(-1);
if (-1 != idx) {
CandyUserCouponBasicDto basicDto = vos.get(idx);
if (5 == basicDto.getState()) {// 券状态为'5-已使用',则不可退款
return ResponseDto.failure("券已使用,不可申请");
}
basicDto.setState(2);// 置为'2-无效',防止用户在后台审核过程中使用券,造成券已使用,订单也退款
vos.set(idx, basicDto);
redisUtils.redisUtil.set(ucKey, vos);
updateCandyUserCouponObjs.add(new Object[]{basicDto.getState(), orderVo.getUserId(), now, basicDto.getUcouponId()});
} else {
log.warn("券类商品订单申请退款,未找到对应券[orderSkuId={},uid={}]", orderSkuVo.getOrderSkuId(), orderVo.getUserId());
}
}
//订单款式状态修改 //订单款式状态修改
orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_61.getValue()); orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_61.getValue());
GoblinBackOrderSkuVo backOrderSkuVo = GoblinBackOrderSkuVo.getNew(); GoblinBackOrderSkuVo backOrderSkuVo = GoblinBackOrderSkuVo.getNew();
...@@ -343,6 +369,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -343,6 +369,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
backOrderSkuVo.setRefundPrice(orderSkuVo.getSkuPriceActual()); backOrderSkuVo.setRefundPrice(orderSkuVo.getSkuPriceActual());
backOrderSkuVo.setSkuSpecs(orderSkuVo.getSkuSpecs()); backOrderSkuVo.setSkuSpecs(orderSkuVo.getSkuSpecs());
backOrderSkuVo.setCreatedAt(nowStr); backOrderSkuVo.setCreatedAt(nowStr);
backOrderSkuVo.setSkuType(orderSkuVo.getSkuType());
orderSkuVoList.add(backOrderSkuVo); orderSkuVoList.add(backOrderSkuVo);
backOrderLog(orderVo, orderSkuVo, now); backOrderLog(orderVo, orderSkuVo, now);
//redis //redis
...@@ -357,6 +384,24 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -357,6 +384,24 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
for (String orderSkuId : orderVo.getOrderSkuVoIds()) { for (String orderSkuId : orderVo.getOrderSkuVoIds()) {
//订单款式状态修改 //订单款式状态修改
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuId); GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuId);
if (Objects.equals(orderSkuVo.getSkuType(), 2)) {// 券类商品-校验发放的券是否已使用
// 券类商品默认一个商品对应一个券,下单只可购买一张
String ucKey = CandyRedisConst.BASIC_USER_COUPON.concat(orderVo.getUserId());
List<CandyUserCouponBasicDto> vos = (List<CandyUserCouponBasicDto>) redisUtils.get(ucKey);
int idx = IntStream.range(0, vos.size()).filter(i -> vos.get(i).getUcouponId().equals(orderSkuVo.getOrderSkuId())).findFirst().orElse(-1);
if (-1 != idx) {
CandyUserCouponBasicDto basicDto = vos.get(idx);
if (5 == basicDto.getState()) {// 券状态为'5-已使用',则不可退款
return ResponseDto.failure("券已使用,不可申请");
}
basicDto.setState(2);// 置为'2-无效',防止用户在后台审核过程中使用券,造成券已使用,订单也退款
vos.set(idx, basicDto);
redisUtils.redisUtil.set(ucKey, vos);
updateCandyUserCouponObjs.add(new Object[]{basicDto.getState(), orderVo.getUserId(), now, basicDto.getUcouponId()});
} else {
log.warn("券类商品订单申请退款,未找到对应券[orderSkuId={},uid={}]", orderSkuVo.getOrderSkuId(), orderVo.getUserId());
}
}
orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_61.getValue()); orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_61.getValue());
GoblinBackOrderSkuVo backOrderSkuVo = GoblinBackOrderSkuVo.getNew(); GoblinBackOrderSkuVo backOrderSkuVo = GoblinBackOrderSkuVo.getNew();
backOrderSkuVo.setOrderSkuId(orderSkuId); backOrderSkuVo.setOrderSkuId(orderSkuId);
...@@ -368,6 +413,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -368,6 +413,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
backOrderSkuVo.setSkuPic(orderSkuVo.getSkuImage()); backOrderSkuVo.setSkuPic(orderSkuVo.getSkuImage());
backOrderSkuVo.setRefundPrice(orderSkuVo.getSkuPriceActual()); backOrderSkuVo.setRefundPrice(orderSkuVo.getSkuPriceActual());
backOrderSkuVo.setCreatedAt(nowStr); backOrderSkuVo.setCreatedAt(nowStr);
backOrderSkuVo.setSkuType(orderSkuVo.getSkuType());
orderSkuVoList.add(backOrderSkuVo); orderSkuVoList.add(backOrderSkuVo);
backOrderLog(orderVo, orderSkuVo, now); backOrderLog(orderVo, orderSkuVo, now);
//redis //redis
...@@ -409,7 +455,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -409,7 +455,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
backOrderLog.getBackOrderLogId(), backOrderLog.getBackOrderId(), backOrderLog.getOperationType(), backOrderLog.getBackOrderLogId(), backOrderLog.getBackOrderId(), backOrderLog.getOperationType(),
backOrderLog.getMessage(), backOrderLog.getOperationName(), backOrderLog.getStatus(), now backOrderLog.getMessage(), backOrderLog.getOperationName(), backOrderLog.getStatus(), now
}); });
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_USER_ORDER_OPERA.getKey(), SqlMapping.gets(sqls, applyRefund, orderStatus, orderSkuStatus, refundLog)); queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_USER_ORDER_OPERA.getKey(), SqlMapping.gets(sqls, applyRefund, orderStatus, orderSkuStatus, refundLog, updateCandyUserCouponObjs));
return ResponseDto.success(); return ResponseDto.success();
} }
......
...@@ -5,6 +5,8 @@ import com.liquidnet.commons.lang.util.*; ...@@ -5,6 +5,8 @@ import com.liquidnet.commons.lang.util.*;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping; import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst; import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.candy.constant.CandyRedisConst;
import com.liquidnet.service.candy.dto.CandyUserCouponBasicDto;
import com.liquidnet.service.dragon.constant.DragonConstant; import com.liquidnet.service.dragon.constant.DragonConstant;
import com.liquidnet.service.goblin.constant.GoblinStatusConst; import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.*; import com.liquidnet.service.goblin.dto.vo.*;
...@@ -25,6 +27,7 @@ import java.math.BigDecimal; ...@@ -25,6 +27,7 @@ import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.stream.IntStream;
@Service @Service
@Slf4j @Slf4j
...@@ -102,6 +105,7 @@ public class GoblinStoreBackOrderServiceImpl implements IGoblinStoreBackOrderSer ...@@ -102,6 +105,7 @@ public class GoblinStoreBackOrderServiceImpl implements IGoblinStoreBackOrderSer
for (String orderSkuVoId : orderVo.getOrderSkuVoIds()) { for (String orderSkuVoId : orderVo.getOrderSkuVoIds()) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuVoId); GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuVoId);
orderSkuVo.setStatus(vo.getStatus()); orderSkuVo.setStatus(vo.getStatus());
orderSkuVo.desensitize();// 商品订单页面展示-关联人信息脱敏
orderSkuVoList.add(orderSkuVo); orderSkuVoList.add(orderSkuVo);
} }
vo.setOrderSkuVoList(orderSkuVoList); vo.setOrderSkuVoList(orderSkuVoList);
...@@ -219,6 +223,32 @@ public class GoblinStoreBackOrderServiceImpl implements IGoblinStoreBackOrderSer ...@@ -219,6 +223,32 @@ public class GoblinStoreBackOrderServiceImpl implements IGoblinStoreBackOrderSer
return ResponseDto.failure("无法查看"); return ResponseDto.failure("无法查看");
} }
GoblinBackOrderVo backOrderVo = redisUtils.getBackOrderVo(backOrderId); GoblinBackOrderVo backOrderVo = redisUtils.getBackOrderVo(backOrderId);
{// 券类商品-拒绝退款后,恢复已发放券状态
List<GoblinBackOrderSkuVo> backOrderSkuVos = backOrderVo.getBackOrderSkuVos();
for (GoblinBackOrderSkuVo backOrderSkuVo : backOrderSkuVos) {
if (2 == backOrderSkuVo.getSkuType()) {
// 券类商品默认一个商品对应一个券,下单只可购买一张
String ucKey = CandyRedisConst.BASIC_USER_COUPON.concat(backOrderVo.getUserId());
List<CandyUserCouponBasicDto> vos = (List<CandyUserCouponBasicDto>) redisUtils.get(ucKey);
int idx = IntStream.range(0, vos.size())
.filter(i -> vos.get(i).getUcouponId().equals(backOrderSkuVo.getOrderSkuId())).findFirst().orElse(-1);
if (-1 != idx) {
CandyUserCouponBasicDto basicDto = vos.get(idx);
basicDto.setState(1);// 恢复状态
vos.set(idx, basicDto);
redisUtils.redisUtil.set(ucKey, vos);
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_STORE_ORDER_OPERA.getKey(),
SqlMapping.get("candy_user_coupon.update_apply_refund",
basicDto.getState(), uid, now, basicDto.getUcouponId()
)
);
} else {
log.warn("券类商品订单拒绝退款,未找到对应券[orderSkuId={},operator={}]", backOrderSkuVo.getOrderSkuId(), uid);
}
}
}
}
backOrderVo.setStatus(GoblinStatusConst.Status.ORDER_BACK_STATUS_3.getValue()); backOrderVo.setStatus(GoblinStatusConst.Status.ORDER_BACK_STATUS_3.getValue());
backOrderVo.setRefuseAt(nowStr); backOrderVo.setRefuseAt(nowStr);
backOrderVo.setRefuseSize(backOrderVo.getRefuseSize() == null ? 1 : backOrderVo.getRefuseSize() + 1); backOrderVo.setRefuseSize(backOrderVo.getRefuseSize() == null ? 1 : backOrderVo.getRefuseSize() + 1);
......
...@@ -203,6 +203,13 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -203,6 +203,13 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
itemSkuVo.setStatus(orderSkuVo.getStatus()); itemSkuVo.setStatus(orderSkuVo.getStatus());
itemSkuVo.setPrice(orderSkuVo.getSkuPrice()); itemSkuVo.setPrice(orderSkuVo.getSkuPrice());
itemSkuVo.setPriceVoucher(orderSkuVo.getPriceVoucher()); itemSkuVo.setPriceVoucher(orderSkuVo.getPriceVoucher());
orderSkuVo.desensitize();// 商品订单页面展示-关联人信息脱敏
itemSkuVo.setSkuType(orderSkuVo.getSkuType());
itemSkuVo.setIsTrueName(orderSkuVo.getIsTrueName());
itemSkuVo.setIdType(orderSkuVo.getIdType());
itemSkuVo.setIdName(orderSkuVo.getIdName());
itemSkuVo.setIdNo(orderSkuVo.getIdNo());
orderListSkuVos.add(itemSkuVo); orderListSkuVos.add(itemSkuVo);
} }
vo.setStoreOrderListSkuVoList(orderListSkuVos); vo.setStoreOrderListSkuVoList(orderListSkuVos);
......
...@@ -593,7 +593,8 @@ public class GoblinMongoUtils { ...@@ -593,7 +593,8 @@ public class GoblinMongoUtils {
if (0 == filterParam.getSpuType()) { if (0 == filterParam.getSpuType()) {
criteria.orOperator(Criteria.where("spuType").exists(false), (Criteria.where("spuType").is(0))); criteria.orOperator(Criteria.where("spuType").exists(false), (Criteria.where("spuType").is(0)));
} else { } else {
criteria.and("spuType").is(1); // criteria.and("spuType").is(1);
criteria.and("spuType").is(filterParam.getSpuType());
} }
} }
if (StringUtils.isNotBlank(filterParam.getKeyword())) { if (StringUtils.isNotBlank(filterParam.getKeyword())) {
...@@ -895,8 +896,12 @@ public class GoblinMongoUtils { ...@@ -895,8 +896,12 @@ public class GoblinMongoUtils {
filterParam.setKeyword(null); filterParam.setKeyword(null);
} else if (0 == filterParam.getSkuType()) { } else if (0 == filterParam.getSkuType()) {
criteria.orOperator(Criteria.where("skuType").exists(false), (Criteria.where("skuType").is(0))); criteria.orOperator(Criteria.where("skuType").exists(false), (Criteria.where("skuType").is(0)));
} else if (1 == filterParam.getSkuType()) { }
criteria.and("skuType").is(1); // else if (1 == filterParam.getSkuType()) {
// criteria.and("skuType").is(1);
// }
else {
criteria.and("skuType").is(filterParam.getSkuType());
} }
} }
if (StringUtils.isNotBlank(filterParam.getKeyword())) { if (StringUtils.isNotBlank(filterParam.getKeyword())) {
......
...@@ -2268,7 +2268,7 @@ public class GoblinRedisUtils { ...@@ -2268,7 +2268,7 @@ public class GoblinRedisUtils {
} }
/** /**
* private int skuType 商品类型[0-常规|1-数字藏品] * private int skuType 商品类型[0-常规|1-数字藏品|2-券类商品]
* private String status 审核状态[0-初始编辑|1-审核中|2-审核不通过|3-审核通过]; * private String status 审核状态[0-初始编辑|1-审核中|2-审核不通过|3-审核通过];
* private String shelvesStatus 单品上架状态[0-待上架|1-下架|2-违规|3-上架]; * private String shelvesStatus 单品上架状态[0-待上架|1-下架|2-违规|3-上架];
* private String skuAppear 是否隐藏[0-默认展示|1-隐藏]; * private String skuAppear 是否隐藏[0-默认展示|1-隐藏];
......
...@@ -97,6 +97,8 @@ ...@@ -97,6 +97,8 @@
149022=\u5F00\u542FERP\u6258\u7BA1\u540E\uFF0C\u8BE5\u5546\u54C1\u5C5E\u6027`ERP\u5546\u54C1\u7F16\u7801`\u5FC5\u586B 149022=\u5F00\u542FERP\u6258\u7BA1\u540E\uFF0C\u8BE5\u5546\u54C1\u5C5E\u6027`ERP\u5546\u54C1\u7F16\u7801`\u5FC5\u586B
149023=\u5F00\u542FERP\u6258\u7BA1\u540E\uFF0C\u5BF9\u5E94\u89C4\u683C\u5C5E\u6027`ERP\u89C4\u683C\u7F16\u7801`\u5FC5\u586B 149023=\u5F00\u542FERP\u6258\u7BA1\u540E\uFF0C\u5BF9\u5E94\u89C4\u683C\u5C5E\u6027`ERP\u89C4\u683C\u7F16\u7801`\u5FC5\u586B
149024=\u5F00\u542FERP\u6258\u7BA1\u540E\uFF0C\u5BF9\u5E94\u89C4\u683C\u5C5E\u6027`ERP\u4ED3\u5E93\u7F16\u53F7`\u5FC5\u586B 149024=\u5F00\u542FERP\u6258\u7BA1\u540E\uFF0C\u5BF9\u5E94\u89C4\u683C\u5C5E\u6027`ERP\u4ED3\u5E93\u7F16\u53F7`\u5FC5\u586B
149025=\u9002\u7528\u5F00\u59CB/\u7ED3\u675F\u65F6\u95F4\u4E3A\u7A7A\uFF0C\u8BF7\u6838\u5B9E
149026=\u9002\u7528\u5F00\u59CB/\u7ED3\u675F\u65F6\u95F4\u65E0\u6548\uFF0C\u8BF7\u6838\u5B9E
148001=\u6B63\u5728\u4E0B\u5355\u5E93\u5B58\u4E0D\u8DB3 148001=\u6B63\u5728\u4E0B\u5355\u5E93\u5B58\u4E0D\u8DB3
......
...@@ -57,6 +57,7 @@ goblin_goods_sku.insert=INSERT INTO goblin_goods_sku (sku_id,spu_id,sku_no,sku_b ...@@ -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.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=? 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_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=? 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=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' #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'
...@@ -64,8 +65,10 @@ goblin_goods_sku.update_by_edit_for_digital=UPDATE goblin_goods_sku SET hit_rati ...@@ -64,8 +65,10 @@ goblin_goods_sku.update_by_edit_for_digital=UPDATE goblin_goods_sku SET hit_rati
#goblin_goods_sku.update_by_edit_box_digital=UPDATE goblin_goods_sku SET name=?,subtitle=?,sku_pic=?,sku_watch=?,watch_type=?,sku_watch_pic=?,price=?,price_member=?,intro=?,details=?,shelves_handle=?,shelves_time=?,sale_start_time=?,opening_time=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0' #goblin_goods_sku.update_by_edit_box_digital=UPDATE goblin_goods_sku SET name=?,subtitle=?,sku_pic=?,sku_watch=?,watch_type=?,sku_watch_pic=?,price=?,price_member=?,intro=?,details=?,shelves_handle=?,shelves_time=?,sale_start_time=?,opening_time=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
goblin_goods_sku.update_by_edit_box_digital=UPDATE goblin_goods_sku SET name=?,subtitle=?,sku_pic=?,sku_watch=?,watch_type=?,sku_watch_pic=?,price=?,price_member=?,intro=?,details=?,shelves_handle=?,shelves_time=?,sale_start_time=?,opening_time=?,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_box_digital=UPDATE goblin_goods_sku SET name=?,subtitle=?,sku_pic=?,sku_watch=?,watch_type=?,sku_watch_pic=?,price=?,price_member=?,intro=?,details=?,shelves_handle=?,shelves_time=?,sale_start_time=?,opening_time=?,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_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_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_edit_coupon_spu=UPDATE goblin_goods_sku SET sku_no=?,virtual_flg=?,logistics_template=?,sku_pic=?,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_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_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=?,buy_limit=?,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_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_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' 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 +78,13 @@ goblin_goods_sku_extra.del_ar=UPDATE goblin_goods_sku_extra SET del_flg='1',upda ...@@ -75,6 +78,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,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.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_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=?
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.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_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') goblin_goods_tag.insert_byreplace=REPLACE INTO goblin_goods_tag (spu_id,tag_id,sort,tag_belong,del_flg)VALUES(?,?,?,?,'0')
...@@ -180,5 +190,6 @@ goblin_nft_order.update_artwork=UPDATE goblin_nft_order SET artwork_id=? WHERE o ...@@ -180,5 +190,6 @@ goblin_nft_order.update_artwork=UPDATE goblin_nft_order SET artwork_id=? WHERE o
#---- #----
goblin_sku.stock=UPDATE goblin_goods_sku SET sku_stock = ? , stock = ?, updated_at = ? WHERE sku_erp_code = ? and erp_warehouse_no = ? goblin_sku.stock=UPDATE goblin_goods_sku SET sku_stock = ? , stock = ?, updated_at = ? WHERE sku_erp_code = ? and erp_warehouse_no = ?
#---- #----
candy_user_coupon.update_apply_refund=UPDATE candy_user_coupon SET state=?,operator=?,updated_at=? WHERE ucoupon_id=?
#---- #----
#---- #----
\ No newline at end of file
...@@ -6,6 +6,7 @@ import com.liquidnet.commons.lang.util.*; ...@@ -6,6 +6,7 @@ import com.liquidnet.commons.lang.util.*;
import com.liquidnet.service.adam.dto.vo.AdamEntersVo; import com.liquidnet.service.adam.dto.vo.AdamEntersVo;
import com.liquidnet.service.base.*; import com.liquidnet.service.base.*;
import com.liquidnet.service.base.constant.MQConst; import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.candy.dto.CandyUserCouponAssocDto;
import com.liquidnet.service.dragon.constant.DragonConstant; import com.liquidnet.service.dragon.constant.DragonConstant;
import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto; import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto; import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
...@@ -261,7 +262,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -261,7 +262,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
} else { } else {
if (DateUtil.compareStrDay(DateUtil.getNowTime(), memberTimeStart) == 1 && DateUtil.compareStrDay(DateUtil.getNowTime(), timeStart) == -1) { if (DateUtil.compareStrDay(DateUtil.getNowTime(), memberTimeStart) == 1 && DateUtil.compareStrDay(DateUtil.getNowTime(), timeStart) == -1) {
advanceMap = orderUtils.useCoupon(payOrderParam.getAdvanceCode(), "购买 " + performanceData.getTitle(), BigDecimal.ZERO, payOrderParam.getPerformanceId(), payOrderParam.getTimeId(), payOrderParam.getTicketId()); advanceMap = orderUtils.useCoupon(payOrderParam.getAdvanceCode(), "购买 " + performanceData.getTitle(), BigDecimal.ZERO, payOrderParam.getPerformanceId(), payOrderParam.getTimeId(), payOrderParam.getTicketId(),performanceData.getType());
if (advanceMap == null) { if (advanceMap == null) {
return ResponseDto.failure("优先券不可用"); return ResponseDto.failure("优先券不可用");
} }
...@@ -322,6 +323,22 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -322,6 +323,22 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
return ResponseDto.failure(ErrorMapping.get("20015"));//入场人数量错误 return ResponseDto.failure(ErrorMapping.get("20015"));//入场人数量错误
} }
//判断新商品券
if(payOrderParam.getVoucherCode()!=null) {
CandyUserCouponAssocDto couponAssocDto = dataUtils.getGoblinPlatformCoupon(payOrderParam.getVoucherCode());
if (couponAssocDto != null) {
boolean goblinPlatformCouponseCanUse = false;
for (AdamEntersVo adamEnters : entersVoList) {
if (couponAssocDto.getIdNo().equals(adamEnters.getIdCard())) {
goblinPlatformCouponseCanUse = true;
}
}
if (!goblinPlatformCouponseCanUse) {
return ResponseDto.failure("实名券与入场人信息不一致");
}
}
}
// 判断库存 // 判断库存
int surplusGeneral = orderUtils.changeSurplus(isPay, payOrderParam.getTicketId(), -payOrderParam.getNumber()); int surplusGeneral = orderUtils.changeSurplus(isPay, payOrderParam.getTicketId(), -payOrderParam.getNumber());
...@@ -476,7 +493,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -476,7 +493,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
} }
if (payOrderParam.getVoucherCode() != null) { if (payOrderParam.getVoucherCode() != null) {
HashMap<String, Object> hashMap = orderUtils.useCoupon(payOrderParam.getVoucherCode(), content, orderTickets.getPriceTotal().subtract(priceExpress), payOrderParam.getPerformanceId(), payOrderParam.getTimeId(), payOrderParam.getTicketId()); HashMap<String, Object> hashMap = orderUtils.useCoupon(payOrderParam.getVoucherCode(), content, orderTickets.getPriceTotal().subtract(priceExpress), payOrderParam.getPerformanceId(), payOrderParam.getTimeId(), payOrderParam.getTicketId(),performanceData.getType());
if (null != hashMap) { if (null != hashMap) {
BigDecimal priceVoucher = (BigDecimal) hashMap.get("voucher"); BigDecimal priceVoucher = (BigDecimal) hashMap.get("voucher");
Integer typeVoucher = (Integer) hashMap.get("type"); Integer typeVoucher = (Integer) hashMap.get("type");
......
...@@ -158,7 +158,7 @@ public class MixOrderServiceImpl implements IMixOrderService { ...@@ -158,7 +158,7 @@ public class MixOrderServiceImpl implements IMixOrderService {
canBuyIds.add(skuId + "," + itemVo.getCount()); canBuyIds.add(skuId + "," + itemVo.getCount());
} }
} }
if (skuInfoVo.getSkuType() == 0) { if (skuInfoVo.getSkuType() == 0 || skuInfoVo.getSkuType() == 2) {
skuInfoList.add(skuInfoVo); skuInfoList.add(skuInfoVo);
skuMix.put(skuInfoVo.getSkuId() + "price", itemVo.getPrice()); skuMix.put(skuInfoVo.getSkuId() + "price", itemVo.getPrice());
skuMix.put(skuInfoVo.getSkuId() + "count", itemVo.getCount()); skuMix.put(skuInfoVo.getSkuId() + "count", itemVo.getCount());
......
package com.liquidnet.service.order.utils; package com.liquidnet.service.order.utils;
import com.fasterxml.jackson.databind.JsonNode;
import com.liquidnet.common.cache.redis.util.RedisUtil; import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.IdentityUtils;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.adam.constant.AdamRedisConst; import com.liquidnet.service.adam.constant.AdamRedisConst;
import com.liquidnet.service.adam.dto.vo.AdamUserInfoVo; import com.liquidnet.service.adam.dto.vo.AdamUserInfoVo;
import com.liquidnet.service.adam.dto.vo.AdamUserMemberVo; import com.liquidnet.service.adam.dto.vo.AdamUserMemberVo;
import com.liquidnet.service.base.ErrorMapping;
import lombok.extern.slf4j.Slf4j; 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 org.springframework.util.StringUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -34,4 +40,87 @@ public class AdamRedisUtils { ...@@ -34,4 +40,87 @@ public class AdamRedisUtils {
log.debug("#RDM耗时:{}ms", System.currentTimeMillis() - s); log.debug("#RDM耗时:{}ms", System.currentTimeMillis() - s);
return vo; return vo;
} }
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 认证失败的<ID_TYPE+ID_NO, ID_NAME> */
private boolean setCertificationJunk(int idType, String idNo, String idName) {
return redisUtil.set(AdamRedisConst.INFO_CERTIFICATION_JUNK + idType + idNo, idName, 604800);
}
private boolean isCertificationJunk(int idType, String idNo, String idName) {
String o = (String) redisUtil.get(AdamRedisConst.INFO_CERTIFICATION_JUNK + idType + idNo);
return !StringUtils.isEmpty(o) && o.equals(idName);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 认证成功的<ID_TYPE+ID_NO, ID_NAME> */
/**
* 目前只针对身份证类型三方服务认证成功的标记
*
* @param idType
* @param idNo
* @param idName
* @return
*/
private boolean setCertification(int idType, String idNo, String idName) {
return redisUtil.set(AdamRedisConst.INFO_CERTIFICATION + idType + idNo, idName);
}
/**
* 目前只针对身份证类型三方服务认证成功的标记
*
* @param idType
* @param idNo
* @param idName
* @return
*/
private int isCertification(int idType, String idNo, String idName) {
String o = (String) redisUtil.get(AdamRedisConst.INFO_CERTIFICATION + idType + idNo);
if (StringUtils.isEmpty(o)) {
return -1;
}
return o.equals(idName) ? 1 : 0;
// return !StringUtils.isEmpty(o) && o.equals(idName);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 认证处理 */
/**
* 身份证实名处理
*
* @param uid
* @param name
* @param idCard
*/
public void identityHandler1(String uid, String name, String idCard) {
int rst = this.isCertification(1, idCard, name);
switch (rst) {
case -1:// 本地不存在
if (this.isCertificationJunk(1, idCard, name)) {
throw new LiquidnetServiceException("-1", "身份证号与姓名不符");
}
String respStr = IdentityUtils.aliThird(name, idCard), respErrorCode = null;
JsonNode respJNode = JsonUtils.fromJson(respStr, JsonNode.class);
if (null == respJNode || !"0".equals(respErrorCode = String.valueOf(respJNode.get("error_code")))) {
log.info("###实名认证失败[{}]", respStr);
// this.setCertificationJunk(1, idCard, name);
if (!StringUtils.isEmpty(respErrorCode) && org.apache.commons.lang3.StringUtils.indexOf("3000290033", respErrorCode) < 0) {
// 认证服务商'30002'、'90033'为运营商导致的失败,这里不做缓存标记
this.setCertificationJunk(1, idCard, name);
}
throw new LiquidnetServiceException("-1", "身份证号与姓名不符");
}
this.setCertification(1, idCard, name);
break;
case 0:// 本地存在,验证不通过
throw new LiquidnetServiceException("-1", "身份证号与姓名不符");
case 1:// 本地存在,验证通过
break;
}
}
} }
...@@ -5,6 +5,8 @@ import com.liquidnet.commons.lang.util.CollectionUtil; ...@@ -5,6 +5,8 @@ import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IPUtil; import com.liquidnet.commons.lang.util.IPUtil;
import com.liquidnet.service.adam.dto.vo.AdamEntersVo; import com.liquidnet.service.adam.dto.vo.AdamEntersVo;
import com.liquidnet.service.candy.constant.CandyRedisConst;
import com.liquidnet.service.candy.dto.CandyUserCouponAssocDto;
import com.liquidnet.service.goblin.constant.SmileRedisConst; import com.liquidnet.service.goblin.constant.SmileRedisConst;
import com.liquidnet.service.kylin.constant.KylinRedisConst; import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dao.KylinFreightChargeDao; import com.liquidnet.service.kylin.dao.KylinFreightChargeDao;
...@@ -126,8 +128,8 @@ public class DataUtils { ...@@ -126,8 +128,8 @@ public class DataUtils {
public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) { public void changeBuyInfo(String userId, String idCard, String performanceId, String ticketId, int buyCount) {
String redisKeyUid; String redisKeyUid;
String redisKeyIdCard; String redisKeyIdCard;
String performanceIdKeyIdCard=""; String performanceIdKeyIdCard = "";
String ticketIdKeyIdCard=""; String ticketIdKeyIdCard = "";
int isTrueName = getPerformanceIsTrueName(performanceId); int isTrueName = getPerformanceIsTrueName(performanceId);
...@@ -380,7 +382,7 @@ public class DataUtils { ...@@ -380,7 +382,7 @@ public class DataUtils {
/** /**
* 获取演出ids * 获取演出ids
*/ */
public List<String> getShowIds(){ public List<String> getShowIds() {
String rdk = SmileRedisConst.SMILE_SHOW; String rdk = SmileRedisConst.SMILE_SHOW;
Object obj = redisUtil.get(rdk); Object obj = redisUtil.get(rdk);
if (obj == null) { if (obj == null) {
...@@ -389,4 +391,19 @@ public class DataUtils { ...@@ -389,4 +391,19 @@ public class DataUtils {
return (List<String>) obj; return (List<String>) obj;
} }
} }
/**
* 根据券id查询适用人证件信息
* @param ucouponId
* @return
*/
public CandyUserCouponAssocDto getGoblinPlatformCoupon(String ucouponId) {
String rdk = CandyRedisConst.BASIC_USER_COUPON_ASSOC.concat(ucouponId);
Object obj = redisUtil.get(rdk);
if (obj == null) {
return null;
} else {
return (CandyUserCouponAssocDto) obj;
}
}
} }
...@@ -429,7 +429,7 @@ public class GoblinNftOrderUtils { ...@@ -429,7 +429,7 @@ public class GoblinNftOrderUtils {
} }
/** /**
* private int skuType 商品类型[0-常规|1-数字藏品] * private int skuType 商品类型[0-常规|1-数字藏品|2-券类商品]
* private String status 审核状态[0-初始编辑|1-审核中|2-审核不通过|3-审核通过]; * private String status 审核状态[0-初始编辑|1-审核中|2-审核不通过|3-审核通过];
* private String shelvesStatus 单品上架状态[0-待上架|1-下架|2-违规|3-上架]; * private String shelvesStatus 单品上架状态[0-待上架|1-下架|2-违规|3-上架];
* private String skuAppear 是否隐藏[0-默认展示|1-隐藏]; 隐藏款 拼参数可购买 盲盒可抽 * private String skuAppear 是否隐藏[0-默认展示|1-隐藏]; 隐藏款 拼参数可购买 盲盒可抽
......
package com.liquidnet.service.order.utils; package com.liquidnet.service.order.utils;
import com.liquidnet.service.adam.dto.vo.AdamEntersVo; 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.dto.vo.*;
import com.liquidnet.service.goblin.entity.GoblinNftOrder; import com.liquidnet.service.goblin.entity.GoblinNftOrder;
import com.liquidnet.service.goblin.entity.GoblinOrderSku; import com.liquidnet.service.goblin.entity.GoblinOrderSku;
...@@ -59,6 +60,7 @@ public class ObjectUtil { ...@@ -59,6 +60,7 @@ public class ObjectUtil {
private static final HashMap<String, List<GoblinGoodsSkuInfoVo>> goblinGoodsSkuInfoVoMap = new HashMap(); private static final HashMap<String, List<GoblinGoodsSkuInfoVo>> goblinGoodsSkuInfoVoMap = new HashMap();
private static final HashMap<String, String[]> mixIdMap = new HashMap(); private static final HashMap<String, String[]> mixIdMap = new HashMap();
private static final ArrayList<CouponOutLineVo> couponOutLineVo = new ArrayList<>(); private static final ArrayList<CouponOutLineVo> couponOutLineVo = new ArrayList<>();
private static final HashMap<String, GoblinOrderSkuParam> goblinOrderSkuParamMap = new HashMap();
public static Object[] objectsArray; public static Object[] objectsArray;
public static final Integer[] integerArray2 = new Integer[2]; public static final Integer[] integerArray2 = new Integer[2];
...@@ -185,4 +187,8 @@ public class ObjectUtil { ...@@ -185,4 +187,8 @@ public class ObjectUtil {
public static ArrayList<WriteModel<Document>> getWriteModelDocumentArrayList() { public static ArrayList<WriteModel<Document>> getWriteModelDocumentArrayList() {
return (ArrayList<WriteModel<Document>>) writeModelDocumentArrayList.clone(); return (ArrayList<WriteModel<Document>>) writeModelDocumentArrayList.clone();
} }
public static HashMap<String, GoblinOrderSkuParam> cloneGoblinOrderSkuParamMap() {
return (HashMap<String, GoblinOrderSkuParam>) goblinOrderSkuParamMap.clone();
}
} }
...@@ -222,7 +222,7 @@ public class OrderUtils { ...@@ -222,7 +222,7 @@ public class OrderUtils {
* @param totalPrice 订单总价 * @param totalPrice 订单总价
* @return * @return
*/ */
public HashMap<String, Object> useCoupon(String uCouponId, String content, BigDecimal totalPrice, String performanceId, String timesId, String ticketId) { public HashMap<String, Object> useCoupon(String uCouponId, String content, BigDecimal totalPrice, String performanceId, String timesId, String ticketId,int perType) {
HashMap<String, Object> hashMap = CollectionUtil.mapStringObject(); HashMap<String, Object> hashMap = CollectionUtil.mapStringObject();
try { try {
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString(); MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
...@@ -233,6 +233,7 @@ public class OrderUtils { ...@@ -233,6 +233,7 @@ public class OrderUtils {
params.add("performanceId", performanceId); params.add("performanceId", performanceId);
params.add("timeId", timesId); params.add("timeId", timesId);
params.add("ticketId", ticketId); params.add("ticketId", ticketId);
params.add("perType", perType+"");
MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString(); MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString();
header.add("Authorization", "Bearer " + CurrentUtil.getToken()); header.add("Authorization", "Bearer " + CurrentUtil.getToken());
String returnData = HttpUtil.post(candyUrl + "/candy-coupon/use", params, header); String returnData = HttpUtil.post(candyUrl + "/candy-coupon/use", params, header);
......
...@@ -33,11 +33,13 @@ kylin_order_refund_entities.overtimeRefund=INSERT INTO kylin_order_refund_entiti ...@@ -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.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.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.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 #---- \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) 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 #---- \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.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) 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.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.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) 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; ...@@ -11,12 +11,11 @@ import com.liquidnet.service.adam.constant.AdamRedisConst;
import com.liquidnet.service.adam.dto.vo.AdamUserMemberVo; import com.liquidnet.service.adam.dto.vo.AdamUserMemberVo;
import com.liquidnet.service.adam.entity.AdamUserMember; import com.liquidnet.service.adam.entity.AdamUserMember;
import com.liquidnet.service.candy.constant.CandyRedisConst; import com.liquidnet.service.candy.constant.CandyRedisConst;
import com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto; import com.liquidnet.service.candy.dto.*;
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.entity.*; import com.liquidnet.service.candy.entity.*;
import com.liquidnet.service.candy.mapper.CandyCouponMapper; 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 com.liquidnet.service.platform.service.impl.adam.PlatformAdamUserMemberService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
...@@ -27,9 +26,9 @@ import org.springframework.util.CollectionUtils; ...@@ -27,9 +26,9 @@ import org.springframework.util.CollectionUtils;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.time.temporal.ChronoUnit;
import java.util.Base64; import java.util.*;
import java.util.List; import java.util.stream.Collectors;
@Slf4j @Slf4j
@Service @Service
...@@ -41,6 +40,8 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C ...@@ -41,6 +40,8 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
@Autowired @Autowired
private PlatformCandyUserCouponService platformCandyUserCouponService; private PlatformCandyUserCouponService platformCandyUserCouponService;
@Autowired @Autowired
private PlatformCandyUserCouponAssocService platformCandyUserCouponAssocService;
@Autowired
private PlatformCandyCommonCouponService platformCandyCommonCouponService; private PlatformCandyCommonCouponService platformCandyCommonCouponService;
@Autowired @Autowired
private PlatformAdamUserMemberService platformAdamUserMemberService; private PlatformAdamUserMemberService platformAdamUserMemberService;
...@@ -300,7 +301,6 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C ...@@ -300,7 +301,6 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
* @param couponRuleDtoList List<CandyCouponRuleDto> * @param couponRuleDtoList List<CandyCouponRuleDto>
*/ */
private void processForUserCoupon(CandyMgtCoupon mgtCoupon, CandyCoupon coupon, List<CandyCouponRuleDto> couponRuleDtoList) { private void processForUserCoupon(CandyMgtCoupon mgtCoupon, CandyCoupon coupon, List<CandyCouponRuleDto> couponRuleDtoList) {
List<CandyUserCoupon> initUserCouponList = new ArrayList<>();
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
String eventLimit = mgtCoupon.getEventLimit(); String eventLimit = mgtCoupon.getEventLimit();
...@@ -309,6 +309,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C ...@@ -309,6 +309,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
log.info("发放券处理中:{}-目标指定手机号[总数:{},发放量:{}]", mgtCoupon.getMcouponId(), limitSize, eventAmt); log.info("发放券处理中:{}-目标指定手机号[总数:{},发放量:{}]", mgtCoupon.getMcouponId(), limitSize, eventAmt);
AbstractRedisUtil redisAdamUtil = redisDataSourceUtil.getRedisAdamUtil(); AbstractRedisUtil redisAdamUtil = redisDataSourceUtil.getRedisAdamUtil();
AbstractRedisUtil redisGoblinUtil = redisDataSourceUtil.getRedisGoblinUtil();
if (coupon.getBindType() == 2) {// 券领取方式[2-积分商品],实际发放至用户时计算有效期 if (coupon.getBindType() == 2) {// 券领取方式[2-积分商品],实际发放至用户时计算有效期
coupon.setEffectAt(now); coupon.setEffectAt(now);
...@@ -324,6 +325,9 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C ...@@ -324,6 +325,9 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
// 指定手机号发放券中,会员权益券失效时间duedAt需要同步会员到期时间expiryAt // 指定手机号发放券中,会员权益券失效时间duedAt需要同步会员到期时间expiryAt
Integer exclusively = mgtCoupon.getExclusively(); Integer exclusively = mgtCoupon.getExclusively();
boolean isMemberRightsCoupon = exclusively == 1; boolean isMemberRightsCoupon = exclusively == 1;
List<CandyUserCoupon> initUserCouponList = new ArrayList<>();
List<CandyUserCouponAssoc> initUserCouponAssocList = new ArrayList<>();
for (int i = 0; i < eventAmt; i++) { for (int i = 0; i < eventAmt; i++) {
for (String r : eventLimitArr) { for (String r : eventLimitArr) {
String uid = (String) redisAdamUtil.get(AdamRedisConst.IDENTITY_MOBILE.concat(r)); String uid = (String) redisAdamUtil.get(AdamRedisConst.IDENTITY_MOBILE.concat(r));
...@@ -353,6 +357,24 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C ...@@ -353,6 +357,24 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
log.warn("发放券处理中:{}-目标指定手机号,该券生效日期或失效日期无效[couponId:{},effectAt:{},expireAt:{}]", mcouponId, couponId, couponEffectAt, couponExpireAt); log.warn("发放券处理中:{}-目标指定手机号,该券生效日期或失效日期无效[couponId:{},effectAt:{},expireAt:{}]", mcouponId, couponId, couponEffectAt, couponExpireAt);
continue; 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();
userCoupon.setUcouponId(mcouponId);// 券类商品默认一个商品对应一个券,下单只可购买一张
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.setOperator(operator);
userCoupon.setCreatedAt(now); userCoupon.setCreatedAt(now);
...@@ -366,6 +388,15 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C ...@@ -366,6 +388,15 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
AbstractRedisUtil redisCandyUtil = redisDataSourceUtil.getRedisCandyUtil(); AbstractRedisUtil redisCandyUtil = redisDataSourceUtil.getRedisCandyUtil();
if (!initUserCouponList.isEmpty()) { if (!initUserCouponList.isEmpty()) {
if (platformCandyUserCouponService.saveBatch(initUserCouponList)) { if (platformCandyUserCouponService.saveBatch(initUserCouponList)) {
if (!initUserCouponAssocList.isEmpty()) {// 券类商品默认一个商品对应一个券,下单只可购买一张
boolean assocSaveFlg = platformCandyUserCouponAssocService.saveBatch(initUserCouponAssocList);
initUserCouponAssocList.forEach(c -> {
CandyUserCouponAssocDto assocDto = CandyUserCouponAssocDto.getNew().copy(c);
long l = ChronoUnit.SECONDS.between(now, couponExpireAt);
boolean assocRdsSetFlg = redisCandyUtil.set(CandyRedisConst.BASIC_USER_COUPON_ASSOC.concat(c.getUcouponId()), assocDto, l);
log.info("发放券-券类商品-记录关联人信息:[mcouponId={}, ucouponId={},assocSaveFlg={},assocRdsSetFlg={}]", mcouponId, c.getUcouponId(), assocSaveFlg, assocRdsSetFlg);
});
}
initUserCouponList.forEach(r -> { initUserCouponList.forEach(r -> {
String uckey = CandyRedisConst.BASIC_USER_COUPON.concat(r.getUid()); 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