| | |
| | | {{ |
| | | add("county_nm,town_nm"); |
| | | add("res_nm"); |
| | | add("rz"); |
| | | // add("rz"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | * @param adCode |
| | | * @param isSendStation |
| | | */ |
| | | @Async |
| | | public void waterInfoNotHandle(AlarmRule alarmRule, String templateId, String uuid, String adCode,Boolean isSendStation) { |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.no_z_last_api_all); |
| | |
| | | |
| | | |
| | | /** |
| | | * 策略2: 水位数据异常 |
| | | * @param alarmRule |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param adCode |
| | | * @param isSendStation |
| | | */ |
| | | @Async |
| | | public void waterDataExcHandle(AlarmRule alarmRule, String templateId, String uuid, String adCode, boolean isSendStation) { |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_z_not_normal_api); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterDataExcList,false,adCode,uuid); |
| | | // 遍历 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 调用短信服务 |
| | | smsService.sendMergeSignMsg(smsRequestTemplate); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 5.水位接近汛限告警 |
| | | * @param templateId |
| | | * @param uuid |
| | |
| | | */ |
| | | public String waterDataExcHandle(String arg1, String arg2) { |
| | | String templateId = "2431012248591"; |
| | | //String adCode = "421181000000"; |
| | | String adCode = null; |
| | | String uuid = templateId + UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | if (null!=alarmRule) { |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_z_not_normal_api); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterDataExcList,false,null,uuid); |
| | | // 拼接后面内容 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 调用短信服务 |
| | | smsService.sendSignMsg(smsRequestTemplate); |
| | | asyncNoticeHandle.waterDataExcHandle(alarmRule,templateId,uuid,adCode,false); |
| | | } |
| | | // 返回 |
| | | return "水位数据异常"; |