|
|
package com.monitor.common.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.monitor.common.config.SendsmsConfig;
|
|
|
import com.monitor.common.service.AlarmMsgService;
|
|
|
import com.monitor.common.service.DingDingService;
|
...
|
...
|
@@ -103,14 +104,23 @@ public class AlarmMsgServiceImpl implements AlarmMsgService { |
|
|
if (StringUtils.isBlank(content)) {
|
|
|
return false;
|
|
|
}
|
|
|
String result = sendSingleSms(content, mobile);
|
|
|
boolean sendStatus = true;
|
|
|
if (result == null) {
|
|
|
sendStatus = false;
|
|
|
String resultJsonString = sendSingleSms(content, mobile);
|
|
|
|
|
|
//发送结果:result为0标识成功
|
|
|
boolean sendStatus = false;
|
|
|
if (resultJsonString !=null ) {
|
|
|
try{
|
|
|
JSONObject jo = JSON.parseObject(resultJsonString);
|
|
|
if(jo!=null&&jo.containsKey("result")&&jo.getIntValue("result")==0){
|
|
|
sendStatus = true;
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
monitorAlarmMapper.insertAlarmMsg(InfluxDBContants.AWS, type, content, alarmInfo, sendStatus ? "successed" : "faild", result,mobile);
|
|
|
monitorAlarmMapper.insertAlarmMsg(InfluxDBContants.AWS, type, content, alarmInfo, sendStatus ? "successed" : "faild", resultJsonString,mobile);
|
|
|
} catch (Exception e) {
|
|
|
logger.error("insert sms into influxdb failed", e);
|
|
|
}
|
...
|
...
|
|