自动化立体仓库 - WCS系统
#fs
lsh
2024-09-10 4375805e5769179d7684a3af3e9132be68c38321
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
package com.zy.asrs.entity;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableField;
import com.core.common.SpringUtils;
 
import java.text.SimpleDateFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
 
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
 
@Data
@TableName("asr_bas_jar_mast")
public class BasJarMast implements Serializable {
 
    private static final long serialVersionUID = 1L;
 
    /**
     * ID
     */
    @ApiModelProperty(value= "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
 
    /**
     * 工作号
     */
    @ApiModelProperty(value= "工作号")
    @TableField("wrk_no")
    private Long wrkNo;
 
    /**
     * 入库源站点
     */
    @ApiModelProperty(value= "入库源站点")
    @TableField("enter_sta_no")
    private Integer enterStaNo;
 
    /**
     * 入库目标站点
     */
    @ApiModelProperty(value= "入库目标站点")
    @TableField("out_sta_no")
    private Integer outStaNo;
 
    /**
     * 入硫化罐站点
     */
    @ApiModelProperty(value= "入硫化罐站点")
    @TableField("jar_enter_sta_no")
    private Integer jarEnterStaNo;
 
    /**
     * 出硫化罐站点
     */
    @ApiModelProperty(value= "出硫化罐站点")
    @TableField("jar_out_sta_no")
    private Integer jarOutStaNo;
 
    /**
     * 硫化罐ID
     */
    @ApiModelProperty(value= "硫化罐ID")
    @TableField("jar_id")
    private Integer jarId;
 
    /**
     * 区域
     */
    @ApiModelProperty(value= "区域")
    @TableField("jar_regin")
    private Integer jarRegin;
 
    /**
     * 工作状态
     */
    @ApiModelProperty(value= "工作状态")
    private Integer status;
 
    /**
     * 入罐小车
     */
    @ApiModelProperty(value= "入罐小车")
    @TableField("enter_ste_no")
    private Integer enterSteNo;
 
    /**
     * 出罐小车
     */
    @ApiModelProperty(value= "出罐小车")
    @TableField("out_ste_id")
    private Integer outSteId;
 
    /**
     * 入罐RGV
     */
    @ApiModelProperty(value= "入罐RGV")
    @TableField("enter_rgv_id")
    private Integer enterRgvId;
 
    /**
     * 出罐RGV
     */
    @ApiModelProperty(value= "出罐RGV")
    @TableField("out_rgv_id")
    private Integer outRgvId;
 
    /**
     * 入库时间
     */
    @ApiModelProperty(value= "入库时间")
    @TableField("io_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date ioTime;
 
    /**
     * 创建时间
     */
    @ApiModelProperty(value= "创建时间")
    @TableField("modi_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date modiTime;
 
    /**
     * 更新时间
     */
    @ApiModelProperty(value= "更新时间")
    @TableField("appe_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date appeTime;
 
    /**
     * 库位号
     */
    @ApiModelProperty(value= "库位号")
    @TableField("jar_loc_digit")
    private Integer jarLocDigit;
 
    /**
     * 冷却
     */
    @ApiModelProperty(value= "冷却")
    private Integer burial;
 
    public BasJarMast() {}
 
    public BasJarMast(Long wrkNo,Integer enterStaNo,Integer outStaNo,Integer jarEnterStaNo,Integer jarOutStaNo,Integer jarId,Integer jarRegin,Integer status,Integer enterSteNo,Integer outSteId,Integer enterRgvId,Integer outRgvId,Date ioTime,Date modiTime,Date appeTime,Integer jarLocDigit,Integer burial) {
        this.wrkNo = wrkNo;
        this.enterStaNo = enterStaNo;
        this.outStaNo = outStaNo;
        this.jarEnterStaNo = jarEnterStaNo;
        this.jarOutStaNo = jarOutStaNo;
        this.jarId = jarId;
        this.jarRegin = jarRegin;
        this.status = status;
        this.enterSteNo = enterSteNo;
        this.outSteId = outSteId;
        this.enterRgvId = enterRgvId;
        this.outRgvId = outRgvId;
        this.ioTime = ioTime;
        this.modiTime = modiTime;
        this.appeTime = appeTime;
        this.jarLocDigit = jarLocDigit;
        this.burial = burial;
    }
 
    public BasJarMast(BasJar jar,WrkMast wrkMast,Integer jarLocDigit) {
        Date now = new Date();
        this.wrkNo = wrkMast.getWrkNo().longValue();
        this.enterStaNo = wrkMast.getSourceStaNo();
        this.outStaNo = wrkMast.getStaNo();
//        this.jarEnterStaNo = jarEnterStaNo;
        this.jarOutStaNo = jar.getStaNo();
        this.jarId = jar.getJarNo();
        this.jarRegin = jar.getRegion();
        this.status = 0;
        this.enterSteNo = jar.getEnterSteNo();
        this.outSteId = jar.getOutSteNo();
        this.enterRgvId = jar.getEnterRgvNo();;
        this.outRgvId = jar.getOutRgvNo();;
        this.ioTime = wrkMast.getIoTime();
        this.modiTime = now;
        this.appeTime = now;
        this.jarLocDigit = jarLocDigit;
        this.burial = jar.getBurial();
    }
 
    public BasJarMast(BasJar jar) {
        Date now = new Date();
//        this.jarEnterStaNo = jarEnterStaNo;
        this.jarOutStaNo = jar.getStaNo();
        this.jarId = jar.getJarNo();
        this.jarRegin = jar.getRegion();
        this.status = 0;
        this.enterSteNo = jar.getEnterSteNo();
        this.outSteId = jar.getOutSteNo();
        this.enterRgvId = jar.getEnterRgvNo();;
        this.outRgvId = jar.getOutRgvNo();;
        this.ioTime = now;
        this.modiTime = now;
        this.appeTime = now;
        this.jarLocDigit = jarLocDigit;
        this.burial = jar.getBurial();
    }
 
 
//    BasJarMast basJarMast = new BasJarMast(
//            null,    // 工作号[非空]
//            null,    // 入库源站点[非空]
//            null,    // 入库目标站点[非空]
//            null,    // 入硫化罐站点[非空]
//            null,    // 出硫化罐站点[非空]
//            null,    // 硫化罐ID[非空]
//            null,    // 区域[非空]
//            null,    // 工作状态[非空]
//            null,    // 入罐小车[非空]
//            null,    // 出罐小车[非空]
//            null,    // 入罐RGV[非空]
//            null,    // 出罐RGV[非空]
//            null,    // 入库时间
//            null,    // 创建时间
//            null    // 更新时间
//    );
 
//    public String getStatus$(){
//        BasJarMastStatusService service = SpringUtils.getBean(BasJarMastStatusService.class);
//        BasJarMastStatus basJarMastStatus = service.selectById(this.status);
//        if (!Cools.isEmpty(basJarMastStatus)){
//            return String.valueOf(basJarMastStatus.getId());
//        }
//        return null;
 
        /*
               default:
                statusList.add(17);//完成  输送线存在工作号《===》转历史档案
            case 7://出冷却槽任务
            case 6://小车移动至冷却槽任务
            case 5://开出料门任务
                statusList.add(10);//入冷却槽完成
            case 4://出硫化罐任务
                statusList.add(11);//冷却中
 
                if (type!=6){
                    statusList.add(12);//冷却完成
                }
                statusList.add(13);//冷却完成调小车任务
 
            case 3://关进料门任务  //生成初始任务
                statusList.add(4);//入硫化罐完成
 
            case 2://关进料门任务  //生成初始任务
                statusList.add(0);//初始
 
            case 1://开进料门任务
                statusList.add(2);//进料门打开
 
            case 0://入硫化罐任务
                statusList.add(1);//开进料门中
                statusList.add(3);//入硫化罐中
 
                statusList.add(5);//硫化中《===》关门完成
 
                if (type!=5){
                    statusList.add(6);//硫化完成
                }
 
                statusList.add(7);//开出料门中
 
                if (type!=4){
                    statusList.add(8);//出料门打开
                }
 
                statusList.add(9);//出硫化罐中《===》入冷却槽中
 
                statusList.add(15);//出冷却槽中
                statusList.add(16);//出冷却槽完成
                if (type!=7){
                    statusList.add(14);//小车到达冷却槽
                }
        * */
//    }
 
    public String getIoTime$(){
        if (Cools.isEmpty(this.ioTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ioTime);
    }
 
    public String getModiTime$(){
        if (Cools.isEmpty(this.modiTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime);
    }
 
    public String getAppeTime$(){
        if (Cools.isEmpty(this.appeTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime);
    }
 
    public Integer getStatusComplete(){
        return this.status+1;
    }
 
    /**
     * ioType任务类型
     * 0: 未知  1: 开进料门  2: 关进料门  3: 开出料门  4: 关出料门  5: 入硫化罐  6: 入冷却槽
     * 7: 穿梭车进冷却槽  B=>C  8: 穿梭车离开冷却槽 C=>B  9: 出冷却槽 10:A=>B 11:B=>A
     */
    public Integer getStatusComplete(Integer ioType){
        switch (ioType){
            case 1:
                return 2;
            case 3:
                return 8;
            case 2:
                return 5;
            case 5:
                return 4;
            case 6:
                return 10;
            case 9:
                return 17;
        }
        return this.status+1;
    }
 
 
}