yxh
7 天以前 68ff33beff11310e830b0615b5a81f83fad0f683
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
package cn.lihu.jh.module.ecg.controller.admin.room.vo;
 
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
 
/**
 * 「工位入座」结果 —— 自动入座({@code POST /clinic/room/auto-seat})
 * 与「查询我的工位」({@code GET /clinic/room/my-seat})共用。
 *
 * <p>背景:前端原来把"按 IP 匹配 → 绑 IP → 入座"拆成三个请求自己拼,
 * 任一步失败就只能回落到"手选工位",现场表现为"登录后没有自动入座"且无从判断原因。
 * 现在收敛成一个接口,并把**识别到的 IP** 与**未入座原因**一起返回,便于排查。
 *
 * @author 心电排队装机系统
 */
@Data
public class RoomSeatRespVO {
 
    @Schema(description = "是否已入座(true 时下面的工位信息有效)", example = "true")
    private Boolean seated = false;
 
    /**
     * 未入座原因(seated=true 时为空):
     * <ul>
     *   <li>{@code ip_invalid} —— 本机 IP 不可用(回环 / IPv6 / 未指定 / 非法),不能作为工位标识;</li>
     *   <li>{@code nomatch}    —— 该 IP 没有匹配到任何工位(工位没录 IP,或工位已关闭);</li>
     *   <li>{@code multi}      —— 该 IP 对应**多个空闲工位**,无法确定坐哪一个,需人工点选;</li>
     *   <li>{@code occupied}   —— 匹配到的工位已被**他人**占用(不挤掉他,转手选/旁观);</li>
     *   <li>{@code error}      —— 入座写库未生效(并发被别人抢先、状态不允许等)。</li>
     * </ul>
     */
    @Schema(description = "未入座原因:ip_invalid/nomatch/multi/occupied/error", example = "nomatch")
    private String reason;
 
    @Schema(description = "后端实际识别到的客户端IP(排查代理未透传 X-Forwarded-For 用)", example = "32.88.65.208")
    private String clientIp;
 
    @Schema(description = "被占用时的占用人姓名", example = "张三")
    private String ownerName;
 
    /* ==================== 工位信息(seated=true 时有效) ==================== */
 
    @Schema(description = "工位主键", example = "1")
    private Integer id;
 
    @Schema(description = "诊室编号", example = "1")
    private Long roomId;
 
    @Schema(description = "诊室名称", example = "1号门诊")
    private String roomName;
 
    @Schema(description = "工位号", example = "A1")
    private String bedNo;
 
    @Schema(description = "工位绑定的IP", example = "32.88.65.208")
    private String ip;
 
    @Schema(description = "工位状态:0已关闭 10已开通 20有医生 30暂停", example = "20")
    private Integer status;
 
    @Schema(description = "当前主人(医生)编号", example = "1")
    private Long docId;
 
    @Schema(description = "当前主人(医生)姓名", example = "张三")
    private String docName;
 
    @Schema(description = "该工位开展的检查项目")
    private Integer[] checkTypes;
 
    @Schema(description = "作业类型:0检查 1领用 2装机", example = "0")
    private Integer opType;
}