| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.lihu.jh.framework.common.pojo.PageResult; |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO; |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.MonitorInfoVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO; |
| | | import cn.lihu.jh.module.ecg.service.queue.QueueService; |
| | | import cn.lihu.jh.module.system.api.oauth2.OAuth2TokenApi; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public RoomDO getRoomByIP(String ip) { |
| | | List<RoomDO> roomDOList = roomMapper.queueByIp(ip); |
| | | Optional<RoomDO> optionalQueueDO = roomDOList.stream().filter(item -> StringUtils.hasLength(item.getIp())).findFirst(); |
| | | if (!optionalQueueDO.isPresent()) { |
| | | return null; |
| | | } |
| | | |
| | | return optionalQueueDO.get(); |
| | | } |
| | | |
| | | @Override |
| | | public PageResult<RoomDO> getRoomPage(RoomPageReqVO pageReqVO) { |
| | | return roomMapper.selectPage(pageReqVO); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void resetRoom() { |
| | | List<BedStatusEnum> bedStatusEnumList = new ArrayList<BedStatusEnum>(); |
| | | bedStatusEnumList.add(BedStatusEnum.DOCTOR_ON); |
| | | bedStatusEnumList.add(BedStatusEnum.PAUSE); |
| | | List<RoomDO> roomDOList = roomMapper.simpleRoomList(bedStatusEnumList); |
| | | |
| | | Integer ret = roomMapper.resetRoom(BedStatusEnum.CLOSED.getStatus()); |
| | | |
| | | // |
| | | List<Long> userIdList = roomDOList.stream().map(roomDO -> roomDO.getDocId()).toList(); |
| | | oAuth2TokenApi.tick(userIdList); |
| | | |
| | | queueService.startBedReload(); |
| | | public void resetRoom(Boolean needCloseBed) { |
| | | queueService.startResetRoom(needCloseBed); |
| | | } |
| | | |
| | | @Override |
| | | public Integer getOpeningFlag() { |
| | | return queueService.getOpeningFlag(); |
| | | public MonitorInfoVO getMonitorInfo() { |
| | | return queueService.getMonitorInfo(); |
| | | } |
| | | } |