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()); }