| | |
| | | |
| | | import com.yssh.dao.*; |
| | | import com.yssh.entity.*; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Service |
| | | public class WarningAnalyseServiceImpl implements IWarningAnalyseService { |
| | | |
| | | protected final Log logger = LogFactory.getLog(this.getClass()); |
| | | protected final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | @Resource |
| | | private WarningDetailMapper warningDetailMapper; |
| | | |
| | | @Resource |
| | | private AlertConfigMapper alertConfigMapper; |
| | | |
| | | @Resource |
| | | private ICommonService commonService; |
| | |
| | | try { |
| | | insertWarningDetails(allData); |
| | | } catch (Exception e) { |
| | | logger.error("批量插入告警数据出现异常!!!"); |
| | | logger.error("批量插入告警数据出现异常!!!", e); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | |
| | | public Map<String, Integer> countThisMonthAlarmAndWarning() { |
| | | Map<String, Integer> result = new HashMap<>(); |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("startTime", ymdhms.format(DateUtils.getMonthStart())); |
| | | param.put("endTime", ymdhms.format(DateUtils.getMonthEnd())); |
| | | |
| | | param.put("type", 0); |
| | | param.put("startTime", DateUtils.getMonthStart()); |
| | | param.put("endTime", DateUtils.getMonthEnd()); |
| | | List<WarningVo> alarms = warningDetailMapper.selectWarningDetailByMap(param); |
| | | if (StringUtils.isNull(alarms)) { |
| | | alarms = new ArrayList<>(); |
| | | } |
| | | result.put("alarmNumber", alarms.size()); |
| | | |
| | | param.put("type", 1); |
| | | List<WarningVo> warnings = warningDetailMapper.selectWarningDetailByMap(param); |
| | | if (StringUtils.isNull(warnings)) { |
| | | warnings = new ArrayList<>(); |
| | | } |
| | | result.put("warningNumber", warnings.size()); |
| | | |
| | | return result; |
| | | } |
| | | |