eight
2024-12-12 2bc90e242eceb83d9aa80d48ea9f991c0f9b99c6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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;
    }
 
}