优惠券 信息 填充
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package com.czg.market.entity;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -14,6 +17,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 积分兑换记录 实体类。
|
||||
@@ -21,6 +25,7 @@ import lombok.NoArgsConstructor;
|
||||
* @author ww
|
||||
* @since 2025-12-08
|
||||
*/
|
||||
@Slf4j
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@@ -66,6 +71,10 @@ public class MkPointsGoodsRecord implements Serializable {
|
||||
* 商品类型 优惠劵 其它商品
|
||||
*/
|
||||
private String goodsCategory;
|
||||
/**
|
||||
* 优惠劵信息
|
||||
*/
|
||||
private String couponJson;
|
||||
|
||||
/**
|
||||
* 领取方式 店内自取、系统发放
|
||||
@@ -145,4 +154,23 @@ public class MkPointsGoodsRecord implements Serializable {
|
||||
* 是否删除 0否 1是
|
||||
*/
|
||||
private Integer isDel;
|
||||
|
||||
/**
|
||||
* 优惠券信息
|
||||
*/
|
||||
@Column(ignore = true)
|
||||
private ShopCoupon couponInfo;
|
||||
|
||||
|
||||
public void fillCouponInfo() {
|
||||
if ("优惠券".equals(goodsCategory)) {
|
||||
if (StrUtil.isNotBlank(couponJson)) {
|
||||
try {
|
||||
couponInfo = JSONObject.parseObject(couponJson, ShopCoupon.class);
|
||||
} catch (Exception e) {
|
||||
log.error("解析优惠券信息失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user