| | |
| | | */ |
| | | public String waterInfoNotHandle(String arg1, String arg2) { |
| | | String templateId = "2431012216668"; |
| | | // 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_null_api); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterInfoNotList,false,null); |
| | | // 拼接内容后面的联系方式,当前模板拼接平台服务电话 |
| | | // 遍历,拼接平台服务电话 |
| | | 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.waterInfoNotHandle(alarmRule,templateId,uuid,adCode,false); |
| | | } |
| | | // 返回 |
| | | return "水位信息接收不到"; |
| | |
| | | */ |
| | | 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); |
| | | // 拼接后面内容 |
| | | 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 "水位数据异常"; |
| | |
| | | * @return |
| | | */ |
| | | public String waterLessDeadHandle(String arg1, String arg2) { |
| | | String adCode = "420607000000"; |
| | | // String adCode = null; |
| | | String templateId = "2431012248594"; |
| | | 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_diff_dead_z_api); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterLessDeadList,true,null); |
| | | // 拼接内容后面的联系方式,当前模板县水利部人员姓名电话 |
| | | // 遍历,拼接县水利部人员电话 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 查询县水利部人员(通过水库编号) |
| | | // list.add("测试:13112341234"); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 调用短信服务 |
| | | Map<String, Object> map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 返回 |
| | | return "本次-水位初次超汛限告警短信成功通知数量:" + map.get("smsRecord"); |
| | | asyncNoticeHandle.waterLessDeadHandle(templateId,uuid,alarmRule,adCode,false); |
| | | } |
| | | // 返回 |
| | | return "水位超低于死水位"; |
| | |
| | | * @return |
| | | */ |
| | | public String waterComeOverHandle(String arg1, String arg2) { |
| | | String adCode = null; |
| | | String templateId = "znxsw10000001"; |
| | | 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_diff_dead_z_api); |
| | | // 只发送站内信 |
| | | SmsRequestTemplate smsRequestTemplate = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterLessDeadList,true,null); |
| | | // 拼接内容后面的联系方式,当前模板县水利部人员姓名电话 |
| | | // 遍历,拼接县水利部人员电话 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 后面依次拼接 巡查责任人姓名,技术责任人姓名,市县水利部门人员姓名电话(暂时不要) |
| | | noticeHandle.addPatrolTechnologyInfo(list); |
| | | // 市县水利部门人员姓名电话(暂时不要) |
| | | // list.add("测试:13112341234"); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | // list.add("999"); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | smsService.saveInStationInfo(smsRequestTemplate); |
| | | asyncNoticeHandle.waterComeOverHandle(templateId,uuid,alarmRule, null); |
| | | } |
| | | return "水位接近汛限告警"; |
| | | } |
| | |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | if (null!=alarmRule) { |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.over_z_res_api); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterFirstOverList,true,adCode); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size()>0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次拼接巡查责任人,技术责任人姓名 |
| | | noticeHandle.addPatrolTechnologyInfo(list); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | // list.add("999"); |
| | | } |
| | | } |
| | | // 调用短信服务 |
| | | Map<String, Object> map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 返回 |
| | | return "本次-水位初次超汛限告警短信成功通知数量:" + map.get("smsRecord"); |
| | | } |
| | | // 短信发送 |
| | | asyncNoticeHandle.waterFirstOverHandle(templateId, uuid, alarmRule,adCode,true); |
| | | // 返回 |
| | | return "水位初次超汛限告警"; |
| | | } |
| | | // 返回 |
| | | return "水位初次超汛限告警"; |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | if (null!=alarmRule) { |
| | | // 异步处理,暂时解决超时重置问题 |
| | | Map<String, Object> map = asyncNoticeHandle.handleAlarmInfo(templateId, uuid, alarmRule); |
| | | Map<String, Object> map = asyncNoticeHandle.waterMoreDesignHandle(templateId, uuid, alarmRule); |
| | | // 返回 |
| | | return "水位超设计洪水位告警"; |
| | | } |