廖井涛
2025-11-28 67f0be5a1d634ba3274fa9366ceacc3580f056b7
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
package com.northglass.entity;
 
import java.util.Date;
 
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
 
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.northglass.constants.ShelfTaskType;
 
@Entity
@Table(name="gmms_shelf_task")
public class ShelfTask extends IdEntity{
 
    private Long taskId;
    private String taskType;
    private String taskState;
    private ShelfRack shelfRack;
    private RawFile rawFile;
    private long groups;
    private String loadRack;
    private Date startTime;
    private Date finshTime;
    
  //含有仓位和上片位的有参构造函数
    /*public ShelfTask(String taskState, String taskType, Date startTime, ShelfRack shelfRack,
            String loadRack) {
        super();
        this.taskState = taskState;
        this.taskType = taskType;
        this.startTime = startTime;
        this.shelfRack = shelfRack;
        this.loadRack = loadRack;
    }*/
     
    /*public MachineDispose(
            Machines machine,
            String plcFontType,
            String plcFontValue,
            String mesFontType,
            String mesFontValue,
            String returnValue,
            String exeLogic,
            String describ) {
        this.machine=machine;
        this.plcFontType=plcFontType;
        this.plcFontValue=plcFontValue;
        this.mesFontType=mesFontType;
        this.mesFontValue=mesFontValue;
        this.returnValue=returnValue;
        this.exeLogic=exeLogic;
        this.describ=describ;
    }*/
 
    
    public Long getTaskId() {
        return taskId;
    }
    public void setTaskId(Long taskId) {
        this.taskId = taskId;
    }
    public String getTaskState() {
        return taskState;
    }
    public void setTaskState(String taskState) {
        this.taskState = taskState;
    }
    public String getTaskType() {
        return taskType;
    }
    public void setTaskType(String taskType) {
        this.taskType = taskType;
    }
    
    public Long getGroups() {
        return groups;
    }
 
    public void setGroups(Long groups) {
        this.groups = groups;
    }
    
 
    
    public String getLoadRack() {
        return loadRack;
    }
 
    public void setLoadRack(String loadRack) {
        this.loadRack = loadRack;
    }
    
    public Date getStartTime() {
        return startTime;
    }
 
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    
    public Date getFinshTime() {
        return finshTime;
    }
 
    public void setFinshTime(Date finshTime) {
        this.finshTime = finshTime;
    }
    
    @ManyToOne
    @JoinColumn(name="file_id")
    public RawFile getRawFile() {
        return rawFile;
    }
 
    public void setRawFile(RawFile rawFile) {
        this.rawFile = rawFile;
    }
    
    @ManyToOne
    @JoinColumn(name="shelf_rack_id")
    public ShelfRack getShelfRack() {
        return shelfRack;
    }
 
    public void setShelfRack(ShelfRack shelfRack) {
        this.shelfRack = shelfRack;
    }
    
    @Transient
    @JsonIgnore
    public String getDescription() {
        String number=this.shelfRack==null?"":this.shelfRack.getNumber();//料架
        String LoadRack=this.getLoadRack()==null?"":this.getLoadRack();              //上片工位/吊装工位
        
        if (ShelfTaskType.DISPLAY_INFO.equals(this.taskType)) {
            return "显示信息:从仓位【" + number + "】,到吊装位【" 
                    + LoadRack + "】";
        }
        
        if (ShelfTaskType.FROM_RANK_TO_HOIST.equals(this.taskType)) {
            return "从仓位【" + number + "】到吊装位【" + LoadRack + "】";
        }
        
        if (ShelfTaskType.FROM_RANK_TO_HOIST1.equals(this.taskType)) {
            return "从仓位【" + number + "】到上片位【" + LoadRack + "】";
        }
        
        if (ShelfTaskType.FROM_HOIST_TO_RANK1.equals(this.taskType)) {
            return "从上片位【" + LoadRack + "】到仓位【" + number + "】";
        }
        if (ShelfTaskType.FROM_HOIST_TO_RANK.equals(this.taskType)) {
            return "从吊装位【" + LoadRack + "】到仓位【" + number + "】";
        }
        
        
       /* if (ShelfTaskType.DISPLAY_INFO.equals(this.taskType)) {
            return "显示信息:从仓位【" + this.shelfRack.getNumber() + "】,到吊装位【" 
                    + this.getLoadRack() + "】";//,玻璃信息【" + this.shelfRank.getRawPackage().getDescription() + "】";
        }
        
        if (ShelfTaskType.FROM_RANK_TO_HOIST.equals(this.taskType)) {
            return "从仓位【" + this.shelfRack.getNumber() + "】到吊装位【" + this.getLoadRack() + "】";
        }
        
        if (ShelfTaskType.FROM_RANK_TO_HOIST1.equals(this.taskType)) {
            return "从仓位【" + this.shelfRack.getNumber() + "】到上片位【" + this.getLoadRack() + "】";
        }
        
        if (ShelfTaskType.FROM_HOIST_TO_RANK1.equals(this.taskType)) {
            return "从上片位【" + this.getLoadRack() + "】到仓位【" + this.shelfRack.getNumber() + "】";
        }
        if (ShelfTaskType.FROM_HOIST_TO_RANK.equals(this.taskType)) {
            return "从吊装位【" + this.getLoadRack() + "】到仓位【" + this.shelfRack.getNumber() + "】";
        }*/
        
  
        
        return "无描述信息";
    }
 
}