sinake
6 天以前 66fd4f82f8567454d0b93cfe6e519801857d156a
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/doctor/DoctorController.java
@@ -7,6 +7,7 @@
import cn.lihu.jh.module.ecg.controller.admin.call.vo.CallSaveReqVO;
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.PatientStatisticVO;
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueRespVO;
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueSaveReqVO;
import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO;
import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
import cn.lihu.jh.module.ecg.enums.QueueStatusEnum;
@@ -28,8 +29,7 @@
import static cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants.SUCCESS;
import static cn.lihu.jh.framework.common.pojo.CommonResult.error;
import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.ECG_INNER_ERROR;
import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.PATIENT_NOT_EXISTS;
import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*;
@Tag(name = "管理后台 - 医生叫号")
@RestController
@@ -55,8 +55,10 @@
        String userNickname = SecurityFrameworkUtils.getLoginUserNickname();
        ErrorCode result = queueService.startBedDoctorPause(roomId, bedNo, userId, userNickname);
        if (result.equals(SUCCESS))
        if (result.equals(SUCCESS)) {
            queueService.updateStop(roomId, bedNo);
            return success(SUCCESS.getCode());
        }
        return error(result);
    }
@@ -136,10 +138,12 @@
    {
        queueService.finishNextPatient(roomId, bedNo);
        List<QueueDO> queueDOList = queueService.getToBeCheckedPatient(roomId, bedNo);
        List<QueueDO> queueDOList = queueService.getCheckRelatedPatient(roomId, bedNo);
        // 过滤出  就诊中的,准备叫号
        QueueDO onStageItem = queueDOList.stream().filter(item -> Objects.equals(item.getStatus(), QueueStatusEnum.ONSTAGE.getStatus())).findFirst().orElse(null);
        QueueDO onStageItem = queueDOList.stream().filter(item ->
                item.getStatus() == QueueStatusEnum.ONSTAGE.getStatus() && item.getAffinityItem() == 0
        ).findFirst().orElse(null);
        if (null != onStageItem) {
            CallSaveReqVO callSaveReqVO = BeanUtils.toBean(onStageItem, CallSaveReqVO.class);
            callSaveReqVO.setId(null);
@@ -160,10 +164,12 @@
    {
        queueService.finishReceiveNextPatient(roomId, bedNo);
        List<QueueDO> queueDOList = queueService.getToBeCheckedPatient(roomId, bedNo);
        List<QueueDO> queueDOList = queueService.getCheckRelatedPatient(roomId, bedNo);
        // 过滤出  就诊中的,准备叫号
        QueueDO onStageItem = queueDOList.stream().filter(item -> Objects.equals(item.getStatus(), QueueStatusEnum.ONSTAGE.getStatus())).findFirst().orElse(null);
        QueueDO onStageItem = queueDOList.stream().filter(item ->
                item.getStatus() == QueueStatusEnum.ONSTAGE.getStatus() && item.getAffinityItem() == 0
        ).findFirst().orElse(null);
        if (null != onStageItem) {
            CallSaveReqVO callSaveReqVO = BeanUtils.toBean(onStageItem, CallSaveReqVO.class);
            callSaveReqVO.setId(null);
@@ -184,12 +190,14 @@
    {
        queueService.finishInstallNextPatient(roomId, bedNo);
        List<QueueDO> queueDOList = queueService.getToBeInstalledPatient(roomId, bedNo);
        List<QueueDO> queueDOList = queueService.getInstallRelatedPatient(roomId, bedNo); // 待安装的患者
        List<QueueDO> installingQueueDOList = queueDOList.stream().filter(queueDO -> queueDO.getStatus() == QueueStatusEnum.INSTALLING.getStatus()).toList();
        List<QueueDO> installingQueueDOList = queueDOList.stream().filter(queueDO ->
                queueDO.getStatus() == QueueStatusEnum.INSTALLING.getStatus() && queueDO.getAffinityItem() == 0
        ).toList();
        // 过滤出  [安装中] 的,准备叫号   该工位应该 最多只有一个 [安装中]
        if (installingQueueDOList.size() > 0) {
            QueueDO onStageItem = installingQueueDOList.getFirst();
            QueueDO onStageItem = installingQueueDOList.get(0);
            CallSaveReqVO callSaveReqVO = BeanUtils.toBean(onStageItem, CallSaveReqVO.class);
            callSaveReqVO.setId(null);
            callSaveReqVO.setCallType(1); // 装机叫号
@@ -197,6 +205,20 @@
        }
        return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
    }
    // 常规检查过号、领用过号
    @GetMapping("/pass-waiting-patient")
    @Operation(summary = "过号排队中患者")
    @Parameter(name = "patId", description = "患者编号", required = true, example = "20247845")
    @Parameter(name = "checkType", description = "预约检查类型", required = true, example = "100")
    @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
    public CommonResult<Integer> passWaitingPatient(
            @RequestParam("patId") String patId,
            @RequestParam("checkType") Integer checkType)
    {
        queueService.passWaitingPatient( patId, checkType );
        return success(0);
    }
    // 常规检查过号、领用过号
@@ -211,7 +233,7 @@
    {
        queueService.passNextPatient(roomId, bedNo);
        List<QueueDO> queueDOList = queueService.getToBeCheckedPatient(roomId, bedNo);
        List<QueueDO> queueDOList = queueService.getCheckRelatedPatient(roomId, bedNo);
        // 过滤出  就诊中的,准备叫号
        QueueDO onStageItem = queueDOList.stream().filter(item -> Objects.equals(item.getStatus(), QueueStatusEnum.ONSTAGE.getStatus())).findFirst().orElse(null);
@@ -235,12 +257,12 @@
    {
        queueService.passInstallNextPatient(roomId, bedNo);
        List<QueueDO> queueDOList = queueService.getToBeInstalledPatient(roomId, bedNo);
        List<QueueDO> queueDOList = queueService.getInstallRelatedPatient(roomId, bedNo);
        List<QueueDO> installingQueueDOList = queueDOList.stream().filter(queueDO -> queueDO.getStatus() == QueueStatusEnum.INSTALLING.getStatus()).toList();
        // 过滤出  [安装中] 的,准备叫号   该工位应该 最多只有一个 [安装中]
        if (installingQueueDOList.size() > 0) {
            QueueDO onStageItem = installingQueueDOList.getFirst();
            QueueDO onStageItem = installingQueueDOList.get(0);
            CallSaveReqVO callSaveReqVO = BeanUtils.toBean(onStageItem, CallSaveReqVO.class);
            callSaveReqVO.setId(null);
            callSaveReqVO.setCallType(1); // 装机叫号
@@ -319,7 +341,7 @@
            @RequestParam("roomId") Long roomId,
            @RequestParam("bedNo") String bedNo)
    {
        List<QueueDO> queueDOList = queueService.getToBeCheckedPatient(roomId, bedNo);
        List<QueueDO> queueDOList = queueService.getCheckRelatedPatient(roomId, bedNo);
        return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
    }
@@ -332,7 +354,7 @@
            @RequestParam("roomId") Long roomId,
            @RequestParam("bedNo") String bedNo)
    {
        List<QueueDO> queueDOList = queueService.getToBeInstalledPatient(roomId, bedNo);
        List<QueueDO> queueDOList = queueService.getInstallRelatedPatient(roomId, bedNo);
        return success(BeanUtils.toBean(queueDOList, QueueRespVO.class));
    }
@@ -376,6 +398,22 @@
        return success(patientStatisticVO);
    }
    @GetMapping("/recall-pass-waiting-patient")
    @Operation(summary = "过号-排队中 患者召回")
    @Parameter(name = "patId", description = "患者编号", required = true, example = "B2")
    @Parameter(name = "checkType", description = "预约检查类型", required = true, example = "100")
    @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
    public CommonResult<String> recallPatient(
            @RequestParam("patId") String patId,
            @RequestParam("checkType") Integer checkType)
    {
        Integer result = queueService.recallPassWaitingPatient(patId, checkType);
        if (null == result || 0 == result)
            return error(PATIENT_NOT_EXISTS);
        return success("操作成功");
    }
    @GetMapping("/recall-patient")
    @Operation(summary = "过号病人召回")
    @Parameter(name = "roomId", description = "诊室编号", required = true, example = "116")
@@ -385,9 +423,12 @@
    public CommonResult<String> recallPatient(
            @RequestParam("roomId") Long roomId,
            @RequestParam("bedNo") String bedNo,
            @RequestParam("patId") String patId )
            @RequestParam("patId") String patId,
            @RequestParam("checkType") Integer checkType,
            @RequestParam("roomId_operator") Long roomId_operator,
            @RequestParam("bedNo_operator") String bedNo_operator )
    {
        Integer result = queueService.recallPatient(roomId, bedNo, patId);
        Integer result = queueService.recallPatient(roomId, bedNo, patId, checkType);
        if (null == result || 0 == result)
            return error(PATIENT_NOT_EXISTS);
@@ -399,13 +440,20 @@
    @Parameter(name = "roomId", description = "诊室编号", required = true, example = "116")
    @Parameter(name = "bedNo", description = "工位编号", required = true, example = "B2")
    @Parameter(name = "patId", description = "患者编号", required = true, example = "B2")
    @Parameter(name = "checkType", description = "检查类型", required = true, example = "100")
    @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
    public CommonResult<String> recallInstallPatient(
            @RequestParam("roomId") Long roomId,
            @RequestParam("bedNo") String bedNo,
            @RequestParam("patId") String patId )
            @RequestParam("patId") String patId,
            @RequestParam("checkType") Integer checkType,
            @RequestParam("roomId_operator") Long roomId_operator,
            @RequestParam("bedNo_operator") String bedNo_operator )
    {
        Integer result = queueService.recallInstallPatient(roomId, bedNo, patId);
        if (roomId != roomId_operator)
            return error(QUEUE_RECALL_INSTALL_NOT_CUR_ROOM);
        Integer result = queueService.recallInstallPatient(roomId, bedNo, patId, checkType, roomId_operator, bedNo_operator);
        if (null == result || 0 == result)
            return error(PATIENT_NOT_EXISTS);