| | |
| | | public enum QueueStatusEnum implements IntArrayValuable { |
| | | |
| | | //5:过号 10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 |
| | | PASSED((byte)5, "已过号"), |
| | | PASSED_INSTALL((byte)7, "已过号-安装"), |
| | | WAITING((byte)10, "排队中"), |
| | | RECALLED((byte)15, "已召回"), |
| | | RECALLED_INSTALL((byte)17, "已召回-安装"), |
| | | READY((byte)20, "候诊中"), |
| | | ONSTAGE((byte)30, "就诊中"), // 或 领用中 |
| | | RECEIVED((byte)33, "已领用"), |
| | | INSTALLING((byte)36, "安装中"), |
| | | FINISH((byte)40, "已就诊"); |
| | | PASSED(5, "已过号"), |
| | | PASSED_INSTALL(7, "已过号-安装"), |
| | | WAITING(10, "排队中"), |
| | | RECALLED(15, "已召回"), |
| | | RECALLED_INSTALL(17, "已召回-安装"), |
| | | READY(20, "候诊中"), |
| | | ONSTAGE(30, "就诊中"), // 或 领用中 |
| | | RECEIVED(33, "已领用"), |
| | | INSTALLING(36, "安装中"), |
| | | FINISH(40, "已就诊"); |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(QueueStatusEnum::getStatus).toArray(); |
| | | |
| | | /** |
| | | * 状态值 |
| | | */ |
| | | private final Byte status; |
| | | private final Integer status; |
| | | /** |
| | | * 状态名 |
| | | */ |
| | |
| | | import cn.lihu.jh.framework.common.util.date.DateUtils; |
| | | import cn.lihu.jh.module.ecg.controller.admin.devrent.vo.DevRentSaveReqVO; |
| | | import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueSaveReqVO; |
| | | import cn.lihu.jh.module.ecg.enums.QueueStatusEnum; |
| | | import cn.lihu.jh.module.ecg.feign.RemoteDataService; |
| | | import cn.lihu.jh.module.ecg.feign.RestApiReqBodyVo; |
| | | import cn.lihu.jh.module.ecg.feign.RestApiResult; |
| | |
| | | queueSaveReqVO.setBookCheckType( 10 ); |
| | | |
| | | queueSaveReqVO.setSeqNum(1); |
| | | queueSaveReqVO.setStatus((byte)10); |
| | | queueSaveReqVO.setStatus(QueueStatusEnum.WAITING.getStatus()); |
| | | queueSaveReqVO.setPassed((byte)0); |
| | | queueSaveReqVO.setExpired((byte)0); |
| | | |
| | |
| | | |
| | | import cn.hutool.extra.servlet.ServletUtil; |
| | | import cn.lihu.jh.framework.common.pojo.CommonResult; |
| | | import cn.lihu.jh.framework.common.pojo.PageResult; |
| | | import cn.lihu.jh.framework.common.util.object.BeanUtils; |
| | | import cn.lihu.jh.module.ecg.controller.admin.checktype.vo.CheckTypePageReqVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO; |
| | | import cn.lihu.jh.module.ecg.enums.QueueStatusEnum; |
| | | import cn.lihu.jh.module.ecg.service.callingscreen.CallingScreenService; |
| | | import cn.lihu.jh.module.ecg.service.checktype.CheckTypeService; |
| | | import cn.lihu.jh.module.ecg.service.config.EcgConfigService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static cn.lihu.jh.framework.common.pojo.CommonResult.error; |
| | | import static cn.lihu.jh.framework.common.pojo.CommonResult.success; |
| | |
| | | |
| | | @Resource |
| | | private CallingScreenService callingScreenService; |
| | | |
| | | @Resource |
| | | private EcgConfigService ecgConfigService; |
| | | |
| | | @GetMapping("/big-screen-data") |
| | | @Operation(summary = "大屏叫号数据") |
| | |
| | | { |
| | | String reqIp = ServletUtil.getClientIP(request); |
| | | |
| | | List<Byte> queueStatusList = new ArrayList<>(); |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.RECALLED.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.RECALLED_INSTALL.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.READY.getStatus()); |
| | |
| | | @RequestParam("roomId") Long roomId, |
| | | @RequestParam("bedNo") String bedNo) |
| | | { |
| | | List<Byte> queueStatusList = new ArrayList<>(); |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus()); |
| | | List<QueueDO> queueDOList = queueService.getBedQueueByStatus(roomId, bedNo, queueStatusList); |
| | | |
| | |
| | | @RequestParam("roomId") Long roomId, |
| | | @RequestParam("bedNo") String bedNo) |
| | | { |
| | | List<Byte> queueStatusList = new ArrayList<>(); |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.INSTALLING.getStatus()); |
| | | List<QueueDO> queueDOList = queueService.getBedQueueByStatus(roomId, bedNo, queueStatusList); |
| | | |
| | |
| | | |
| | | @Schema(description = "排队序号") |
| | | private Integer seqNum; |
| | | |
| | | @Schema(description = "5:过号 10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 ", example = "1") |
| | | private Byte status; |
| | | private Integer status; |
| | | |
| | | @Schema(description = "过号标记") |
| | | private Boolean passed; |
| | |
| | | |
| | | @Schema(description = "5:过号 10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 ", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @ExcelProperty("5:过号 10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 ") |
| | | private Byte status; |
| | | private Integer status; |
| | | |
| | | @Schema(description = "过号标记", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @ExcelProperty("过号标记") |
| | |
| | | |
| | | @Schema(description = "5:过号 10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 ", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @NotNull(message = "5:过号 10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 不能为空") |
| | | private Byte status; |
| | | private Integer status; |
| | | |
| | | @Schema(description = "过号标记", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "过号标记不能为空") |
| | |
| | | */ |
| | | @Data |
| | | public class BedQueueStatisticDO { |
| | | private Byte status; |
| | | private Integer status; |
| | | private Integer totalInStatus; |
| | | } |
| | |
| | | /** |
| | | * 5:过号 10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 |
| | | */ |
| | | private Byte status; |
| | | private Integer status; |
| | | /** |
| | | * 过号标记 |
| | | */ |
| | |
| | | " </foreach> )" + |
| | | " order by status desc, seq_num" + |
| | | "</script>") |
| | | List<QueueDO> getRoomQueueByStatus(@Param("roomId")Long roomId, @Param("statusList")List<Byte> statusList); |
| | | List<QueueDO> getRoomQueueByStatus(@Param("roomId")Long roomId, @Param("statusList")List<Integer> statusList); |
| | | |
| | | @Select("<script>" + |
| | | "SELECT * FROM lihu.queue " + |
| | |
| | | " </foreach> )" + |
| | | " order by status desc, seq_num" + |
| | | "</script>") |
| | | List<QueueDO> getQueueByStatus( @Param("statusList")List<Byte> statusList); |
| | | List<QueueDO> getQueueByStatus( @Param("statusList")List<Integer> statusList); |
| | | |
| | | @Select("<script>" + |
| | | "SELECT * FROM lihu.queue " + |
| | |
| | | " limit #{size} " + |
| | | " order by id" + |
| | | "</script>") |
| | | List<QueueDO> getPartialQueueByStatus( @Param("statusList")List<Byte> statusList, @Param("from") Integer from, @Param("size") Integer size); |
| | | List<QueueDO> getPartialQueueByStatus( @Param("statusList")List<Integer> statusList, @Param("from") Integer from, @Param("size") Integer size); |
| | | |
| | | @Select("<script>" + |
| | | "SELECT count(1) as total_in_status FROM lihu.queue where status in (" + |
| | |
| | | " #{status} " + |
| | | " </foreach> );" + |
| | | "</script>") |
| | | Integer statusStatistic(@Param("statusList")List<Byte> statusList); |
| | | Integer statusStatistic(@Param("statusList")List<Integer> statusList); |
| | | |
| | | @Select("<script>" + |
| | | "SELECT count(1) as total_in_status FROM lihu.queue where " + |
| | |
| | | " #{checkType} " + |
| | | " </foreach> ) " + |
| | | "</script>") |
| | | Integer checkTypeAndStatusStatistic( @Param("checkTypes")Integer[] checkTypes, @Param("statusList")List<Byte> statusList ); |
| | | Integer checkTypeAndStatusStatistic( @Param("checkTypes")Integer[] checkTypes, @Param("statusList")List<Integer> statusList ); |
| | | |
| | | @Select("<script>" + |
| | | "SELECT room_id, bed_no, count(1) as total_in_status FROM lihu.queue where status in (" + |
| | |
| | | " </foreach> )" + |
| | | " group by room_id, bed_no; " |
| | | +"</script>") |
| | | List<QueueStatisticDO> queueStatistic(@Param("statusList")List<Byte> statusList); |
| | | List<QueueStatisticDO> queueStatistic(@Param("statusList")List<Integer> statusList); |
| | | |
| | | @Select("<script>" + |
| | | "SELECT status, count(1) as total_in_status FROM lihu.queue where " + |
| | |
| | | " #{status} " + |
| | | " </foreach> )" + |
| | | "</script>") |
| | | Integer bedQueueStatisticByStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("statusList")List<Byte> statusList); |
| | | Integer bedQueueStatisticByStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("statusList")List<Integer> statusList); |
| | | |
| | | @Select("<script>" + |
| | | "SELECT * FROM lihu.queue " + |
| | |
| | | " </foreach> )" + |
| | | " order by status desc, seq_num" + |
| | | "</script>") |
| | | List<QueueDO> getBedQueueByStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("statusList")List<Byte> statusList); |
| | | List<QueueDO> getBedQueueByStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("statusList")List<Integer> statusList); |
| | | |
| | | @Update("update lihu.queue set status = #{newStatus} where seq_num = \n" + |
| | | "(select a.min_seq_num from \n" + |
| | | " (select min(seq_num) as min_seq_num from lihu.queue where room_id = #{roomId} and bed_no = #{bedNo} and status = #{curStatus}) a )") |
| | | Integer updateBedQueueStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus); |
| | | Integer updateBedQueueStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("curStatus")Integer curStatus, @Param("newStatus")Integer newStatus); |
| | | |
| | | // 某个诊室范围内 [已领用] [已召回-安装] 人员 抢占 |
| | | @Update("<script> " + |
| | |
| | | " )" + |
| | | "</script>" |
| | | ) |
| | | Integer preemptToBeInstalledPatient(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("curStatusList")List<Byte> curStatusList, @Param("newStatus")Byte newStatus); |
| | | Integer preemptToBeInstalledPatient(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("curStatusList")List<Integer> curStatusList, @Param("newStatus")Integer newStatus); |
| | | |
| | | @Update("update lihu.queue set status = #{newStatus} where pat_id = #{patId} and status = #{curStatus}") |
| | | Integer updatePatientQueueStatus(@Param("patId")String patId, @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus); |
| | | Integer updatePatientQueueStatus(@Param("patId")String patId, @Param("curStatus")Integer curStatus, @Param("newStatus")Integer newStatus); |
| | | |
| | | // 整个系统范围内 [排队中]人员 抢占 |
| | | @Update("update lihu.queue set status = #{newStatus}, room_id = #{roomId}, room_name = #{roomName}, \n" + |
| | |
| | | " (select a.id from \n" + |
| | | " (select id from lihu.queue where status = #{curStatus} and book_check_type= #{checkType} order by jump_flag desc, book_timeslot, create_time limit 1) a)") |
| | | Integer preemptWaitingPatient(@Param("roomId")Long roomId, @Param("roomName")String roomName, @Param("bedNo")String bedNo, |
| | | @Param("seqNum")Integer seqNum, @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus, |
| | | @Param("seqNum")Integer seqNum, @Param("curStatus")Integer curStatus, @Param("newStatus")Integer newStatus, |
| | | @Param("checkType")Integer checkType); |
| | | |
| | | @Update("update lihu.queue set status = #{newStatus}, seq_num = #{seqNum} " + |
| | |
| | | " ) a" + |
| | | " )" ) |
| | | Integer queueRecalledPatient(@Param("roomId")Long roomId, @Param("roomName")String roomName, @Param("bedNo")String bedNo, |
| | | @Param("seqNum")Integer seqNum, @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus); |
| | | @Param("seqNum")Integer seqNum, @Param("curStatus")Integer curStatus, @Param("newStatus")Integer newStatus); |
| | | |
| | | // 常规检查 或 领用 的患者召回, 原工位处理 |
| | | @Update("update lihu.queue set status = #{newStatus}, passed = 1 " + |
| | | " where room_id = #{roomId} and bed_no = #{bedNo} and status = #{curStatus} and pat_id = #{patId} ") |
| | | Integer recallPassedPatient(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("patId")String patId, |
| | | @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus); |
| | | @Param("curStatus")Integer curStatus, @Param("newStatus")Integer newStatus); |
| | | |
| | | // 装机医生 允许抢占 本科室 [安装过号] 的患者 |
| | | @Update("update lihu.queue set status = #{newStatus}, bed_no = #{bedNo}, passed = 1 " + |
| | | " where room_id = #{roomId} and status = #{curStatus} and pat_id = #{patId} ") |
| | | Integer recallPassedInstallPatient(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("patId")String patId, |
| | | @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus); |
| | | @Param("curStatus")Integer curStatus, @Param("newStatus")Integer newStatus); |
| | | |
| | | @Update("update lihu.queue set jump_flag = #{jumped} " + |
| | | " where status = #{curStatus} and pat_id = #{patId}") |
| | | Integer queueJump(@Param("patId")String patId, @Param("curStatus")Byte curStatus, @Param("jumped")Byte jumped ); |
| | | Integer queueJump(@Param("patId")String patId, @Param("curStatus")Integer curStatus, @Param("jumped")Byte jumped ); |
| | | |
| | | //@Update("TRUNCATE TABLE lihu.queue") |
| | | @Delete("delete from lihu.queue where TO_DAYS(book_date) != TO_DAYS(NOW())") |
| | |
| | | void setBigScreenConfig(BigScreenConfig bigScreenConfig); |
| | | |
| | | Map<Integer, List<QueueDO>> callingData(); |
| | | Map<Integer, List<QueueDO>> callingData2(); |
| | | |
| | | List<QueueDO> getRoomQueue(String ip, List<Byte> statusList); |
| | | List<QueueDO> getRoomQueue(String ip, List<Integer> statusList); |
| | | } |
| | |
| | | package cn.lihu.jh.module.ecg.service.callingscreen; |
| | | |
| | | import cn.lihu.jh.framework.common.pojo.PageResult; |
| | | import cn.lihu.jh.module.ecg.controller.admin.checktype.vo.CheckTypePageReqVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO; |
| | | import cn.lihu.jh.module.ecg.dal.mysql.checktype.CheckTypeMapper; |
| | | import cn.lihu.jh.module.ecg.dal.mysql.queue.QueueMapper; |
| | | import cn.lihu.jh.module.ecg.dal.mysql.room.RoomMapper; |
| | | import cn.lihu.jh.module.ecg.enums.QueueStatusEnum; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 排队 Service 实现类 |
| | |
| | | @Resource |
| | | private RoomMapper roomMapper; |
| | | |
| | | @Resource |
| | | private CheckTypeMapper checkTypeMapper; |
| | | |
| | | BigScreenConfig bigScreenConfig; |
| | | |
| | | Map<Integer, Integer> mapCheckTypeVsDisplayColumn = null; |
| | | |
| | | Map<Integer, List<QueueDO>> mapDisplaySlotVsCallingData = new HashMap<>(); |
| | | |
| | | Integer waitingFrom = 0; |
| | | Integer passedFrom = 0; |
| | |
| | | |
| | | @Override |
| | | public Map<Integer, List<QueueDO>> callingData() { |
| | | List<Byte> queueStatusList = new ArrayList<>(); |
| | | if (null == mapCheckTypeVsDisplayColumn) { |
| | | getDisplayColumnConfig(); |
| | | } else { |
| | | mapDisplaySlotVsCallingData.values().stream().forEach(slotQueueList -> slotQueueList.clear()); |
| | | } |
| | | |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.READY.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.WAITING.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.RECALLED.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.PASSED.getStatus()); |
| | | List<QueueDO> queueDOList = queueMapper.getQueueByStatus( queueStatusList ); |
| | | queueDOList.stream().forEach(queueDO -> { |
| | | List<QueueDO> listSolt = getDisplatSlotByQueue( queueDO.getBookCheckType(), queueDO.getStatus()); |
| | | listSolt.add( queueDO ); |
| | | }); |
| | | |
| | | mapDisplaySlotVsCallingData.values().stream().forEach(slotQueueList -> slotQueueList.sort(null)); |
| | | return mapDisplaySlotVsCallingData; |
| | | } |
| | | |
| | | @Override |
| | | public Map<Integer, List<QueueDO>> callingData2() { |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.READY.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus()); |
| | | List<QueueDO> listReady = queueMapper.getQueueByStatus( queueStatusList ); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<QueueDO> getRoomQueue(String ip, List<Byte> statusList) { |
| | | public List<QueueDO> getRoomQueue(String ip, List<Integer> statusList) { |
| | | List<RoomDO> roomDOList = roomMapper.queueByIp(ip); |
| | | Optional<RoomDO> optionalQueueDO = roomDOList.stream().filter(item -> StringUtils.hasLength(item.getIp())).findFirst(); |
| | | if (!optionalQueueDO.isPresent()) { |
| | |
| | | return queueDOList; |
| | | } |
| | | |
| | | private void getDisplayColumnConfig() { |
| | | CheckTypePageReqVO checkTypePageReqVO = new CheckTypePageReqVO(); |
| | | checkTypePageReqVO.setPageSize(-1); |
| | | PageResult<CheckTypeDO> pageResult = checkTypeMapper.selectPage(checkTypePageReqVO); |
| | | mapCheckTypeVsDisplayColumn = pageResult.getList().stream().collect(Collectors.toMap(CheckTypeDO::getValue, item -> item.getCallingColumn())); |
| | | |
| | | int displayColCnt = (int) mapCheckTypeVsDisplayColumn.values().stream().distinct().count(); |
| | | for (int i=0; i<displayColCnt; i++) { |
| | | mapDisplaySlotVsCallingData.put(i*1000 + 0, new ArrayList<>()); |
| | | mapDisplaySlotVsCallingData.put(i*1000 + 1, new ArrayList<>()); |
| | | mapDisplaySlotVsCallingData.put(i*1000 + 2, new ArrayList<>()); |
| | | } |
| | | } |
| | | |
| | | private List<QueueDO> getDisplatSlotByQueue( Integer checkType, Integer queueStatus ) { |
| | | return mapDisplaySlotVsCallingData.get(mapCheckTypeVsDisplayColumn.get(checkType)*1000 + getDisplatSlotByQueueStatus(queueStatus)); |
| | | } |
| | | |
| | | private Integer getDisplatSlotByQueueStatus( Integer queueStatus ) { |
| | | if (QueueStatusEnum.READY.getStatus() == queueStatus) |
| | | return 0; |
| | | else if (QueueStatusEnum.ONSTAGE.getStatus() == queueStatus) |
| | | return 0; |
| | | else if (QueueStatusEnum.WAITING.getStatus() == queueStatus) |
| | | return 1; |
| | | else if (QueueStatusEnum.RECALLED.getStatus() == queueStatus) |
| | | return 1; |
| | | else if (QueueStatusEnum.PASSED.getStatus() == queueStatus) |
| | | return 2; |
| | | else |
| | | return 0; |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | void passInstallNextPatient(Long roomId, String bedNo); |
| | | |
| | | List<QueueDO> getBedQueueByStatus(Long roomId, String bedNo, List<Byte> statusList); |
| | | List<QueueDO> getBedQueueByStatus(Long roomId, String bedNo, List<Integer> statusList); |
| | | |
| | | List<QueueDO> getRoomQueueByStatus(Long roomId, List<Byte> statusList); |
| | | List<QueueDO> getRoomQueueByStatus(Long roomId, List<Integer> statusList); |
| | | |
| | | PatientStatisticVO getPatientStatistic(Long roomId, String bedNo); |
| | | |
| | |
| | | // QueueStatusEnum.ONSTAGE.getStatus(), QueueStatusEnum.FINISH.getStatus()); |
| | | |
| | | // 从 DB 检查 该工位 是否有 [就诊中] 人员,若有就.放弃取下一位 |
| | | List<Byte> queueStatusList = new ArrayList<>(); |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus()); |
| | | Integer num = queueMapper.bedQueueStatisticByStatus(roomId, bedNo, queueStatusList); |
| | | if ( num != null && num > 0) |
| | |
| | | // QueueStatusEnum.ONSTAGE.getStatus(), QueueStatusEnum.RECEIVED.getStatus()); |
| | | |
| | | // 从 DB 检查 该工位 是否有 [就诊中] 人员,若有就.放弃取下一位 |
| | | List<Byte> queueStatusList = new ArrayList<>(); |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus()); |
| | | Integer num = queueMapper.bedQueueStatisticByStatus(roomId, bedNo, queueStatusList); |
| | | if ( num != null && num > 0) |
| | |
| | | // QueueStatusEnum.INSTALLING.getStatus(), QueueStatusEnum.FINISH.getStatus()); |
| | | |
| | | // 从 DB 检查 该工位 是否有 [就诊中] 人员,若有就.放弃取下一位 |
| | | List<Byte> queueStatusList = new ArrayList<>(); |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.INSTALLING.getStatus()); |
| | | Integer num = queueMapper.bedQueueStatisticByStatus(roomId, bedNo, queueStatusList); |
| | | if ( num != null && num > 0) |
| | |
| | | startNextPatient(roomId, bedNo); |
| | | } |
| | | |
| | | public List<QueueDO> getBedQueueByStatus(Long roomId, String bedNo, List<Byte> statusList) { |
| | | public List<QueueDO> getBedQueueByStatus(Long roomId, String bedNo, List<Integer> statusList) { |
| | | List<QueueDO> queueDOList = queueMapper.getBedQueueByStatus(roomId, bedNo, statusList); |
| | | return queueDOList; |
| | | } |
| | | |
| | | @Override |
| | | public List<QueueDO> getRoomQueueByStatus(Long roomId, List<Byte> statusList) { |
| | | public List<QueueDO> getRoomQueueByStatus(Long roomId, List<Integer> statusList) { |
| | | List<QueueDO> queueDOList = queueMapper.getRoomQueueByStatus(roomId, statusList); |
| | | return queueDOList; |
| | | } |
| | |
| | | // 统计 该工位类型的【排队中】人员数量 |
| | | RoomDO roomDO = getRoomDO(roomId, bedNo); |
| | | Integer[] checkTypes = roomDO.getCheckTypes(); |
| | | List<Byte> statusList = new ArrayList<>(); |
| | | List<Integer> statusList = new ArrayList<>(); |
| | | statusList.add(QueueStatusEnum.WAITING.getStatus()); |
| | | Integer num = queueMapper.checkTypeAndStatusStatistic(checkTypes, statusList); |
| | | patientStatisticVO.setQueuingNum(num); |
| | |
| | | // 统计 该工位类型的【排队中】人员数量 |
| | | RoomDO roomDO = getRoomDO(roomId, bedNo); |
| | | Integer[] checkTypes = roomDO.getCheckTypes(); |
| | | List<Byte> statusList = new ArrayList<>(); |
| | | List<Integer> statusList = new ArrayList<>(); |
| | | statusList.add(QueueStatusEnum.WAITING.getStatus()); |
| | | Integer num = queueMapper.checkTypeAndStatusStatistic(checkTypes, statusList); |
| | | patientStatisticVO.setQueuingNum(num); |
| | |
| | | |
| | | @Override |
| | | public List<QueueDO> getToBeCheckedPatient(Long roomId, String bedNo) { |
| | | List<Byte> queueStatusList = new ArrayList<>(); |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.RECALLED.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.READY.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus()); |
| | |
| | | |
| | | @Override |
| | | public List<QueueDO> getToBeInstalledPatient(Long roomId, String bedNo) { |
| | | List<Byte> queueStatusList = new ArrayList<>(); |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.RECEIVED.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.PASSED_INSTALL.getStatus()); |
| | | List<QueueDO> queueDOList = getRoomQueueByStatus(roomId, queueStatusList); |
| | |
| | | return ROOM_INVALID_STATUS; |
| | | } |
| | | |
| | | List<Byte> queueStatusList = new ArrayList<>(); |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.READY.getStatus()); |
| | | List<QueueDO> queueDOList = queueMapper.getBedQueueByStatus(roomId, bedNo, queueStatusList); |
| | | |
| | |
| | | // 除了判断 准备候诊中 的人数,还需要 判断 过号的人数 |
| | | //if (bedQueueBO.getQueueNum().get() >0) |
| | | // return QUEUE_HAVE_PATIENT; |
| | | List<Byte> queueStatusList = new ArrayList<>(); |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.READY.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.PASSED.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.RECALLED.getStatus()); |
| | |
| | | List<BedQueueBO> bedQueueBOList = roomDOList.stream().map(item -> BeanUtils.toBean(item, BedQueueBO.class)).toList(); |
| | | |
| | | // 从DB 获取 队列中 就诊准备中人员统计 列表 |
| | | List<Byte> queueStatusList = new ArrayList<>(); |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.READY.getStatus()); |
| | | List<QueueStatisticDO> queueStatisticDOList = queueMapper.queueStatistic(queueStatusList); |
| | | |