| | |
| | | import cn.lihu.jh.module.ecg.dal.mysql.devrent.DevRentMapper; |
| | | 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.BedOpTypeEnum; |
| | | import cn.lihu.jh.module.ecg.enums.BedStatusEnum; |
| | | import cn.lihu.jh.module.ecg.enums.QueueStatusEnum; |
| | | import cn.lihu.jh.module.infra.api.config.ConfigApi; |
| | |
| | | AtomicInteger openingFlag = new AtomicInteger(0); |
| | | AtomicInteger curSeqNum = new AtomicInteger(0); |
| | | |
| | | ConcurrentHashMap<String, BedQueueBO > mapBedVsQueue = new ConcurrentHashMap<>(); |
| | | // ç»´æ¤ å¼æ¾çå·¥ä½ |
| | | ConcurrentHashMap<String, BedQueueBO > mapOpeningBed = new ConcurrentHashMap<>(); |
| | | |
| | | // è£
æºå·¥ä½..ä¸è¿å
¥ä¼å
éå |
| | | Map<Integer, PriorityBlockingQueue<BedQueueBO>> mapCheckTypePriorityQueue = new HashMap(); |
| | | |
| | | // åºäºç±»åç, è£
æºåå¤çä¼å
éå |
| | | // Map<Integer, PriorityBlockingQueue<BedQueueBO>> mapReadyPriorityQueue = new HashMap(); |
| | | |
| | | // è£
æºå·¥ä½..ä¸è¿å
¥åæµéå |
| | | Map<Integer, PriorityBlockingQueue<BedQueueBO>> mapCheckTypeRoutingQueue = new HashMap(); |
| | | |
| | | Map<Integer, CheckTypeDO> mapCheckTypeVsReadyMax = null; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public ErrorCode bedOpen(Long roomId, String roomName, String bedNo) { |
| | | BedQueueBO bedQueueBO2 = mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | BedQueueBO bedQueueBO2 = mapOpeningBed.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | if (null != bedQueueBO2) { |
| | | log.error("bedOpen mapBedVsQueue has existed. " + roomId + " " + bedNo); |
| | | return QUEUE_BED_EXIST; |
| | |
| | | bedQueueBO.setStatus(BedStatusEnum.OPENING.getStatus()); |
| | | bedQueueBO.setCheckTypes( roomDO.getCheckTypes() ); |
| | | bedQueueBO.setOpType( roomDO.getOpType() ); |
| | | mapBedVsQueue.put( Utils.formatRoomBed(roomId, bedNo), bedQueueBO); |
| | | mapOpeningBed.put( Utils.formatRoomBed(roomId, bedNo), bedQueueBO); |
| | | |
| | | return GlobalErrorCodeConstants.SUCCESS; |
| | | } |
| | | |
| | | public ErrorCode bedClose(Long roomId, String bedNo) { |
| | | BedQueueBO bedQueueBO = mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | BedQueueBO bedQueueBO = mapOpeningBed.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | if (null == bedQueueBO) { |
| | | log.error("bedClose mapBedVsQueue DONOT existed. " + roomId + " " + bedNo); |
| | | return QUEUE_BED_NOT_EXIST; |
| | | } |
| | | |
| | | // é¤äºå¤æ åå¤åè¯ä¸ ç人æ°ï¼è¿éè¦ å¤æ è¿å·çäººæ° |
| | | //if (bedQueueBO.getQueueNum().get() >0) |
| | | // return QUEUE_HAVE_PATIENT; |
| | | // æ£æ¥æ¯å¦è¿ææ£è
éè¦å¤ç |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.READY.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.INSTALLING.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.PASSED.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.PASSED_INSTALL.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.RECALLED.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.RECALLED_INSTALL.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.AFFINITY.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.AFFINITY_INSTALL.getStatus()); |
| | | List<QueueDO> queueDOList = queueMapper.getBedQueueByStatus(roomId, bedNo, queueStatusList); |
| | | if (queueDOList.size() > 0) |
| | | return QUEUE_HAVE_PATIENT; |
| | |
| | | return ROOM_INVALID_STATUS; |
| | | } |
| | | |
| | | mapBedVsQueue.remove( Utils.formatRoomBed(roomId, bedNo) ); |
| | | removePriorityQueue(bedQueueBO); |
| | | mapOpeningBed.remove( Utils.formatRoomBed(roomId, bedNo) ); |
| | | removeRoutingQueue(bedQueueBO); |
| | | return GlobalErrorCodeConstants.SUCCESS; |
| | | } |
| | | |
| | | public ErrorCode bedDoctorPause(Long roomId, String bedNo, Long docId, String docName) { |
| | | BedQueueBO bedQueueBO = mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | BedQueueBO bedQueueBO = mapOpeningBed.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | if (null == bedQueueBO) { |
| | | log.error("bedDoctorPause mapBedVsQueue DONOT existed. " + roomId + " " + bedNo); |
| | | return QUEUE_BED_NOT_EXIST; |
| | |
| | | } |
| | | |
| | | bedQueueBO.setStatus(BedStatusEnum.PAUSE.getStatus()); |
| | | removePriorityQueue(bedQueueBO); |
| | | removeRoutingQueue(bedQueueBO); |
| | | return GlobalErrorCodeConstants.SUCCESS; |
| | | } |
| | | |
| | | public ErrorCode bedDoctorResume(Long roomId, String bedNo, Long docId, String docName) { |
| | | BedQueueBO bedQueueBO = mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | BedQueueBO bedQueueBO = mapOpeningBed.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | if (null == bedQueueBO || !bedQueueBO.getStatus().equals(BedStatusEnum.PAUSE.getStatus())) { |
| | | log.error("bedDoctorResume mapBedVsQueue DONOT existed OR NOT Paused. " + roomId + " " + bedNo); |
| | | return QUEUE_BED_NOT_EXIST; |
| | |
| | | } |
| | | |
| | | bedQueueBO.setStatus(BedStatusEnum.DOCTOR_ON.getStatus()); |
| | | addPriorityQueue(bedQueueBO); |
| | | addRoutingQueue(bedQueueBO); |
| | | return GlobalErrorCodeConstants.SUCCESS; |
| | | } |
| | | |
| | | public ErrorCode bedDoctorOn(Long roomId, String bedNo, Long docId, String docName) { |
| | | BedQueueBO bedQueueBO = mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | BedQueueBO bedQueueBO = mapOpeningBed.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | if (null == bedQueueBO) { |
| | | log.error("bedDoctorOn mapBedVsQueue DONOT existed. " + roomId + " " + bedNo); |
| | | return QUEUE_BED_NOT_EXIST; |
| | |
| | | } |
| | | |
| | | bedQueueBO.setStatus(BedStatusEnum.DOCTOR_ON.getStatus()); |
| | | addPriorityQueue(bedQueueBO); |
| | | addRoutingQueue(bedQueueBO); |
| | | return GlobalErrorCodeConstants.SUCCESS; |
| | | } |
| | | |
| | | public ErrorCode bedDoctorOff(Long roomId, String bedNo, Long docId, String docName) { |
| | | BedQueueBO bedQueueBO = mapBedVsQueue.get( Utils.formatRoomBed( roomId, bedNo ) ); |
| | | BedQueueBO bedQueueBO = mapOpeningBed.get( Utils.formatRoomBed( roomId, bedNo ) ); |
| | | if (null == bedQueueBO) { |
| | | log.error("bedDoctorOff mapBedVsQueue DONOT existed. " + roomId + " " + bedNo); |
| | | return QUEUE_BED_NOT_EXIST; |
| | |
| | | return ROOM_INVALID_STATUS; |
| | | } |
| | | |
| | | removePriorityQueue(bedQueueBO); |
| | | removeRoutingQueue(bedQueueBO); |
| | | |
| | | bedQueueBO.setStatus(BedStatusEnum.OPENING.getStatus()); |
| | | return GlobalErrorCodeConstants.SUCCESS; |
| | |
| | | return QUEUE_NOT_READY_PATIENT; |
| | | } |
| | | |
| | | // ä¼å
éåä¸ è¯¥å·¥ä½ åè¯ä¸ä¸äººçæ°é åä¸ |
| | | // åæµéåä¸ è¯¥å·¥ä½ åè¯ä¸ä¸äººçæ°é åä¸ |
| | | BedQueueBO bo = mapBedVsQueue.get( Utils.formatRoomBed( roomId, bedNo ) ); |
| | | bo.queueNum.getAndDecrement(); // å¯è½å·²ç»ãå¹¶åçãå¨ hurry-up 䏿¹åäºå¼ |
| | | |
| | | refreshPriorityQueue(bo); |
| | | refreshRoutingQueue(bo); |
| | | return GlobalErrorCodeConstants.SUCCESS; |
| | | } |
| | | */ |
| | |
| | | firstReadyQueueItem.setStatus(QueueStatusEnum.ONSTAGE.getStatus()); |
| | | queueMapper.updateById( firstReadyQueueItem ); |
| | | |
| | | // ä¼å
éåä¸ è¯¥å·¥ä½ åè¯ä¸ä¸äººçæ°é åä¸ |
| | | BedQueueBO bo = mapBedVsQueue.get( Utils.formatRoomBed( roomId, bedNo ) ); |
| | | // åæµéåä¸ è¯¥å·¥ä½ åè¯ä¸ä¸äººçæ°é åä¸ |
| | | BedQueueBO bo = mapOpeningBed.get( Utils.formatRoomBed( roomId, bedNo ) ); |
| | | bo.queueNum.getAndDecrement(); // å¯è½å·²ç»ãå¹¶åçãå¨ hurry-up 䏿¹åäºå¼ |
| | | |
| | | refreshPriorityQueue(bo); |
| | | refreshRoutingQueue(bo); |
| | | return GlobalErrorCodeConstants.SUCCESS; |
| | | } |
| | | |
| | |
| | | procAffinityWhenSomeOneEntryInstalling(firstItem.getPatId(), roomId, bedNo, checkTypeDO.getAffinityCheckTypes() ); |
| | | } |
| | | |
| | | // è£
æºå·¥ä½ æ ä¼å
éå |
| | | // ä¼å
éåä¸ è¯¥å·¥ä½ [å·²é¢ç¨]äººçæ°é åä¸ |
| | | // è£
æºå·¥ä½ ä¸è¿å
¥ åæµéå |
| | | // åæµéåä¸ è¯¥å·¥ä½ [å·²é¢ç¨]äººçæ°é åä¸ |
| | | //BedQueueBO bo = mapBedVsQueue.get( Utils.formatRoomBed( roomId, bedNo ) ); |
| | | //bo.queueNum.getAndDecrement(); // å¯è½å·²ç»ãå¹¶åçãå¨ hurry-up 䏿¹åäºå¼ |
| | | //refreshPriorityQueue(bo); |
| | | //refreshRoutingQueue(bo); |
| | | |
| | | return GlobalErrorCodeConstants.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 1. æ¯å¤©å¼è¯å ä»DB忥工ä½çæ£è
éåæ°æ®å° å·¥ä½ä¼å
éå |
| | | * 1. æ¯å¤©å¼è¯å ä»DB忥工ä½çæ£è
éåæ°æ®å° å·¥ä½åæµéå |
| | | * 2. æå¡è¿ç»´é坿¶ |
| | | */ |
| | | public ErrorCode bedReload() { |
| | | mapCheckTypePriorityQueue.clear(); |
| | | mapBedVsQueue.clear(); |
| | | mapCheckTypeRoutingQueue.clear(); |
| | | mapOpeningBed.clear(); |
| | | |
| | | // æ¸
é¤éå½å¤©çæé人å |
| | | queueMapper.clearQueue(); |
| | |
| | | List<RoomDO> roomDOList = roomMapper.simpleRoomList(bedStatusEnumList); |
| | | List<BedQueueBO> bedQueueBOList = roomDOList.stream().map(item -> BeanUtils.toBean(item, BedQueueBO.class)).toList(); |
| | | |
| | | // ä»DB è·å éåä¸ åè¯ä¸ä¸äººåç»è®¡ å表 |
| | | // ä»DB è·å éåä¸ ãåè¯ä¸ã人åç»è®¡ å表 |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.READY.getStatus()); |
| | | List<QueueStatisticDO> queueStatisticDOList = queueMapper.queueStatistic(queueStatusList); |
| | | |
| | | bedQueueBOList.forEach(item -> { |
| | | item.maxQueueNum = getBedReadyMax(item.roomId, item.bedNo); |
| | | item.setMaxQueueNum( getBedReadyMax(item.roomId, item.bedNo) ); |
| | | Optional<QueueStatisticDO> queueStatisticDOOptional = queueStatisticDOList.stream().filter(it->it.getRoomId()==item.roomId && it.getBedNo().equals(item.getBedNo())).findFirst(); |
| | | int queueNum = queueStatisticDOOptional.isPresent() ? queueStatisticDOOptional.get().getTotalInStatus() : 0; |
| | | if ( item.maxQueueNum < queueNum ) |
| | | if ( item.getMaxQueueNum() < queueNum ) |
| | | throw new RuntimeException("init: exceed max queue number!"); |
| | | |
| | | item.queueNum.set( queueNum ); |
| | | mapBedVsQueue.put( Utils.formatRoomBed(item.roomId, item.bedNo), item); |
| | | item.setQueueNum( new AtomicInteger(queueNum) ); |
| | | mapOpeningBed.put( Utils.formatRoomBed(item.roomId, item.bedNo), item); |
| | | if (BedStatusEnum.DOCTOR_ON.getStatus() == item.getStatus()) { |
| | | addPriorityQueue(item); |
| | | addRoutingQueue(item); |
| | | } |
| | | }); |
| | | |
| | |
| | | if (0 == openingFlag.get()) |
| | | return; |
| | | |
| | | mapBedVsQueue.values().forEach(bedQueueBO -> hurryupOneBed(bedQueueBO.roomId, bedQueueBO.bedNo)); |
| | | mapOpeningBed.values().forEach(bedQueueBO -> hurryupOneBed(bedQueueBO.roomId, bedQueueBO.bedNo)); |
| | | } |
| | | |
| | | /** |
| | |
| | | bedQueueBO.getRoomName(), |
| | | bedQueueBO.getBedNo(), |
| | | curSeqNum.get() + 1, // è¿å·åæ¥ï¼æå°å½åçä¸ä¸ä½ |
| | | QueueStatusEnum.RECALLED.getStatus(), // ä¸éè¦å¤ç [å®è£
å¬å], åå : å®è£
å·¥ä½ æ²¡æä¼å
éå |
| | | QueueStatusEnum.RECALLED.getStatus(), // ä¸éè¦å¤ç [å®è£
å¬å], åå : å®è£
å·¥ä½ ä¸è¿å
¥åæµéå |
| | | QueueStatusEnum.READY.getStatus()); |
| | | if (null == updateNum || 0 == updateNum) |
| | | break; |
| | |
| | | // å¯è½å·²ç»ãå¹¶åçãå¨ nextPatient 䏿¹åäºå¼ |
| | | bedQueueBO.queueNum.incrementAndGet(); |
| | | |
| | | // å¯è½å·²ç»ãå¹¶åçãå¨ nextPatient 䏿¹åäºä¼å
éåé¡ºåº |
| | | refreshPriorityQueue(bedQueueBO); |
| | | // å¯è½å·²ç»ãå¹¶åçãå¨ nextPatient 䏿¹åäºåæµéåé¡ºåº |
| | | refreshRoutingQueue(bedQueueBO); |
| | | } |
| | | |
| | | // å¤ç æéä¸ æ£è
|
| | |
| | | */ |
| | | public void hurryupOneCheckType(Integer checkType) { |
| | | |
| | | PriorityBlockingQueue<BedQueueBO> priorityQueue = mapCheckTypePriorityQueue.get(checkType); |
| | | if (null == priorityQueue) |
| | | PriorityBlockingQueue<BedQueueBO> routingQueue = mapCheckTypeRoutingQueue.get(checkType); |
| | | if (null == routingQueue) |
| | | return; |
| | | |
| | | while (true) { |
| | | BedQueueBO bedQueueBO = priorityQueue.peek(); |
| | | BedQueueBO bedQueueBO = routingQueue.peek(); |
| | | if (null == bedQueueBO) |
| | | return; |
| | | |
| | |
| | | // å¯è½å·²ç»ãå¹¶åçãå¨ nextPatient 䏿¹åäºå¼ |
| | | bedQueueBO.queueNum.incrementAndGet(); |
| | | |
| | | // å¯è½å·²ç»ãå¹¶åçãå¨ nextPatient 䏿¹åäºä¼å
éåé¡ºåº |
| | | refreshPriorityQueue(bedQueueBO); |
| | | // å¯è½å·²ç»ãå¹¶åçãå¨ nextPatient 䏿¹åäºåæµéåé¡ºåº |
| | | refreshRoutingQueue(bedQueueBO); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | public BedQueueBO getBedQueueBO(Long roomId, String bedNo) { |
| | | return mapBedVsQueue.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | return mapOpeningBed.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | } |
| | | |
| | | public MonitorInfoVO getMonitorInfo() { |
| | |
| | | public void monitorInfo() { |
| | | MonitorInfoVO monitorInfoVO = new MonitorInfoVO(); |
| | | roomBedStatistic(monitorInfoVO); |
| | | log.info(" opening " + openingFlag.get() + " " + monitorInfoVO.getQueueNum() + " " + monitorInfoVO.getActiveQueueNum() + " " + monitorInfoVO.getCheckTypeBedInfo().toString() ); |
| | | log.info(" opening " + openingFlag.get() + " " + monitorInfoVO.getOpeningBedNum() + " " + monitorInfoVO.getDocBedNum() + " " + monitorInfoVO.getCheckTypeBedInfo().toString() ); |
| | | } |
| | | |
| | | private void hurryupOneBedCheckTypeList(BedQueueBO bedQueueBO) { |
| | |
| | | bedQueueBO.queueNum.incrementAndGet(); |
| | | } |
| | | |
| | | // æ¹åäºä¼å
éåé¡ºåº |
| | | refreshPriorityQueue(bedQueueBO); |
| | | // æ¹åäºåæµéåé¡ºåº |
| | | refreshRoutingQueue(bedQueueBO); |
| | | } |
| | | |
| | | /** |
| | |
| | | for (int i=0; i<checkTypes.length; i++) { |
| | | CheckTypeDO checkTypeDO = mapCheckTypeVsReadyMax.get(checkTypes[i]); |
| | | Integer tmp = checkTypeDO.getReadyNum(); |
| | | ret = ret < tmp ? tmp : ret; //åå¤§å¼ |
| | | ret = ret < tmp ? tmp : ret; //ãåè¯ä¸ãæ°é åå¤§å¼ |
| | | } |
| | | return ret; |
| | | } |
| | | |
| | | private void addPriorityQueue(BedQueueBO bedQueueBO) { |
| | | private void addRoutingQueue(BedQueueBO bedQueueBO) { |
| | | // è£
æºå·¥ä½ ä¸è¿ åæµéåï¼ä¸æ¥æ¶ ãæéä¸ãæ£è
åæµ |
| | | if (BedOpTypeEnum.OP_INSTALL.getOpType() == bedQueueBO.getOpType()) |
| | | return; |
| | | |
| | | Integer[] checkTypes = bedQueueBO.getCheckTypes(); |
| | | Arrays.stream(checkTypes).forEach(checkType -> { |
| | | CheckTypeDO checkTypeDO = mapCheckTypeVsReadyMax.get(checkType); |
| | | // è£
æºå·¥ä½ ä¸è¿ ä¼å
éåï¼ä¸ä»æé䏿¥æ¶äºº |
| | | if (checkTypeDO.getNeedDevReady() == 1 && bedQueueBO.getOpType() == 2) { |
| | | return; |
| | | } |
| | | |
| | | PriorityBlockingQueue<BedQueueBO> priorityQueue = mapCheckTypePriorityQueue.get(checkType); |
| | | if (null == priorityQueue) { |
| | | priorityQueue = new PriorityBlockingQueue<BedQueueBO>(); |
| | | mapCheckTypePriorityQueue.put( checkType, priorityQueue ); |
| | | PriorityBlockingQueue<BedQueueBO> routingQueue = mapCheckTypeRoutingQueue.get(checkType); |
| | | if (null == routingQueue) { |
| | | routingQueue = new PriorityBlockingQueue<BedQueueBO>(); |
| | | mapCheckTypeRoutingQueue.put( checkType, routingQueue ); |
| | | } |
| | | |
| | | if (!priorityQueue.contains(bedQueueBO)) { |
| | | priorityQueue.offer(bedQueueBO); |
| | | if (!routingQueue.contains(bedQueueBO)) { |
| | | routingQueue.offer(bedQueueBO); |
| | | } else { |
| | | log.error("bedDoctorResume priorityQueue still exist!. " + bedQueueBO.getRoomId() + " " + bedQueueBO.getBedNo()); |
| | | log.error("bedDoctorResume routingQueue still exist!. " + bedQueueBO.getRoomId() + " " + bedQueueBO.getBedNo()); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private void removePriorityQueue(BedQueueBO bedQueueBO) { |
| | | private void removeRoutingQueue(BedQueueBO bedQueueBO) { |
| | | // è£
æºå·¥ä½ ä¸è¿ åæµéåï¼ä¸æ¥æ¶ ãæéä¸ãæ£è
åæµ |
| | | if (BedOpTypeEnum.OP_INSTALL.getOpType() == bedQueueBO.getOpType()) |
| | | return; |
| | | |
| | | Integer[] checkTypes = bedQueueBO.getCheckTypes(); |
| | | Arrays.stream(checkTypes).forEach(checkType -> { |
| | | PriorityBlockingQueue<BedQueueBO> priorityBlockingQueue = mapCheckTypePriorityQueue.get(checkType); |
| | | if (null != priorityBlockingQueue) |
| | | priorityBlockingQueue.remove(bedQueueBO); |
| | | PriorityBlockingQueue<BedQueueBO> routingQueue = mapCheckTypeRoutingQueue.get(checkType); |
| | | if (null != routingQueue) |
| | | routingQueue.remove(bedQueueBO); |
| | | }); |
| | | } |
| | | |
| | | private void refreshPriorityQueue(BedQueueBO bedQueueBO) { |
| | | private void refreshRoutingQueue(BedQueueBO bedQueueBO) { |
| | | // è£
æºå·¥ä½ ä¸è¿ åæµéåï¼ä¸æ¥æ¶ ãæéä¸ãæ£è
åæµ |
| | | if (BedOpTypeEnum.OP_INSTALL.getOpType() == bedQueueBO.getOpType()) |
| | | return; |
| | | |
| | | Integer[] checkTypes = bedQueueBO.getCheckTypes(); |
| | | Arrays.stream(checkTypes).forEach(checkType -> { |
| | | PriorityBlockingQueue<BedQueueBO> priorityQueue = mapCheckTypePriorityQueue.get(checkType); |
| | | priorityQueue.remove(bedQueueBO); |
| | | priorityQueue.offer(bedQueueBO); |
| | | PriorityBlockingQueue<BedQueueBO> routingQueue = mapCheckTypeRoutingQueue.get(checkType); |
| | | routingQueue.remove(bedQueueBO); |
| | | routingQueue.offer(bedQueueBO); |
| | | }); |
| | | } |
| | | |
| | |
| | | }); |
| | | |
| | | //å¼éç å è¿è¥ä¸ çå·¥ä½ç»è®¡ |
| | | mapBedVsQueue.values().forEach( bedQueueBO -> { |
| | | mapOpeningBed.values().forEach(bedQueueBO -> { |
| | | Integer[] checkTypes = bedQueueBO.getCheckTypes(); |
| | | Arrays.stream(checkTypes).forEach(checkType -> { |
| | | if (bedQueueBO.opType == 0 || bedQueueBO.opType == 1) |
| | |
| | | }); |
| | | }); |
| | | |
| | | // æ¥æ¶..æé䏿£è
..çä¼å
éå |
| | | // æ¥æ¶..æé䏿£è
..çåæµéå |
| | | HashSet<BedQueueBO> hashSetOperatingBedQueue = new HashSet<>(); |
| | | mapCheckTypePriorityQueue.values().forEach(priorityQueue->{ |
| | | priorityQueue.stream().forEach(bedQueueBO -> hashSetOperatingBedQueue.add(bedQueueBO)); |
| | | mapCheckTypeRoutingQueue.values().forEach(routingQueue->{ |
| | | routingQueue.stream().forEach(bedQueueBO -> hashSetOperatingBedQueue.add(bedQueueBO)); |
| | | }); |
| | | |
| | | |
| | |
| | | }); |
| | | |
| | | monitorInfoVO.setCheckTypeBedInfo(mapCheckTypeBedInfo); |
| | | monitorInfoVO.setQueueNum(mapBedVsQueue.size()); |
| | | monitorInfoVO.setActiveQueueNum((int) mapBedVsQueue.values().stream().filter(item -> item.getStatus() == BedStatusEnum.DOCTOR_ON.getStatus()).count()); |
| | | monitorInfoVO.setPriorityQueueNum( hashSetOperatingBedQueue.size() ); |
| | | monitorInfoVO.setMapBedVsQueue( mapBedVsQueue ); |
| | | monitorInfoVO.setOpeningBedNum(mapOpeningBed.size()); |
| | | monitorInfoVO.setDocBedNum((int) mapOpeningBed.values().stream().filter(item -> |
| | | item.getStatus() == BedStatusEnum.DOCTOR_ON.getStatus() || |
| | | item.getStatus() == BedStatusEnum.PAUSE.getStatus()) |
| | | .count()); |
| | | monitorInfoVO.setRoutingBedNum( hashSetOperatingBedQueue.size() ); |
| | | monitorInfoVO.setMapBedVsQueue(mapOpeningBed); |
| | | } |
| | | |
| | | } |