| | |
| | | |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | @Override |
| | | public Map<String, List<Map<String, Object>>> countEverydayAlarmAndWarning() { |
| | | Map<String, List<Map<String, Object>>> result = new HashMap<>(); |
| | | |
| | | Map<String, Object> param = new HashMap<String, Object>(); |
| | | Date now = new Date(); |
| | | Date last = DateUtils.getAPeriodOfTime(now, -7, Calendar.DATE); // 上周的今天 |
| | | param.put("startTime", ymdhms.format(last)); |
| | | param.put("endTime", ymdhms.format(now)); |
| | | |
| | | param.put("type", 0); |
| | | Date endTime = DateUtils.getNowDate(); |
| | | //上周的今天 |
| | | param.put("startTime", DateUtils.getAPeriodOfTime(endTime, -7, Calendar.DATE)); |
| | | param.put("endTime", endTime); |
| | | List<Map<String, Object>> alarmDayCount = warningDetailMapper.selectWarningDayCountByMap(param); |
| | | result.put("alarmDayCount", alarmDayCount); |
| | | |
| | | param.put("type", 1); |
| | | List<Map<String, Object>> warningDayCount = warningDetailMapper.selectWarningDayCountByMap(param); |
| | | result.put("warningDayCount", warningDayCount); |
| | | |
| | | return result; |
| | | } |
| | | |