ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
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
package com.vci.server.base.persistence.history;
 
import java.io.Serializable;
import java.text.DateFormat;
import java.util.Date;
 
import com.vci.common.objects.Historizable;
 
public class HistoryEntry implements Serializable {
 
    /**
     * 
     */
    private static final long serialVersionUID = 8226744877750275782L;
    private String id;
    private Date timestamp; //操作时间
    private OperationType operationType; //操作类型
    private String module; //操作模块
    private String entity;//操作对象
    private String entityId; //操作对象ID
    private String description; //操作描述
    private String property; //被操作的属性
    private String previousValue; //操作前的值
    private String newValue; //操作后的值
    private String user; //操作用户名称
    private String ip; //操作用户的及其IP地址
    private String result; //操作的结果
    
    
    public HistoryEntry() {
        
    }
    
    public String getUser() {
        return user;
    }
 
    public void setUser(String user) {
        this.user = user;
    }
 
    public String getIp() {
        return ip;
    }
 
    public void setIp(String ip) {
        this.ip = ip;
    }
 
    public String getResult() {
        return result;
    }
 
    public void setResult(String result) {
        this.result = result;
    }
    
    public String getId() {
        return id;
    }
 
    public void setId(String id) {
        this.id = id;
    }
 
    public String getDescription() {
        return description;
    }
 
    public void setDescription(String description) {
        this.description = description;
    }
 
    public String getEntity() {
        return entity;
    }
 
    public void setEntity(String entity) {
        this.entity = entity;
    }
 
    public String getEntityId() {
        return entityId;
    }
 
    public void setEntityId(String entityId) {
        this.entityId = entityId;
    }
 
    public String getNewValue() {
        return newValue;
    }
 
    public void setNewValue(String newValue) {
        this.newValue = newValue;
    }
 
    public OperationType getOperationType() {
        return operationType;
    }
 
    public void setOperationType(OperationType operationType) {
        this.operationType = operationType;
    }
 
    public String getPreviousValue() {
        return previousValue;
    }
 
    public void setPreviousValue(String previousValue) {
        this.previousValue = previousValue;
    }
 
    public String getProperty() {
        return property;
    }
 
    public void setProperty(String property) {
        this.property = property;
    }
 
    public Date getTimestamp() {
        return timestamp;
    }
 
    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }
    
    public void setHistorizableEntity(Historizable entity) {
        this.setEntity(entity.getClass().getSimpleName());
        this.setEntityId(entity.getId());
        this.setDescription(entity.toString());
    }
    
    public String getModule() {
        return module;
    }
 
    public void setModule(String module) {
        this.module = module;
    }
 
    public String toString() {
        return "History[" + DateFormat.getDateTimeInstance().format(timestamp) + ", " + operationType + ", " + entity + "," + id + " " + property + "]";
    }
 
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final HistoryEntry other = (HistoryEntry) obj;
        return this.getId().equals(other.getId());
    }
}