| | |
| | | ErrorCode ROOM_INVALID_STATUS = new ErrorCode(1_010_002_001, "è¯å®¤åè¯çåºç¶æå¼å¸¸"); |
| | | ErrorCode QUEUE_NOT_EXISTS = new ErrorCode(1_010_003_000, "æéä¸åå¨"); |
| | | ErrorCode QUEUE_BED_ABNORMAL = new ErrorCode(1_010_003_001, "å·¥ä½éåä¸åå¨"); |
| | | ErrorCode QUEUE_HAVE_PATIENT = new ErrorCode(1_010_003_001, "æ£è
éåä¸"); |
| | | ErrorCode QUEUE_HAVE_PATIENT = new ErrorCode(1_010_003_002, "éå䏿æ£è
"); |
| | | ErrorCode QUEUE_NOT_READY_PATIENT = new ErrorCode(1_010_003_003, "没æåå¤ä¸çæ£è
"); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.lihu.jh.module.ecg.service.queue; |
| | | |
| | | import cn.lihu.jh.framework.common.exception.ErrorCode; |
| | | |
| | | import java.util.concurrent.Callable; |
| | | |
| | | public class BedDoctorNextPatientCallable implements Callable<ErrorCode> { |
| | | |
| | | QueueService queueService; |
| | | private Long roomId; |
| | | private String bedNo; |
| | | |
| | | public BedDoctorNextPatientCallable(QueueService queueService, Long roomId, String bedNo) |
| | | { |
| | | super(); |
| | | this.roomId = roomId; |
| | | this.bedNo = bedNo; |
| | | this.queueService = queueService; |
| | | } |
| | | |
| | | public ErrorCode call() throws Exception { |
| | | return queueService.nextPatient(roomId, bedNo); |
| | | } |
| | | |
| | | } |
| | |
| | | ErrorCode startBedDoctorResume(Long roomId, String bedNo, Long docId, String docName); |
| | | ErrorCode startBedDoctorOn(Long roomId, String bedNo, Long docId, String docName); |
| | | ErrorCode startBedDoctorOff(Long roomId, String bedNo, Long docId, String docName); |
| | | ErrorCode startNextPatient(Long roomId, String bedNo); |
| | | |
| | | ErrorCode bedOpen(Long roomId, String bedNo); |
| | | ErrorCode bedClose(Long roomId, String bedNo); |
| | |
| | | ErrorCode bedDoctorResume(Long roomId, String bedNo, Long docId, String docName); |
| | | ErrorCode bedDoctorOn(Long roomId, String bedNo, Long docId, String docName); |
| | | ErrorCode bedDoctorOff(Long roomId, String bedNo, Long docId, String docName); |
| | | ErrorCode nextPatient(Long roomId, String bedNo); |
| | | |
| | | CommonResult<RoomRespVO> getRoom(Long roomId, String bedNo, Long docId); |
| | | |
| | | /** |
| | | * è·å¾æé |
| | | * |
| | |
| | | */ |
| | | void queue(QueueSaveReqVO queueSaveReqVO); |
| | | |
| | | |
| | | /** |
| | | * æå»çåè¯çéå塿»¡ |
| | | */ |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | System.out.println("startBedOpen ========"); |
| | | return ECG_INNER_ERROR; |
| | | } |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | System.out.println("startBedClose ========"); |
| | | return ECG_INNER_ERROR; |
| | | } |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | System.out.println("startBedDoctorPause ========"); |
| | | return ECG_INNER_ERROR; |
| | | } |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | System.out.println("startBedDoctorResume ========"); |
| | | return ECG_INNER_ERROR; |
| | | } |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | System.out.println("startBedDoctorOn ========"); |
| | | return ECG_INNER_ERROR; |
| | | } |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | System.out.println("startBedDoctorOff ========"); |
| | | return ECG_INNER_ERROR; |
| | | } |
| | | |
| | | @Override |
| | | public ErrorCode startNextPatient(Long roomId, String bedNo) { |
| | | Future<ErrorCode> future = singleThreadExecutor.submit( |
| | | new BedDoctorNextPatientCallable(this, roomId, bedNo) |
| | | ); |
| | | |
| | | try { |
| | | ErrorCode ret = future.get(); |
| | | return ret; |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } catch (ExecutionException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | System.out.println("startNextPatient ========"); |
| | | return ECG_INNER_ERROR; |
| | | } |
| | | |
| | |
| | | startHurryUp(); |
| | | } |
| | | |
| | | private void nextPatient(Long roomId, String bedNo) { |
| | | @Override |
| | | public ErrorCode nextPatient(Long roomId, String bedNo) { |
| | | // ä» DB æ åºå·æå°ç å°±è¯åå¤ä¸ç人 设置为就è¯ä¸ |
| | | Integer updateNum = queueMapper.updateQueueStatus(roomId, bedNo, |
| | | QueueStatusEnum.READY.getStatus(), QueueStatusEnum.ONSTAGE.getStatus()); |
| | | |
| | | // è¯¥å·¥ä½ æ²¡æ å°±è¯åå¤ä¸ 人å |
| | | if (null == updateNum || 0 == updateNum) { |
| | | return; |
| | | return QUEUE_NOT_READY_PATIENT; |
| | | } |
| | | |
| | | // ä¼å
éåä¸ è¯¥å·¥ä½ å°±è¯åå¤ä¸äººçæ°é åä¸ |
| | |
| | | priorityQueue.remove(bo); |
| | | priorityQueue.offer(bo); |
| | | |
| | | startHurryUp(); |
| | | hurryup(); |
| | | return SUCCESS; |
| | | } |
| | | |
| | | public void finishNextPatient(Long roomId, String bedNo) { |
| | |
| | | Integer ret = queueMapper.updateQueueStatus(roomId, bedNo, |
| | | QueueStatusEnum.ONSTAGE.getStatus(), QueueStatusEnum.FINISH.getStatus()); |
| | | |
| | | nextPatient(roomId, bedNo); |
| | | startNextPatient(roomId, bedNo); |
| | | } |
| | | |
| | | public void passNextPatient(Long roomId, String bedNo) { |
| | |
| | | Integer ret = queueMapper.updateQueueStatus(roomId, bedNo, |
| | | QueueStatusEnum.ONSTAGE.getStatus(), QueueStatusEnum.PASSED.getStatus()); |
| | | |
| | | nextPatient(roomId, bedNo); |
| | | startNextPatient(roomId, bedNo); |
| | | } |
| | | |
| | | public List<QueueDO> getDoctorQueueByStatus(Long roomId, String bedNo, List<Byte> statusList) { |