| | |
| | | package cn.lihu.jh.module.ecg.service.callingscreen; |
| | | |
| | | 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.queue.QueueDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO; |
| | | import cn.lihu.jh.module.ecg.dal.mysql.queue.queueMapper; |
| | | import cn.lihu.jh.module.ecg.dal.mysql.queue.QueueMapper; |
| | | import cn.lihu.jh.module.ecg.dal.mysql.room.RoomMapper; |
| | | import cn.lihu.jh.module.ecg.enums.QueueStatusEnum; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.PATIENT_NOT_EXISTS; |
| | | |
| | | /** |
| | | * 排队 Service 实现类 |
| | |
| | | public class CallingScreenServiceImpl implements CallingScreenService { |
| | | |
| | | @Resource |
| | | private queueMapper queueMapper; |
| | | private QueueMapper queueMapper; |
| | | |
| | | @Resource |
| | | private RoomMapper roomMapper; |
| | |
| | | if (listWaiting.size() < bigScreenConfig.waitingSize && waitingFrom != 0) { |
| | | List<QueueDO> listWaiting_next = queueMapper.getPartialQueueByStatus( queueStatusList, 0, bigScreenConfig.waitingSize - listWaiting.size()); |
| | | listWaiting.addAll(listWaiting_next); |
| | | waitingFrom = listWaiting.getLast().getId() + 1; |
| | | } |
| | | if (listWaiting.size() < bigScreenConfig.waitingSize) { |
| | | waitingFrom = 0; |
| | |
| | | Long roomId = optionalQueueDO.get().getRoomId(); |
| | | List<QueueDO> queueDOList = queueMapper.getRoomQueueByStatus(roomId, statusList); |
| | | return queueDOList; |
| | | } |
| | | |
| | | @Override |
| | | public ErrorCode markCalled(String patientId) { |
| | | Integer rowNum = queueMapper.markCalled(patientId); |
| | | if (rowNum == 1) |
| | | return GlobalErrorCodeConstants.SUCCESS; |
| | | |
| | | return PATIENT_NOT_EXISTS; |
| | | } |
| | | |
| | | } |