Commit f7c345f6 by shenjinzhu

每日统计数据量的修改mainThread

parent 332baa98
......@@ -169,12 +169,13 @@ public class MainThread extends Thread {
int count = 0;
List<Channel> channel = serverService.findDisChannel();
for (Channel chan : channel) {
try {
if (chan.getPt().equals("网媒")) {
List<CrawTemplate> list = crawService.findAll();
// 每日的数据量入库(对应模板)
for (CrawTemplate cr : list) {
count = (int) dataService.finCountByDayData(start.getTime(), end.getTime(), cr.getPt(),
cr.getId());
count = (int) dataService.finCountByDayData(start.getTime(), end.getTime(),
cr.getPt(), cr.getId());
Data data = new Data();
data.setCount(count);
data.setTempName(cr.getConfigName());
......@@ -197,16 +198,16 @@ public class MainThread extends Thread {
}
log.info(TimeUtil.yearToDay(start.getTime()) + "|" + data.getTempName() + "|入库");
}
count = (int) dataService.finCountByDayData(start.getTime(), end.getTime(), chan.getPt(),
null);
count = (int) dataService.finCountByDayData(start.getTime(), end.getTime(),
chan.getPt(), null);
Data data = new Data();
data.setCount(count);
data.setPt(chan.getPt());
data.setTime(start.getTime());
dataService.insert(data);
} else {
count = (int) dataService.finCountByDayData(start.getTime(), end.getTime(), chan.getPt(),
null);
count = (int) dataService.finCountByDayData(start.getTime(), end.getTime(),
chan.getPt(), null);
Data data = new Data();
data.setCount(count);
data.setPt(chan.getPt());
......@@ -214,6 +215,9 @@ public class MainThread extends Thread {
dataService.insert(data);
log.info(TimeUtil.yearToDay(start.getTime()) + "|" + chan.getPt() + "|入库");
}
} catch (Exception e) {
}
}
Set<String> keys = allTmp.keySet();
for (Iterator<String> it = keys.iterator(); it.hasNext();) {
......
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