package org.jeecg.modules.dnc.entity;
|
|
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
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.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;
|
|
//展示名称
|
private transient String label;
|
|
|
private transient List<ProductMix> children = new ArrayList<>();
|
|
public ProductMix(Long id, Long parentId, String name, String code, Integer type) {
|
this.id = id;
|
this.parentId = parentId;
|
this.name = name;
|
this.code = code;
|
this.type = type;
|
this.children = new ArrayList<>();
|
this.label="["+code+"]"+name;
|
}
|
|
public void addChild(ProductMix child) {
|
this.children.add(child);
|
}
|
|
}
|