策略20: 大坝安全监测告警-测压管水位大于校核洪水位-定时任务执行器
| | |
| | | }}; |
| | | |
| | | /** |
| | | * 19.坝安全监测告警 |
| | | * 19.坝安全监测告警-数据缺失 |
| | | */ |
| | | public static List<String> damSafetyList = new ArrayList<String>() |
| | | {{ |
| | |
| | | add("res_nm"); |
| | | add("ms_flag"); |
| | | }}; |
| | | |
| | | /** |
| | | * 20.坝安全监测告警-渗压管水位大于校核洪水位 |
| | | */ |
| | | public static List<String> damSafetySyList = new ArrayList<String>() |
| | | {{ |
| | | add("city_nm,county_nm,town_nm"); |
| | | add("res_nm"); |
| | | add("sy_val"); |
| | | add("tb_chec_fl_stag"); |
| | | }}; |
| | | } |
| | |
| | | public static final String alarm_rain_6_over_api = "/services/1234567890ABCDEFGHIJKLMN/alarm/rain/6/over/api"; |
| | | |
| | | /** |
| | | * 19. 大坝安全监测告警 |
| | | * 19. 大坝安全监测告警-数据缺失 |
| | | */ |
| | | public static final String alarm_db_api = "/services/1234567890ABCDEFGHIJKLMN/alarm/db/api"; |
| | | /** |
| | | * 20. 大坝安全监测告警-渗压管水位 |
| | | */ |
| | | public static final String alarm_db_sy_api = "/services/1234567890ABCDEFGHIJKLMN/alarm/sy/api"; |
| | | |
| | | } |
| | |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | public void damSafetySyHandle(AlarmRule alarmRule, AlarmRuleDetail alarmRuleDetail, JSONArray ztData, List<String> columnList, boolean flag, String adCode, boolean isSendStation, String uuid) { |
| | | // 只发短信,将发短信信息组装好 |
| | | SmsRequestTemplate smsRequestTemplate |
| | | = noticeHandle.getSendSmsTemplate(ztData,alarmRule,alarmRuleDetail,columnList ,flag,adCode,uuid,isSendStation); |
| | | // 拼接内容后面的联系方式,当前模板县水利部人员姓名电话 |
| | | if (smsRequestTemplate.getPersonVOList().size()>0) { |
| | | // 遍历,拼接县水利部人员电话 拼接发送的模板内容 |
| | | for (List<String> list : smsRequestTemplate.getTemplateContent()) { |
| | | // 后面依次拼接 巡查责任人姓名,技术责任人姓名, |
| | | // noticeHandle.addPatrolTechnologyInfo(list,false); |
| | | // 拼接市县水利部人员姓名及联系方式 |
| | | // noticeHandle.addCityCountyBusinessPersonInfo(list); |
| | | // 保存告警记录信息 |
| | | AlarmRecord alarmRecord = noticeHandle.saveAlarmRecord(list,alarmRule,uuid); |
| | | if (null != alarmRecord) { |
| | | list.add(alarmRecord.getId().toString()); |
| | | } |
| | | } |
| | | // 保存站内信记录信息 |
| | | noticeHandle.saveInStationInfo(smsRequestTemplate,alarmRule); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | |
| | | 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 = ""; |
| | |
| | | return "大坝安全监测告警"; |
| | | } |
| | | |
| | | public String damSafetySyHandle(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("?is_alarm=1", ZtApiUrlConstant.alarm_db_sy_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.damSafetySyHandle(alarmRule, alarmRuleDetail, ztData,ZtApiDataColumnConstant.damSafetySyList,true, adCode, true,uuid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 返回 |
| | | return "大坝安全监测告警"; |
| | | } |
| | | } |
| | |
| | | strategyMap.put("twoHourRainHandle", (arg1, arg2) -> noticeStrategyImpl.twoHourRainHandle(arg1, arg2)); |
| | | strategyMap.put("sixHourRainHandle", (arg1, arg2) -> noticeStrategyImpl.sixHourRainHandle(arg1, arg2)); |
| | | strategyMap.put("damSafetyHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetyHandle(arg1, arg2)); |
| | | strategyMap.put("damSafetySyHandle", (arg1, arg2) -> noticeStrategyImpl.damSafetySyHandle(arg1, arg2)); |
| | | } |
| | | |
| | | /** |
| | |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 策略20: 大坝安全监测告警-测压管水位大于校核洪水位-定时任务执行器 |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("damSafetySyHandle") |
| | | public ReturnT<String> damSafetySyHandle(String param){ |
| | | XxlJobLogger.log("开始执行任务..."); |
| | | // 创建外呼任务 |
| | | noticeClient.createAlarmNoticeTaskJobHandler("测压管水位大于校核洪水位","","damSafetySyHandle"); |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | // 返回 |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | } |