public String getBrokerReward() throws Exception { ? ? ?User user = (User) session("user"); ? ? ?Long userId = user.getId();// 獲得用戶編號 ? ? ?pageBean.setPageNum(1); ? ? ?pageBean.setPageSize(12); ? ? ?myHomeService.getEveryMonthReward(pageBean, userId); ? ? ?List<Map<String, Object>> list = pageBean.getPage(); ? ? ? ? ? ?List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>(); ? ? ?DateFormat dateFormat = new SimpleDateFormat("yyyy-MM");for (int i = 0; i < 12; i++) { ? String month = dateFormat.format(DateUtil.dateAddMonth(new Date(), ? ? ? ? i - 12)); ? Map<String, Object> map = new HashMap<String, Object>(); ? map.put("month", month); ? map.put("reward", 0.00); ? map.put("rewardFormat", "0.00"); ? ? for(Map<String, Object> reward : list){ ? ? ?if(month.equals((String)reward.get("month"))){ ? ? ? ? map.put("reward", reward.get("reward")); ? ? ? ? map.put("rewardFormat", reward.get("rewardFormat")); ? ? ? ? ? ? ? ? list.remove(reward); ? ? ? ? break; ? ? ?} ? } ? resultList.add(map);}Map<String, Object> resultMap = new HashMap<String, Object>();resultMap.put("result", resultList);JSONUtils.printObject(resultMap); ? ? ?return null; ?}這是后臺給的數(shù)據(jù),什么意思
添加回答
舉報
0/150
提交
取消