peng
2025-10-10 ad9751046d07546724ca76447898895b19d63158
framework/src/main/java/cn/lili/modules/search/entity/dos/EsGoodsIndex.java
@@ -5,7 +5,10 @@
import cn.lili.elasticsearch.EsSuffix;
import cn.lili.modules.goods.entity.dos.GoodsSku;
import cn.lili.modules.goods.entity.dto.GoodsParamsDTO;
import cn.lili.modules.order.order.entity.enums.CustomizeFlagEnum;
import cn.lili.modules.promotion.tools.PromotionTools;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -15,6 +18,7 @@
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.ArrayList;
@@ -271,6 +275,18 @@
    @Field(type = FieldType.Nested)
    private List<EsGoodsAttribute> attrList;
    @ApiModelProperty(value = "预售结束时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Field(type = FieldType.Date)
    private Date preSaleEndDate;
    @ApiModelProperty(value = "预售开始时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Field(type = FieldType.Date)
    private Date preSaleBeginDate;
    /**
     * 商品促销活动集合
     * key 为 促销活动类型
@@ -278,10 +294,18 @@
     * @see PromotionTypeEnum
     * value 为 促销活动实体信息
     */
    @Field(type = FieldType.Text)
    @ApiModelProperty("商品促销活动集合JSON,key 为 促销活动类型,value 为 促销活动实体信息 ")
    private String promotionMapJson;
    @ApiModelProperty(value = "商品排序")
    @Field(type = FieldType.Long)
    private Integer goodsSort;
    @ApiModelProperty(value = "定制商品")
    @Field(type = FieldType.Text)
    /**
     * @see CustomizeFlagEnum
     */
    private String customizeFlag;
    public EsGoodsIndex(GoodsSku sku) {
        if (sku != null) {
@@ -311,6 +335,7 @@
            this.recommend = sku.getRecommend();
            this.goodsType = sku.getGoodsType();
            this.releaseTime = new Date().getTime();
            this.customizeFlag = sku.getCustomizeFlag();
        }
    }
@@ -381,6 +406,7 @@
            this.intro = sku.getIntro();
            this.grade = sku.getGrade();
            this.releaseTime = new Date().getTime();
            this.customizeFlag = sku.getCustomizeFlag();
        }
    }