You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
138 lines
3.4 KiB
138 lines
3.4 KiB
/**
|
|
* 培训记录类
|
|
* 记录员工参加培训的详细信息
|
|
* 遵循单一职责原则
|
|
*/
|
|
package com.employeetraining.training;
|
|
|
|
import com.employeetraining.model.Employee;
|
|
import com.employeetraining.course.Course;
|
|
|
|
import java.time.LocalDate;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.util.Objects;
|
|
|
|
public class TrainingRecord {
|
|
private String recordId;
|
|
private String employeeId;
|
|
private String courseId;
|
|
private LocalDate completionDate;
|
|
private double score;
|
|
private TrainingStatus status;
|
|
private String feedback;
|
|
|
|
public TrainingRecord() {
|
|
}
|
|
|
|
public TrainingRecord(String recordId, String employeeId, String courseId,
|
|
LocalDate completionDate, double score,
|
|
TrainingStatus status, String feedback) {
|
|
this.recordId = recordId;
|
|
this.employeeId = employeeId;
|
|
this.courseId = courseId;
|
|
this.completionDate = completionDate;
|
|
this.score = score;
|
|
this.status = status;
|
|
this.feedback = feedback;
|
|
}
|
|
|
|
// Getters and Setters
|
|
public String getRecordId() {
|
|
return recordId;
|
|
}
|
|
|
|
public void setRecordId(String recordId) {
|
|
this.recordId = recordId;
|
|
}
|
|
|
|
public String getEmployeeId() {
|
|
return employeeId;
|
|
}
|
|
|
|
public void setEmployeeId(String employeeId) {
|
|
this.employeeId = employeeId;
|
|
}
|
|
|
|
public String getCourseId() {
|
|
return courseId;
|
|
}
|
|
|
|
public void setCourseId(String courseId) {
|
|
this.courseId = courseId;
|
|
}
|
|
|
|
public LocalDate getCompletionDate() {
|
|
return completionDate;
|
|
}
|
|
|
|
public void setCompletionDate(LocalDate completionDate) {
|
|
this.completionDate = completionDate;
|
|
}
|
|
|
|
public String getFormattedCompletionDate() {
|
|
if (completionDate == null) {
|
|
return "N/A";
|
|
}
|
|
return completionDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
}
|
|
|
|
public double getScore() {
|
|
return score;
|
|
}
|
|
|
|
public void setScore(double score) {
|
|
this.score = score;
|
|
}
|
|
|
|
public TrainingStatus getStatus() {
|
|
return status;
|
|
}
|
|
|
|
public void setStatus(TrainingStatus status) {
|
|
this.status = status;
|
|
}
|
|
|
|
public String getFeedback() {
|
|
return feedback;
|
|
}
|
|
|
|
public void setFeedback(String feedback) {
|
|
this.feedback = feedback;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) return true;
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
TrainingRecord that = (TrainingRecord) o;
|
|
return Objects.equals(recordId, that.recordId);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(recordId);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "TrainingRecord{" +
|
|
"recordId='" + recordId + '\'' +
|
|
", employeeId='" + employeeId + '\'' +
|
|
", courseId='" + courseId + '\'' +
|
|
", status=" + status +
|
|
", completionDate=" + getFormattedCompletionDate() +
|
|
", score=" + score +
|
|
'}';
|
|
}
|
|
|
|
/**
|
|
* 培训状态枚举
|
|
*/
|
|
public enum TrainingStatus {
|
|
NOT_STARTED,
|
|
IN_PROGRESS,
|
|
COMPLETED,
|
|
FAILED,
|
|
CERTIFIED
|
|
}
|
|
} |