| | |
| | | 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) { |