| | |
| | | import cn.gistack.alerts.alarmRule.entity.AlarmRule; |
| | | import cn.gistack.alerts.alarmRule.service.AlarmRecordService; |
| | | import cn.gistack.alerts.alarmRule.service.AlarmRuleService; |
| | | import cn.gistack.alerts.notice.constant.ZtConfigConstant; |
| | | import cn.gistack.alerts.sms.service.ISmsTemplateService; |
| | | import cn.gistack.sm.intelligentCall.constant.ZtConstant; |
| | | import cn.gistack.common.utils.SpringContextUtil; |
| | | import cn.gistack.alerts.notice.constant.PtInfoConstant; |
| | | import cn.gistack.alerts.notice.constant.ZtApiDataColumnConstant; |
| | | import cn.gistack.alerts.notice.constant.ZtApiUrlConstant; |
| | |
| | | import org.springframework.web.client.RestTemplate; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 通知策略 |
| | |
| | | } |
| | | } |
| | | // 调用短信服务 |
| | | smsService.sendSignMsg(smsRequestTemplate); |
| | | Map<String,Object> map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 返回 |
| | | return "本次-水位初次超汛限告警短信成功通知数量:" + map.get("smsRecord"); |
| | | } |
| | | // 返回 |
| | | return "水位超低于死水位"; |
| | |
| | | } |
| | | } |
| | | // 调用短信服务 |
| | | smsService.sendSignMsg(smsRequestTemplate); |
| | | Map<String, Object> map = smsService.sendSignMsg(smsRequestTemplate); |
| | | // 返回 |
| | | return "本次-水位初次超汛限告警短信成功通知数量:" + map.get("smsRecord"); |
| | | } |
| | | // 返回 |
| | | return "水位初次超汛限告警"; |
| | |
| | | * @return |
| | | */ |
| | | private JSONArray getZtData(String params, String url) { |
| | | // 获取环境 |
| | | String activeProfile = SpringContextUtil.getActiveProfile(); |
| | | if (activeProfile.equals("dev")){ |
| | | url = ZtApiUrlConstant.url_prefix_dev + url; |
| | | } |
| | | if (activeProfile.equals("prod")){ |
| | | url = ZtApiUrlConstant.url_prefix_prod + url; |
| | | } |
| | | //设置请求头 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add(ZtConstant.header_key, ZtConstant.header_value); |
| | | headers.add(ZtConfigConstant.header_key, ZtConfigConstant.header_value); |
| | | //封装请求头 |
| | | HttpEntity<MultiValueMap<String, Object>> formEntity = new HttpEntity<MultiValueMap<String, Object>>(headers); |
| | | try { |
| | |
| | | formEntity, |
| | | String.class); |
| | | JSONObject jsonObject = JSON.parseObject(responseEntity.getBody()); |
| | | JSONArray jsonArray = JSONArray.parseArray(jsonObject.get("data").toString()); |
| | | // 返回 |
| | | return jsonArray; |
| | | return JSONArray.parseArray(jsonObject.get("data").toString()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |