Houjie
7 天以前 bb839b724afdaf9b4ea8a80c2d8963d2b9c2934c
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
package org.jeecg.modules.system.model;
 
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.modules.system.entity.MdcProduction;
 
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
 
/**
 * 产线表 封装树结构的产线的名称的实体类
 *
 * @author: LiuS
 * @create: 2023-03-23 15:15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class ProductionIdModel implements Serializable {
 
    private static final long serialVersionUID = 6403075134223338239L;
 
    /**
     * 主键ID
     */
    private String key;
 
    /**
     * 主键ID
     */
    private String value;
 
    /**
     * 产线名称
     */
    private String title;
 
    /**
     * 是否可选
     */
    private Boolean selectable = true;
 
    List<ProductionIdModel> children = new ArrayList<>();
 
    /**
     * 将MdcProductionTreeModel的部分数据放在该对象当中
     *
     * @param treeModel
     * @return
     */
    public ProductionIdModel convert(MdcProductionTreeModel treeModel) {
        this.key = treeModel.getId();
        this.value = treeModel.getId();
        this.title = treeModel.getProductionName();
        return this;
    }
 
    /**
     * 该方法为用户产线的实现类所使用
     *
     * @return
     */
    public ProductionIdModel convertByUserProduction(MdcProduction mdcProduction) {
        this.key = mdcProduction.getId();
        this.value = mdcProduction.getId();
        this.title = mdcProduction.getProductionName();
        return this;
    }
}