| | |
| | | package cn.lihu.jh.module.ecg.service.room; |
| | | |
| | | import java.util.*; |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.lihu.jh.framework.common.pojo.PageResult; |
| | | 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; |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomSaveReqVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomStatisticsDO; |
| | | import cn.lihu.jh.module.ecg.dal.mysql.room.RoomMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | import cn.lihu.jh.framework.common.pojo.PageResult; |
| | | import cn.lihu.jh.framework.common.pojo.PageParam; |
| | | import cn.lihu.jh.module.ecg.enums.BedStatusEnum; |
| | | import cn.lihu.jh.framework.common.util.object.BeanUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception; |
| | | import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.ROOM_NOT_EXISTS; |
| | | |
| | | |
| | | /** |
| | | * 诊室和诊疗床 Service 实现类 |
| | |
| | | |
| | | @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); |
| | | } |
| | |
| | | public List<RoomStatisticsDO> roomStatistics() { |
| | | return roomMapper.roomStatistic(); |
| | | } |
| | | |
| | | @Override |
| | | public List<RoomDO> simpleRoomList() { |
| | | List<BedStatusEnum> bedStatusEnumList = new ArrayList<BedStatusEnum>(); |
| | | bedStatusEnumList.add(BedStatusEnum.OPENING); |
| | | bedStatusEnumList.add(BedStatusEnum.DOCTOR_ON); |
| | | bedStatusEnumList.add(BedStatusEnum.PAUSE); |
| | | return roomMapper.simpleRoomList(bedStatusEnumList); |
| | | } |
| | | |
| | | @Override |
| | | public void resetRoom(Boolean needCloseBed) { |
| | | queueService.startResetRoom(needCloseBed); |
| | | } |
| | | |
| | | @Override |
| | | public MonitorInfoVO getMonitorInfo() { |
| | | return queueService.getMonitorInfo(); |
| | | } |
| | | } |