| | |
| | | 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; |
| | |
| | | |
| | | @Resource |
| | | private RoomMapper roomMapper; |
| | | |
| | | @Resource |
| | | private OAuth2TokenApi oAuth2TokenApi; |
| | | |
| | | @Resource |
| | | QueueService queueService; |
| | | |
| | | @Override |
| | | public Integer createRoom(RoomSaveReqVO createReqVO) { |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | |
| | | bedStatusEnumList.add(BedStatusEnum.PAUSE); |
| | | return roomMapper.simpleRoomList(bedStatusEnumList); |
| | | } |
| | | |
| | | @Override |
| | | public void resetRoom(Boolean needCloseBed) { |
| | | queueService.startResetRoom(needCloseBed); |
| | | } |
| | | |
| | | @Override |
| | | public MonitorInfoVO getMonitorInfo() { |
| | | return queueService.getMonitorInfo(); |
| | | } |
| | | } |