| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DoctorApiImpl implements DoctorApi { |
| | |
| | | |
| | | @Override |
| | | public ErrorCode bedDoctorOff(Long userId, String userName) { |
| | | RoomDO roomDO = queueService.getDocRoomInfo(userId); |
| | | List<RoomDO> roomDOList = queueService.getDocRoomInfo(userId); |
| | | // 未入座, 跳过 |
| | | if (null == roomDO) { |
| | | if (roomDOList.isEmpty()) { |
| | | return GlobalErrorCodeConstants.SUCCESS; |
| | | } |
| | | |
| | | return queueService.startBedDoctorOff(roomDO.getRoomId(), roomDO.getBedNo(), userId, userName); |
| | | roomDOList.forEach( bedItem -> queueService.startBedDoctorOff(bedItem.getRoomId(), bedItem.getBedNo(), userId, userName)); |
| | | return GlobalErrorCodeConstants.SUCCESS; |
| | | } |
| | | |
| | | } |