| | |
| | | |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRecord; |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRuleDetail; |
| | | import cn.gistack.alerts.notice.constant.ZtApiDataColumnConstant; |
| | | import cn.gistack.alerts.notice.constant.ZtApiUrlConstant; |
| | | import cn.gistack.alerts.notice.enums.DangerEnum; |
| | | import cn.gistack.alerts.sms.service.SmsService; |
| | | import cn.gistack.alerts.sms.vo.SmsRequestTemplate; |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import cn.gistack.sm.intelligentCall.feign.OutCallClient; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalTime; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | @Component |
| | | public class AsyncNoticeHandle { |
| | |
| | | |
| | | |
| | | /** |
| | | * 1.水位信息接收不到 |
| | | * @param alarmRule |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param adCode |
| | | * @param isSendStation |
| | | * 1.水位信息接收不到 2. 水位数据异常 需要合并水库的 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @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); |
| | | public void waterInfoNotHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation) { |
| | | String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterInfoNotList,false,adCode,uuid); |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 遍历 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 调用短信服务 |
| | | smsService.sendMergeSignMsg(smsRequestTemplate); |
| | | } |
| | | |
| | | if (!isTimeSend()) return; |
| | | |
| | | /** |
| | | * 策略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); |
| | | } |
| | | |
| | | /** |
| | | * 3.水位超低于死水位 |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param alarmRule |
| | | * @param adCode |
| | | * @param isSendStation |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterLessDeadHandle(String templateId, String uuid, AlarmRule alarmRule, String adCode, boolean isSendStation) { |
| | | public Map<String, Object> waterLessDeadHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_diff_dead_z_api); |
| | | // 只发送站内信 |
| | | SmsRequestTemplate smsRequestTemplate = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterLessDeadList,true,adCode,uuid); |
| | | String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接内容后面的联系方式,当前模板县水利部人员姓名电话 |
| | | if (smsRequestTemplate.getPersonVOList().size()>0) { |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | // 遍历,拼接县水利部人员电话 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 后面依次拼接市县水利部门人员姓名电话 |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n死水位:{}米\n超低于死水位:{}米\n", |
| | | list.get(9), |
| | | String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(10))), |
| | | list.get(10) |
| | | ); |
| | | list.remove(10); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | |
| | | if (!isTimeSend()) return map; |
| | | // 调用短信服务 |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 返回 |
| | |
| | | |
| | | |
| | | /** |
| | | * 5.水位接近汛限告警 |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param alarmRule |
| | | * @param adCode |
| | | * 5.水位接近汛限告警--发送站内信 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | */ |
| | | @Async |
| | | public void waterComeOverHandle(String templateId, String uuid, AlarmRule alarmRule, String adCode) { |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_diff_dead_z_api); |
| | | // 只发送站内信 |
| | | SmsRequestTemplate smsRequestTemplate = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterLessDeadList,true,null,uuid); |
| | | public void waterComeOverHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation) { |
| | | String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接内容后面的联系方式,当前模板县水利部人员姓名电话 |
| | | if (smsRequestTemplate.getPersonVOList().size()>0) { |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | // 遍历,拼接县水利部人员电话 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 后面依次拼接 巡查责任人姓名,技术责任人姓名,市县水利部门人员姓名电话(暂时不要) |
| | | noticeHandle.addPatrolTechnologyInfo(list); |
| | | // 市县水利部门人员姓名电话(暂时不要) |
| | | // list.add("测试:13112341234"); |
| | | // 后面依次拼接 巡查责任人姓名,技术责任人姓名, |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n汛限水位:{}米\n接近汛限水位:{}米\n", |
| | | list.get(9), list.get(13), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(13))) |
| | | ); |
| | | list.remove(13); |
| | | |
| | | // 保存告警记录信息 |
| | | // AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | // if (null != alarmRecord) { |
| | | // list.add(alarmRecord.getId().toString()); |
| | | list.add("999"); |
| | | // } |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | |
| | | if(!isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 6.水位初次超汛限告警 处理 |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param alarmRule |
| | | * @param adCode |
| | | * @param isSendStation 是否发送站内信 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterFirstOverHandle(String templateId, String uuid, AlarmRule alarmRule,String adCode,Boolean isSendStation) { |
| | | public Map<String, Object> waterFirstOverHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.over_z_res_api); |
| | | String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterFirstOverList,true,adCode,uuid); |
| | | smsRequestTemplate.setIsSendStation(isSendStation); |
| | | |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size()>0) { |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次拼接巡查责任人,技术责任人姓名 |
| | | noticeHandle.addPatrolTechnologyInfo(list); |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n汛限水位:{}米\n超汛限水位:{}米\n", |
| | | list.get(9), list.get(11), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(11))) |
| | | ); |
| | | list.remove(11); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | |
| | | if (!isTimeSend()) return map; |
| | | |
| | | // 调用短信服务 |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | return map; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 10.水位超设计洪水位告警处理 |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param alarmRule |
| | | * 7.1 水位小幅超汛限告警(发松给 水库技术责任人、巡查责任人) |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @param uuid 变量 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterMoreDesignHandle(String templateId, String uuid, AlarmRule alarmRule) { |
| | | public Map<String, Object> waterSmallScaleOverHandle1(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.over_des_rz_warn_api); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, templateId, alarmRule, ZtApiDataColumnConstant.waterMoreDesignList, true, null,uuid); |
| | | = noticeHandle.getSendSmsTemplate(ztData, 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); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n汛限水位:{}米\n超汛限水位:{}米\n", |
| | | list.get(9), list.get(12), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(12))) |
| | | ); |
| | | list.remove(12); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | // 调用短信服务 |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 7.2 水位小幅超汛限告警(发送给 县级水利部门有关人员、主管部门责任人) |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterSmallScaleOverHandle2(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次拼接巡查责任人,技术责任人姓名联系电话 |
| | | noticeHandle.addPatrolTechnologyInfo(list, true); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | // noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n汛限水位:{}米\n超汛限水位:{}米\n", |
| | | list.get(9), list.get(12), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(12))) |
| | | ); |
| | | list.remove(12); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | // 调用短信服务 |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 8.1 水位大幅超汛限告警(发松给 水库技术责任人、巡查责任人) |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterBigScaleOverHandle1(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, 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); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n汛限水位:{}米\n超汛限水位:{}米\n", |
| | | list.get(9), list.get(13), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(13))) |
| | | ); |
| | | list.remove(13); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | // 调用短信服务 |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 8.2 水位大幅超汛限告警(发送给 县级水利部门有关人员、主管部门责任人) |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterBigScaleOverHandle2(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次拼接巡查责任人,技术责任人姓名联系电话 |
| | | noticeHandle.addPatrolTechnologyInfo(list, true); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n汛限水位:{}米\n超汛限水位:{}米\n", |
| | | list.get(9), list.get(12), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(12))) |
| | | ); |
| | | list.remove(12); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | // 调用短信服务 |
| | | // map = smsService.sendSignMsg(smsRequestTemplate); |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略9.1: 水位接近设计洪水位告警-短信 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterComeDesignHandleBySms(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 外呼告警信息 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> outCallHandleCall(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | // noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | String remark = StringUtil.format("降雨:{}\n", |
| | | list.get(6) + "毫米" |
| | | ); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | |
| | | if(!isTimeSend()) return map; |
| | | List<String> list = noticeHandle.createOutCallTaskByAlarm(smsRequestTemplate); |
| | | map.put("list", list); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略9.3: 水位接近设计洪水位告警-站内信 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public void waterComeDesignHandleStation(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行政责任人,主管部门责任人,技术责任人,巡查责任人信息(姓名,联系电话) |
| | | noticeHandle.addWaterMoreDesignPatrolTechnologyInfo(list, "1,2,4,5"); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | |
| | | if (!isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 10.1 水位超设计洪水位告警处理--短信 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterMoreDesignHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | |
| | | String remark = StringUtil.format("水位:{}\n设计洪水位:{}米\n超设计洪水位:{}米\n", |
| | | list.get(9), list.get(13), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(13))) |
| | | ); |
| | | list.remove(13); |
| | | |
| | | // System.out.println(remark); |
| | | // 依次添加行政责任人,主管部门责任人,技术责任人,巡查责任人信息(姓名,联系电话) |
| | | noticeHandle.addWaterMoreDesignPatrolTechnologyInfo(list, "1,2,4,5"); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 10.水位超设计洪水位告警处理 - 电话 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterMoreDesignHandleCall(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 11.1 水位超校核洪水位告警--短信 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterMoreCheckHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | // 依次添加行政责任人,主管部门责任人,技术责任人,巡查责任人信息(姓名,联系电话) |
| | | noticeHandle.addWaterMoreDesignPatrolTechnologyInfo(list, "1,2,4,5"); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("水位:{}\n校核洪水位:{}米\n{}米\n", |
| | | list.get(9), list.get(10), list.get(11) |
| | | ); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 11.2 水位超校核洪水位告警 - 电话 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterMoreCheckHandleCall(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 12 近1h水位陡升--短信 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterComeOneHourUpHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // // 依次添加行巡查责任人,技术责任人信息,主管部门责任人(姓名) |
| | | // noticeHandle.addPatrolTechnologyInfoNew(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("近1h水位陡升:{}\n", |
| | | list.get(10) |
| | | ); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 13 近1h水位陡降--短信 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterComeOneHourDownHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, 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); |
| | | |
| | | String remark = StringUtil.format("近1h水位陡降:{}\n", |
| | | list.get(10) |
| | | ); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略15: 已降大雨告警 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> alreadyHeavyRainHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, 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); |
| | | |
| | | String remark = list.get(9); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略16: 已降暴雨告警 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> alreadyRainstormHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, 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); |
| | | |
| | | String remark = list.get(9); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略18: 6小时降雨告警--短信 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> sixHourRainHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行政责任人,主管部门责任人,技术责任人,巡查责任人信息(姓名,联系电话) |
| | | // noticeHandle.addWaterMoreDesignPatrolTechnologyInfo(list, "1,2,4,5"); |
| | | // 主管部门责任人,技术责任人,巡查责任人信息 2024-05-29修改 |
| | | noticeHandle.addWaterMoreDesignPatrolTechnologyInfoNew(list, "2,4,5"); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("降雨:{}\n", |
| | | list.get(6) + "毫米" |
| | | ); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略18: 6小时降雨告警--电话 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> sixHourRainHandleByCall(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (!isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略19: 大坝安全监测告警-短信 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @param isDay 是否每日发送,day |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetyHandle(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid, |
| | | String isDay) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | 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()); |
| | | } |
| | | } |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | map = smsService.sendSignMsgMergeCd(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | public void damSafetySyHandle(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray ztData, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, 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()); |
| | | } |
| | | } |
| | | |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | //保存记录 |
| | | public void damSafetySyNoneHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray ztData, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | |
| | | 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()); |
| | | } |
| | | } |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 需要合并水库保存站内信记录信息 |
| | | noticeHandle.saveInStationInfoMerge(smsRequestTemplate, alarmRule); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | public Map<String, Object> damSafetyHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | |
| | | 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()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | map = smsService.sendSignMsgMergeCd(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | |
| | | } |
| | | |
| | | |
| | | //渗压资料缺失 |
| | | public Map<String, Object> damSafetySyDataMissingHandle(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | |
| | | 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()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略26 短信-----渗压水位低于管底高程 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyLessThenPipeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | 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()) { |
| | | |
| | | String remark = StringUtil.format("渗压水位:{}\n管底高程:{}\n", |
| | | list.get(3), String.format("%.2f", Double.valueOf(list.get(11)) + Double.valueOf(list.get(12))) |
| | | ); |
| | | // System.out.println(remark); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略26 站内信-----渗压水位低于管底高程 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyLessThenPipeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | String remark = StringUtil.format("渗压水位:{}\n管底高程:{}\n", |
| | | list.get(3), String.format("%.2f", Double.valueOf(list.get(11)) + Double.valueOf(list.get(12))) |
| | | ); |
| | | // System.out.println(remark); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略27 短信-----渗压水位高于管口高程 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyHigherThenNozzleHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | 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()) { |
| | | |
| | | String remark = StringUtil.format("渗压水位:{}\n管口高程:{}\n", |
| | | list.get(11), list.get(12) |
| | | ); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | // map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略26 站内信-----渗压水位高于管口高程 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyHigherThenNozzleHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | String remark = StringUtil.format("渗压水位:{}\n管口高程:{}\n", |
| | | list.get(11), list.get(12) |
| | | ); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 策略28 短信-----渗压水位高于坝顶高程 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyHigherThenBdElevationHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | 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()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略28 站内信-----渗压水位高于坝顶高程 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyHigherThenBdElevationHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | String remark = StringUtil.format("渗压水位:{}\n坝顶高程:{}\n", |
| | | list.get(11), list.get(13) |
| | | ); |
| | | list.remove(13); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略29 短信-----渗压水位高于库水位 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyHigherThenWaterLevelHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | 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()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略29 站内信-----渗压水位高于库水位 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyHigherThenWaterLevelHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | |
| | | String remark = StringUtil.format("渗压水位:{}\n库水位:{}\n", |
| | | list.get(11), list.get(12) |
| | | ); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略30 短信-----水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyYellowChangeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | 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()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略30 站内信-----水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyYellowChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | String remark = StringUtil.format("一日测值:{}\n二日测值:{}\n五日测值:{}\n十日测值:{}\n三十日测值:{}\n" + |
| | | "二日变幅:{}\n五日变幅:{}\n十日变幅:{}\n三十日变幅:{}\n", |
| | | list.get(13), list.get(14), list.get(15), list.get(16), list.get(17), |
| | | list.get(18), list.get(19), list.get(20), list.get(21) |
| | | ); |
| | | // System.out.println(remark); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略31 短信-----渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyOrangeChangeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | 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()) { |
| | | // // 保存告警记录信息 |
| | | // AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | // if (null != alarmRecord) { |
| | | // list.add(alarmRecord.getId().toString()); |
| | | // } |
| | | // } |
| | | 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()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略31 站内信-----渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyOrangeChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | 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()); |
| | | // } |
| | | // } |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list, false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | |
| | | String remark = StringUtil.format("一日测值:{}\n二日测值:{}\n五日测值:{}\n十日测值:{}\n三十日测值:{}\n" + |
| | | "二日变幅:{}\n五日变幅:{}\n十日变幅:{}\n三十日变幅:{}\n", |
| | | list.get(14), list.get(15), list.get(16), list.get(17), list.get(18), |
| | | list.get(19), list.get(20), list.get(21), list.get(22) |
| | | ); |
| | | list.remove(14); |
| | | list.remove(15); |
| | | list.remove(16); |
| | | list.remove(17); |
| | | list.remove(18); |
| | | list.remove(19); |
| | | list.remove(20); |
| | | list.remove(21); |
| | | list.remove(22); |
| | | // System.out.println(remark); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略32 短信-----渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyRedChangeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | 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()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略32 站内信-----渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyRedChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | 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); |
| | | |
| | | String remark = StringUtil.format("一日测值:{}\n二日测值:{}\n五日测值:{}\n十日测值:{}\n三十日测值:{}\n" + |
| | | "二日变幅:{}\n五日变幅:{}\n十日变幅:{}\n三十日变幅:{}\n", |
| | | list.get(14), list.get(15), list.get(16), list.get(17), list.get(18), |
| | | list.get(19), list.get(20), list.get(21), list.get(22) |
| | | ); |
| | | list.remove(14); |
| | | list.remove(15); |
| | | list.remove(16); |
| | | list.remove(17); |
| | | list.remove(18); |
| | | list.remove(19); |
| | | list.remove(20); |
| | | list.remove(21); |
| | | list.remove(22); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 策略33 短信-----近1h水位陡降 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public Map<String, Object> damSafetySyRz1hChangeHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | 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()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略33 站内信----- 近1h水位陡降 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param data 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void damSafetySyRz1hChangeHandleStation(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | 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); |
| | | |
| | | String remark = StringUtil.format("当前测值:{}\n近1H测值:{}\n{}:{}\n", |
| | | list.get(11), list.get(14), list.get(12), list.get(13) |
| | | ); |
| | | // 不拼接短信内容需要删除 |
| | | list.remove(14); |
| | | System.out.println(remark); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | 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, String isDay) { |
| | | 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()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | 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, String isDay) { |
| | | 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); |
| | | |
| | | String remark = StringUtil.format("上下游:{}\n左右岸:{}\n垂直位移:{}\n", |
| | | list.get(13), list.get(14), list.get(15) |
| | | ); |
| | | list.remove(13); |
| | | list.remove(14); |
| | | list.remove(15); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | 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, String isDay) { |
| | | 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()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | 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, String isDay) { |
| | | 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); |
| | | |
| | | String remark = StringUtil.format("上下游:{}\n左右岸:{}\n垂直位移:{}\n", |
| | | list.get(13), list.get(14), list.get(15) |
| | | ); |
| | | list.remove(13); |
| | | list.remove(14); |
| | | list.remove(15); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | 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, String isDay) { |
| | | 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); |
| | | |
| | | String remark = StringUtil.format("上下游:{}\n左右岸:{}\n垂直位移:{}\n", |
| | | list.get(13), list.get(14), list.get(15) |
| | | ); |
| | | list.remove(13); |
| | | list.remove(14); |
| | | list.remove(15); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | 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, String isDay) { |
| | | 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); |
| | | |
| | | String remark = StringUtil.format("上下游:{}\n左右岸:{}\n垂直位移:{}\n", |
| | | list.get(13), list.get(14), list.get(15) |
| | | ); |
| | | list.remove(13); |
| | | list.remove(14); |
| | | list.remove(15); |
| | | |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | 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, String isDay) { |
| | | 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()); |
| | | } |
| | | } |
| | | |
| | | |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | 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, String isDay) { |
| | | 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()); |
| | | } |
| | | } |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | 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, String isDay) { |
| | | 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()); |
| | | } |
| | | } |
| | | |
| | | |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | 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, String isDay) { |
| | | 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); |
| | | |
| | | String remark = StringUtil.format("当前:{}\n一日:{}\n二日:{}\n", |
| | | list.get(11), list.get(12), list.get(13) |
| | | ); |
| | | list.remove(12); |
| | | list.remove(13); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid, remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | 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, String isDay) { |
| | | 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()); |
| | | } |
| | | } |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | 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, String isDay) { |
| | | 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()); |
| | | } |
| | | } |
| | | |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfoMergeVideo(smsRequestTemplate, alarmRule); |
| | | } |
| | | } |
| | | |
| | | public void damSafetySyDataMissingHandleSms(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray ztData, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid, String isDay) { |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 遍历 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 调用短信服务 |
| | | smsService.sendMergeSignMsg(smsRequestTemplate); |
| | | } |
| | | |
| | | public Map<String, Object> videoOfflineHandleSms(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray ztData, |
| | | List<String> columnList, |
| | | Boolean flag, |
| | | String adCode, |
| | | Boolean isSendStation, |
| | | String uuid, |
| | | String isDay) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | 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()); |
| | | } |
| | | } |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day") || !isTimeSend()) return map; |
| | | map = smsService.sendSignMsgMergeCdVideo(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 策略42 站内信----- 超防洪高水位告警 |
| | | * |
| | | * @param alarmRule 告警规则 |
| | | * @param alarmRuleDetail 告警规则详情 |
| | | * @param ztData 中台数据 |
| | | * @param columnList 需要展示的数据字段 |
| | | * @param flag 是否显示日期 |
| | | * @param adCode 行政区划 |
| | | * @param isSendStation 是否站内信 |
| | | * @param uuid 随机生成id |
| | | * @return |
| | | */ |
| | | public void topLevOfFloAlertHandleStation(AlarmRule alarmRule, |
| | | AlarmRuleDetail alarmRuleDetail, |
| | | JSONArray data, |
| | | List<String> columnList, |
| | | boolean flag, |
| | | String adCode, |
| | | boolean isSendStation, |
| | | String uuid, |
| | | String isDay |
| | | ) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | String remark = StringUtil.format("水位:{}\n防洪高水位:{}米\n超防洪高水位:{}米\n", |
| | | list.get(9), list.get(13), String.format("%.2f", Double.valueOf(list.get(9).replace("米", "")) - Double.valueOf(list.get(13))) |
| | | ); |
| | | list.remove(13); |
| | | System.out.println(remark); |
| | | // 依次添加行政责任人,主管部门责任人,技术责任人,巡查责任人信息(姓名,联系电话) |
| | | noticeHandle.addWaterMoreDesignPatrolTechnologyInfo(list, "1,2,4,5"); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid,remark); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | |
| | | //如果参数是day,表示是每天生成告警,不需要发信息 |
| | | if (isDay.equals("day") || !isTimeSend()) return; |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate, alarmRule); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 是否在时间范围内发送 |
| | | * @return |
| | | */ |
| | | private boolean isTimeSend(){ |
| | | boolean flag = false; |
| | | // 判断时间范围 |
| | | // 开始时间 |
| | | LocalTime startTime = LocalTime.parse("08:00"); |
| | | // 结束时间 |
| | | LocalTime endTime = LocalTime.parse("22:00"); |
| | | // 当前时间 |
| | | LocalTime now = LocalTime.now(); |
| | | // 比较 |
| | | flag = !now.isBefore(startTime) && !now.isAfter(endTime); |
| | | // 返回 |
| | | return flag; |
| | | } |
| | | } |