Commit fb4eb0ca by 马黎滨

Merge branch 'mlbWork' into 'master'

预警打印

See merge request !11
parents d2c550e7 31c6cb65
......@@ -29,8 +29,9 @@ public class TipsUtils {
if(!typeTips.containsKey(type)){
//发送预警
String crawlerContent = String.format("%s数据采集异常",type);
QYWechatUtil.send(key, QYWechatUtil.MSGTYPE_TEXT, crawlerContent,
null, null);
// QYWechatUtil.send(key, QYWechatUtil.MSGTYPE_TEXT, crawlerContent,
// null, null);
System.out.println(crawlerContent);
}
typeTips.put(type,time);
}
......@@ -46,9 +47,29 @@ public class TipsUtils {
typeTips.remove(type);
//发送恢复通知
String crawlerContent = String.format("%s数据采集恢复正常",type);
QYWechatUtil.send(key, QYWechatUtil.MSGTYPE_TEXT, crawlerContent,
null, null);
// QYWechatUtil.send(key, QYWechatUtil.MSGTYPE_TEXT, crawlerContent,
// 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