eight
2024-10-11 111ded437886aa10072434f8b0a459da24f8545a
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java
@@ -1,10 +1,8 @@
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;
@@ -14,8 +12,6 @@
import javax.annotation.Resource;
import java.util.*;
import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.PATIENT_NOT_EXISTS;
/**
 * 排队 Service 实现类
@@ -28,7 +24,7 @@
public class CallingScreenServiceImpl implements CallingScreenService {
    @Resource
    private queueMapper queueMapper;
    private QueueMapper queueMapper;
    @Resource
    private RoomMapper roomMapper;
@@ -57,7 +53,6 @@
        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;
@@ -98,15 +93,6 @@
        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;
    }
}