zoukankan      html  css  js  c++  java
  • map的使用

    @Override
    public List<Map<String, Object>> findSchedule(Date beginTime, Date endTime, Long userId) {
           Map<String, Object> map = new HashMap<>();
           Map<String, Object> param = new HashMap<>();
           param.put("beginTime", beginTime);
           param.put("endTime", endTime);
           param.put("userId", userId);
           List<CrmSchedule> schedules = crmScheduleRepo.find(param);
           for (CrmSchedule schedule : schedules) {//日程的
                  map.put(DateUtil.format(DateUtil.shortDate(schedule.getDeadline()),

                                                                       DateUtil.yyyyMMddHHmmss),1);
           }
           for (CrmSchedule schedule : schedules) {//未完成的跟踪记录
                  if(schedule.getTrackId()==null){
                         map.put(DateUtil.format(DateUtil.shortDate(schedule.getDeadline()),

                                                DateUtil.yyyyMMddHHmmss),0);//当做所有是已经完成的
                  }
           }
           List<Map<String, Object>> rs = new ArrayList<>();
           Set<String> keySet = map.keySet();
           for (String key : keySet) {
                  Map<String, Object> info = new HashMap<>();
                  info.put("time", key);
                  info.put("state", map.get(key));
                  rs.add(info);
           }
           return rs;
    }

  • 相关阅读:
    009-Python-面向对象
    008-Python-模块
    007-Python函数-装饰器
    006-Python函数
    005-Python字典
    003-python列表
    PyCharm之python书写规范--消去提示波浪线
    001-python基础
    Java基础总结(一)
    High ASCII字符从bat文件到dos控制台的转化问题
  • 原文地址:https://www.cnblogs.com/ctaixw/p/5474339.html
Copyright © 2011-2022 走看看