huang
2025-11-18 1566e4c7604d85737ea67fe6757e71b8185fa48e
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
package com.mes.device.vo;
 
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
 
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
 
/**
 * 设备配置视图对象
 * 
 * @author mes
 * @since 2024-10-30
 */
public class DeviceConfigVO {
 
    /**
     * 设备配置信息
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class DeviceInfo {
        private Long id;
        private String deviceCode;
        private String deviceName;
        private String deviceType;
        private String deviceModel;
        private String manufacturer;
        private String location;
        private String status;
        private String deviceStatus;
        private String plcIp;
        private Integer plcPort;
        private String plcType;
        private String moduleName;
        private Boolean isPrimary;
        private Boolean enabled;
        private String protocol;
        private String connectionType;
        private String description;
        private Boolean isEnabled;
        private Date lastHeartbeat;
        private Date createdTime;
        private Date updatedTime;
        private String extraParams;
        private Long projectId;
    }
 
    /**
     * 设备树节点
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class DeviceTreeNode {
        private Long id;
        private String label;
        private String type;
        private String icon;
        private String status;
        private Boolean disabled;
        private Boolean isGroup;
        private List<DeviceTreeNode> children;
        private Object data;
    }
 
    /**
     * 设备健康检查结果
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class HealthCheckResult {
        private Boolean isHealthy;
        private String overallStatus;
        private LocalDateTime checkTime;
        private Integer responseTime;
        private Integer connectionTimeout;
        private String lastError;
        private List<HealthCheckItem> checkItems;
        private String summary;
    }
 
    /**
     * 健康检查项目
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class HealthCheckItem {
        private String itemName;
        private String status;
        private String message;
        private Integer responseTime;
        private String details;
    }
 
    /**
     * 设备监控信息
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class DeviceMonitoring {
        private Long deviceId;
        private String deviceName;
        private String status;
        private Boolean isOnline;
        private LocalDateTime lastHeartbeat;
        private Double cpuUsage;
        private Double memoryUsage;
        private Double networkTraffic;
        private Integer activeConnections;
        private List<DeviceMetric> metrics;
    }
 
    /**
     * 设备指标
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class DeviceMetric {
        private String metricName;
        private String metricValue;
        private String metricUnit;
        private LocalDateTime timestamp;
        private String status;
    }
 
    /**
     * 设备配置详情(用于编辑表单)
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class DeviceConfigDetail {
        private Long id;
        private String deviceCode;
        private String deviceName;
        private String deviceType;
        private String deviceModel;
        private String manufacturer;
        private String location;
        private String status;
        private String ipAddress;
        private Integer port;
        private String protocol;
        private String connectionType;
        private String username;
        private String password;
        private String description;
        private Boolean isEnabled;
        private String extraParams;
        private LocalDateTime createdTime;
        private LocalDateTime updatedTime;
    }
 
    /**
     * 设备连接测试结果
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ConnectionTestResult {
        private Boolean isSuccess;
        private String message;
        private Integer responseTime;
        private LocalDateTime testTime;
        private String errorMessage;
        private List<String> testDetails;
    }
 
    /**
     * 设备批量操作结果
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class BatchOperationResult {
        private Integer totalCount;
        private Integer successCount;
        private Integer failureCount;
        private List<String> successIds;
        private List<String> failureIds;
        private List<String> errorMessages;
    }
 
    /**
     * 设备性能统计
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class DevicePerformanceStats {
        private Long deviceId;
        private String deviceName;
        private Double averageCpuUsage;
        private Double averageMemoryUsage;
        private Double averageNetworkTraffic;
        private Integer totalConnections;
        private Integer totalRequests;
        private Integer successRequests;
        private Integer failureRequests;
        private Double successRate;
        private LocalDateTime statsTime;
    }
}