| | |
| | | add("type"); |
| | | add("diff_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略34: 变形值大于20mm小于50mm |
| | | */ |
| | | public static List<String> wyOver2Less5 = new ArrayList<String>() |
| | | {{ |
| | | add("city_nm"); |
| | | add("county_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("direction"); |
| | | add("val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略35: 变形值大于50mm小于100mm |
| | | */ |
| | | public static List<String> wyOver5Less10 = new ArrayList<String>() |
| | | {{ |
| | | add("city_nm"); |
| | | add("county_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("direction"); |
| | | add("val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略36: 变形值大于100mm |
| | | */ |
| | | public static List<String> wyOver10 = new ArrayList<String>() |
| | | {{ |
| | | add("city_nm"); |
| | | add("county_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("direction"); |
| | | add("val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略36: 变形值大于100mm |
| | | */ |
| | | public static List<String> wy1hChangeOver10 = new ArrayList<String>() |
| | | {{ |
| | | add("city_nm"); |
| | | add("county_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("direction"); |
| | | add("val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略36: 变形值大于100mm |
| | | */ |
| | | public static List<String> slOverLess = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("value"); |
| | | }}; |
| | | } |
| | |
| | | public static final String alarm_db_sy_rz_change_api = "/services/1234567890ABCDEFGHIJKLMN/press/bf/alarm/api"; |
| | | |
| | | /** |
| | | * 31. 大坝安全监测告警-近1h水位陡降 |
| | | * 33. 大坝安全监测告警-近1h水位陡降 |
| | | */ |
| | | public static final String alarm_db_sy_rz_1h_change_api = "/services/1234567890ABCDEFGHIJKLMN/sy/alarm/recent/api"; |
| | | |
| | | /** |
| | | * 34. 大坝安全监测告警-位移变形值区间 |
| | | */ |
| | | public static final String alarm_db_wy_value_api = "/services/1234567890ABCDEFGHIJKLMN/wy/alarm/api"; |
| | | |
| | | /** |
| | | * 37. 大坝安全监测告警-近1h变形值陡变 |
| | | */ |
| | | public static final String alarm_db_wy_value_1h_change_over_10_api = "/services/1234567890ABCDEFGHIJKLMN/wy/alarm/recent/api"; |
| | | |
| | | /** |
| | | * 38. 大坝安全监测告警-渗流量变化 |
| | | */ |
| | | public static final String alarm_db_sl_value_change_api = "/services/1234567890ABCDEFGHIJKLMN/sl/alarm/api"; |
| | | |
| | | } |
| | |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 策略34 短信-----变形值大于20mm小于50mm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetyWyOver2Less5HandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 站内信----- 变形值大于20mm小于50mm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetyWyOver2Less5HandleStation(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()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 策略35 短信-----变形值大于50mm小于100mm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetyWyOver5Less10HandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 站内信----- 变形值大于50mm小于100mm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetyWyOver5Less10HandleStation(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()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 短信-----变形值大于100mm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetyWyOver10HandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 站内信----- 变形值大于100mm |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetyWyOver10HandleStation(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()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 策略34 短信-----近1h变形值大于10cm以上 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetyWy1hChangeOver10HandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 站内信----- 近1h变形值大于10cm以上 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetyWy1hChangeOver10HandleStation(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()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 策略34 短信-----渗流值 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySlOverLessHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34 站内信----- 渗流值 |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySlOverLessHandleStation(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()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | } |
| | |
| | | package cn.gistack.alerts.notice.service.impl; |
| | | |
| | | import cn.com.flaginfo.sdk.cmc.api.result.ComResult; |
| | | import cn.com.flaginfo.sdk.cmc.api.sms.dynsend.DynSMSSendDataResult; |
| | | import cn.com.flaginfo.sdk.cmc.api.sms.send.SMSSendRequest; |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRecord; |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRecordDetail; |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRuleDetail; |
| | | import cn.gistack.alerts.alarmRule.service.AlarmRecordService; |
| | | import cn.gistack.alerts.alarmRule.vo.AlarmRecordDetailVO; |
| | | import cn.gistack.alerts.notice.constant.ZnwhColumnConstant; |
| | | import cn.gistack.alerts.notice.constant.ZtApiUrlConstant; |
| | | import cn.gistack.alerts.notice.constant.ZtConfigConstant; |
| | | import cn.gistack.alerts.notice.enums.PersonEnum; |
| | | import cn.gistack.alerts.notice.util.FormatUtil; |
| | | import cn.gistack.alerts.push.service.IPushService; |
| | | import cn.gistack.alerts.sms.entity.SmsRecord; |
| | | import cn.gistack.alerts.sms.entity.SmsResult; |
| | | import cn.gistack.alerts.sms.entity.SmsTemplate; |
| | | import cn.gistack.alerts.sms.service.ISmsTemplateService; |
| | | import cn.gistack.alerts.sms.vo.SmsRequestTemplate; |
| | | import cn.gistack.alerts.sms.vo.Temp; |
| | | import cn.gistack.alerts.sse.server.SSEServer; |
| | | import cn.gistack.common.utils.SpringContextUtil; |
| | | import cn.gistack.sm.intelligentCall.feign.OutCallClient; |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.google.common.collect.Lists; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Component |
| | | @Slf4j |
| | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存站内信记录(水库合并) |
| | | * @param smsRequestTemplate |
| | | * @param alarmRule |
| | | * @return |
| | | */ |
| | | public Map<String, Object> saveInStationInfoMerge(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(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<>(); |
| | | // 设置站内信记录信息 |
| | | 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); |
| | | |
| | | // 删除 最后一个 告警记录id |
| | | list.remove(list.size() - 1); |
| | | // 删除 0 水库编码 |
| | | list.remove(0); |
| | | |
| | | // 设置手机号 |
| | | // messageRecord.setRecipient(list.get(0)); |
| | | messageRecord.setContent(format); |
| | | // 放入集合 |
| | | messageRecordList.add(messageRecord); |
| | | |
| | | } |
| | | }); |
| | | |
| | | // 保存告警记录详情信息 |
| | | if (smsRequestTemplate.getIsSendStation()) { |
| | | saveMessageRecord(messageRecordList); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | // 返回 |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存站内信记录信息 |
| | | * @param messageRecordList |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | return "近1h水位陡降告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 变形值大于20mm小于50mm |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetyWyOver2Less5Handle(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_wy_value_api); |
| | | |
| | | JSONArray data = judgeDirection(ztData, "1"); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | 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.damSafetyWyOver2Less5HandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wyOver2Less5, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetyWyOver2Less5HandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wyOver2Less5, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "变形值大于2cm小于5cm告警"; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 变形值大于50mm小于100mm |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetyWyOver5Less10Handle(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_wy_value_api); |
| | | |
| | | JSONArray data = judgeDirection(ztData, "2"); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | 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.damSafetyWyOver5Less10HandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wyOver5Less10, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetyWyOver5Less10HandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wyOver5Less10, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "变形值大于5cm小于10cm告警"; |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 近1h变形值大于10cm以上 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetyWyOver10Handle(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_wy_value_1h_change_over_10_api); |
| | | JSONArray data = judgeDirection(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.damSafetyWyOver10HandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wyOver10, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetyWyOver10HandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wyOver10, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "变形值大于10cm告警"; |
| | | } |
| | | |
| | | /** |
| | | * 近1h变形值大于10cm以上 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetyWy1hChangeOver10Handle(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_wy_value_1h_change_over_10_api); |
| | | JSONArray data = judgeDirectionV2(ztData); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | 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.damSafetyWy1hChangeOver10HandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetyWy1hChangeOver10HandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | return "近1h变形值大于10cm以上告警"; |
| | | } |
| | | |
| | | public String damSafetySlOver5Less8Handle(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,"1"); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | 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.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "渗流量一日大于5L小于8L,连续3日增加告警"; |
| | | } |
| | | |
| | | |
| | | public String damSafetySlOver8Less10Handle(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,"2"); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | 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.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "渗流量一日大于5L小于8L,连续3日增加告警"; |
| | | } |
| | | |
| | | |
| | | |
| | | public String damSafetySlOver10Handle(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.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "渗流量一日大于5L小于8L,连续3日增加告警"; |
| | | } |
| | | |
| | | |
| | | |
| | | private JSONArray filterData(JSONArray ztData, String level) { |
| | | |
| | | JSONArray array = new JSONArray(); |
| | | for (int i = 0; i < ztData.size(); i++) { |
| | | JSONObject jsonObject = ztData.getJSONObject(i); |
| | | String dataLevel = jsonObject.getString("level"); |
| | | |
| | | if (dataLevel.equals(level)) { |
| | | array.add(jsonObject); |
| | | } |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | /** |
| | | * 判断方向 |
| | | * |
| | | * @param ztData |
| | | * @return |
| | | */ |
| | | private JSONArray judgeDirectionV2(JSONArray ztData) { |
| | | JSONArray array = new JSONArray(); |
| | | for (int i = 0; i < ztData.size(); i++) { |
| | | JSONObject jsonObject = ztData.getJSONObject(i); |
| | | //上下游方向 |
| | | Double diffDe = jsonObject.getDouble("diff_de"); |
| | | //左右岸方向 |
| | | Double diffDn = jsonObject.getDouble("diff_dn"); |
| | | //垂直 |
| | | Double diffDu = jsonObject.getDouble("diff_du"); |
| | | |
| | | String direction = ""; |
| | | String val = ""; |
| | | //近1h变形值大于10cm以上 |
| | | if (diffDe > 100) { |
| | | direction = "上下游方向"; |
| | | val = diffDe.toString(); |
| | | } else if (diffDn > 100) { |
| | | direction = "左右岸方向"; |
| | | val = diffDn.toString(); |
| | | } else if (diffDu > 100) { |
| | | direction = "垂直"; |
| | | val = diffDu.toString(); |
| | | } |
| | | |
| | | jsonObject.put("direction", direction); |
| | | jsonObject.put("val", val); |
| | | array.add(jsonObject); |
| | | |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断方向 |
| | | * |
| | | * @param ztData |
| | | * @return |
| | | */ |
| | | private JSONArray judgeDirection(JSONArray ztData, String level) { |
| | | JSONArray array = new JSONArray(); |
| | | for (int i = 0; i < ztData.size(); i++) { |
| | | JSONObject jsonObject = ztData.getJSONObject(i); |
| | | String dataLevel = jsonObject.getString("level"); |
| | | //上下游方向 |
| | | Double deVal = jsonObject.getDouble("de_val"); |
| | | //左右岸方向 |
| | | Double dnVal = jsonObject.getDouble("dn_val"); |
| | | //垂直 |
| | | Double duValue = jsonObject.getDouble("du_value"); |
| | | |
| | | String direction = ""; |
| | | String val = ""; |
| | | |
| | | if (dataLevel.equals(level)) { |
| | | if (level.equals("1")) { |
| | | //变形值大于20mm小于50mm |
| | | if (20 < deVal && deVal < 50) { |
| | | direction = "上下游方向"; |
| | | val = deVal.toString(); |
| | | } else if (20 < dnVal && dnVal < 50) { |
| | | direction = "左右岸方向"; |
| | | val = dnVal.toString(); |
| | | } else if (20 < duValue && duValue < 50) { |
| | | direction = "垂直"; |
| | | val = duValue.toString(); |
| | | } |
| | | } else if (level.equals("2")) { |
| | | //变形值大于50mm小于100mm |
| | | if (50 < deVal && deVal < 100) { |
| | | direction = "上下游方向"; |
| | | val = deVal.toString(); |
| | | } else if (50 < dnVal && dnVal < 100) { |
| | | direction = "左右岸方向"; |
| | | val = dnVal.toString(); |
| | | } else if (50 < duValue && duValue < 100) { |
| | | direction = "垂直"; |
| | | val = duValue.toString(); |
| | | } |
| | | } else if (level.equals("3")) { |
| | | //变形值大于100mm |
| | | |
| | | if (deVal > 100) { |
| | | direction = "上下游方向"; |
| | | val = deVal.toString(); |
| | | } else if (dnVal > 100) { |
| | | direction = "左右岸方向"; |
| | | val = dnVal.toString(); |
| | | } else if (duValue > 100) { |
| | | direction = "垂直"; |
| | | val = duValue.toString(); |
| | | } |
| | | } |
| | | |
| | | jsonObject.put("direction", direction); |
| | | jsonObject.put("val", val); |
| | | array.add(jsonObject); |
| | | } |
| | | |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | |
| | | private JSONArray judgeType(JSONArray ztData) { |
| | | JSONArray array = new JSONArray(); |
| | | for (int i = 0; i < ztData.size(); i++) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | strategyMap.put("damSafetySyOrangeChangeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyOrangeChangeHandle(arg1,arg2)); |
| | | //32 渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米 |
| | | strategyMap.put("damSafetySyRedChangeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyRedChangeHandle(arg1,arg2)); |
| | | //32 近1h水位陡降 |
| | | //33 近1h水位陡降 |
| | | strategyMap.put("damSafetySyRz1hChangeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyRz1hChangeHandle(arg1,arg2)); |
| | | //34 变形值大于20mm小于50mm |
| | | strategyMap.put("damSafetyWyOver2Less5Handle",(arg1,arg2)->noticeStrategyImpl.damSafetyWyOver2Less5Handle(arg1,arg2)); |
| | | //35 变形值大于50mm小于100mm |
| | | strategyMap.put("damSafetyWyOver5Less10Handle",(arg1,arg2)->noticeStrategyImpl.damSafetyWyOver5Less10Handle(arg1,arg2)); |
| | | //36 变形值大于100mm |
| | | strategyMap.put("damSafetyWyOver10Handle",(arg1,arg2)->noticeStrategyImpl.damSafetyWyOver10Handle(arg1,arg2)); |
| | | //37 近1h变形值大于10cm以上 |
| | | strategyMap.put("damSafetyWy1hChangeOver10Handle",(arg1,arg2)->noticeStrategyImpl.damSafetyWy1hChangeOver10Handle(arg1,arg2)); |
| | | //38 渗流量一日大于5L小于8L,连续3日增加 |
| | | strategyMap.put("damSafetySlOver5Less8Handle",(arg1,arg2)->noticeStrategyImpl.damSafetySlOver5Less8Handle(arg1,arg2)); |
| | | //39 渗流量一日大于8L小于10L,连续3日增加 |
| | | strategyMap.put("damSafetySlOver8Less10Handle",(arg1,arg2)->noticeStrategyImpl.damSafetySlOver8Less10Handle(arg1,arg2)); |
| | | //40 渗流量一日大于10L以上,连续3日增加 |
| | | strategyMap.put("damSafetySlOver10Handle",(arg1,arg2)->noticeStrategyImpl.damSafetySlOver10Handle(arg1,arg2)); |
| | | } |
| | | |
| | | /** |
| | |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略34: 大坝安全监测告警-变形值大于2cm小于5cm-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetyWyOver2Less5Handle") |
| | | public ReturnT<String> damSafetyWyOver2Less5Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形值大于2cm小于5cm","","damSafetyWyOver2Less5Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略35: 大坝安全监测告警-变形值大于5cm小于10cm-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetyWyOver5Less10Handle") |
| | | public ReturnT<String> damSafetyWyOver5Less10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形值大于5cm小于10cm","","damSafetyWyOver5Less10Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略36: 大坝安全监测告警-变形值大于10cm以上-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetyWyOver10Handle") |
| | | public ReturnT<String> damSafetyWyOver10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形值大于10cm以上","","damSafetyWyOver10Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略37: 大坝安全监测告警-近1h变形值大于10cm以上-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetyWy1hChangeOver10Handle") |
| | | public ReturnT<String> damSafetyWy1hChangeOver10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("近1h变形值大于10cm以上","","damSafetyWy1hChangeOver10Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略38: 大坝安全监测告警-渗流量一日大于5L小于8L,连续3日增加-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySlOver5Less8Handle") |
| | | public ReturnT<String> damSafetySlOver5Less8Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流量一日大于5L小于8L连续3日增加","","damSafetySlOver5Less8Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略39: 大坝安全监测告警-渗流量一日大于8L小于10L,连续3日增加-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySlOver8Less10Handle") |
| | | public ReturnT<String> damSafetySlOver8Less10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流量一日大于8L小于10L连续3日增加","","damSafetySlOver8Less10Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略40: 大坝安全监测告警-渗流量一日大于10L以上,连续3日增加-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySlOver10Handle") |
| | | public ReturnT<String> damSafetySlOver10Handle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗流量一日大于10L连续3日增加","","damSafetySlOver10Handle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | |
| | | } |