@SuppressWarnings("deprecation") public void deal(Map<Integer, ArrayList<Date>> map) throws Exception { Date d = map.values().iterator().next().get(0); int beginStatistic = Const.beginStatistic; Calendar smallMonth = new GregorianCalendar(1900+d.getYear(),d.getMonth(),beginStatistic); Date d1 = null; Date d2 = null; int date = 0; Map<Integer, ArrayList<Date>> uniq = uniqe(map); while(true) { date = smallMonth.get(Calendar.DAY_OF_MONTH); if(smallMonth.get(Calendar.DAY_OF_WEEK) == 1 || smallMonth.get(Calendar.DAY_OF_WEEK) == 7)//周末 { if(uniq.containsKey(date))//加班 { if(uniq.get(date) != null) { extra_weekend.put(date, new ArrayList<Date>(2)); extra_weekend.get(date).add(uniq.get(date).get(0)); extra_weekend.get(date).add(uniq.get(date).get(1)); } } } else if(uniq.containsKey(date))//平时刷卡 { ArrayList<Date> ds = uniq.get(date); if(ds == null) { smallMonth.add(Calendar.DAY_OF_MONTH, 1); continue; } d1 = timeFormat.parse(timeFormat.format(ds.get(0))); d2 = timeFormat.parse(timeFormat.format(ds.get(1))); if(d1.after(am.getTime()) || d2.before(pm.getTime()))//迟到,早退 { exception.put(date, new ArrayList<Date>(2)); exception.get(date).add(ds.get(0)); exception.get(date).add(ds.get(1)); } if(d2.after(eve.getTime()))//平时加班 { extra_weekday.add(ds.get(1));//记录晚上打卡时间 } } else//缺席 { if(exception.get(100) == null) { exception.put(100, new ArrayList<Date>()); } exception.get(100).add(smallMonth.getTime()); } smallMonth.add(Calendar.DAY_OF_MONTH,1); if(smallMonth.get(Calendar.DAY_OF_MONTH) == beginStatistic) { break; } } } }