huang
2025-11-20 366ba040d2447bacd3455299425e3166f1f992bb
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
package com.mes.device.entity;
 
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
 
import java.util.Date;
 
/**
 * 设备交互执行记录实体类
 * 对应数据库表:device_interaction_execution
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("device_interaction_execution")
@ApiModel(value = "DeviceInteractionExecution", description = "设备交互执行记录")
public class DeviceInteractionExecution {
 
    @ApiModelProperty(value = "执行记录ID", example = "1")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
 
    @ApiModelProperty(value = "关联的交互逻辑ID", example = "1")
    @TableField("logic_id")
    private Long logicId;
 
    @ApiModelProperty(value = "设备组ID", example = "1")
    @TableField("group_id")
    private Long groupId;
 
    @ApiModelProperty(value = "所属项目ID", example = "1")
    @TableField("project_id")
    private Long projectId;
 
    @ApiModelProperty(value = "执行批次号", example = "EXEC_20241030_001")
    @TableField("batch_no")
    private String batchNo;
 
    @ApiModelProperty(value = "执行状态:0-等待,1-执行中,2-成功,3-失败,4-超时,5-取消", example = "0")
    @TableField("status")
    private Integer status;
 
    @ApiModelProperty(value = "执行模式:1-手动,2-自动,3-定时", example = "2")
    @TableField("execution_mode")
    private Integer executionMode;
 
    @ApiModelProperty(value = "开始执行时间")
    @TableField("start_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
 
    @ApiModelProperty(value = "结束执行时间")
    @TableField("end_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
 
    @ApiModelProperty(value = "执行耗时(毫秒)", example = "25000")
    @TableField("execution_duration")
    private Long executionDuration;
 
    @ApiModelProperty(value = "执行进度:0-100", example = "80")
    @TableField("progress")
    private Integer progress;
 
    @ApiModelProperty(value = "当前执行的步骤序号", example = "3")
    @TableField("current_step")
    private Integer currentStep;
 
    @ApiModelProperty(value = "总步骤数", example = "10")
    @TableField("total_steps")
    private Integer totalSteps;
 
    @ApiModelProperty(value = "成功执行的设备数量", example = "3")
    @TableField("success_devices")
    private Integer successDevices;
 
    @ApiModelProperty(value = "失败的设备数量", example = "0")
    @TableField("failed_devices")
    private Integer failedDevices;
 
    @ApiModelProperty(value = "触发执行的操作人", example = "admin")
    @TableField("triggered_by")
    private String triggeredBy;
 
    @ApiModelProperty(value = "执行结果描述", example = "所有设备成功完成自动化测试")
    @TableField("result_message")
    private String resultMessage;
 
    @ApiModelProperty(value = "错误信息JSON", example = "{\"deviceId\": 2, \"error\": \"Connection timeout\"}")
    @TableField("error_details")
    private String errorDetails;
 
    @ApiModelProperty(value = "执行数据统计JSON", example = "{\"totalTime\": 25000, \"avgResponseTime\": 120}")
    @TableField("execution_stats")
    private String executionStats;
 
    @ApiModelProperty(value = "扩展参数JSON", example = "{\"testDataId\": \"TD_001\", \"environment\": \"prod\"}")
    @TableField("extra_params")
    private String extraParams;
 
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;
 
    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;
 
    @ApiModelProperty(value = "创建人", example = "system")
    @TableField(value = "created_by", fill = FieldFill.INSERT)
    private String createdBy;
 
    @ApiModelProperty(value = "更新人", example = "system")
    @TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;
 
    @ApiModelProperty(value = "是否删除:0-否,1-是", example = "0")
    @TableField("is_deleted")
    @TableLogic
    private Integer isDeleted;
 
    // 执行状态枚举
    public static final class Status {
        public static final int WAITING = 0;        // 等待
        public static final int RUNNING = 1;        // 执行中
        public static final int SUCCESS = 2;        // 成功
        public static final int FAILED = 3;         // 失败
        public static final int TIMEOUT = 4;        // 超时
        public static final int CANCELLED = 5;      // 取消
    }
 
    // 执行模式枚举
    public static final class ExecutionMode {
        public static final int MANUAL = 1;         // 手动
        public static final int AUTOMATIC = 2;      // 自动
        public static final int SCHEDULED = 3;      // 定时
    }
}