/**
* 異步加載后台首頁
* @param model
* @return
*/
@ResponseBody
@RequestMapping("/loadData")
public Map<Object, Object> loadData(HttpSession session, HttpServletResponse response, Model model, HttpServletRequest request,String startTime,String endTime) {
AdminIndexData adminIndexData = new AdminIndexData();
if(("".equals(startTime) || startTime==null) || ("".equals(endTime) || endTime == null)){
adminIndexData.setStartTime(adminIndexService.getNewDate("yyyy-MM", 11));//開始時間默認為當前時間的前11個月的時間
adminIndexData.setEndTime(adminIndexService.getDate("yyyy-MM",0));//結束時間為當前時間
}else{
adminIndexData.setStartTime(startTime);
adminIndexData.setEndTime(endTime);
}
HashMap<Object, Object> map = Maps.newHashMap();
List<Chart> listChar = new ArrayList<Chart>();
List<AdminIndexData> zhuBanFanList= RedisCacheManager.getAllZhuBanFanCount(model, "zhuBanfangcount", adminIndexService,adminIndexData);// 按年月份統計展會主辦方
List<AdminIndexData> daiLiShangList = RedisCacheManager.getAllDaiLiShang(model, "daiLiShanCount", adminIndexService,adminIndexData);// 按年月份統展會代理商
List<AdminIndexData> accountList = RedisCacheManager.getAllCountAccount(model, "accountCount", adminIndexService,adminIndexData);//按年月份統計用戶賬號
List<AdminIndexData> exhiMainList = RedisCacheManager.getAllExhiMain(model, "exhiMainCount", adminIndexService,adminIndexData);//按年月份統計展覽
List<AdminIndexData> huiYiMainList = RedisCacheManager.getAllHuiYiMain(model, "huiYiMainCount", adminIndexService,adminIndexData);//按年月份統計會議
List<AdminIndexData> orderList = RedisCacheManager.getAllOrder(model, "orderCount", adminIndexService,adminIndexData);//按年月份統計訂單
listChar.add(RedisCacheManager.getStatisticalData(zhuBanFanList, "展會主辦方",adminIndexData.getStartTime(),adminIndexData.getEndTime(),adminIndexService,adminIndexData));//將主辦方的數據放到集合里面
listChar.add(RedisCacheManager.getStatisticalData(daiLiShangList, "展會代理商",adminIndexData.getStartTime(),adminIndexData.getEndTime(),adminIndexService,adminIndexData));//將展會代理商的數據放到集合里面
listChar.add(RedisCacheManager.getStatisticalData(accountList, "用戶賬號",adminIndexData.getStartTime(),adminIndexData.getEndTime(),adminIndexService,adminIndexData));//將用戶賬號的數據放到集合里面
listChar.add(RedisCacheManager.getStatisticalData(exhiMainList, "展覽",adminIndexData.getStartTime(),adminIndexData.getEndTime(),adminIndexService,adminIndexData));//將展覽總數的數據放到集合里面
listChar.add(RedisCacheManager.getStatisticalData(huiYiMainList, "會議",adminIndexData.getStartTime(),adminIndexData.getEndTime(),adminIndexService,adminIndexData));//將會議總數的數據放到集合里面
listChar.add(RedisCacheManager.getStatisticalData(orderList, "訂單",adminIndexData.getStartTime(),adminIndexData.getEndTime(),adminIndexService,adminIndexData));//將訂單總數的數據放到集合里面
map.put("series", listChar);
map.put("categories", adminIndexService.getYearMonth(adminIndexData.getStartTime(), adminIndexData.getEndTime()));
return map;
}