自动化立体仓库 - WCS系统
#
Junjie
2025-01-06 0ac76f7d8101903e1d050116f7d3835ce1303dfa
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
package com.zy.core.model.protocol;
 
import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasLiftErr;
import com.zy.asrs.service.BasLiftErrService;
import com.zy.core.enums.ForkLiftIoModeType;
import com.zy.core.enums.ForkLiftProtocolStatusType;
import com.zy.core.enums.ForkLiftTaskModeType;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
 
/**
 * 货叉提升机
 */
@Slf4j
@Data
public class ForkLiftProtocol implements Cloneable {
 
    /**
     * 提升机号
     */
    private Integer liftNo;
 
    /**
     * 模式0单机 1联机
     */
    private Integer model;
 
    /**
     * 任务号
     */
    private Integer taskNo = 0;
 
    /**
     * 任务状态
     */
    private Integer protocolStatus = ForkLiftProtocolStatusType.NONE.id;
 
    /**
     * 任务状态枚举
     */
    private ForkLiftProtocolStatusType protocolStatusType = ForkLiftProtocolStatusType.NONE;
 
    /**
     * 任务模式
     */
    private Integer mode = ForkLiftTaskModeType.NONE.id;
 
    /**
     * 任务模式枚举
     */
    private ForkLiftTaskModeType modeType = ForkLiftTaskModeType.NONE;
 
    /**
     * 取货数据
     */
    private Integer pick;
 
    /**
     * 放货数据
     */
    private Integer put;
 
    /**
     * 出入库模式
     */
    private Integer iOMode = ForkLiftIoModeType.NONE.id;
 
    /**
     * 出入库模式枚举
     */
    private ForkLiftIoModeType iOModeType = ForkLiftIoModeType.NONE;
 
    /**
     * 故障码
     */
    private Integer errorCode;
 
    /**
     * 作业标记
     */
    private Boolean pakMk = false;
 
    /**
     * 指令下发时间
     */
    private Long sendTime = 0L;
 
    /**
     * 日志采集时间
     */
    private Long deviceDataLog = System.currentTimeMillis();
 
    /**
     * 扩展字段
     */
    private Object extend;
 
    /**
     * 设置任务状态
     */
    public void setProtocolStatus(Integer status) {
        this.protocolStatus = status;
        this.protocolStatusType = ForkLiftProtocolStatusType.get(status);
    }
 
    /**
     * 设置任务状态
     */
    public void setProtocolStatus(ForkLiftProtocolStatusType status) {
        this.protocolStatus = status.id;
        this.protocolStatusType = status;
    }
 
    /**
     * 设置任务模式
     */
    public void setMode(Integer mode) {
        this.mode = mode;
        this.modeType = ForkLiftTaskModeType.get(mode);
    }
 
    /**
     * 设置任务模式
     */
    public void setMode(ForkLiftTaskModeType mode) {
        this.mode = mode.id;
        this.modeType = mode;
    }
 
    /**
     * 设置出入库模式
     */
    public void setIOMode(Integer ioMode) {
        this.iOMode = ioMode;
        this.iOModeType = ForkLiftIoModeType.get(ioMode);
    }
 
    /**
     * 设置出入库模式
     */
    public void setIOMode(ForkLiftIoModeType ioMode) {
        this.iOMode = ioMode.id;
        this.iOModeType = ioMode;
    }
 
    /**
     * 错误码
     */
    public String getErrCode$() {
        if (this.errorCode == null) {
            return "";
        }
        BasLiftErrService basLiftErrService = SpringUtils.getBean(BasLiftErrService.class);
        BasLiftErr basLiftErr = basLiftErrService.selectById(this.errorCode);
        if (basLiftErr == null) {
            return String.valueOf(this.errorCode);
        }
        return basLiftErr.getErrName();
    }
 
    @Override
    public ForkLiftProtocol clone() {
        try {
            return (ForkLiftProtocol) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return null;
    }
 
 
}