...
|
...
|
@@ -36,6 +36,9 @@ public class VoiceMsgServiceImpl implements VoiceMsgService { |
|
|
@Autowired
|
|
|
private ZkClientUtil zkClient;
|
|
|
|
|
|
@Autowired
|
|
|
private DingDingServiceImpl dingDingService;
|
|
|
|
|
|
public final Logger DEBUG = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
private String ZK_PATH = "/yh/config/";
|
...
|
...
|
@@ -70,6 +73,11 @@ public class VoiceMsgServiceImpl implements VoiceMsgService { |
|
|
|
|
|
@Override
|
|
|
public void sendVoiceAlarm(String mobile,String content) throws UnsupportedEncodingException {
|
|
|
String promptfile = "请及时处理故障:紧急故障";
|
|
|
if (content != null){
|
|
|
promptfile = "请及时处理故障:"+content;
|
|
|
}
|
|
|
|
|
|
//根据zk的开关判断是否需要发送数据
|
|
|
String open="";
|
|
|
try{
|
...
|
...
|
@@ -79,15 +87,13 @@ public class VoiceMsgServiceImpl implements VoiceMsgService { |
|
|
DEBUG.error("Send msg type get ZK_PATH smsVoiceSendSwitch error",e);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(open)&&"false".equals(open)){
|
|
|
dingDingService.insertMsg("yhops语音告警(语音告警已关闭):"+promptfile);
|
|
|
return ;//开关关掉了,不再发送语音
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
VoiceSmsNotice voiceSms = new VoiceSmsNotice();
|
|
|
String promptfile = "请及时处理故障:紧急故障";
|
|
|
if (content != null){
|
|
|
promptfile = "请及时处理故障:"+content;
|
|
|
}
|
|
|
|
|
|
voiceSms.setPromptfile(promptfile);
|
|
|
voiceSms.setExt("nothing");
|
|
|
String[] mobiles = mobile.split(",");
|
...
|
...
|
@@ -102,6 +108,7 @@ public class VoiceMsgServiceImpl implements VoiceMsgService { |
|
|
monitorAlarmMapper.insertAlarmMsg(InfluxDBContants.AWS, "voice", promptfile, "null", result!=null ? "successed" : "faild", result,mobile);
|
|
|
}
|
|
|
|
|
|
dingDingService.insertMsg("yhops语音告警:"+promptfile);
|
|
|
} catch (Exception e) {
|
|
|
DEBUG.error("sendVoide notice error ", e);
|
|
|
}
|
...
|
...
|
|