List<Map<String, Object>> foreList = forecastDataDao.getcityforeresults(param);
        Map<String,List<Map<String, Object>>> timegroupby=foreList.stream().collect(groupingBy(p->p.get("citycode").toString()));
        Map<String,Map<String,List<Map<String, Object>>>> ret=new HashMap<>();
        if(timegroupby!=null){
            for(String time:timegroupby.keySet()){
                Map<String,List<Map<String, Object>>> citygroup=null;
                citygroup=timegroupby.get(time).stream().collect(groupingBy(p->DateUtil.dateToStr((Date)p.get("datatime"),"yyyyMMdd")));
                if(citygroup!=null){
                    ret.put(time,citygroup);
                }
            }
        }
        return JSONObject.toJSONString(ret);

 

相关文章:

  • 2021-11-05
  • 2022-02-12
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-02
  • 2022-12-23
  • 2021-05-28
  • 2021-06-02
  • 2022-12-23
  • 2021-10-19
  • 2018-04-20
相关资源
相似解决方案