zepengdev
2025-06-23 02fb5e406abcda2534ed1f2505c5226027c13473
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
package com.oying.modules.pc.product.domain;
 
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.oying.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
 
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
 
/**
* @author lzp
* @date 2025-04-30
**/
@Getter
@Setter
@TableName("pc_product")
public class Product extends BaseEntity implements Serializable {
 
    @TableId(value = "product_id", type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Long productId;
 
    @NotBlank
    @ApiModelProperty(value = "店铺ID")
    private Long storeId;
 
    @NotBlank
    @ApiModelProperty(value = "条形码")
    private String barcode;
 
    @NotBlank
    @ApiModelProperty(value = "商品名称")
    private String name;
 
    @NotBlank
    @ApiModelProperty(value = "商品标题")
    private String title;
 
    @NotNull
    @ApiModelProperty(value = "一级分类ID")
    private Long categoryId;
 
    @NotNull
    @ApiModelProperty(value = "二级分类ID")
    private Long secondCategoryId;
 
    @NotNull
    @ApiModelProperty(value = "状态")
    private Integer status;
 
    @NotBlank
    @ApiModelProperty(value = "主图片")
    private String mainImageId;
 
    @NotBlank
    @ApiModelProperty(value = "主图地址")
    private String mainImageUrl;
 
    @ApiModelProperty(value = "商品描述")
    private String description;
 
    @NotNull
    @ApiModelProperty(value = "销售价格")
    private BigDecimal price;
 
    @NotNull
    @ApiModelProperty(value = "库存数量")
    private Integer stockQuantity;
 
    @NotNull
    @ApiModelProperty(value = "起售数量")
    private Integer minPurchaseQuantity;
 
    @ApiModelProperty(value = "预警库存")
    private Integer warnStock;
 
    @ApiModelProperty(value = "重量(单位:g)")
    private Integer weight;
 
    @ApiModelProperty(value = "宽度(单位:厘米)")
    private Integer width;
 
    @ApiModelProperty(value = "长度(单位:厘米)")
    private Integer length;
 
    @ApiModelProperty(value = "高度(单位:厘米)")
    private Integer height;
 
    @ApiModelProperty(value = "是否支持退货")
    private Integer returns;
 
    @ApiModelProperty(value = "是否支持自提")
    private Integer selfPickup;
 
    @TableField(exist = false)
    @ApiModelProperty(value = "销量")
    private Integer totalUnitsSold = 0;
 
    @TableField(exist = false)
    @ApiModelProperty(value = "月销售量")
    private Integer monthlyUnitsSold = 0;
 
    @NotNull
    @ApiModelProperty(value = "是否删除")
    private Integer deletedFlag;
 
    @NotNull
    @ApiModelProperty(value = "版本号")
    private Long version;
 
    @TableField(exist = false)
    @ApiModelProperty(value = "图片")
    private List<ProductImage> images;
 
    @TableField(exist = false)
    @ApiModelProperty(value = "标签")
    private List<ProductLabel> labels;
 
    public void copy(Product source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}