eight
2024-11-11 adb4da3c83649d550b8674feb1eb0926fbace30e
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java
@@ -418,6 +418,20 @@
                return;
            }
            // 抢到排队患者后,处理 检查项目.亲和性 逻辑
            QueueDO queueDO = queueMapper.getQueueItemBySeqNum(curSeqNum.get() + 1);
            CheckTypeDO checkTypeDO = getCheckTypeItem( queueDO.getBookCheckType() );
            if ( checkTypeDO.getAffinityCheckTypes().length > 0) {
                List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckItems(queueDO.getPatId(), checkTypeDO.getAffinityCheckTypes());
                for (int i = 0; i < affinityItems.size(); i++) {
                    QueueDO queueItem = affinityItems.get(i);
                    queueItem.setStatus(QueueStatusEnum.AFFINITY_ALREADY.getStatus()); //改变 排队状态
                    queueItem.setRoomId(queueItem.getRoomId());
                    queueItem.setRoomName(queueItem.getRoomName());
                    queueItem.setBedNo(queueItem.getBedNo());
                }
            }
            curSeqNum.getAndIncrement();
            // 可能已经【并发的】在 nextPatient 中改变了值
@@ -441,6 +455,10 @@
        mapCheckTypeVsReadyMax = checkTypeDOList.stream().collect(Collectors.toMap(CheckTypeDO::getValue, checkType -> checkType));
    }
    public CheckTypeDO getCheckTypeItem(Integer checkType) {
        return mapCheckTypeVsReadyMax.get( checkType );
    }
    public BedQueueBO getBedQueueBO(Long roomId, String bedNo) {
        return mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) );
    }
@@ -457,13 +475,6 @@
        MonitorInfoVO monitorInfoVO = new MonitorInfoVO();
        roomBedStatistic(monitorInfoVO);
        log.info(" opening " + openingFlag.get() + " " + monitorInfoVO.getQueueNum() + " " + monitorInfoVO.getActiveQueueNum() + " " + monitorInfoVO.getCheckTypeBedInfo().toString() );
    }
    public void resetQueueSequenceTable() {
        String strBookTimeslotLength = configApi.getConfigValueByKey(BOOK_TIMESLOT_LENGTH);
        String strBookTimeslotList = configApi.getConfigValueByKey(BOOK_TIMESLOT_LIST);
    }
    private Integer getBedReadyMax(Long roomId, String bedNo) {