Commit 2a1b40ca by zt

修改

parent 50337bb3
......@@ -4,6 +4,8 @@ import com.foc.entity.AccessInfo;
import com.foc.service.Sms;
import com.foc.service.SoundMonitorService;
import com.foc.util.PropertiesUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Properties;
......@@ -17,6 +19,8 @@ import java.util.Properties;
*/
public class DbSoundsMonitorTask {
private static final Logger logger = LoggerFactory.getLogger(DbSoundsMonitorTask.class);
public static void main(String[] args) throws Exception {
if (args == null || args.length == 0){
loadConf(Thread.currentThread().getContextClassLoader().getResource("global.properties").getPath());
......@@ -29,15 +33,14 @@ public class DbSoundsMonitorTask {
//查看定时任务最后同步时间
SoundMonitorService.init();
Integer i = SoundMonitorService.test();
if (i == 2){
if (i == 1){
//发送短信
AccessInfo accessInfo = new AccessInfo();
accessInfo.setAicc("5");
accessInfo.setAicp("10.68.26.52");
Properties properties = PropertiesUtil.getProperties(path);
String result = Sms.sendSms(accessInfo, properties.getProperty("mobile"), "警告");
System.out.println(result);
logger.info(result);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment