84 lines
2.2 KiB
Java
84 lines
2.2 KiB
Java
package com.ipsen.medical.entity;
|
||
|
||
import javax.persistence.*;
|
||
import lombok.Data;
|
||
import java.time.LocalDateTime;
|
||
|
||
/**
|
||
* 查询请求实体
|
||
*/
|
||
@Data
|
||
@Entity
|
||
@Table(name = "inquiry_requests")
|
||
public class InquiryRequest {
|
||
|
||
@Id
|
||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||
private Long id;
|
||
|
||
@Column(nullable = false)
|
||
private String requestNumber; // 请求编号
|
||
|
||
private String customerName; // 客户姓名(非必填)
|
||
|
||
private String customerEmail; // 客户邮箱(非必填)
|
||
|
||
private String customerTitle; // 客户职称
|
||
|
||
@Column(columnDefinition = "TEXT", nullable = false)
|
||
private String inquiryContent; // 查询内容(必填)
|
||
|
||
@Column(columnDefinition = "TEXT")
|
||
private String keywords; // 提取的关键词(JSON格式)
|
||
|
||
private Boolean keywordsConfirmed; // 用户是否确认关键词
|
||
|
||
private Boolean searchInternalData; // 是否在内部数据中检索
|
||
|
||
private Boolean searchKnowledgeBase; // 是否在知识库中检索
|
||
|
||
private Boolean searchCnki; // 是否在知网中检索
|
||
|
||
private Boolean searchClinicalTrials; // 是否在ClinicalTrials中检索
|
||
|
||
@Enumerated(EnumType.STRING)
|
||
@Column(nullable = false)
|
||
private RequestStatus status; // 状态
|
||
|
||
@Column(columnDefinition = "TEXT")
|
||
private String searchResults; // 检索结果(JSON格式)
|
||
|
||
@Column(columnDefinition = "TEXT")
|
||
private String responseContent; // 回复内容
|
||
|
||
private String assignedTo; // 指派给的人员
|
||
|
||
@Column(nullable = false)
|
||
private LocalDateTime createdAt;
|
||
|
||
private LocalDateTime updatedAt;
|
||
|
||
private LocalDateTime completedAt;
|
||
|
||
@PrePersist
|
||
protected void onCreate() {
|
||
createdAt = LocalDateTime.now();
|
||
}
|
||
|
||
@PreUpdate
|
||
protected void onUpdate() {
|
||
updatedAt = LocalDateTime.now();
|
||
}
|
||
|
||
public enum RequestStatus {
|
||
CREATED, // 已创建
|
||
SEARCHING, // 检索中(提取关键词成功后进入)
|
||
SEARCHED, // 已检索(有检索结果)
|
||
RESPONDING, // 回复中(生成回复后)
|
||
COMPLETED // 已完成(邮件发送后人工标记)
|
||
}
|
||
}
|
||
|
||
|
||
|