| | |
| | | @AllArgsConstructor |
| | | public enum QueueStatusEnum implements IntArrayValuable { |
| | | |
| | | //10:排队中 20:候诊准备 30:就诊中 40:就诊完成 50:过号 60:过期 |
| | | //10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 50:过号 |
| | | WAITING((byte)10, "排队中"), |
| | | RECALLED((byte)15, "已召回"), |
| | | READY((byte)20, "候诊准备"), |
| | | ONSTAGE((byte)30, "就诊中"), |
| | | FINISH((byte)40, "就诊完成"), |
| | | PASSED((byte)50, "过号"), |
| | | RECALLED((byte)60, "过号回来"); |
| | | PASSED((byte)50, "过号"); |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(QueueStatusEnum::getStatus).toArray(); |
| | | |
| | |
| | | private Integer seqNum; |
| | | |
| | | /** |
| | | * 10:排队中 20:候诊准备 30:就诊中 40:就诊完成 50:过号 60:过期 |
| | | * 10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 50:过号 |
| | | */ |
| | | @Schema(description = "排队状态", example = "1") |
| | | @ExcelProperty("排队状态") |
| | |
| | | Map<Integer, List<QueueDO>> map = callingScreenService.callingData(); |
| | | |
| | | Map<Integer, List<CallingRespVO>> mapVO = new HashMap<>(); |
| | | |
| | | map.keySet().forEach( key -> { |
| | | mapVO.put(key, BeanUtils.toBean(map.get(key), CallingRespVO.class)); |
| | | }); |
| | |
| | | @GetMapping("/room-screen-data") |
| | | @Operation(summary = "诊间屏数据") |
| | | @PermitAll |
| | | public CommonResult<List<CallingRespVO>> callingDataRoom(HttpServletRequest request) |
| | | public CommonResult<Map<Integer, List<CallingRespVO>>> callingDataRoom(HttpServletRequest request) |
| | | { |
| | | String reqIp = ServletUtil.getClientIP(request); |
| | | |
| | | List<Byte> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.RECALLED.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.READY.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.PASSED.getStatus()); |
| | | |
| | | List<QueueDO> queueDOList = callingScreenService.getRoomQueue(reqIp, queueStatusList); |
| | | return success(BeanUtils.toBean(queueDOList, CallingRespVO.class)); |
| | | |
| | | List<QueueDO> passedList = queueDOList.stream().filter(queue -> queue.getStatus() == QueueStatusEnum.PASSED.getStatus()).toList(); |
| | | queueDOList.removeIf(queue -> queue.getStatus() == QueueStatusEnum.PASSED.getStatus()); |
| | | |
| | | Map<Integer, List<CallingRespVO>> mapVO = new HashMap<>(); |
| | | mapVO.put(1, BeanUtils.toBean(queueDOList, CallingRespVO.class)); |
| | | mapVO.put(2, BeanUtils.toBean(passedList, CallingRespVO.class)); |
| | | return success( mapVO ); |
| | | } |
| | | |
| | | @GetMapping("/mark-called") |
| | |
| | | |
| | | @Schema(description = "排队序号") |
| | | private Integer seqNum; |
| | | |
| | | @Schema(description = "10:排队中 20:候诊准备 30:就诊中 40:就诊完成 50:过号 60:过期", example = "1") |
| | | @Schema(description = "10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 50:过号", example = "1") |
| | | private Byte status; |
| | | |
| | | @Schema(description = "过号标记") |
| | |
| | | @ExcelProperty("排队序号") |
| | | private Integer seqNum; |
| | | |
| | | @Schema(description = "10:排队中 20:候诊准备 30:就诊中 40:就诊完成 50:过号 60:过期", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @ExcelProperty("10:排队中 20:候诊准备 30:就诊中 40:就诊完成 50:过号 60:过期") |
| | | @Schema(description = "10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 50:过号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @ExcelProperty("10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 50:过号") |
| | | private Byte status; |
| | | |
| | | @Schema(description = "过号标记", requiredMode = Schema.RequiredMode.REQUIRED) |
| | |
| | | @NotNull(message = "排队序号不能为空") |
| | | private Integer seqNum; |
| | | |
| | | @Schema(description = "10:排队中 20:候诊准备 30:就诊中 40:就诊完成 50:过号 60:过期", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @NotNull(message = "10:排队中 20:候诊准备 30:就诊中 40:就诊完成 50:过号 60:过期不能为空") |
| | | @Schema(description = "10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 50:过号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @NotNull(message = "10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 50:过号 不能为空") |
| | | private Byte status; |
| | | |
| | | @Schema(description = "过号标记", requiredMode = Schema.RequiredMode.REQUIRED) |
| | |
| | | */ |
| | | private Integer seqNum; |
| | | /** |
| | | * 10:排队中 20:候诊准备 30:就诊中 40:就诊完成 50:过号 60:过期 |
| | | * 10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 50:过号 |
| | | */ |
| | | private Byte status; |
| | | /** |
| | |
| | | @Select("select * from lihu.call_patient where called = 0 order by id limit 1") |
| | | CallDO getNextCall(); |
| | | |
| | | @Update("TRUNCATE TABLE lihu.call_patient") |
| | | //@Update("TRUNCATE TABLE lihu.call_patient") |
| | | @Delete("delete from lihu.call_patient where TO_DAYS(book_date) != TO_DAYS(NOW())") |
| | | void clearCall(); |
| | | } |
| | |
| | | " <foreach collection='statusList' separator=',' item='status'>" + |
| | | " #{status} " + |
| | | " </foreach> )" + |
| | | " order by seq_num" + |
| | | " order by status desc, seq_num" + |
| | | "</script>") |
| | | List<QueueDO> getRoomQueueByStatus(@Param("roomId")Long roomId, @Param("statusList")List<Byte> statusList); |
| | | |
| | |
| | | " where status = #{curStatus} and pat_id = #{patId}") |
| | | Integer queueJump(@Param("patId")String patId, @Param("curStatus")Byte curStatus, @Param("jumped")Byte jumped ); |
| | | |
| | | //@Delete("delete from lihu.queue where TO_DAYS(book_date) != TO_DAYS(NOW())") |
| | | @Update("TRUNCATE TABLE lihu.queue") |
| | | //@Update("TRUNCATE TABLE lihu.queue") |
| | | @Delete("delete from lihu.queue where TO_DAYS(book_date) != TO_DAYS(NOW())") |
| | | void clearQueue(); |
| | | } |
| | | |