//获取柱状图数据的方法
public OrderMoneyNumVo getOrderMoneyCount(Integer siteNumber) {
//柱状图参数实体类
OrderMoneyNumVo orderMoneyNumVo = new OrderMoneyNumVo();
ArrayList<String> xData = new ArrayList<>();
ArrayList<Integer> yData = new ArrayList<>();
//初始化一个日历对象
Calendar calendar = Calendar.getInstance();
int month = 0;
int numMoney = 0;
for (int i = 0; i < 12; i++, calendar.add(Calendar.MONTH, -1)) {
month = calendar.get(Calendar.MONTH) + 1;
xData.add(String.valueOf(month));
numMoney = organizationDao.getOrderMoneyByMonth(month, siteNumber);
yData.add(numMoney);
}
//将倒序改为正序
Collections.reverse(xData);
Collections.reverse(yData);
orderMoneyNumVo.setxData(xData);
orderMoneyNumVo.setyData(yData);
return orderMoneyNumVo;
}