eight
2024-09-25 c3e27cb2e84782e99a30cc5a6e8caa67ca0cb72f
医生登出,自动离座,自动从暂停恢复
已添加2个文件
已修改5个文件
65 ■■■■■ 文件已修改
jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/api/doctor/DoctorApi.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/api/doctor/DoctorApiImpl.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-system/jh-module-system-biz/pom.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-system/jh-module-system-biz/src/main/java/cn/lihu/jh/module/system/controller/admin/auth/AuthController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/api/doctor/DoctorApi.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
package cn.lihu.jh.module.ecg.api.doctor;
import cn.lihu.jh.framework.common.exception.ErrorCode;
import cn.lihu.jh.framework.common.pojo.CommonResult;
public interface DoctorApi {
    ErrorCode bedDoctorOff(Long userId, String userName);
}
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/api/doctor/DoctorApiImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,29 @@
package cn.lihu.jh.module.ecg.api.doctor;
import cn.lihu.jh.framework.common.exception.ErrorCode;
import cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants;
import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
import cn.lihu.jh.module.ecg.service.queue.QueueService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class DoctorApiImpl implements DoctorApi {
    @Resource
    private QueueService queueService;
    @Override
    public ErrorCode bedDoctorOff(Long userId, String userName) {
        RoomDO roomDO = queueService.getDocRoomInfo(userId);
        // æœªå…¥åº§, è·³è¿‡
        if (null == roomDO) {
            return GlobalErrorCodeConstants.SUCCESS;
        }
        return queueService.bedDoctorOff(roomDO.getRoomId(), roomDO.getBedNo(), userId, userName);
    }
}
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java
@@ -56,6 +56,9 @@
    @Select("SELECT * FROM lihu.clinic_room where room_id=#{roomId} and bed_no=#{bedNo} and doc_id=#{docId}")
    RoomDO getRoom(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("docId")Long docId);
    @Select("SELECT * FROM lihu.clinic_room where doc_id=#{docId} limit 1")
    RoomDO getRoomByDocId(@Param("docId")Long docId);
    @Update("<script> " +
            "update lihu.clinic_room set status=#{newStatus.status} " +
            " where room_id=#{roomId} and bed_no=#{bedNo} and isNull(doc_id) " +
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueService.java
@@ -10,6 +10,7 @@
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.framework.common.pojo.PageResult;
import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
/**
 * æŽ’队 Service æŽ¥å£
@@ -118,4 +119,6 @@
    Integer patientJump(String patId, Byte jumped );
    void monitorInfo();
    RoomDO getDocRoomInfo(Long docId);
}
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java
@@ -703,4 +703,9 @@
                 + " opening " + openingFlag.get());
    }
    @Override
    public RoomDO getDocRoomInfo(Long docId) {
        return roomMapper.getRoomByDocId(docId);
    }
}
jh-module-system/jh-module-system-biz/pom.xml
@@ -28,6 +28,12 @@
            <artifactId>jh-module-infra-api</artifactId>
            <version>${revision}</version>
        </dependency>
        <dependency>
            <groupId>cn.lihu</groupId>
            <artifactId>jh-module-ecg-api</artifactId>
            <version>${revision}</version>
            <scope>compile</scope>
        </dependency>
        <!-- ä¸šåŠ¡ç»„ä»¶ -->
        <dependency>
jh-module-system/jh-module-system-biz/src/main/java/cn/lihu/jh/module/system/controller/admin/auth/AuthController.java
@@ -6,7 +6,9 @@
import cn.lihu.jh.framework.common.enums.UserTypeEnum;
import cn.lihu.jh.framework.common.pojo.CommonResult;
import cn.lihu.jh.framework.security.config.SecurityProperties;
import cn.lihu.jh.framework.security.core.LoginUser;
import cn.lihu.jh.framework.security.core.util.SecurityFrameworkUtils;
import cn.lihu.jh.module.ecg.api.doctor.DoctorApi;
import cn.lihu.jh.module.system.controller.admin.auth.vo.*;
import cn.lihu.jh.module.system.convert.auth.AuthConvert;
import cn.lihu.jh.module.system.dal.dataobject.permission.MenuDO;
@@ -37,7 +39,7 @@
import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
import static cn.lihu.jh.framework.common.util.collection.CollectionUtils.convertSet;
import static cn.lihu.jh.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import static cn.lihu.jh.framework.security.core.util.SecurityFrameworkUtils.*;
@Tag(name = "管理后台 - è®¤è¯")
@RestController
@@ -62,6 +64,9 @@
    @Resource
    private SecurityProperties securityProperties;
    @Resource
    private DoctorApi doctorApi;
    @PostMapping("/login")
    @PermitAll
    @Operation(summary = "使用账号密码登录")
@@ -73,8 +78,12 @@
    @PermitAll
    @Operation(summary = "登出系统")
    public CommonResult<Boolean> logout(HttpServletRequest request) {
        // ç™»å‡ºå‰ï¼Œå…ˆç¦»åº§
        doctorApi.bedDoctorOff(getLoginUserId(), getLoginUserNickname());
        String token = SecurityFrameworkUtils.obtainAuthorization(request,
                securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
        if (StrUtil.isNotBlank(token)) {
            authService.logout(token, LoginLogTypeEnum.LOGOUT_SELF.getType());
        }