| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalTime; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | // 电话,站内信需满足规定时间范围内才发送 |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.waterComeOverHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.waterComeOverList, true, adCode, true); |
| | | } |
| | | } |
| | |
| | | */ |
| | | public String waterFirstOverHandle(String arg1, String arg2) { |
| | | String adCode = "421303000000"; |
| | | // String adCode = null; |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_z_small_over_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | | List<AlarmRuleDetail> alarmRuleDetailList = alarmRuleDetailService.list(new QueryWrapper<AlarmRuleDetail>().eq("alarm_rule_id", alarmRule.getId())); |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | if (alarmRuleDetailList.get(0).getAlarmMode().equals("短信")) { |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | // 返回 |
| | | return "水位小幅超汛限告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略7.1: 水位小幅超汛限告警2--水位高于汛限水位20cm |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String waterSmallScaleOver20Handle(String arg1, String arg2) { |
| | | // String adCode = "421303000000"; |
| | | String adCode = null; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("?diff_value=0.2", ZtApiUrlConstant.res_over_z_small_over_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterComeDesignHandleBySms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.waterComeDesignList1, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // 电话,站内信需满足规定时间范围内才发送 |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话") && isTimeSend()) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterComeDesignList2,true, adCode, false,uuid); |
| | | // } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | // 电话,站内信需满足规定时间范围内才发送 |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.waterComeDesignHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.waterComeDesignList3, true, adCode, true, uuid); |
| | | } |
| | | } |
| | |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.over_des_rz_warn_api); |
| | | JSONArray ztData = noticeHandle.getZtData("?is_show=1", ZtApiUrlConstant.over_des_rz_warn_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterMoreDesignHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterMoreDesignList, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话") && isTimeSend()) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterMoreDesignList,true, adCode, false,uuid); |
| | | // } |
| | | } |
| | |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_chec_api); |
| | | JSONArray ztData = noticeHandle.getZtData("?is_show=1", ZtApiUrlConstant.res_over_chec_api); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterMoreCheckHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterMoreCheckList, true, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话") && isTimeSend()) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.waterMoreCheckList,true, adCode, false,uuid); |
| | | // } |
| | | } |
| | |
| | | // 遍历 |
| | | 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, false, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 遍历 |
| | | 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, false, adCode, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 遍历 |
| | | 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, false, adCode, false, uuid); |
| | | } |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话")) { |
| | | // if (alarmRuleDetail.getAlarmMode().equals("电话") && isTimeSend()) { |
| | | // asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.sixHourRainList,true, adCode, false,uuid); |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | // 返回 |
| | | return "6小时降雨告警"; |
| | | } |
| | | |
| | | /** |
| | | * 策略18: 6小时降雨告警2 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String sixHourRainHandle2(String arg1, String arg2) { |
| | | //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("?drp=50", ZtApiUrlConstant.alarm_rain_only_6_over_api); |
| | | // 外呼对应数据 |
| | | JSONArray whztData = noticeHandle.getZtData("?drp=100", ZtApiUrlConstant.alarm_rain_only_6_over_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.sixHourRainHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.sixHourRainList, false, adCode, false, uuid); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("电话") && isTimeSend()) { |
| | | asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, whztData,ZtApiDataColumnConstant.sixHourRainList,false, adCode, false,uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetySyList, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syDataMissingList, false, adCode, true, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")){ |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.bxDataMissingList, false, adCode, true, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")){ |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyLessThenPipeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syLessThenPipe, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyLessThenPipeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syLessThenPipe, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenNozzleHandleSms(alarmRule, alarmRuleDetail, resultData,ZtApiDataColumnConstant.syHigherThenNozzle,true, adCode, false,uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyHigherThenNozzleHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenNozzle, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenBdElevationHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenBdElevation, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyHigherThenBdElevationHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenBdElevation, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenWaterLevelHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenWaterLevel, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyHigherThenWaterLevelHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenWaterLevel, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyYellowChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syYellowRzChange, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyYellowChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syYellowRzChange, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyOrangeChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syOrangeRzChange, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyOrangeChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syOrangeRzChange, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyRedChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRedRzChange, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyRedChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRedRzChange, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_rz_1h_change_api); |
| | | |
| | | // 处理数据 |
| | | JSONArray data = judgeType(ztData); |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyRz1hChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRz1hChange, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySyRz1hChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRz1hChange, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWyOver2Less5HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver2Less5, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetyWyOver2Less5HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver2Less5, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWyOver5Less10HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver5Less10, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetyWyOver5Less10HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver5Less10, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 近1h变形值大于10cm以上 |
| | | * 变形值大于100mm |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | |
| | | // 查询当前策略对应的告警规则信息 |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_wy_value_1h_change_over_10_api); |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_wy_value_api); |
| | | JSONArray data = judgeDirection(ztData, "3"); |
| | | |
| | | |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWyOver10HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver10, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetyWyOver10HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver10, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWy1hChangeOver10HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetyWy1hChangeOver10HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.videoOfflineHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.videoOffline, false, adCode, true, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | |
| | | } |
| | | |
| | | return "视频信息缺失告警"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 策略42: 水位防洪高水位告警 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String topLevOfFloAlertHandle(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.over_flpr_rz_warn_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("站内信") && isTimeSend()) { |
| | | asyncNoticeHandle.topLevOfFloAlertHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.topLevOfFloAlertList, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 返回 |
| | | return "水位防洪高水位告警"; |
| | | } |
| | | |
| | | private JSONArray filterData(JSONArray ztData, String level) { |
| | |
| | | //左右岸方向 |
| | | Double dnVal = jsonObject.getDouble("dn_val"); |
| | | //垂直 |
| | | Double duValue = jsonObject.getDouble("du_value"); |
| | | Double duValue = jsonObject.getDouble("垂直位移"); |
| | | |
| | | String direction = ""; |
| | | String val = ""; |
| | |
| | | } |
| | | |
| | | jsonObject.put("type", type); |
| | | jsonObject.put("monitorData",jsonObject.getString("diff_val")); |
| | | jsonObject.put("monitorData",jsonObject.getString("sy_val")); |
| | | array.add(jsonObject); |
| | | } |
| | | return array; |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 是否在时间范围内发送 |
| | | * @return |
| | | */ |
| | | public boolean isTimeSend(){ |
| | | boolean flag = false; |
| | | // 判断时间范围 |
| | | // 开始时间 |
| | | LocalTime startTime = LocalTime.parse("08:00"); |
| | | // 结束时间 |
| | | LocalTime endTime = LocalTime.parse("22:00"); |
| | | // 当前时间 |
| | | LocalTime now = LocalTime.now(); |
| | | // 比较 |
| | | flag = !now.isBefore(startTime) && !now.isAfter(endTime); |
| | | // 返回 |
| | | return flag; |
| | | } |
| | | } |