yxh
昨天 fce96ef468291fb9a0e6a4d34ab371315e9485d4
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
package cn.lihu.jh.module.ecg.service.queuesequence;
 
import java.util.*;
import cn.lihu.jh.module.ecg.controller.admin.queuesequence.vo.*;
import cn.lihu.jh.module.ecg.dal.dataobject.queuesequence.QueueSequenceDO;
import cn.lihu.jh.framework.common.pojo.PageResult;
import cn.lihu.jh.framework.common.pojo.PageParam;
 
import javax.validation.Valid;
 
/**
 * 当天序号 Service 接口
 *
 * @author 金华医院
 */
public interface QueueSequenceService {
 
    void initQueueSequenceTable();
 
    /**
     * 创建当天序号
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Integer createQueueSequence(@Valid QueueSequenceSaveReqVO createReqVO);
 
    /**
     * 更新当天序号
     *
     * @param updateReqVO 更新信息
     */
    void updateQueueSequence(@Valid QueueSequenceSaveReqVO updateReqVO);
 
    /**
     * 删除当天序号
     *
     * @param id 编号
     */
    void deleteQueueSequence(Integer id);
 
    /**
     * 获得当天序号
     *
     * @param id 编号
     * @return 当天序号
     */
    QueueSequenceDO getQueueSequence(Integer id);
 
    /**
     * 获得指定检查类型的时间段情况
     *
     */
    List<QueueSequenceDO> selectGivenCheckTypeTimeslot(Integer checkType);
 
    /**
     * 获得当天序号分页
     *
     * @param pageReqVO 分页查询
     * @return 当天序号分页
     */
    PageResult<QueueSequenceDO> getQueueSequencePage(QueueSequencePageReqVO pageReqVO);
 
    void  resetQueueSequence();
 
    Integer distributeSeqNo(Integer checkType, Integer timeslot);
    Integer distributeVipSeqNo(Integer checkType, Integer timeslot);
 
    /**
     * 按【检查类型配置的规则】分配排队序号(签到时调用)。
     *
     * <p>规则来自 {@code check_type.seq_rule},取值见
     * {@link cn.lihu.jh.module.ecg.enums.SeqRuleEnum}:
     * <ul>
     *   <li>{@code 0=预约号}   —— 直接用预约系统已下发的号({@code existingSeqNo}),不再分配;</li>
     *   <li>{@code 1=签到序号} —— 当天同检查类型内连续递增,每 9 个号预留 1 个给加急;</li>
     *   <li>{@code 2=时段号}   —— 按预约时段从号池取号(改造前的原有行为,也是未配置时的默认)。</li>
     * </ul>
     *
     * @param checkType     检查类型值({@code check_type.value})
     * @param timeslot      HIS 下发的预约时段(仅规则 2 使用)
     * @param existingSeqNo 预约系统已下发的号(仅规则 0 使用;为 null 时回退到签到序号规则)
     * @param urgent        是否加急({@code jjbz=J})—— 仅规则 1 使用:加急可占用预留号
     * @return 分配给该患者的排队序号(从 1 开始)
     */
    Integer distributeSeqNoByRule(Integer checkType, Integer timeslot,
                                 Integer existingSeqNo, boolean urgent);
 
    void initNumber();
}