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;
|
import java.util.List;
|
|
@Service
|
public class DoctorApiImpl implements DoctorApi {
|
|
@Resource
|
private QueueService queueService;
|
|
@Override
|
public ErrorCode bedDoctorOff(Long userId, String userName) {
|
List<RoomDO> roomDOList = queueService.getDocRoomInfo(userId);
|
// 未入座, 跳过
|
if (roomDOList.isEmpty()) {
|
return GlobalErrorCodeConstants.SUCCESS;
|
}
|
|
roomDOList.forEach( bedItem -> queueService.startBedDoctorOff(bedItem.getRoomId(), bedItem.getBedNo(), userId, userName));
|
return GlobalErrorCodeConstants.SUCCESS;
|
}
|
|
}
|