实时提供数据,需要实时监控到数据再更新到记录中

   params.put("startRow", startRow);
        params.put("size", size);
        Integer total = orderSettingMapper.countOrderList(params);
        //1.这里需要先查询出,已经点击预约的人数
 
        List<Map<String, Object>> lstPeople=orderSettingMapper.selectCountOrder();
        List<Map<String, Object>> notifyRecord = orderSettingMapper.SelectOrderList(params);
        String memberKeyString="";
        for (Map m : lstPeople) {
            java.util.Optional<String> memberKeyOptional = notifyRecord.stream().filter(e -> e.containsKey("activeId") && m.containsKey("activeId") && e.get("activeId") != null && e.get("activeId").toString().equalsIgnoreCase(m.get("activeId").toString()))
                    .map(e -> String.format("%s", e.get("activeId"))).findAny();
            memberKeyString = memberKeyOptional.isPresent() ? memberKeyOptional.get() : null;
            if (memberKeyString != null) {
                final String activeId = memberKeyString;
                java.util.Optional<Map<String,Object>> recordOptional = notifyRecord.stream().filter(e -> e.get("activeId") != null && e.get("activeId").toString().equalsIgnoreCase(activeId)).findAny();
                if (recordOptional.isPresent()) {
                    Integer sendTotal=Integer.valueOf(m.get("sendTotal").toString());
                    recordOptional.get().put("sendTotal",(m.containsKey("sendTotal") ? sendTotal : "0"));
                }
            }
            }
        response.put("notifyRecord", notifyRecord);
        response.put("total", total);
        response.put("status", "OK");
posted @ 2021-04-30 17:02  夏之  阅读(75)  评论(0编辑  收藏  举报