public static Chart getStatisticalData(List<AdminIndexData> listAdminIndex, String name,String startTime,String endTime,AdminIndexService adminIndexService,AdminIndexData ad) { Chart chart = new Chart(); Calendar star = Calendar.getInstance(); star.setTime(DateUtils.parseDate(startTime)); Calendar end = Calendar.getInstance(); end.setTime(DateUtils.parseDate(endTime)); List<Integer> datas = new ArrayList<Integer>(); //int total=0; int countZhuBanFan=adminIndexService.getCountZhuBanFan(ad); int countDaiLiShang=adminIndexService.getCountDaiLiShang(ad); int countAccount=adminIndexService.getCountAccount(ad); int countExhiMain=adminIndexService.getCountExhiMain(ad); int countHuiYiMain=adminIndexService.getCountHuiYiMain(ad); int countOrder=adminIndexService.getCountOrder(ad); String month=""; for (;star.getTime().getTime()<=end.getTime().getTime();star.add(Calendar.MONTH, 1)){ month = DateUtils.formatDate(star.getTime(), "yyyy-MM"); int number = 0;; for (AdminIndexData adminIndexData : listAdminIndex) { if (month.equals(adminIndexData.getMonthTime())) { number = adminIndexData.getNumber(); //total = total+number; } } datas.add(number); //chart.setName(name+"<br/>"+String.valueOf(total)); if("展会主办方".equals(name)){ chart.setName(name+"<br/>"+String.valueOf(countZhuBanFan)); }else if("展会代理商".equals(name)){ chart.setName(name+"<br/>"+String.valueOf(countDaiLiShang)); }else if("用户账号".equals(name)){ chart.setName(name+"<br/>"+String.valueOf(countAccount)); }else if("展览".equals(name)){ chart.setName(name+"<br/>"+String.valueOf(countExhiMain)); }else if("会议".equals(name)){ chart.setName(name+"<br/>"+String.valueOf(countHuiYiMain)); }else if("订单".equals(name)){ chart.setName(name+"<br/>"+String.valueOf(countOrder)); } chart.setData(datas); } return chart; } }
时间: 2024-10-10 07:35:40