| | |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }else { |
| | | long nowTime = new Date().getTime(); |
| | | try { |
| | | long alarmTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(alarm.getAlarmTime()).getTime(); |
| | | //0-5分钟 |
| | | if (nowTime-alarmTime>0 && nowTime-alarmTime<AlarmTimeConstant.FIVE_TIME){ |
| | | count05+=1; |
| | | } |
| | | //5-10分钟 |
| | | if (nowTime-alarmTime>=AlarmTimeConstant.FIVE_TIME && nowTime-alarmTime<AlarmTimeConstant.TEN_TIME){ |
| | | count0510+=1; |
| | | } |
| | | //10-30分钟 |
| | | if (nowTime-alarmTime>=AlarmTimeConstant.TEN_TIME && nowTime-alarmTime<AlarmTimeConstant.THIRTY_TIME){ |
| | | count1030+=1; |
| | | } |
| | | //30分钟以上 |
| | | if (nowTime-alarmTime>=AlarmTimeConstant.THIRTY_TIME){ |
| | | count30+=1; |
| | | } |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | // else { |
| | | // long nowTime = new Date().getTime(); |
| | | // try { |
| | | // long alarmTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(alarm.getAlarmTime()).getTime(); |
| | | // //0-5分钟 |
| | | // if (nowTime-alarmTime>0 && nowTime-alarmTime<AlarmTimeConstant.FIVE_TIME){ |
| | | // count05+=1; |
| | | // } |
| | | // //5-10分钟 |
| | | // if (nowTime-alarmTime>=AlarmTimeConstant.FIVE_TIME && nowTime-alarmTime<AlarmTimeConstant.TEN_TIME){ |
| | | // count0510+=1; |
| | | // } |
| | | // //10-30分钟 |
| | | // if (nowTime-alarmTime>=AlarmTimeConstant.TEN_TIME && nowTime-alarmTime<AlarmTimeConstant.THIRTY_TIME){ |
| | | // count1030+=1; |
| | | // } |
| | | // //30分钟以上 |
| | | // if (nowTime-alarmTime>=AlarmTimeConstant.THIRTY_TIME){ |
| | | // count30+=1; |
| | | // } |
| | | // } catch (ParseException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | } |
| | | //封装数据 |
| | | list.add(count05); |