Authored by zhengyouwei

add

... ... @@ -56,7 +56,7 @@ public class SmsUpMapperImpl extends InfluxDBQuery implements SmsUpMapper {
@Override
public QueryResult select(int min) {
String command = "SELECT count(nationcode) FROM sms_up where time > now() - "+ min+"m and result = '0'";
String command = "SELECT count(text) FROM sms_up where time > now() - "+ min+"m";
return query(InfluxDBContants.AWS, command, InfluxDBContants.YOMO_MONITOR);
... ...
... ... @@ -49,24 +49,25 @@ public class AlarmSendVoiceTask {
DEBUG.info("alarmSendVoice task sms count = {}", count);
if (count > 5) {//大于无
//todo 查询是否需要语音通知
if (count > 5) {//大于5
boolean needVoice = true;
// QueryResult queryResult1 = smsUpMapper.select(30);
// int voiceCount = QueryResultUtil.getCount(queryResult1);
QueryResult queryResult1 = smsUpMapper.select(30);
int voiceCount = QueryResultUtil.getCount(queryResult1);
// DEBUG.info("alarmSendVoice task sms voiceCount = {}", voiceCount);
DEBUG.info("alarmSendVoice task sms voiceCount = {}", voiceCount);
// if (voiceCount > 0) {
if (voiceCount > 0) {
needVoice = false;
}else {
if (lastTime == 0) {
lastTime = now;
} else {
if (now - lastTime < 10 * 60 * 1000) {//十分钟内不再发送
if (now - lastTime < 10 * 60 * 1000) {//十分钟内不再发送
needVoice = false;
}
}
// }
}
if (needVoice) {
lastTime = now;
... ...