Commit 9b83ec7e by admin

1

parent a27ef8a3
......@@ -41,13 +41,13 @@ public class MainThread extends Thread {
public static Map<String, Template> allTmp = new ConcurrentHashMap<String, Template>();
public static Map<String, String> map = new HashMap<>();
static ESUtil es = new ESUtil();
static Map<String,Integer> counts=new HashMap<>();
static Map<String, Integer> counts = new HashMap<>();
static {
counts.put("网媒", 1200);
counts.put("微博", 2000);
counts.put("微信", 3500);
counts.put("知乎", 300);
// counts.put("平媒", 300);
// counts.put("平媒", 300);
}
public MainThread() {
......@@ -185,10 +185,11 @@ public class MainThread extends Thread {
data.setTime(start.getTime());
dataService.insert(data);
log.info(sdf.format(start.getTime()) + "|" + chan.getPt() + "|入库");
if(count<counts.get(chan.getPt())) {
Messages m=new Messages();
m.setTitle("渠道低数据量预警{"+chan.getPt()+"}");
m.setContent("1小时内的数据量为:"+count);
if (counts.get(chan.getPt()) != null)
if (count < counts.get(chan.getPt())) {
Messages m = new Messages();
m.setTitle("渠道低数据量预警{" + chan.getPt() + "}");
m.setContent("1小时内的数据量为:" + count);
SendMailUtil.sendMessage(Config.getVal("count_mail"), m);
}
} catch (Exception e) {
......
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