Esempio n. 1
0
 private void buildCompanyStatisticBean(
     List<OverviewStatisticBean> statisticBeans,
     Date toDate,
     Date fromLast7Days,
     Date fromLast30Days) {
   int total = ((Long) companyRepo.count()).intValue();
   int last7Days = companyRepo.countInDateRange(fromLast7Days, toDate, Company.class.getName());
   int last30Days = companyRepo.countInDateRange(fromLast30Days, toDate, Company.class.getName());
   OverviewStatisticBean statisticBean =
       new OverviewStatisticBean(
           "Ask For Company Advice",
           total,
           last7Days,
           last30Days,
           WebConstants.FixValue.COMPANY_REPORT);
   statisticBeans.add(statisticBean);
 }
Esempio n. 2
0
 public List<StatisticDetailsBean> getCompanyStatisticData(Date from, Date to) {
   List<StatisticDetailsBean> results = new ArrayList<StatisticDetailsBean>();
   List<Company> companies = companyRepo.findInDateRange(from, to);
   StatisticDetailsBean companyDetailsBean = null;
   for (Company c : companies) {
     companyDetailsBean =
         new StatisticDetailsBean(c.getCompanyId(), c.getInfo(), c.getEmail(), c.getCreatedDate());
     results.add(companyDetailsBean);
   }
   return results;
 }