| | |
| | | |
| | | BigScreenConfig bigScreenConfig; |
| | | |
| | | Map<Integer, Integer> mapCheckTypeVsDisplayColumn = null; |
| | | Map<Integer, List<CheckTypeDO>> mapDisplayColName = null; |
| | | |
| | | Map<Integer, List<QueueDO>> mapDisplaySlotVsCallingData = new HashMap<>(); |
| | | Map<Integer, Integer> mapCheckTypeVsDisplayColumn = null; |
| | | |
| | | Integer waitingFrom = 0; |
| | | Integer passedFrom = 0; |
| | |
| | | this.bigScreenConfig = bigScreenConfig; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Map<Integer, List<QueueDO>> callingData() { |
| | | if (null == mapCheckTypeVsDisplayColumn) { |
| | | getDisplayColumnConfig(); |
| | | } else { |
| | | mapDisplaySlotVsCallingData.values().stream().forEach(slotQueueList -> slotQueueList.clear()); |
| | | public Map<Integer, List<String>> getDisplayColInfo() { |
| | | if (null == mapDisplayColName) { |
| | | CheckTypePageReqVO checkTypePageReqVO = new CheckTypePageReqVO(); |
| | | checkTypePageReqVO.setPageSize(-1); |
| | | PageResult<CheckTypeDO> pageResult = checkTypeMapper.selectPage(checkTypePageReqVO); |
| | | mapDisplayColName = pageResult.getList().stream().collect(Collectors.groupingBy(CheckTypeDO::getCallingColumn)); |
| | | mapCheckTypeVsDisplayColumn = pageResult.getList().stream().collect(Collectors.toMap(CheckTypeDO::getValue, item -> item.getCallingColumn())); |
| | | } |
| | | |
| | | Map<Integer, List<String>> _map = new HashMap<>(); |
| | | mapDisplayColName.keySet().forEach(key -> { |
| | | _map.put(key, mapDisplayColName.get(key).stream().map(item->item.getName()).toList()); |
| | | }); |
| | | return _map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<Integer, Map<Integer, List<QueueDO>>> callingData() { |
| | | Map<Integer, Map<Integer, List<QueueDO>>> mapDisplayColQueue = new HashMap<>(); |
| | | int displayColCnt = (int) mapCheckTypeVsDisplayColumn.values().stream().distinct().count(); |
| | | for (int dispCol=0; dispCol<displayColCnt; dispCol++) { |
| | | Map<Integer, List<QueueDO>> mapSoltQueueData = new HashMap<>(); |
| | | mapSoltQueueData.put(0, new ArrayList<>()); |
| | | mapSoltQueueData.put(1, new ArrayList<>()); |
| | | mapSoltQueueData.put(2, new ArrayList<>()); |
| | | mapDisplayColQueue.put(dispCol, mapSoltQueueData); |
| | | } |
| | | |
| | | mapDisplayColQueue.values().stream().forEach(mapSlotQueue -> { |
| | | mapSlotQueue.values().stream().forEach(queueList -> queueList.clear()); |
| | | }); |
| | | |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.READY.getStatus()); |
| | |
| | | queueStatusList.add(QueueStatusEnum.PASSED.getStatus()); |
| | | List<QueueDO> queueDOList = queueMapper.getQueueByStatus( queueStatusList ); |
| | | queueDOList.stream().forEach(queueDO -> { |
| | | List<QueueDO> listSolt = getDisplatSlotByQueue( queueDO.getBookCheckType(), queueDO.getStatus()); |
| | | listSolt.add( queueDO ); |
| | | Map<Integer, List<QueueDO>> mapSlotQueue = mapDisplayColQueue.get(mapCheckTypeVsDisplayColumn.get(queueDO.getBookCheckType())); |
| | | List<QueueDO> soltList = mapSlotQueue.get(getDisplatSlotByQueueStatus(queueDO.getStatus())); |
| | | soltList.add( queueDO ); |
| | | }); |
| | | |
| | | mapDisplaySlotVsCallingData.values().stream().forEach(slotQueueList -> slotQueueList.sort(null)); |
| | | return mapDisplaySlotVsCallingData; |
| | | mapDisplayColQueue.values().stream().forEach(mapSoltQueue -> mapSoltQueue.values().stream().forEach( |
| | | slotQueueList -> slotQueueList.sort((o1, o2) -> o1.getSeqNum() - o2.getSeqNum()))); |
| | | return mapDisplayColQueue; |
| | | } |
| | | |
| | | @Override |
| | |
| | | Long roomId = optionalQueueDO.get().getRoomId(); |
| | | List<QueueDO> queueDOList = queueMapper.getRoomQueueByStatus(roomId, statusList); |
| | | return queueDOList; |
| | | } |
| | | |
| | | private void getDisplayColumnConfig() { |
| | | CheckTypePageReqVO checkTypePageReqVO = new CheckTypePageReqVO(); |
| | | checkTypePageReqVO.setPageSize(-1); |
| | | PageResult<CheckTypeDO> pageResult = checkTypeMapper.selectPage(checkTypePageReqVO); |
| | | mapCheckTypeVsDisplayColumn = pageResult.getList().stream().collect(Collectors.toMap(CheckTypeDO::getValue, item -> item.getCallingColumn())); |
| | | |
| | | int displayColCnt = (int) mapCheckTypeVsDisplayColumn.values().stream().distinct().count(); |
| | | for (int i=0; i<displayColCnt; i++) { |
| | | mapDisplaySlotVsCallingData.put(i*1000 + 0, new ArrayList<>()); |
| | | mapDisplaySlotVsCallingData.put(i*1000 + 1, new ArrayList<>()); |
| | | mapDisplaySlotVsCallingData.put(i*1000 + 2, new ArrayList<>()); |
| | | } |
| | | } |
| | | |
| | | private List<QueueDO> getDisplatSlotByQueue( Integer checkType, Integer queueStatus ) { |
| | | return mapDisplaySlotVsCallingData.get(mapCheckTypeVsDisplayColumn.get(checkType)*1000 + getDisplatSlotByQueueStatus(queueStatus)); |
| | | } |
| | | |
| | | private Integer getDisplatSlotByQueueStatus( Integer queueStatus ) { |