lyh
2025-03-19 ed839069a1df066d9559263129e999de7e9c2ccc
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
package org.jeecg.modules.dnc.entity;
 
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
 
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
 
@Getter
@Data
@NoArgsConstructor
@TableName(value = "nc_product_mix")
public class ProductMix implements Serializable {
    private static final long serialVersionUID = 1529244980533421687L;
    // id
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    // 父级 id
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "parent_id")
    private Long parentId;
    // 名称
    @TableField(value = "name")
    private String name;
    // code
    @TableField(value = "tree_code")
    private String code;
    // 类型
    @TableField(value = "tree_type")
    private Integer type;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @TableField(value = "create_time")
    private Date createTime;
 
    //展示名称
    private transient String label;
 
 
    private transient List<ProductMix> children = new ArrayList<>();
 
    public ProductMix(Long id, Long parentId, String name, String code, Integer type, Date createTime) {
        this.id = id;
        this.parentId = parentId;
        this.name = name;
        this.code = code;
        this.type = type;
        this.children = new ArrayList<>();
        this.label="["+code+"]"+name;
        this.createTime = createTime;
    }
 
    public void addChild(ProductMix child) {
        this.children.add(child);
    }
 
 
    public ProductMix(Date createTime) {
        this.createTime = createTime;
    }
 
    public Date getCreateTime() {
        return createTime;
    }
 
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
 
    @Override
    public String toString() {
        return "ProductMix{createTime=" + createTime + '}';
    }
 
}