大坝渗压监测告警相关定时器,获取渗压,变形资料缺失接口
13 files modified
4 files added
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package cn.gistack.resource.feign; |
| | | |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.sms.model.SmsResponse; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ISmsClient |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @FeignClient( |
| | | value = AppConstant.APPLICATION_RESOURCE_NAME, |
| | | fallback = ITextualResearchAttachFallback.class |
| | | ) |
| | | public interface ITextualResearchAttachClient { |
| | | String API_PREFIX = "/client"; |
| | | |
| | | String GET_SY_DATA_MISSING = API_PREFIX + "getSyDataMissing"; |
| | | |
| | | String GET_BX_DATA_MISSING = API_PREFIX + "getBxDataMissing"; |
| | | |
| | | |
| | | @PostMapping(GET_SY_DATA_MISSING) |
| | | List<AlertTextualResearchAttachVO> getSyDataMissing(); |
| | | |
| | | @PostMapping(GET_BX_DATA_MISSING) |
| | | List<AlertTextualResearchAttachVO> getBxDataMissing(); |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package cn.gistack.resource.feign; |
| | | |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import dm.jdbc.filter.stat.json.JSONArray; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 流程远程调用失败处理类 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Component |
| | | public class ITextualResearchAttachFallback implements ITextualResearchAttachClient { |
| | | |
| | | |
| | | @Override |
| | | public List<AlertTextualResearchAttachVO> getSyDataMissing() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<AlertTextualResearchAttachVO> getBxDataMissing() { |
| | | return null; |
| | | } |
| | | } |
| New file |
| | |
| | | package cn.gistack.resource.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 告警资料缺失vo |
| | | */ |
| | | @Data |
| | | public class AlertTextualResearchAttachVO { |
| | | |
| | | private String res_cd; |
| | | private String res_nm; |
| | | private String town_cd; |
| | | private String town_nm; |
| | | private String county_cd; |
| | | private String county_nm; |
| | | private String city_cd; |
| | | private String city_nm; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package cn.gistack.resource.feign; |
| | | |
| | | import cn.gistack.resource.service.TextualResearchAttachService; |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static cn.gistack.resource.utils.SmsUtil.*; |
| | | |
| | | /** |
| | | * 短信远程调用服务 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class TextualResearchAttachClient implements ITextualResearchAttachClient { |
| | | private final TextualResearchAttachService textualResearchAttachService; |
| | | |
| | | |
| | | @Override |
| | | @PostMapping(GET_SY_DATA_MISSING) |
| | | public List<AlertTextualResearchAttachVO> getSyDataMissing() { |
| | | List<AlertTextualResearchAttachVO> syLackAlertList = textualResearchAttachService.getSyLackAlertList(); |
| | | return syLackAlertList; |
| | | } |
| | | |
| | | @Override |
| | | public List<AlertTextualResearchAttachVO> getBxDataMissing() { |
| | | List<AlertTextualResearchAttachVO> syLackAlertList = textualResearchAttachService.getWyLackAlertList(); |
| | | return syLackAlertList; |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | import cn.gistack.resource.entity.TextualResearchAttach; |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import cn.gistack.resource.vo.TextualResearchAttachVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | */ |
| | | List<TextualResearchAttachVO> selectTextualResearchAttachPage(IPage<TextualResearchAttachVO> page, |
| | | @Param("textualResearchAttach") TextualResearchAttachVO textualResearchAttach); |
| | | |
| | | List<AlertTextualResearchAttachVO> getSyLackAlertList(); |
| | | |
| | | List<AlertTextualResearchAttachVO> getWyLackAlertList(); |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <resultMap id="vo" type="cn.gistack.resource.vo.AlertTextualResearchAttachVO"> |
| | | <result property="res_nm" column="res_nm"/> |
| | | <result property="res_cd" column="res_cd"/> |
| | | <result property="town_cd" column="town_cd"/> |
| | | <result property="town_nm" column="town_nm"/> |
| | | <result property="county_cd" column="county_cd"/> |
| | | <result property="county_nm" column="county_nm"/> |
| | | <result property="city_cd" column="city_cd"/> |
| | | <result property="city_nm" column="city_nm"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="getSyLackAlertList" resultMap="vo"> |
| | | SELECT * FROM ( |
| | | SELECT |
| | | basic."guid" res_cd, |
| | | basic."name" res_nm, |
| | | basic.townCode town_cd, |
| | | basic.townName town_nm, |
| | | basic.countyCode county_cd, |
| | | basic.countyName county_nm, |
| | | basic.cityCode city_cd, |
| | | basic.cityName city_nm, |
| | | LISTAGG(basic.type, ',') WITHIN GROUP (ORDER BY basic.type ASC) typeList from ( |
| | | SELECT |
| | | distinct |
| | | arb."guid",arb."name", |
| | | stra.type, |
| | | case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS townCode, |
| | | case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS townName, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_code" |
| | | when county."ad_grad" = 3 THEN county."ad_code" END AS countyCode, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_name" |
| | | when county."ad_grad" = 3 THEN county."ad_name" END AS countyName, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_code" |
| | | when county."ad_grad" = 2 THEN county."ad_code" |
| | | ELSE city."ad_code" END AS cityCode, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_name" |
| | | when county."ad_grad" = 2 THEN county."ad_name" |
| | | ELSE city."ad_name" END AS cityName |
| | | FROM SJZT_MD."att_res_base" arb |
| | | LEFT JOIN SJZT_MD."att_ad_base" town ON town."ad_code" = arb."interior_ad_guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" county ON county."ad_code" = town."p_ad_code" |
| | | LEFT JOIN SJZT_MD."att_ad_base" city ON city."ad_code" = county."p_ad_code" |
| | | LEFT JOIN YWXT.SM_TEXTUAL_RESEARCH_ATTACH STRA ON STRA.RES_GUID = arb."guid" and (stra.type = 2 or stra.type = 3 or stra.type = 8 or stra.type = 11 or stra.type = 12) |
| | | )basic |
| | | group by basic."guid",basic."name", |
| | | basic.townCode,basic.townName, |
| | | basic.countyCode,basic.countyName, |
| | | basic.cityCode,basic.cityName |
| | | )info |
| | | where info.typeList != '2,3,8,11,12' or info.typeList is null |
| | | </select> |
| | | <select id="getWyLackAlertList" resultMap="vo"> |
| | | |
| | | SELECT |
| | | distinct |
| | | arb."guid" res_cd, |
| | | arb."name" res_nm, |
| | | case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS town_cd, |
| | | case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS town_nm, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_code" |
| | | when county."ad_grad" = 3 THEN county."ad_code" END AS county_cd, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_name" |
| | | when county."ad_grad" = 3 THEN county."ad_name" END AS county_nm, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_code" |
| | | when county."ad_grad" = 2 THEN county."ad_code" |
| | | ELSE city."ad_code" END AS city_cd, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_name" |
| | | when county."ad_grad" = 2 THEN county."ad_name" |
| | | ELSE city."ad_name" END AS city_nm, |
| | | stra.type |
| | | from sjzt_md."att_res_base" arb |
| | | LEFT JOIN SJZT_MD."att_ad_base" town ON town."ad_code" = arb."interior_ad_guid" |
| | | LEFT JOIN SJZT_MD."att_ad_base" county ON county."ad_code" = town."p_ad_code" |
| | | LEFT JOIN SJZT_MD."att_ad_base" city ON city."ad_code" = county."p_ad_code" |
| | | LEFT JOIN YWXT.SM_TEXTUAL_RESEARCH_ATTACH STRA ON STRA.RES_GUID = arb."guid" and stra.type = 1 |
| | | where stra.type != 1 or stra.type is null |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | |
| | | import cn.gistack.resource.entity.TextualResearchAttach; |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import cn.gistack.resource.vo.TextualResearchAttachVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 考证附件服务层 |
| | |
| | | * @return |
| | | */ |
| | | Object selectTextualResearchAttachPage(IPage<TextualResearchAttachVO> page, TextualResearchAttachVO textualResearchAttach); |
| | | |
| | | |
| | | /** |
| | | * 获取渗压监测基础资料缺失水库列表 |
| | | * @return |
| | | */ |
| | | List<AlertTextualResearchAttachVO> getSyLackAlertList(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取位移监测基础资料缺失水库列表 |
| | | * @return |
| | | */ |
| | | List<AlertTextualResearchAttachVO> getWyLackAlertList(); |
| | | } |
| | |
| | | import cn.gistack.resource.entity.TextualResearchAttach; |
| | | import cn.gistack.resource.mapper.TextualResearchAttachMapper; |
| | | import cn.gistack.resource.service.TextualResearchAttachService; |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import cn.gistack.resource.vo.TextualResearchAttachVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 考证附件服务实现层 |
| | |
| | | } |
| | | return page.setRecords(baseMapper.selectTextualResearchAttachPage(page,textualResearchAttach)); |
| | | } |
| | | |
| | | @Override |
| | | public List<AlertTextualResearchAttachVO> getSyLackAlertList() { |
| | | List<AlertTextualResearchAttachVO> list = baseMapper.getSyLackAlertList(); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<AlertTextualResearchAttachVO> getWyLackAlertList() { |
| | | List<AlertTextualResearchAttachVO> list = baseMapper.getWyLackAlertList(); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | <artifactId>skjcmanager-system-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.gistack</groupId> |
| | | <artifactId>skjcmanager-resource-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | add("sy_val"); |
| | | add("tb_chec_fl_stag"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略24: 大坝安全监测告警-渗压资料缺失 |
| | | */ |
| | | public static List<String> syDataMissingList = new ArrayList<String>() |
| | | {{ |
| | | add("res_nm"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略25: 大坝安全监测告警-变形资料缺失 |
| | | */ |
| | | public static List<String> bxDataMissingList = new ArrayList<String>() |
| | | {{ |
| | | add("res_nm"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略26: 大坝安全监测告警-渗压水位低于管底高程 |
| | | */ |
| | | public static List<String> syLessThenPipe = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("min_value"); |
| | | add("diff_tbb_val_abs"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略27: 大坝安全监测告警-渗压水位高于管口高程 |
| | | */ |
| | | public static List<String> syHigherThenNozzle = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("max_value"); |
| | | add("diff_tbt_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略28: 大坝安全监测告警-水位高于坝顶高程 |
| | | */ |
| | | public static List<String> syHigherThenBdElevation = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("max_value"); |
| | | add("diff_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略29: 大坝安全监测告警-水位高于库水位 |
| | | */ |
| | | public static List<String> syHigherThenWaterLevel = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("max_value"); |
| | | add("diff_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略30: 水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm |
| | | */ |
| | | public static List<String> syYellowRzChange = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("dayNum"); |
| | | add("diff_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略31: 渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米 |
| | | */ |
| | | public static List<String> syOrangeRzChange = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("val1"); |
| | | add("dayNum"); |
| | | add("diff_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略32: 渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米 |
| | | */ |
| | | public static List<String> syRedRzChange = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("val1"); |
| | | add("dayNum"); |
| | | add("diff_val"); |
| | | }}; |
| | | |
| | | /** |
| | | * 策略33: 近1h水位陡降 |
| | | */ |
| | | public static List<String> syRz1hChange = new ArrayList<String>() |
| | | {{ |
| | | add("county_nm"); |
| | | add("town_nm"); |
| | | add("res_nm"); |
| | | add("cd_nm"); |
| | | add("sy_val"); |
| | | add("type"); |
| | | add("diff_val"); |
| | | }}; |
| | | } |
| | |
| | | /** |
| | | * 请求头url 前缀(dev) |
| | | */ |
| | | public static final String url_prefix_dev = "http://10.10.2.192"; |
| | | public static final String url_prefix_dev = "http://10.42.6.192"; |
| | | |
| | | /** |
| | | * 请求头url 前缀(prod) |
| | |
| | | */ |
| | | public static final String alarm_db_wy_none_api = "/services/1234567890ABCDEFGHIJKLMN/alarm/dt/wy/api"; |
| | | |
| | | /** |
| | | * 26.27 大坝安全监测告警-水位低于管底高程或大于管口高程 |
| | | */ |
| | | public static final String alarm_db_sy_less_or_higher_api = "/services/1234567890ABCDEFGHIJKLMN/press/pip/alarm/api"; |
| | | |
| | | /** |
| | | * 28. 大坝安全监测告警-水位大于坝顶高程 |
| | | */ |
| | | public static final String alarm_db_sy_higher_then_bdElevation_api = "/services/1234567890ABCDEFGHIJKLMN/press/dam/alarm/api"; |
| | | |
| | | /** |
| | | * 29. 大坝安全监测告警-水位大于库水位 |
| | | */ |
| | | public static final String alarm_db_sy_higher_then_water_level_api = "/services/1234567890ABCDEFGHIJKLMN/press/rz/alarm/api"; |
| | | |
| | | /** |
| | | * 30. 大坝安全监测告警-水位变幅 |
| | | */ |
| | | public static final String alarm_db_sy_rz_change_api = "/services/1234567890ABCDEFGHIJKLMN/press/bf/alarm/api"; |
| | | |
| | | /** |
| | | * 31. 大坝安全监测告警-近1h水位陡降 |
| | | */ |
| | | public static final String alarm_db_sy_rz_1h_change_api = "/services/1234567890ABCDEFGHIJKLMN/sy/alarm/recent/api"; |
| | | |
| | | } |
| | |
| | | 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.springframework.beans.factory.annotation.Autowired; |
| | |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | public Map<String, Object> damSafetySyDataMissingHandle(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray data, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | 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()); |
| | | } |
| | | } |
| | | 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) { |
| | | 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()); |
| | | } |
| | | } |
| | | 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) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.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) { |
| | | 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()); |
| | | } |
| | | } |
| | | 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) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.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) { |
| | | 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()); |
| | | } |
| | | } |
| | | 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) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.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) { |
| | | 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()); |
| | | } |
| | | } |
| | | 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) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.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) { |
| | | 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()); |
| | | } |
| | | } |
| | | 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) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.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) { |
| | | 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()); |
| | | } |
| | | } |
| | | 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) { |
| | | 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()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | 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) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略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) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 策略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) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 调用短信服务 |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略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) { |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(data, alarmRule, alarmRuleDetail, columnList, flag, adCode, uuid, isSendStation); |
| | | // 拼接后面内容 |
| | | if (smsRequestTemplate.getPersonVOList().size() > 0) { |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 依次添加行巡查责任人,技术责任人信息(姓名) |
| | | noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list, alarmRule, uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | |
| | | import java.util.*; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class NoticeHandle { |
| | | |
| | | |
| | |
| | | // 告警内容 |
| | | List<List<String>> lists = new ArrayList<>(); |
| | | Set<String> set = new HashSet<>(); |
| | | |
| | | // 查询对应的角色信息 |
| | | List<String> roles = sysClient.getRoleNames(alarmRuleDetail.getAlarmPerson()).getData(); |
| | | |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | if (null!=adCode){ |
| | | // city_cd,county_cd 过滤数据 |
| | | String county_cd = jsonArray.getJSONObject(i).getString("county_cd"); |
| | | if (null!= county_cd && county_cd.equals(adCode)) { |
| | | jointData(jsonArray, columnsList, alarmRuleDetail, flag, personLists, lists, i,uuid,set); |
| | | // jointData(jsonArray, columnsList, alarmRuleDetail, flag, personLists, lists, i,uuid,set); |
| | | jointDataV2(jsonArray, columnsList, alarmRuleDetail,roles ,flag, personLists, lists, i,uuid,set); |
| | | } |
| | | }else { |
| | | jointData(jsonArray, columnsList, alarmRuleDetail, flag, personLists, lists, i,uuid,set); |
| | | // jointData(jsonArray, columnsList, alarmRuleDetail, flag, personLists, lists, i,uuid,set); |
| | | jointDataV2(jsonArray, columnsList, alarmRuleDetail,roles, flag, personLists, lists, i,uuid,set); |
| | | } |
| | | log.info("告警人员信息:{}",personLists.toString()); |
| | | } |
| | | // 设置信息 |
| | | smsRequestTemplate.setPersonVOList(personLists); |
| | | smsRequestTemplate.setTemplateContent(lists); |
| | | } |
| | | |
| | | private void jointDataV2(JSONArray jsonArray, List<String> columnsList, AlarmRuleDetail alarmRuleDetail, List<String> roles, Boolean flag, List<PersonVO> personLists, List<List<String>> lists, int i, String uuid, Set<String> set) { |
| | | // 根据水库编号,所在区域查询需要发送的人员手机号及设置 |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | String res_cd = jsonObject.getString("res_cd"); |
| | | String res_nm = jsonObject.getString("res_nm"); |
| | | String town_nm = jsonObject.getString("town_nm"); |
| | | String county_nm = jsonObject.getString("county_nm"); |
| | | String city_nm = jsonObject.getString("city_nm"); |
| | | log.info("当前为第{}个水库,行政区划:{}-{}-{},水库编码:{},水库名称:{}",i+1,city_nm,county_nm,town_nm,res_cd,res_nm); |
| | | String tempStr = uuid + res_cd; |
| | | // 去重水库操作,如果有重复的水库则不操作 |
| | | if (!set.contains(tempStr)) { |
| | | set.add(tempStr); |
| | | // 取出测站编码 |
| | | String stcd = jsonArray.getJSONObject(i).getString("stcd"); |
| | | if (StringUtil.isBlank(stcd)) { |
| | | stcd = jsonArray.getJSONObject(i).getString("cd"); |
| | | } |
| | | // 判断时间是否存在 |
| | | String tm = jsonArray.getJSONObject(i).getString("tm"); |
| | | String day = ""; |
| | | String hour = ""; |
| | | String minute = ""; |
| | | if (null != tm && !tm.equals("") && flag) { |
| | | //如果显示日期,并且中台的日期不为空,则使用中台的日期 |
| | | flag = true; |
| | | // 加入天,时,分 |
| | | day = tm.substring(8, 10); |
| | | hour = tm.substring(11, 13); |
| | | minute = tm.substring(14, 16); |
| | | } else if(flag){ |
| | | //如果显示日期,但是中台没传日期,就使用当前时间 |
| | | Date now = DateUtil.now(); |
| | | String formatTm = DateUtil.format(now, DateUtil.PATTERN_DATETIME); |
| | | // 加入天,时,分 |
| | | day = formatTm.substring(8, 10); |
| | | hour = formatTm.substring(11, 13); |
| | | minute = formatTm.substring(14, 16); |
| | | }else{ |
| | | flag = false; |
| | | } |
| | | // 获取告警人员信息 |
| | | // getAlarmPersonList(jsonArray, columnsList, alarmRuleDetail,flag, personLists, lists, i, res_cd, day, hour, minute, stcd); |
| | | getAlarmPersonListV2(jsonArray, columnsList, alarmRuleDetail,roles,flag, personLists, lists, i, res_cd, day, hour, minute, stcd); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void getAlarmPersonListV2(JSONArray jsonArray, List<String> columnsList, AlarmRuleDetail alarmRuleDetail, List<String> roles, Boolean flag, List<PersonVO> personLists, List<List<String>> lists, int i, String res_cd, String day, String hour, String minute, String stcd) { |
| | | // 查询告警人员信息 |
| | | // List<PersonVO> personVOList = getPersonListByResGuid(res_cd, alarmRuleDetail.getAlarmPerson()); |
| | | List<PersonVO> personVOList = getPersonListByResGuidV2(res_cd, roles); |
| | | if (personVOList.size() > 0) { |
| | | for (PersonVO personVO : personVOList) { |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(stcd); |
| | | list.add(res_cd); |
| | | list.add(personVO.getPhone()); |
| | | if (flag) { |
| | | // 如果是电话告警,需要把日期拼到一起 |
| | | if (alarmRuleDetail.getAlarmMode().equals("电话")){ |
| | | String tem = day + "日" + hour + "时" + minute + "分"; |
| | | list.add(tem); |
| | | }else { |
| | | list.add(day); |
| | | list.add(hour); |
| | | list.add(minute); |
| | | } |
| | | } |
| | | // 变量将值放入集合中 |
| | | for (String column : columnsList) { |
| | | String[] split = column.split(","); |
| | | String format = ""; |
| | | // 内容处理 |
| | | format = addAlarmContent(jsonArray, i, split, format); |
| | | // 加入集合 |
| | | list.add(format); |
| | | } |
| | | lists.add(list); |
| | | } |
| | | } |
| | | personLists.addAll(personVOList); |
| | | |
| | | } |
| | | |
| | | private List<PersonVO> getPersonListByResGuidV2(String res_cd, List<String> roles) { |
| | | List<String> personList = new ArrayList<>(); |
| | | List<String> areaList = new ArrayList<>(); |
| | | // 遍历 |
| | | for (String role : roles) { |
| | | if (role.contains("责任人")){ |
| | | personList.add(PersonEnum.findByName(role).getType().toString()); |
| | | }else { |
| | | areaList.add(role); |
| | | } |
| | | } |
| | | // 根据角色,水库编号查询对应的告警人员信息 |
| | | List<PersonVO> list = new ArrayList<>(); |
| | | //1. 根据水库编号查询除责任人之外的人员信息 |
| | | if (areaList.size() > 0) { |
| | | List<PersonVO> personVOList = attResManagePersonClient.getUserListByResGuid(res_cd,String.join(",",areaList)); |
| | | list.addAll(personVOList); |
| | | } |
| | | //2. 根据水库编号及责任人类型查询相关责任人信息 |
| | | if (personList.size() > 0) { |
| | | List<PersonVO> personVOList1 = attResManagePersonClient.getPersonListByResGuid(res_cd, String.join(",", personList)); |
| | | // 合并人员数据 |
| | | list.addAll(personVOList1); |
| | | } |
| | | // 返回数据 |
| | | return list; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 拼接列数据设置告警人员信息 |
| | | * @param jsonArray 告警动态数据 |
| | |
| | | import cn.gistack.alerts.alarmRule.service.AlarmRuleService; |
| | | import cn.gistack.alerts.notice.constant.ZtApiDataColumnConstant; |
| | | import cn.gistack.alerts.notice.constant.ZtApiUrlConstant; |
| | | import cn.gistack.resource.feign.ITextualResearchAttachClient; |
| | | import cn.gistack.resource.vo.AlertTextualResearchAttachVO; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | |
| | | @Autowired |
| | | private AsyncNoticeHandle asyncNoticeHandle; |
| | | |
| | | |
| | | @Autowired |
| | | private ITextualResearchAttachClient textualResearchAttachClient; |
| | | |
| | | |
| | | /** |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.no_z_last_api_all); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterInfoNotHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterInfoNotList,false, adCode, false); |
| | | asyncNoticeHandle.waterInfoNotHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterInfoNotList, false, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_z_not_normal_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterInfoNotHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterDataExcList,false, adCode, false); |
| | | asyncNoticeHandle.waterInfoNotHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterDataExcList, false, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_diff_dead_z_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterLessDeadHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterLessDeadList,true, adCode, false); |
| | | asyncNoticeHandle.waterLessDeadHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterLessDeadList, true, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 返回 |
| | | return "水位超低于死水位"; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_z_is_warn_over_flse_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.waterComeOverHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeOverList,true, adCode, true); |
| | | asyncNoticeHandle.waterComeOverHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterComeOverList, true, adCode, true); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "水位接近汛限告警"; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.over_z_res_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterFirstOverHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterFirstOverList,true, adCode, true); |
| | | asyncNoticeHandle.waterFirstOverHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterFirstOverList, true, adCode, true); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_z_small_over_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | if (alarmRuleDetailList.get(0).getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterSmallScaleOverHandle1(alarmRule, alarmRuleDetailList.get(0), ztData,ZtApiDataColumnConstant.waterSmallScaleOverList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterSmallScaleOverHandle1(alarmRule, alarmRuleDetailList.get(0), ztData, ZtApiDataColumnConstant.waterSmallScaleOverList, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetailList.get(1).getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterSmallScaleOverHandle2(alarmRule, alarmRuleDetailList.get(1), ztData,ZtApiDataColumnConstant.waterSmallScaleOverList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterSmallScaleOverHandle2(alarmRule, alarmRuleDetailList.get(1), ztData, ZtApiDataColumnConstant.waterSmallScaleOverList, true, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_z_big_over_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | if (alarmRuleDetailList.get(0).getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterBigScaleOverHandle1(alarmRule, alarmRuleDetailList.get(0), ztData,ZtApiDataColumnConstant.waterBigScaleOverList1,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterBigScaleOverHandle1(alarmRule, alarmRuleDetailList.get(0), ztData, ZtApiDataColumnConstant.waterBigScaleOverList1, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetailList.get(1).getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterBigScaleOverHandle2(alarmRule, alarmRuleDetailList.get(1), ztData,ZtApiDataColumnConstant.waterBigScaleOverList2,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterBigScaleOverHandle2(alarmRule, alarmRuleDetailList.get(1), ztData, ZtApiDataColumnConstant.waterBigScaleOverList2, true, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_des_is_warn_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterComeDesignHandleBySms(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeDesignList1,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterComeDesignHandleBySms(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterComeDesignList1, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeDesignList2,true, adCode, false,uuid); |
| | | // } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.waterComeDesignHandleStation(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeDesignList3,true, adCode, true,uuid); |
| | | asyncNoticeHandle.waterComeDesignHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterComeDesignList3, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.over_des_rz_warn_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterMoreDesignHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterMoreDesignList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterMoreDesignHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterMoreDesignList, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterMoreDesignList,true, adCode, false,uuid); |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_chec_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterMoreCheckHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterMoreCheckList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterMoreCheckHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterMoreCheckList, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterMoreCheckList,true, adCode, false,uuid); |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_z_diff_up_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterComeOneHourUpHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeOneHourUpList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterComeOneHourUpHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterComeOneHourUpList, true, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_z_diff_down_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterComeOneHourDownHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeOneHourDownList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.waterComeOneHourDownHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterComeOneHourDownList, true, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_rain_dy_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.alreadyHeavyRainHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.alreadyHeavyRainList,true, adCode, false); |
| | | asyncNoticeHandle.alreadyHeavyRainHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.alreadyHeavyRainList, true, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_rain_by_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.alreadyRainstormHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.alreadyRainstormList,true, adCode, false); |
| | | asyncNoticeHandle.alreadyRainstormHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.alreadyRainstormList, true, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_rain_6_over_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.sixHourRainHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.sixHourRainList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.sixHourRainHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.sixHourRainList, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.sixHourRainList,true, adCode, false,uuid); |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.damSafetyList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("?is_alarm=1", ZtApiUrlConstant.alarm_db_sy_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.damSafetySyList,true, adCode, true,uuid); |
| | | asyncNoticeHandle.damSafetySyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetySyList, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | //String adCode = "420607000000"; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | String adCode = null; |
| | | // 查询当前策略对应的告警规则信息 |
| | | // 查询当前策略对应的告警规则信息,根据名称获取告警信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_none_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.damSafetyList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sl_none_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.damSafetyList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_wy_none_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null!=alarmRule) { |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size()>0){ |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.damSafetyList,true, adCode, false,uuid); |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid); |
| | | } |
| | | } |
| | | } |
| | |
| | | return "大坝安全监测告警"; |
| | | } |
| | | |
| | | /** |
| | | * 策略24:渗压基础数据缺失 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyDataMissingHandle(String arg1, String arg2) { |
| | | |
| | | String uuid = UUID.randomUUID().toString(); |
| | | String adCode = null; |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | //调用本地服务获取数据 |
| | | List<AlertTextualResearchAttachVO> syDataMissing = textualResearchAttachClient.getSyDataMissing(); |
| | | |
| | | JSONArray data = JSON.parseArray(JSON.toJSONString(syDataMissing)); |
| | | |
| | | |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandle(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syDataMissingList, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "大坝安全监测渗压资料缺失告警"; |
| | | } |
| | | |
| | | /** |
| | | * 策略25:变形基础数据缺失 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetyBxDataMissingHandle(String arg1, String arg2) { |
| | | String uuid = UUID.randomUUID().toString(); |
| | | String adCode = null; |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | //调用本地服务获取数据 |
| | | List<AlertTextualResearchAttachVO> syDataMissing = textualResearchAttachClient.getBxDataMissing(); |
| | | |
| | | JSONArray data = JSON.parseArray(JSON.toJSONString(syDataMissing)); |
| | | |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandle(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.bxDataMissingList, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "大坝安全监测变形资料缺失告警"; |
| | | } |
| | | |
| | | /** |
| | | * 策略26:水位低于管底高程 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyLessThenPipeHandle(String arg1, String arg2) { |
| | | |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_less_or_higher_api); |
| | | JSONArray array = lessOrHigher(ztData, "less"); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyLessThenPipeHandleSms(alarmRule, alarmRuleDetail, array, ZtApiDataColumnConstant.syLessThenPipe, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyLessThenPipeHandleStation(alarmRule, alarmRuleDetail, array, ZtApiDataColumnConstant.syLessThenPipe, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "水位低于管底高程告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略27:水位高于管口高程 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyHigherThenNozzleHandle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_less_or_higher_api); |
| | | |
| | | |
| | | JSONArray array = lessOrHigher(ztData, "higher"); |
| | | |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | // if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | // asyncNoticeHandle.damSafetySyHigherThenNozzleHandleSms(alarmRule, alarmRuleDetail, array,ZtApiDataColumnConstant.syHigherThenNozzle,true, adCode, false,uuid); |
| | | // } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenNozzleHandleStation(alarmRule, alarmRuleDetail, array, ZtApiDataColumnConstant.syHigherThenNozzle, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "水位高于管口高程告警"; |
| | | } |
| | | |
| | | /** |
| | | * 策略28:水位高于坝顶高程 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyHigherThenBdElevationHandle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_higher_then_bdElevation_api); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenBdElevationHandleSms(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.syHigherThenBdElevation, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenBdElevationHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.syHigherThenBdElevation, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "水位高于坝顶高程告警"; |
| | | } |
| | | |
| | | /** |
| | | * 水位高于库水位告警 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyHigherThenWaterLevelHandle(String arg1, String arg2) { |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_higher_then_water_level_api); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenWaterLevelHandleSms(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.syHigherThenWaterLevel, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenWaterLevelHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.syHigherThenWaterLevel, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "水位高于库水位告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyYellowChangeHandle(String arg1, String arg2) { |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_rz_change_api); |
| | | |
| | | JSONArray data = changeRange(ztData, "1"); |
| | | |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyYellowChangeHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syYellowRzChange, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyYellowChangeHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syYellowRzChange, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "水位五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyOrangeChangeHandle(String arg1, String arg2) { |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_rz_change_api); |
| | | |
| | | JSONArray data = changeRange(ztData, "2"); |
| | | |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyOrangeChangeHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syOrangeRzChange, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyOrangeChangeHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syOrangeRzChange, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyRedChangeHandle(String arg1, String arg2) { |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_rz_change_api); |
| | | |
| | | JSONArray data = changeRange(ztData, "3"); |
| | | |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyRedChangeHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syRedRzChange, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyRedChangeHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syRedRzChange, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米告警"; |
| | | } |
| | | |
| | | /** |
| | | * 近1h水位陡降 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySyRz1hChangeHandle(String arg1, String arg2) { |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_rz_1h_change_api); |
| | | |
| | | JSONArray data = judgeType(ztData); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyRz1hChangeHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syRz1hChange, true, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyRz1hChangeHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syRz1hChange, true, adCode, true, uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return "近1h水位陡降告警"; |
| | | } |
| | | |
| | | private JSONArray judgeType(JSONArray ztData) { |
| | | JSONArray array = new JSONArray(); |
| | | for (int i = 0; i < ztData.size(); i++) { |
| | | JSONObject jsonObject = ztData.getJSONObject(i); |
| | | Double syVal = jsonObject.getDouble("sy_val"); |
| | | Double leadVal = jsonObject.getDouble("lead_val"); |
| | | String type = ""; |
| | | if (syVal > leadVal) { |
| | | //当前水位大于1h |
| | | type = "陡升"; |
| | | } else { |
| | | type = "陡降"; |
| | | } |
| | | |
| | | jsonObject.put("type", type); |
| | | array.add(jsonObject); |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | /** |
| | | * 根据数据过滤不同程度的变幅 |
| | | * |
| | | * @param ztData |
| | | * @param level 1黄、2橙、3红 |
| | | * @return |
| | | */ |
| | | private JSONArray changeRange(JSONArray ztData, String level) { |
| | | JSONArray array = new JSONArray(); |
| | | |
| | | for (int i = 0; i < ztData.size(); i++) { |
| | | JSONObject jsonObject = ztData.getJSONObject(i); |
| | | String dataLevel = jsonObject.getString("level"); |
| | | |
| | | //一日变幅 |
| | | Double diff2 = jsonObject.getDouble("diff_2"); |
| | | |
| | | //五日变幅 |
| | | Double diff5 = jsonObject.getDouble("diff_5"); |
| | | |
| | | //十日变幅 |
| | | Double diff10 = jsonObject.getDouble("diff_10"); |
| | | |
| | | //三十日变幅 |
| | | Double diff30 = jsonObject.getDouble("diff_30"); |
| | | |
| | | String dayNum = ""; |
| | | String diffVal = ""; |
| | | |
| | | if (dataLevel.equals(level)) { |
| | | if (level.equals("1")) { |
| | | //水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm |
| | | if (diff5 < 0.05) { |
| | | dayNum = "五"; |
| | | diffVal = diff5.toString(); |
| | | } else if (0.05 < diff10 && diff10 < 0.08) { |
| | | dayNum = "十"; |
| | | diffVal = diff10.toString(); |
| | | } else if (0.08 < diff30 && diff30 < 0.1) { |
| | | dayNum = "三十"; |
| | | diffVal = diff30.toString(); |
| | | } |
| | | } else if (level.equals("2")) { |
| | | //渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米 |
| | | if (0.5 < diff2 && diff2 < 1) { |
| | | dayNum = "一"; |
| | | diffVal = diff2.toString(); |
| | | } else if (1 < diff5 && diff5 < 2) { |
| | | dayNum = "五"; |
| | | diffVal = diff5.toString(); |
| | | } else if (2 < diff10 && diff10 < 5) { |
| | | dayNum = "十"; |
| | | diffVal = diff10.toString(); |
| | | } else if (5 < diff30 && diff30 < 10) { |
| | | dayNum = "三十"; |
| | | diffVal = diff30.toString(); |
| | | } |
| | | } else if (level.equals("3")) { |
| | | //渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米 |
| | | |
| | | if (1 < diff2 && diff2 < 2) { |
| | | dayNum = "一"; |
| | | diffVal = diff2.toString(); |
| | | } else if (2 < diff5 && diff5 < 5) { |
| | | dayNum = "五"; |
| | | diffVal = diff5.toString(); |
| | | } else if (5 < diff10 && diff10 < 10) { |
| | | dayNum = "十"; |
| | | diffVal = diff10.toString(); |
| | | } else if (10 < diff30) { |
| | | dayNum = "三十"; |
| | | diffVal = diff30.toString(); |
| | | } |
| | | } |
| | | |
| | | jsonObject.put("dayNum", dayNum); |
| | | |
| | | if (diffVal.equals("0.0")) { |
| | | diffVal = "0"; |
| | | } |
| | | |
| | | jsonObject.put("diff_val", diffVal); |
| | | array.add(jsonObject); |
| | | } |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 过滤低于管底高程数据或高于管口高程数据 |
| | | * |
| | | * @param ztData |
| | | * @param flag |
| | | * @return |
| | | */ |
| | | private JSONArray lessOrHigher(JSONArray ztData, String flag) { |
| | | |
| | | JSONArray array = new JSONArray(); |
| | | |
| | | for (int i = 0; i < ztData.size(); i++) { |
| | | JSONObject jsonObject = ztData.getJSONObject(i); |
| | | |
| | | //获取低于管底高程数据min_value < tbbtel 即 min_value - tbbtel <0 即diff_tbb_val <0 |
| | | if (flag == "less") { |
| | | Double differ = jsonObject.getDouble("diff_tbb_val"); |
| | | if (differ < 0) { |
| | | //加进一个绝对值方便展示 |
| | | jsonObject.put("diff_tbb_val_abs", Math.abs(differ)); |
| | | array.add(jsonObject); |
| | | } |
| | | } else if (flag == "higher") { |
| | | //获取高于管口高程数据,即 max_value > tbttel 即 max_value - tbttel >0 即 diff_tbt_val >0 |
| | | Double differ = jsonObject.getDouble("diff_tbt_val"); |
| | | if (differ > 0) { |
| | | array.add(jsonObject); |
| | | } |
| | | } |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | strategyMap.put("damSafetySlNoneHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetySlNoneHandle(arg1, arg2)); |
| | | //23 |
| | | strategyMap.put("damSafetyWyNoneHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetyWyNoneHandle(arg1, arg2)); |
| | | //24 |
| | | strategyMap.put("damSafetySyDataMissingHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyDataMissingHandle(arg1,arg2)); |
| | | //25 |
| | | strategyMap.put("damSafetyBxDataMissingHandle",(arg1,arg2)->noticeStrategyImpl.damSafetyBxDataMissingHandle(arg1,arg2)); |
| | | //26 水位低于管底高程 |
| | | strategyMap.put("damSafetySyLessThenPipeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyLessThenPipeHandle(arg1,arg2)); |
| | | //27 水位高于管口高程 |
| | | strategyMap.put("damSafetySyHigherThenNozzleHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyHigherThenNozzleHandle(arg1,arg2)); |
| | | //28 水位高于坝顶高程 |
| | | strategyMap.put("damSafetySyHigherThenBdElevationHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyHigherThenBdElevationHandle(arg1,arg2)); |
| | | //29 水位大于库水位 |
| | | strategyMap.put("damSafetySyHigherThenWaterLevelHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyHigherThenWaterLevelHandle(arg1,arg2)); |
| | | //30 水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm |
| | | strategyMap.put("damSafetySyYellowChangeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyYellowChangeHandle(arg1,arg2)); |
| | | //31 渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米 |
| | | strategyMap.put("damSafetySyOrangeChangeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyOrangeChangeHandle(arg1,arg2)); |
| | | //32 渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米 |
| | | strategyMap.put("damSafetySyRedChangeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyRedChangeHandle(arg1,arg2)); |
| | | //32 近1h水位陡降 |
| | | strategyMap.put("damSafetySyRz1hChangeHandle",(arg1,arg2)->noticeStrategyImpl.damSafetySyRz1hChangeHandle(arg1,arg2)); |
| | | } |
| | | |
| | | /** |
| | |
| | | messageRecord.setRecipient(list.get(0)); |
| | | // 设置手机号 |
| | | request.setUserNumber(list.get(0)); |
| | | // 内容处理 |
| | | // 内容处理,把括号内容换成%s,后面用format替换,因此括号内容要和list的个数一样 |
| | | String s = smsTemplate.getContent().replaceAll("\\{.+?\\}", "%s"); |
| | | // 短信内容拼接(完成发送的结果信息) |
| | | // 需要删除最前面的手机号 |
| | |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略24: 大坝安全监测告警-渗压资料缺失-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyDataMissingHandle") |
| | | public ReturnT<String> damSafetySyDataMissingHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("渗压资料缺失","","damSafetySyDataMissingHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略25: 大坝安全监测告警-变形资料缺失-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetyBxDataMissingHandle") |
| | | public ReturnT<String> damSafetyBxDataMissingHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("变形资料缺失","","damSafetyBxDataMissingHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略26: 大坝安全监测告警-水位低于管底高程-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyLessThenPipeHandle") |
| | | public ReturnT<String> damSafetySyLessThenPipeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位低于管底高程","","damSafetySyLessThenPipeHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略27: 大坝安全监测告警-水位大于管口高程-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyHigherThenNozzleHandle") |
| | | public ReturnT<String> damSafetySyHigherThenNozzleHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大于管口高程","","damSafetySyHigherThenNozzleHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略28: 大坝安全监测告警-水位大于坝顶高程-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyHigherThenBdElevationHandle") |
| | | public ReturnT<String> damSafetySyHigherThenBdElevationHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大于坝顶高程","","damSafetySyHigherThenBdElevationHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略29: 大坝安全监测告警-水位大于库水位-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyHigherThenWaterLevelHandle") |
| | | public ReturnT<String> damSafetySyHigherThenWaterLevelHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位大于库水位","","damSafetySyHigherThenWaterLevelHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略30: 大坝安全监测告警-水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyYellowChangeHandle") |
| | | public ReturnT<String> damSafetySyYellowChangeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位变幅黄色告警","","damSafetySyYellowChangeHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略31: 大坝安全监测告警-渗压水位一日变幅大于0.5米小于1米,五日变幅大于1米小于2米,十日变幅大于2米小于5米,三十日变幅大于5米小于10米-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyOrangeChangeHandle") |
| | | public ReturnT<String> damSafetySyOrangeChangeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位变幅橙色告警","","damSafetySyOrangeChangeHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略32: 大坝安全监测告警-渗压水位一日变幅大于1米小于2米,五日变幅大于2米小于5米,十日变幅大于5米小于10米,三十日变幅大于10米-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyRedChangeHandle") |
| | | public ReturnT<String> damSafetySyRedChangeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("水位变幅红色告警","","damSafetySyRedChangeHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略33: 大坝安全监测告警-近1h水位陡降-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyRz1hChangeHandle") |
| | | public ReturnT<String> damSafetySyRz1hChangeHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("近1h水位陡升陡降","","damSafetySyRz1hChangeHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |