zoukankan      html  css  js  c++  java
  • 时间日期循环

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

      

  • 相关阅读:
    1.Http讲解
    1.创建SpringMVC项目
    0.学习springmvc补充
    apache-maven安装
    apache-tomcat安装
    Tomcat启动问题:严重[main] org.apache.catalina.core.AprLifecycleListener.init An incompatible version...
    Tomcat启动服务报错:Unknown version string [4.0]. Default version will be used.
    设置make为内部命令
    Xshell6和Xftp6初步使用
    Swift字符串类型
  • 原文地址:https://www.cnblogs.com/SHMILYHP/p/5121868.html
Copyright © 2011-2022 走看看