| | |
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.exception.SMSException;
|
| | | import com.yeshi.fanli.exception.config.SMSException;
|
| | |
|
| | | /**
|
| | | * 紧急告警
|
| | |
| | | static Map<String, Long> emergentTimeMap = new HashMap<>();
|
| | |
|
| | | public static void baoJin(String key, String name, String[] phones) {
|
| | | if (emergentTimeMap.get(key) == null || System.currentTimeMillis() - emergentTimeMap.get(key) > 1000 * 60 * 2)// 2分钟报警一次
|
| | | if (emergentTimeMap.get(key) == null || System.currentTimeMillis() - emergentTimeMap.get(key) > 1000 * 60 * 10)// 10分钟报警一次
|
| | | {
|
| | | emergentTimeMap.put(key, System.currentTimeMillis());
|
| | | // 发送短信
|