Commit 31c6cb65 by 马黎滨

预警打印

parent 56a2d38e
...@@ -29,8 +29,9 @@ public class TipsUtils { ...@@ -29,8 +29,9 @@ public class TipsUtils {
if(!typeTips.containsKey(type)){ if(!typeTips.containsKey(type)){
//发送预警 //发送预警
String crawlerContent = String.format("%s数据采集异常",type); String crawlerContent = String.format("%s数据采集异常",type);
QYWechatUtil.send(key, QYWechatUtil.MSGTYPE_TEXT, crawlerContent, // QYWechatUtil.send(key, QYWechatUtil.MSGTYPE_TEXT, crawlerContent,
null, null); // null, null);
System.out.println(crawlerContent);
} }
typeTips.put(type,time); typeTips.put(type,time);
} }
...@@ -46,9 +47,29 @@ public class TipsUtils { ...@@ -46,9 +47,29 @@ public class TipsUtils {
typeTips.remove(type); typeTips.remove(type);
//发送恢复通知 //发送恢复通知
String crawlerContent = String.format("%s数据采集恢复正常",type); String crawlerContent = String.format("%s数据采集恢复正常",type);
QYWechatUtil.send(key, QYWechatUtil.MSGTYPE_TEXT, crawlerContent, // QYWechatUtil.send(key, QYWechatUtil.MSGTYPE_TEXT, crawlerContent,
null, null); // null, null);
System.out.println(crawlerContent);
} }
} }
} }
/**
* 从String类型中截取出热度值
* @param hotCountString
* @return
*/
public static Integer getHotCount(String hotCountString){
Integer count;
if(hotCountString.contains("万")){
hotCountString = hotCountString.replaceAll("万.*", "").trim();
count = (int)(Double.parseDouble(hotCountString)*10000);
}else if(hotCountString.contains("亿")){
hotCountString = hotCountString.replaceAll("亿.*", "").trim();
count = (int)(Double.parseDouble(hotCountString)*10000000);
}else{
count = (int)(Double.parseDouble(hotCountString));
}
return count;
}
} }
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