• 时间日期循环


    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;
    		
    	}
    }
    

      

  • 相关阅读:
    网页自动跳转/定时跳转代码
    阿里云ECS用Xshell安装wdcp教程
    wdcp环境下更新PHP到5.3教程
    WDCP 安装教程,超简单!!
    Jquery select 三级联动 (需要JSON数据)
    Jquery实现循环删除Reaper某一行
    jquery更改Reaper某一列的值
    联系电话正则表达式(jquery表单验证)
    Jquery获取选中的checkbox的值
    sql语句创建主键、外键、索引、绑定默认值
  • 原文地址:https://www.cnblogs.com/SHMILYHP/p/5121868.html
Copyright © 2020-2023  润新知