| | |
| | | |
| | | 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 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,null); |
| | | smsRequestTemplate.setIsSendStation(isSendStation); |
| | | // 遍历 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 调用短信服务 |
| | | smsService.sendMergeSignMsg(smsRequestTemplate); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略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,null); |
| | | smsRequestTemplate.setIsSendStation(isSendStation); |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 遍历 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | |
| | | |
| | | /** |
| | | * 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); |
| | | // 获取需要发送的信息 |
| | | String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterLessDeadList,true,adCode,uuid,null); |
| | | smsRequestTemplate.setIsSendStation(isSendStation); |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接内容后面的联系方式,当前模板县水利部人员姓名电话 |
| | | if (smsRequestTemplate.getPersonVOList().size()>0) { |
| | | // 遍历,拼接县水利部人员电话 |
| | |
| | | |
| | | |
| | | /** |
| | | * 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,Boolean isSendStation) { |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_z_is_warn_over_flse_api); |
| | | // 只发送站内信 |
| | | SmsRequestTemplate smsRequestTemplate = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterComeOverList,true,adCode,uuid, DangerEnum.DISTANCE.getValue()); |
| | | smsRequestTemplate.setIsSendStation(isSendStation); |
| | | 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) { |
| | | // 遍历,拼接县水利部人员电话 |
| | |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 6.水位初次超汛限告警 处理 |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param alarmRule |
| | | * @param adCode |
| | | * @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,DangerEnum.OVER.getValue()); |
| | | smsRequestTemplate.setIsSendStation(isSendStation); |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size()>0) { |
| | |
| | | |
| | | /** |
| | | * 7.1 水位小幅超汛限告警(发松给 水库技术责任人、巡查责任人) |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param alarmRule |
| | | * @param adCode |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @param uuid 变量 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterSmallScaleOverHandle1(String templateId, String uuid, AlarmRule alarmRule,String adCode,Boolean isSendStation) { |
| | | 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.res_over_z_small_over_api); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterSmallScaleOverList,true,adCode,uuid,DangerEnum.ALREADY_OVER.getValue()); |
| | | smsRequestTemplate.setIsSendStation(isSendStation); |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size()>0) { |
| | |
| | | |
| | | /** |
| | | * 7.2 水位小幅超汛限告警(发送给 县级水利部门有关人员、主管部门责任人) |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param alarmRule |
| | | * @param adCode |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterSmallScaleOverHandle2(String templateId, String uuid, AlarmRule alarmRule,String adCode,Boolean isSendStation) { |
| | | 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<>(); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_z_small_over_api); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterSmallScaleOverList,true,adCode,uuid,DangerEnum.ALREADY_OVER.getValue()); |
| | | smsRequestTemplate.setIsSendStation(isSendStation); |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size()>0) { |
| | |
| | | |
| | | /** |
| | | * 8.1 水位大幅超汛限告警(发松给 水库技术责任人、巡查责任人) |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param alarmRule |
| | | * @param adCode |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterBigScaleOverHandle1(String templateId, String uuid, AlarmRule alarmRule,String adCode,Boolean isSendStation) { |
| | | 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<>(); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_z_big_over_api); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterBigScaleOverList1,true,adCode,uuid,DangerEnum.ALREADY_BIG_OVER.getValue()); |
| | | smsRequestTemplate.setIsSendStation(isSendStation); |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size()>0) { |
| | |
| | | |
| | | /** |
| | | * 8.2 水位大幅超汛限告警(发送给 县级水利部门有关人员、主管部门责任人) |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param alarmRule |
| | | * @param adCode |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterBigScaleOverHandle2(String templateId, String uuid, AlarmRule alarmRule,String adCode,Boolean isSendStation) { |
| | | 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<>(); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_z_big_over_api); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, templateId,alarmRule, ZtApiDataColumnConstant.waterBigScaleOverList2,true,adCode,uuid,DangerEnum.ALREADY_BIG_OVER.getValue()); |
| | | smsRequestTemplate.setIsSendStation(isSendStation); |
| | | = 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); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | if (null != alarmRecord) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 10.水位超设计洪水位告警处理 |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param alarmRule |
| | | * 策略9.1: 水位接近设计洪水位告警-短信 |
| | | * |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> waterMoreDesignHandle(String templateId, String uuid, AlarmRule alarmRule) { |
| | | 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<>(); |
| | | // 调用中台服务接口查询数据 |
| | | 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,null); |
| | | = noticeHandle.getSendSmsTemplate(ztData, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 策略15: 已降大雨告警 |
| | | * 策略9.1: 水位接近设计洪水位告警-电话 |
| | | * |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param alarmRule |
| | | * @param adCode |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> alreadyHeavyRainHandle(String templateId, String uuid, AlarmRule alarmRule, String adCode, boolean isSendStation) { |
| | | public Map<String, Object> waterComeDesignHandleCall(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.alarm_rain_dy_api); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, templateId, alarmRule, ZtApiDataColumnConstant.alreadyHeavyRainList, false, adCode,uuid,null); |
| | | = 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()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | 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()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | 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()) { |
| | | // 依次添加行政责任人,主管部门责任人,技术责任人,巡查责任人信息(姓名,联系电话) |
| | | 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()); |
| | | } |
| | | } |
| | | 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()); |
| | | } |
| | | } |
| | | 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); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | 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()); |
| | | } |
| | | } |
| | | 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.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 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); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | 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()) { |
| | |
| | | /** |
| | | * 策略16: 已降暴雨告警 |
| | | * |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param alarmRule |
| | | * @param adCode |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> alreadyRainstormHandle(String templateId, String uuid, AlarmRule alarmRule, String adCode, boolean isSendStation) { |
| | | 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<>(); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_rain_by_api); |
| | | String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, templateId, alarmRule, ZtApiDataColumnConstant.alreadyRainstormList, false, adCode,uuid,null); |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 策略18: 6小时降雨告警 |
| | | * 策略18: 6小时降雨告警--短信 |
| | | * |
| | | * @param templateId |
| | | * @param uuid |
| | | * @param alarmRule |
| | | * @param adCode |
| | | * @param alarmRule 告警规则信息 |
| | | * @param alarmRuleDetail 告警规则详情信息 |
| | | * @param ztData 告警数据 |
| | | * @param columnList 告警模板动态内容key |
| | | * @param flag 是否包含日期 |
| | | * @param adCode 行政区code用户过滤数据 |
| | | * @param isSendStation 是否发送站内信 |
| | | * @return |
| | | */ |
| | | @Async |
| | | public Map<String, Object> sixHourRainHandle(String templateId, String uuid, AlarmRule alarmRule, String adCode, boolean isSendStation) { |
| | | 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<>(); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_rain_6_over_api); |
| | | // String uuid = alarmRuleDetail.getTemplateId() + UUID.randomUUID().toString(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData, templateId, alarmRule, ZtApiDataColumnConstant.sixHourRainList, false, adCode,uuid,null); |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | |
| | | } |
| | | 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<>(); |
| | | // 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()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | } |