eight
2024-08-30 ae24af77aaa940a64281f9f1bf2fe5ab3f9c68b8
update
已添加1个文件
已修改3个文件
70 ■■■■■ 文件已修改
jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedDoctorNextPatientCallable.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java
@@ -16,5 +16,6 @@
    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, "没有准备中的患者");
}
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/BedDoctorNextPatientCallable.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
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);
    }
}
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueService.java
@@ -55,6 +55,7 @@
    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);
@@ -62,7 +63,10 @@
    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);
    /**
     * èŽ·å¾—æŽ’é˜Ÿ
     *
@@ -85,6 +89,7 @@
     */
    void queue(QueueSaveReqVO queueSaveReqVO);
    /**
     * æŠŠåŒ»ç”Ÿå€™è¯Šçš„队列塞满
     */
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java
@@ -109,6 +109,7 @@
            e.printStackTrace();
        }
        System.out.println("startBedOpen ========");
        return ECG_INNER_ERROR;
    }
@@ -125,6 +126,7 @@
            e.printStackTrace();
        }
        System.out.println("startBedClose ========");
        return ECG_INNER_ERROR;
    }
@@ -143,6 +145,7 @@
            e.printStackTrace();
        }
        System.out.println("startBedDoctorPause ========");
        return ECG_INNER_ERROR;
    }
@@ -161,6 +164,7 @@
            e.printStackTrace();
        }
        System.out.println("startBedDoctorResume ========");
        return ECG_INNER_ERROR;
    }
@@ -179,6 +183,7 @@
            e.printStackTrace();
        }
        System.out.println("startBedDoctorOn ========");
        return ECG_INNER_ERROR;
    }
@@ -197,6 +202,26 @@
            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;
    }
@@ -491,14 +516,15 @@
        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;
        }
        // ä¼˜å…ˆé˜Ÿåˆ—中 è¯¥å·¥ä½ å°±è¯Šå‡†å¤‡ä¸­äººçš„æ•°é‡ å‡ä¸€
@@ -507,7 +533,8 @@
        priorityQueue.remove(bo);
        priorityQueue.offer(bo);
        startHurryUp();
        hurryup();
        return SUCCESS;
    }
    public void finishNextPatient(Long roomId, String bedNo) {
@@ -515,7 +542,7 @@
        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) {
@@ -523,7 +550,7 @@
        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) {