示例#1
0
 private StatisticDetailsBean initStatisticBeanFromGaData(List<String> row) {
   String info = row.get(0);
   String date = row.get(1);
   String hour = row.get(2);
   String minute = row.get(3);
   Date viewDate = DateUtil.convertStringToDate(date + hour + minute, "yyyyMMddhhmm");
   StatisticDetailsBean viewDetailsBean = new StatisticDetailsBean();
   viewDetailsBean.setInfo(info);
   viewDetailsBean.setSubmitDate(new Timestamp(viewDate.getTime()));
   return viewDetailsBean;
 }
示例#2
0
 private List<StatisticDetailsBean> buildStatisicBeanFromGaData(List<List<String>> gaData) {
   StatisticDetailsBean viewDetailsBean;
   Map<String, StatisticDetailsBean> pageTitleStatisticBeanMap =
       new HashMap<String, StatisticDetailsBean>();
   for (List<String> row : gaData) {
     String pageTitle = row.get(0);
     if (StringUtils.isBlank(pageTitle)) {
       continue;
     }
     viewDetailsBean = pageTitleStatisticBeanMap.get(pageTitle);
     if (viewDetailsBean == null) {
       viewDetailsBean = initStatisticBeanFromGaData(row);
       pageTitleStatisticBeanMap.put(pageTitle, viewDetailsBean);
     }
     int pageViews = Lib.getIntValue(row.get(5));
     viewDetailsBean.increasePageViews(pageViews);
   }
   return new ArrayList<StatisticDetailsBean>(pageTitleStatisticBeanMap.values());
 }