| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_z_is_warn_over_flse_api); |
| | | //过滤不告警水库 |
| | | JSONArray resultData = filterNoAlertRes(ztData, arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.waterComeOverHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterComeOverList, true, adCode, true); |
| | | 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) { |
| | | // 查询告警详情信息 |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.res_over_des_is_warn_api); |
| | | |
| | | //过滤不告警水库 |
| | | JSONArray resultData = filterNoAlertRes(ztData, arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.waterComeDesignHandleBySms(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.waterComeDesignList1, true, adCode, false, uuid); |
| | | asyncNoticeHandle.waterComeDesignHandleBySms(alarmRule, alarmRuleDetail, resultData, 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, 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) { |
| | | // 查询告警详情信息 |
| | |
| | | // 查询当前策略对应的告警规则信息 |
| | | 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) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | 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("电话")) { |
| | | // 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("电话")) { |
| | | asyncNoticeHandle.outCallHandleCall(alarmRule, alarmRuleDetail, whztData,ZtApiDataColumnConstant.sixHourRainList,false, adCode, false,uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | // 遍历 |
| | | 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,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("?is_alarm=1", ZtApiUrlConstant.alarm_db_sy_api); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(ztData,arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetySyList, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetySyHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetySyList, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_none_api); |
| | | |
| | | JSONArray resultData = filterNoAlertRes(ztData, arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sl_none_api); |
| | | JSONArray resultData = filterNoAlertRes(ztData, arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetyHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_wy_none_api); |
| | | JSONArray resultData = filterNoAlertRes(ztData, arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetyHandle(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyNoneHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.damSafetyList, false, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | List<AlertTextualResearchAttachVO> syDataMissing = textualResearchAttachClient.getSyDataMissing(); |
| | | |
| | | JSONArray data = JSON.parseArray(JSON.toJSONString(syDataMissing)); |
| | | |
| | | JSONArray resultData = filterNoAlertRes(data, arg1); |
| | | |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | if (alarmRuleDetailList.size() > 0) { |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandle(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syDataMissingList, true, adCode, true, uuid); |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syDataMissingList, false, adCode, true, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")){ |
| | | asyncNoticeHandle.damSafetySyDataMissingHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syDataMissingList, false, adCode, false, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | List<AlertTextualResearchAttachVO> syDataMissing = textualResearchAttachClient.getBxDataMissing(); |
| | | |
| | | JSONArray data = JSON.parseArray(JSON.toJSONString(syDataMissing)); |
| | | |
| | | JSONArray resultData = filterNoAlertRes(data, arg1); |
| | | 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); |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyDataMissingHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.bxDataMissingList, false, adCode, true, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")){ |
| | | asyncNoticeHandle.damSafetySyDataMissingHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.bxDataMissingList, false, adCode, false, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_less_or_higher_api); |
| | | JSONArray array = lessOrHigher(ztData, "less"); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(array,arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyLessThenPipeHandleSms(alarmRule, alarmRuleDetail, array, ZtApiDataColumnConstant.syLessThenPipe, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetySyLessThenPipeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syLessThenPipe, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyLessThenPipeHandleStation(alarmRule, alarmRuleDetail, array, ZtApiDataColumnConstant.syLessThenPipe, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetySyLessThenPipeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syLessThenPipe, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | JSONArray array = lessOrHigher(ztData, "higher"); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(array,arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | |
| | | 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.damSafetySyHigherThenNozzleHandleSms(alarmRule, alarmRuleDetail, resultData,ZtApiDataColumnConstant.syHigherThenNozzle,true, adCode, false,uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenNozzleHandleStation(alarmRule, alarmRuleDetail, array, ZtApiDataColumnConstant.syHigherThenNozzle, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetySyHigherThenNozzleHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenNozzle, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_higher_then_bdElevation_api); |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData1 = filterNoAlertRes(ztData,arg1); |
| | | |
| | | JSONArray resultData = setMonitorData(resultData1, "max_value"); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenBdElevationHandleSms(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.syHigherThenBdElevation, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetySyHigherThenBdElevationHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenBdElevation, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenBdElevationHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.syHigherThenBdElevation, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetySyHigherThenBdElevationHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenBdElevation, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | AlarmRule alarmRule = alarmRuleService.getOne(new QueryWrapper<AlarmRule>().eq("rule_name", arg1)); |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_higher_then_water_level_api); |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData1 = filterNoAlertRes(ztData,arg1); |
| | | |
| | | JSONArray resultData = setMonitorData(resultData1, "max_value"); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenWaterLevelHandleSms(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.syHigherThenWaterLevel, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetySyHigherThenWaterLevelHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenWaterLevel, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyHigherThenWaterLevelHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.syHigherThenWaterLevel, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetySyHigherThenWaterLevelHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syHigherThenWaterLevel, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | JSONArray data = changeRange(ztData, "1"); |
| | | |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyYellowChangeHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syYellowRzChange, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetySyYellowChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syYellowRzChange, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyYellowChangeHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syYellowRzChange, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetySyYellowChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syYellowRzChange, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_rz_change_api); |
| | | |
| | | JSONArray data = changeRange(ztData, "2"); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyOrangeChangeHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syOrangeRzChange, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetySyOrangeChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syOrangeRzChange, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyOrangeChangeHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syOrangeRzChange, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetySyOrangeChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syOrangeRzChange, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sy_rz_change_api); |
| | | |
| | | JSONArray data = changeRange(ztData, "3"); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyRedChangeHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syRedRzChange, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetySyRedChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRedRzChange, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyRedChangeHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syRedRzChange, true, adCode, true, uuid); |
| | | 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 (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySyRz1hChangeHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syRz1hChange, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetySyRz1hChangeHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRz1hChange, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySyRz1hChangeHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.syRz1hChange, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetySyRz1hChangeHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.syRz1hChange, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_wy_value_api); |
| | | |
| | | JSONArray data = judgeDirection(ztData, "1"); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWyOver2Less5HandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wyOver2Less5, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetyWyOver2Less5HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver2Less5, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetyWyOver2Less5HandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wyOver2Less5, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetyWyOver2Less5HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver2Less5, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_wy_value_api); |
| | | |
| | | JSONArray data = judgeDirection(ztData, "2"); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWyOver5Less10HandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wyOver5Less10, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetyWyOver5Less10HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver5Less10, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetyWyOver5Less10HandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wyOver5Less10, true, adCode, true, uuid); |
| | | 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"); |
| | | |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWyOver10HandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wyOver10, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetyWyOver10HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver10, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetyWyOver10HandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wyOver10, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetyWyOver10HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wyOver10, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_wy_value_1h_change_over_10_api); |
| | | JSONArray data = judgeDirectionV2(ztData); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData = filterNoAlertRes(data,arg1); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetyWy1hChangeOver10HandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetyWy1hChangeOver10HandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetyWy1hChangeOver10HandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetyWy1hChangeOver10HandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | return "近1h变形值大于10cm以上告警"; |
| | | } |
| | | |
| | | /** |
| | | * 渗流量一日大于5L小于8L,连续3日增加 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySlOver5Less8Handle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sl_value_change_api); |
| | | JSONArray data = filterData(ztData,"1"); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData1 = filterNoAlertRes(data,arg1); |
| | | JSONArray resultData = setMonitorData(resultData1, "value"); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 渗流量一日大于8L小于10L,连续3日增加 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySlOver8Less10Handle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sl_value_change_api); |
| | | JSONArray data = filterData(ztData,"2"); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData1 = filterNoAlertRes(data,arg1); |
| | | JSONArray resultData = setMonitorData(resultData1, "value"); |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 渗流量一日大于10L,连续3日增加 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String damSafetySlOver10Handle(String arg1, String arg2) { |
| | | |
| | | String adCode = null; |
| | |
| | | // 调用中台服务接口查询数据 |
| | | JSONArray ztData = noticeHandle.getZtData("", ZtApiUrlConstant.alarm_db_sl_value_change_api); |
| | | JSONArray data = filterData(ztData,"3"); |
| | | |
| | | //这里需要对数据进行过滤 |
| | | JSONArray resultData1 = filterNoAlertRes(data,arg1); |
| | | |
| | | JSONArray resultData = setMonitorData(resultData1, "value"); |
| | | |
| | | // 获取告警规则详情,判断告警类型(短信,电话,站内信) |
| | | if (null != alarmRule) { |
| | | // 查询告警详情信息 |
| | |
| | | // 遍历 |
| | | for (AlarmRuleDetail alarmRuleDetail : alarmRuleDetailList) { |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, false, uuid); |
| | | asyncNoticeHandle.damSafetySlOverLessHandleSms(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, false, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("站内信")) { |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, data, ZtApiDataColumnConstant.wy1hChangeOver10, true, adCode, true, uuid); |
| | | asyncNoticeHandle.damSafetySlOverLessHandleStation(alarmRule, alarmRuleDetail, resultData, ZtApiDataColumnConstant.slOverLess, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return "渗流量一日大于5L小于8L,连续3日增加告警"; |
| | | return "渗流量一日大于10L告警"; |
| | | } |
| | | |
| | | /** |
| | | * 视频离线 |
| | | * |
| | | * @param arg1 |
| | | * @param arg2 |
| | | * @return |
| | | */ |
| | | public String videoOfflineHandle(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.getZtDataV2("", ZtApiUrlConstant.alarm_video_offline_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.videoOfflineHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.videoOffline, false, adCode, true, uuid,arg2); |
| | | } |
| | | if (alarmRuleDetail.getAlarmMode().equals("短信")) { |
| | | asyncNoticeHandle.videoOfflineHandleSms(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.videoOffline, false, adCode, false, uuid,arg2); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | 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("站内信")) { |
| | | asyncNoticeHandle.topLevOfFloAlertHandleStation(alarmRule, alarmRuleDetail, ztData, ZtApiDataColumnConstant.topLevOfFloAlertList, true, adCode, true, uuid,arg2); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 返回 |
| | | return "水位防洪高水位告警"; |
| | | } |
| | | |
| | | private JSONArray filterData(JSONArray ztData, String level) { |
| | | |
| | |
| | | |
| | | jsonObject.put("direction", direction); |
| | | jsonObject.put("val", val); |
| | | jsonObject.put("monitorData",val); |
| | | array.add(jsonObject); |
| | | |
| | | } |
| | |
| | | //左右岸方向 |
| | | Double dnVal = jsonObject.getDouble("dn_val"); |
| | | //垂直 |
| | | Double duValue = jsonObject.getDouble("du_value"); |
| | | Double duValue = jsonObject.getDouble("垂直位移"); |
| | | |
| | | String direction = ""; |
| | | String val = ""; |
| | |
| | | |
| | | jsonObject.put("direction", direction); |
| | | jsonObject.put("val", val); |
| | | jsonObject.put("monitorData",val); |
| | | array.add(jsonObject); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | jsonObject.put("type", type); |
| | | jsonObject.put("monitorData",jsonObject.getString("sy_val")); |
| | | array.add(jsonObject); |
| | | } |
| | | return array; |
| | |
| | | |
| | | String dayNum = ""; |
| | | String diffVal = ""; |
| | | |
| | | if (dataLevel.equals(level)) { |
| | | if (level.equals("1")) { |
| | | //水位长期不变,五日变幅小于5cm,十日变幅大于5cm小于8cm,三十日变幅大于8cm小于10cm |
| | |
| | | } |
| | | |
| | | jsonObject.put("diff_val", diffVal); |
| | | jsonObject.put("monitorData",jsonObject.getString("val1")); |
| | | array.add(jsonObject); |
| | | } |
| | | } |
| | |
| | | if (differ < 0) { |
| | | //加进一个绝对值方便展示 |
| | | jsonObject.put("diff_tbb_val_abs", Math.abs(differ)); |
| | | jsonObject.put("monitorData",jsonObject.getString("min_value")); |
| | | 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) { |
| | | jsonObject.put("monitorData",jsonObject.getString("max_value")); |
| | | array.add(jsonObject); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | //过滤不需要告警的水库 |
| | | public JSONArray filterNoAlertRes(JSONArray jsonArray,String ruleName){ |
| | | JSONArray result = new JSONArray(); |
| | | |
| | | //获取要过滤的水库数据 |
| | | String noAlertRes= noticeHandle.getNoAlertRes(ruleName); |
| | | |
| | | if (StringUtil.isBlank(noAlertRes)){ |
| | | //如果没有需要过滤的数据 |
| | | return jsonArray; |
| | | } |
| | | |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | |
| | | String resCd = jsonObject.getString("res_cd"); |
| | | //判断水库是否在不告警水库列表中 |
| | | boolean contains = noAlertRes.contains(resCd); |
| | | |
| | | if (!contains){ |
| | | //不在则往结果集中加入数据 |
| | | result.add(jsonObject); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | //给数组赋值监测值,便于后面记录监测值 |
| | | public JSONArray setMonitorData(JSONArray source,String monitorName){ |
| | | JSONArray result = new JSONArray(); |
| | | for (int i = 0; i < source.size(); i++) { |
| | | JSONObject jsonObject = source.getJSONObject(i); |
| | | |
| | | String data = jsonObject.getString(monitorName); |
| | | jsonObject.put("monitorData",data); |
| | | result.add(jsonObject); |
| | | } |
| | | return result; |
| | | } |
| | | } |