yangys
2024-09-05 312fd03ae1ee528892129a10630d44de92c73c37
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
package com.qianwen.mdc.collect.dto;
 
import org.apache.commons.lang3.builder.ToStringBuilder;
 
import com.qianwen.mdc.collect.enums.WorkstationParamTypeEnum;
/**
 * 封装好的采集数据,主要包括了工位id,calendarCode,shiftIndex,shiftTimeType
 */
public class PackedTelemetryData {
    private Long workstationId;
    //private Integer paramType;
    private String name;//参数名称如Output,DeviceStatus
    private String value;
    private Long time;
    private String calendarCode;
    private Integer factoryYear;
    private Integer factoryMonth;
    private Integer factoryWeek;
    private Integer factoryDate;
    private Integer shiftIndex;
    private Integer shiftTimeType;
 
 
    public PackedTelemetryData setWorkstationId(Long workstationId) {
        this.workstationId = workstationId;
        return this;
    }
 
    public PackedTelemetryData setValue(String value) {
        this.value = value;
        return this;
    }
 
    
 
    public Long getTime() {
        return time;
    }
 
    public void setTime(Long time) {
        this.time = time;
    }
 
    public PackedTelemetryData setCalendarCode(String calendarCode) {
        this.calendarCode = calendarCode;
        return this;
    }
 
    public PackedTelemetryData setFactoryYear(Integer factoryYear) {
        this.factoryYear = factoryYear;
        return this;
    }
 
    public PackedTelemetryData setFactoryMonth(Integer factoryMonth) {
        this.factoryMonth = factoryMonth;
        return this;
    }
 
    public PackedTelemetryData setFactoryWeek(Integer factoryWeek) {
        this.factoryWeek = factoryWeek;
        return this;
    }
 
    public PackedTelemetryData setFactoryDate(Integer factoryDate) {
        this.factoryDate = factoryDate;
        return this;
    }
 
    public PackedTelemetryData setShiftIndex(Integer shiftIndex) {
        this.shiftIndex = shiftIndex;
        return this;
    }
 
    public PackedTelemetryData setShiftTimeType(Integer shiftTimeType) {
        this.shiftTimeType = shiftTimeType;
        return this;
    }
    public PackedTelemetryData setName(String name) {
        this.name = name;
        return this;
    }
   
 
    public String getName() {
        return name;
    }
 
    protected boolean canEqual(Object other) {
        return other instanceof PackedTelemetryData;
    }
 
 
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
 
    public Long getWorkstationId() {
        return this.workstationId;
    }
 
    public Integer getParamType() {
        int result = WorkstationParamTypeEnum.OTHER.getType();
        
        
        switch(this.name) {
        case "Output":
            result = WorkstationParamTypeEnum.OUTPUT.getType();
            break;
        case "DeviceStatus":
            result = WorkstationParamTypeEnum.STATE.getType();
            break;
        case "Alarm":
            result = WorkstationParamTypeEnum.ALARM.getType();
            break;
        case "AlarmNo":
            result = WorkstationParamTypeEnum.ALARM_NO.getType();
            break;
        case "AlarmMsg":
            result = WorkstationParamTypeEnum.ALARM_MSG.getType();
            break;
        default:
            result = WorkstationParamTypeEnum.OTHER.getType();
            break;
        }
        return result;
    }
 
    public String getValue() {
        return this.value;
    }
 
  
    public String getCalendarCode() {
        return this.calendarCode;
    }
 
    public Integer getFactoryYear() {
        return this.factoryYear;
    }
 
    public Integer getFactoryMonth() {
        return this.factoryMonth;
    }
 
    public Integer getFactoryWeek() {
        return this.factoryWeek;
    }
 
    public Integer getFactoryDate() {
        return this.factoryDate;
    }
 
    public Integer getShiftIndex() {
        return this.shiftIndex;
    }
 
    public Integer getShiftTimeType() {
        return this.shiftTimeType;
    }
}