...
|
...
|
@@ -7,6 +7,7 @@ import com.monitor.common.util.MD5Util; |
|
|
import com.monitor.influxdb.contants.InfluxDBContants;
|
|
|
import com.monitor.influxdb.mapper.MonitorAlarmMapper;
|
|
|
import com.monitor.model.domain.VoiceSms;
|
|
|
import com.monitor.model.domain.VoiceSmsNotice;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
...
|
...
|
@@ -29,7 +30,7 @@ public class VoiceMsgServiceImpl implements VoiceMsgService { |
|
|
public final Logger DEBUG = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
@Override
|
|
|
public void sendVoide(String mobile) throws UnsupportedEncodingException {
|
|
|
public void sendVoice(String mobile) throws UnsupportedEncodingException {
|
|
|
|
|
|
try {
|
|
|
|
...
|
...
|
@@ -54,4 +55,31 @@ public class VoiceMsgServiceImpl implements VoiceMsgService { |
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public void sendVoiceAlarm(String mobile) throws UnsupportedEncodingException {
|
|
|
try {
|
|
|
|
|
|
VoiceSmsNotice voiceSms = new VoiceSmsNotice();
|
|
|
voiceSms.setPromptfile("请及时处理故障:紧急故障");
|
|
|
voiceSms.setExt("nothing");
|
|
|
String[] mobiles = mobile.split(",");
|
|
|
for (String str : mobiles) {
|
|
|
VoiceSmsNotice.Tel tel = new VoiceSmsNotice.Tel();
|
|
|
tel.setNationcode("86");
|
|
|
tel.setPhone(str);
|
|
|
voiceSms.setSig(MD5Util.encryption("6e56f948f6f1c0a1bc359e23f7acc140" + str));
|
|
|
voiceSms.setTel(tel);
|
|
|
DEBUG.info("send voice notice msg,content:{}", JSON.toJSONString(voiceSms));
|
|
|
String result = httpRestClientService.doPostStringJson("https://yun.tim.qq.com/v3/tlsvoicesvr/sendvoiceprompt?sdkappid=1400021400&random=123", JSON.toJSONString(voiceSms));
|
|
|
DEBUG.info("send voice notice msg,result:{}", result);
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
DEBUG.error("sendVoide notice error ", e);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
} |
...
|
...
|
|