zhangherong
2025-05-12 7e254edced5f0361882471ebffbad572c181235d
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
package org.jeecg.modules.system.entity;
 
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.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
 
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
 
/**
 * @Description: 分类字典
 * @Author: jeecg-boot
 * @Date: 2019-05-29
 * @Version: V1.0
 */
@Data
@TableName("sys_category")
public class SysCategory implements Serializable {
    private static final long serialVersionUID = 1L;
 
    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    private String id;
    /**
     * 父级节点
     */
    private String pid;
    /**
     * 类型编码
     */
    @Excel(name = "分类编码", width = 15, orderNum = "1")
    private String code;
    /**
     * 类型名称
     */
    @Excel(name = "分类名称", width = 15, orderNum = "2")
    private String name;
    /**
     * 创建人
     */
    private String createBy;
    /**
     * 创建日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date createTime;
    /**
     * 更新人
     */
    private String updateBy;
    /**
     * 更新日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date updateTime;
    /**
     * 所属部门
     */
    private String sysOrgCode;
    /**
     * 是否有子节点
     */
    private String hasChild;
    /**
     * 根节点编码
     */
    @Excel(name = "根节点编码", width = 15, orderNum = "4")
    private String rootCode;
    /**
     * 所有父节点ID
     */
    private String parentIds;
 
    @TableField(exist = false)
    @Excel(name = "父节点编码", width = 15, orderNum = "3")
    private String parentCode;
 
    @TableField(exist = false)
    private List<SysCategory> children;
 
    @Override
    public String toString() {
        return "SysCategory [code=" + code + ", name=" + name + "]";
    }
 
    public void addChild(SysCategory node) {
        if (children == null) {
            children = new ArrayList<>();
        }
        children.add(node);
    }
}