| | |
| | | private String city_cd; |
| | | private String city_nm; |
| | | |
| | | private String type; |
| | | } |
| | |
| | | <result property="county_nm" column="county_nm"/> |
| | | <result property="city_cd" column="city_cd"/> |
| | | <result property="city_nm" column="city_nm"/> |
| | | <result property="type" column="type"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="getSyLackAlertList" resultMap="vo"> |
| | | SELECT * FROM ( |
| | | SELECT |
| | | info.res_cd, |
| | | info.res_nm, |
| | | info.town_cd, |
| | | info.town_nm, |
| | | info.county_cd, |
| | | info.county_nm, |
| | | info.city_cd, |
| | | info.city_nm, |
| | | info.typeList as type |
| | | |
| | | FROM ( |
| | | SELECT |
| | | basic."guid" res_cd, |
| | | basic."name" res_nm, |
| | |
| | | {{ |
| | | // add("county_nm,town_nm"); |
| | | add("res_nm"); |
| | | add("ms_flag"); |
| | | add("cd_nm"); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add("cd_nm"); |
| | | add("value"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略36: 变形值大于100mm |
| | | */ |
| | | public static List<String> videoOffline = new ArrayList<String>() |
| | | {{ |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | }}; |
| | | } |
| | |
| | | */ |
| | | public static final String alarm_db_sl_value_change_api = "/services/1234567890ABCDEFGHIJKLMN/sl/alarm/api"; |
| | | |
| | | /** |
| | | * 38. 大坝安全监测告警-渗流量变化 |
| | | */ |
| | | public static final String alarm_video_offline_api = "/services/1234567890ABCDEFGHIJKLMN/sl/alarm/api"; |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | //保存记录 |
| | | public void damSafetySyNoneHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray ztData, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接内容后面的联系方式,当前模板县水利部人员姓名电话 |
| | | if (smsRequestTemplate.getPersonVOList().size()>0) { |
| | | // 遍历,拼接县水利部人员电话 拼接发送的模板内容 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 需要合并水库保存站内信记录信息 |
| | | noticeHandle.saveInStationInfoMerge(smsRequestTemplate,alarmRule); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public Map<String, Object> damSafetySyDataMissingHandle(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 策略34 站内信----- 资料缺失 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyDataMissingHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfoMergeNoCd(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 站内信----- 视频离线 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void videoOfflineHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfoMerge(smsRequestTemplate,alarmRule); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | private OutCallClient outCallClient; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 短信发送数据组装 |
| | | * |
| | |
| | | |
| | | /** |
| | | * 列名数据转换 |
| | | * |
| | | * @param jsonArray 告警动态数据 |
| | | * @param columnsList 告警动态内容 key |
| | | * @param smsRequestTemplate 消息发送对象 |
| | |
| | | } |
| | | // 返回数据 |
| | | return list; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 拼接列数据设置告警人员信息 |
| | | * |
| | | * @param jsonArray 告警动态数据 |
| | | * @param columnsList 告警动态内容 key |
| | | * @param alarmRuleDetail 告警人角色ids |
| | |
| | | |
| | | /** |
| | | * 获取告警人员信息 |
| | | * |
| | | * @param jsonArray 接口水库相关数据 |
| | | * @param columnsList 模板对应列key |
| | | * @param alarmRuleDetail 告警人员角色ids |
| | |
| | | |
| | | /** |
| | | * 告警内容拼接处理 |
| | | * |
| | | * @param jsonArray 数据 |
| | | * @param i 第几个 |
| | | * @param split key 值 |
| | |
| | | |
| | | /** |
| | | * 保存告警记录信息 |
| | | * |
| | | * @param list |
| | | * @param alarmRule 告警规则 |
| | | * @param uuid 临时id |
| | |
| | | |
| | | /** |
| | | * 查询告警人员信息 |
| | | * |
| | | * @param res_cd 水库 guid |
| | | * @param roleIds 角色ids |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 依次添加巡查责任人,技术责任人信息 |
| | | * |
| | | * @param list |
| | | * @param isPhone 是否保护电话 |
| | | */ |
| | | public void addPatrolTechnologyInfo(List<String> list,Boolean isPhone) { |
| | | // 查询巡查责任人姓名,技术责任人姓名信息 |
| | | // 根据水库id查询巡查责任人姓名,技术责任人姓名信息 |
| | | List<PersonVO> personVOList = attResManagePersonClient.getPersonListByResGuid(list.get(1),"4,5"); |
| | | if (personVOList.size()>0) { |
| | | String xczrr = "-"; |
| | |
| | | |
| | | /** |
| | | * 拼接市县水利部人员姓名及联系方式 |
| | | * |
| | | * @param list |
| | | */ |
| | | public void addCityCountyBusinessPersonInfo(List<String> list) { |
| | |
| | | |
| | | /** |
| | | * 依次添加行政责任人,主管部门责任人,技术责任人,巡查责任人信息 |
| | | * |
| | | * @param list |
| | | * @param personTypes |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 保存站内信记录信息 |
| | | * |
| | | * @param smsRequestTemplate |
| | | * @param alarmRule |
| | | * @return |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存站内信记录(水库合并) |
| | | * |
| | | * @param smsRequestTemplate |
| | | * @param alarmRule |
| | | * @return |
| | |
| | | Temp temp = new Temp(); |
| | | temp.setPhone(list.get(1)); |
| | | temp.setReservoirCode(list.get(0)); |
| | | temp.setReservoirName(list.get(3)); |
| | | temp.setReservoirName(list.get(2)); |
| | | temp.setCdNm(list.get(3)); |
| | | temp.setAlarmRecordId(list.get(list.size()-1)); |
| | | // 放入临时集合 |
| | | tempList.add(temp); |
| | |
| | | Map<String, List<Temp>> listMap = tempList.stream().collect(Collectors.groupingBy(Temp::getPhone)); |
| | | |
| | | |
| | | listMap.forEach((s, temps) -> { |
| | | StringBuilder builder = new StringBuilder(); |
| | | StringBuilder smsRecordBuilder = new StringBuilder(); |
| | | builder.append(s).append(","); |
| | | // 站内信其实不用分组,与短信发送结构保持一致, |
| | | List<List<Temp>> lists = Lists.partition(new ArrayList<>(temps), 7000); |
| | | for (List<Temp> list : lists) { |
| | | List<AlarmRecordDetailVO> alarmRecordDetailList = new ArrayList<>(); |
| | | // 设置站内信记录信息 |
| | | listMap.forEach((phone, temps) -> { |
| | | MessageRecord messageRecord = new MessageRecord(); |
| | | |
| | | // 遍历 |
| | | for (Temp temp : list) { |
| | | builder.append(temp.getReservoirName()).append(","); |
| | | smsRecordBuilder.append(temp.getReservoirName()).append(","); |
| | | AlarmRecordDetailVO alarmRecordDetail = new AlarmRecordDetailVO(); |
| | | alarmRecordDetail.setReservoirNumber(temp.getReservoirCode()); |
| | | alarmRecordDetail.setAlarmRecordId(Long.parseLong(temp.getAlarmRecordId())); |
| | | alarmRecordDetail.setAlarmMode("站内信"); |
| | | alarmRecordDetail.setPhone(temp.getPhone()); |
| | | alarmRecordDetail.setReservoirName(temp.getReservoirName()); |
| | | // 加入集合 |
| | | alarmRecordDetailList.add(alarmRecordDetail); |
| | | } |
| | | |
| | | |
| | | String row = builder.substring(0, builder.length() - 1); |
| | | // 组装数据 |
| | | String[] titleArr = smsRequestTemplate.getTitle().split(","); |
| | | String[][] dyns = new String[2][titleArr.length]; |
| | | dyns[0] = titleArr; |
| | | dyns[1] = row.split(","); |
| | | // 内容处理 |
| | | String str = smsTemplate.getContent().replaceAll("\\{.+?\\}", "%s"); |
| | | // 短信内容拼接(完成发送的结果信息) |
| | | String substring = smsRecordBuilder.substring(0, smsRecordBuilder.length() - 1); |
| | | // 格式转换 |
| | | String format = String.format(str, substring.split(",")); |
| | | |
| | | |
| | | messageRecord.setTheme(alarmRule.getRuleName()); |
| | | messageRecord.setSender(AuthUtil.getUserId().toString()); |
| | | messageRecord.setSource("智能告警"); |
| | | messageRecord.setStatus(0); |
| | | messageRecord.setRecipient(phone); |
| | | |
| | | // 删除 最后一个 告警记录id |
| | | list.remove(list.size() - 1); |
| | | // 删除 0 水库编码 |
| | | list.remove(0); |
| | | |
| | | // 设置手机号 |
| | | // messageRecord.setRecipient(list.get(0)); |
| | | messageRecord.setContent(format); |
| | | // 放入集合 |
| | | StringBuilder builder = new StringBuilder(); |
| | | Map<String, List<Temp>> resCollect = temps.stream().collect(Collectors.groupingBy(Temp::getReservoirCode)); |
| | | List<String> contentList = new ArrayList<>(); |
| | | resCollect.forEach((resCode, contentTemp) -> { |
| | | List<String> cdNmList = new ArrayList<>(); |
| | | //凤凰水库(测点12170062992),大新众水库(测点12170063012、测点12170062998) |
| | | //因为只能按编号分组,名称会有重复,所以拿第一条数据的名称就行 |
| | | String resName = contentTemp.get(0).getReservoirName(); |
| | | contentTemp.forEach(info -> { |
| | | //把测站加进测站集合里 |
| | | cdNmList.add("测点" + info.getCdNm()); |
| | | }); |
| | | String cdNameListStr = String.join("、", cdNmList); |
| | | contentList.add(StringUtil.format("{}({})", resName, cdNameListStr)); |
| | | }); |
| | | String contentListStr = String.join(",", contentList); |
| | | //需要填充的数据 |
| | | List<String> fillList = new ArrayList<>(); |
| | | fillList.add(contentListStr); |
| | | String sendContent = contentConvert(smsTemplate.getContent(), fillList); |
| | | messageRecord.setContent(sendContent); |
| | | |
| | | messageRecordList.add(messageRecord); |
| | | |
| | | } |
| | | }); |
| | | |
| | | // 保存告警记录详情信息 |
| | |
| | | } |
| | | |
| | | |
| | | public Map<String, Object> saveInStationInfoMergeNoCd(SmsRequestTemplate smsRequestTemplate, AlarmRule alarmRule) { |
| | | |
| | | // 取出数据 |
| | | SMSSendRequest request = new SMSSendRequest(); |
| | | SmsTemplate smsTemplate = smsRequestTemplate.getSmsTemplate(); |
| | | request.setTemplateId(smsTemplate.getTemplateId()); |
| | | List<List<String>> templateContent = smsRequestTemplate.getTemplateContent(); |
| | | |
| | | List<MessageRecord> messageRecordList = new ArrayList<>(); |
| | | List<Temp> tempList = new ArrayList<>(); |
| | | // 合并数据 |
| | | for (List<String> list : templateContent) { |
| | | Temp temp = new Temp(); |
| | | temp.setPhone(list.get(1)); |
| | | temp.setReservoirCode(list.get(0)); |
| | | temp.setReservoirName(list.get(2)); |
| | | temp.setAlarmRecordId(list.get(list.size() - 1)); |
| | | // 放入临时集合 |
| | | tempList.add(temp); |
| | | } |
| | | |
| | | // 按手机号分组 |
| | | Map<String, List<Temp>> listMap = tempList.stream().collect(Collectors.groupingBy(Temp::getPhone)); |
| | | |
| | | |
| | | listMap.forEach((phone, temps) -> { |
| | | MessageRecord messageRecord = new MessageRecord(); |
| | | |
| | | messageRecord.setTheme(alarmRule.getRuleName()); |
| | | messageRecord.setSender(AuthUtil.getUserId().toString()); |
| | | messageRecord.setSource("智能告警"); |
| | | messageRecord.setStatus(0); |
| | | messageRecord.setRecipient(phone); |
| | | List<String> contentList = new ArrayList<>(); |
| | | //因为只能按编号分组,名称会有重复,所以拿第一条数据的名称就行 |
| | | temps.forEach(info -> { |
| | | //把水库加进集合 |
| | | contentList.add(info.getReservoirName()); |
| | | }); |
| | | String contentListStr = String.join(",", contentList); |
| | | //需要填充的数据 |
| | | List<String> fillList = new ArrayList<>(); |
| | | fillList.add(contentListStr); |
| | | String sendContent = contentConvert(smsTemplate.getContent(), fillList); |
| | | messageRecord.setContent(sendContent); |
| | | messageRecordList.add(messageRecord); |
| | | }); |
| | | |
| | | // 保存告警记录详情信息 |
| | | if (smsRequestTemplate.getIsSendStation()) { |
| | | saveMessageRecord(messageRecordList); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | // 返回 |
| | | return map; |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 把填充内容补充到模板中 |
| | | * |
| | | * @param templateString 模板 |
| | | * @param strList 填充内容集合 |
| | | * @return |
| | | */ |
| | | private String contentConvert(String templateString, List<String> strList) { |
| | | |
| | | //把{}转换成%s |
| | | String formatTemplate = templateString.replaceAll("\\{.+?\\}", "%s"); |
| | | String content = String.format(formatTemplate, strList.toArray()); |
| | | return content; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存站内信记录信息 |
| | | * |
| | | * @param messageRecordList |
| | | */ |
| | | public void saveMessageRecord(List<MessageRecord> messageRecordList) { |
| | |
| | | |
| | | /** |
| | | * 新增测试信息 |
| | | * |
| | | * @param messageRecordList |
| | | */ |
| | | private void addSendMsgTest(List<MessageRecord> messageRecordList) { |
| | |
| | | |
| | | /** |
| | | * 创建告警外呼任务 |
| | | * |
| | | * @param smsRequestTemplate |
| | | * @return |
| | | */ |
| | |
| | | // 创建外呼任务 |
| | | return outCallClient.createOutCallTaskByAlarm(map); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandle(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syDataMissingList, true, adCode, true, uuid); |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syDataMissingList, false, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandle(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.bxDataMissingList, true, adCode, true, uuid); |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandle(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.bxDataMissingList, false, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | return "近1h变形值大于10cm以上告警"; |
| | | } |
| | | |
| | | /** |
| | | * 渗流量一日大于5L小于8L,连续3日增加 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySlOver5Less8Handle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 渗流量一日大于8L小于10L,连续3日增加 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySlOver8Less10Handle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 渗流量一日大于10L,连续3日增加 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySlOver10Handle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | |
| | | return "渗流量一日大于5L小于8L,连续3日增加告警"; |
| | | } |
| | | |
| | | /** |
| | | * 视频离线 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String videoOfflineHandle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sl_value_change_api); |
| | | JSONArray data = filterData(ztData,"3"); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.videoOfflineHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, false, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "视频信息缺失告警"; |
| | | } |
| | | |
| | | private JSONArray filterData(JSONArray ztData, String level) { |
| | | |
| | |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | strategyMap.put("damSafetyHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetyHandle(arg1, arg2)); |
| | | //20 |
| | | strategyMap.put("damSafetySyHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetySyHandle(arg1, arg2)); |
| | | //21 |
| | | //21 渗压信息接收不到 |
| | | strategyMap.put("damSafetySyNoneHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetySyNoneHandle(arg1, arg2)); |
| | | //22 |
| | | //22 渗流信息接收不到 |
| | | strategyMap.put("damSafetySlNoneHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetySlNoneHandle(arg1, arg2)); |
| | | //23 |
| | | //23 位移信息接收不到 |
| | | strategyMap.put("damSafetyWyNoneHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetyWyNoneHandle(arg1, arg2)); |
| | | //24 |
| | | //24 渗压资料缺失 |
| | | strategyMap.put("damSafetySyDataMissingHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyDataMissingHandle(arg1,arg2)); |
| | | //25 |
| | | //25 变形资料缺失 |
| | | strategyMap.put("damSafetyBxDataMissingHandle",(arg1,arg2)->noticeStrategyImpl.damSafetyBxDataMissingHandle(arg1,arg2)); |
| | | //26 水位低于管底高程 |
| | | strategyMap.put("damSafetySyLessThenPipeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyLessThenPipeHandle(arg1,arg2)); |
| | |
| | | strategyMap.put("damSafetySlOver8Less10Handle",(arg1,arg2)->noticeStrategyImpl.damSafetySlOver8Less10Handle(arg1,arg2)); |
| | | //40 渗流量一日大于10L以上,连续3日增加 |
| | | strategyMap.put("damSafetySlOver10Handle",(arg1,arg2)->noticeStrategyImpl.damSafetySlOver10Handle(arg1,arg2)); |
| | | //41 视频信息接收不到 |
| | | strategyMap.put("videoOfflineHandle",(arg1,arg2)->noticeStrategyImpl.videoOfflineHandle(arg1,arg2)); |
| | | } |
| | | |
| | | /** |
| | |
| | | Temp temp = new Temp(); |
| | | temp.setPhone(list.get(1)); |
| | | temp.setReservoirCode(list.get(0)); |
| | | temp.setReservoirName(list.get(3)); |
| | | temp.setReservoirName(list.get(2)); |
| | | temp.setAlarmRecordId(list.get(list.size()-1)); |
| | | // 放入临时集合 |
| | | tempList.add(temp); |
| | |
| | | */ |
| | | private String reservoirName; |
| | | |
| | | //测站名称 |
| | | private String cdNm; |
| | | |
| | | /** |
| | | * 告警记录id |
| | | */ |
| | |
| | | public ReturnT<String> damSafetySyNoneHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("监测数据缺失","","damSafetySyNoneHandle"); |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗压监测数据缺失","","damSafetySyNoneHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetySlNoneHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("监测数据缺失","","damSafetySlNoneHandle"); |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流监测数据缺失","","damSafetySlNoneHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | public ReturnT<String> damSafetyWyNoneHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("监测数据缺失","","damSafetyWyNoneHandle"); |
| | | noticeClient.createAlarmNoticeTaskJobHandler("位移监测数据缺失","","damSafetyWyNoneHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略41: 视频告警-视频信息接收不到-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySlOver10Handle") |
| | | public ReturnT<String> videoOfflineHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("视频信息接收不到","","videoOfflineHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | } |