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

      

  • 相关阅读:
    UVa10050 Hartals
    UVa540 Team Queue
    UVa 11234 Expressions (二叉树重建&由叶往根的层次遍历)
    stl lower_bound upper_bound binary_search equal_range
    【windows】使用键盘代替鼠标的快捷键
    【Linux】xshell连接中断后就无法连接虚拟机中的Linux
    【Linux命令】ls命令
    【DB2】NULLS LAST与NULLS FIRST
    【PPT】PPT倒计时动画的制作方法 5.4.3.2.1...
    【Datastage】函数大全
  • 原文地址:https://www.cnblogs.com/SHMILYHP/p/5121868.html
Copyright © 2011-2022 走看看