发表于: 2018-01-28 23:12:46

1 598


今天完成事情:

对科目新增, 合作机构新增编辑,热门推荐新增编辑接口进行修改,完成排行榜接口.

  @RequestMapping(value = "/a/u/study/ranking",method = RequestMethod.GET)
   public String getUserRank(HttpServletRequest request,HttpServletResponse response,ModelMap model) throws Exception{

       try {
           List<HashMap<String,Object>> userRankList= new ArrayList<>();

//            获取前五名排行 userId
           List<Long> ids =userLessonPeriodService.getUserLessiodPeriodRank();
           List<User> userList = userService.getObjectsByIds(ids);
           String userName;
           Integer userDay;
           Long userLessonPeriodStudy;

           for (User user:userList){
               HashMap<String,Object> userRank = new HashMap<>();
               userName=user.getName();
               userDay = user.getStudyDay();
               Map<String, Object> param1= DynamicUtil.getCountLessonPeriodIdByUserId(user.getId());
               Object o =  userLessonPeriodService.getObjectByDynamicCondition(UserLessonPeriod.class, param1, 0, Integer.MAX_VALUE);
               userLessonPeriodStudy= BigIntgerToLong.bigIntgerToLong(o).get(0);
               userRank.put("userName",userName);
               userRank.put("userDay",userDay);
               userRank.put("userLessonPeriodStudy",userLessonPeriodStudy);
               userRankList.add(userRank);
           }
           model.addAttribute("code", "0");
           model.addAttribute("userRankList",userRankList);
               return "/user/json/userRank";
           }
        catch (Throwable t) {
           log.error(t.getMessage());
           log.error("get user rank fail  ");
           model.addAttribute("code", -1);
           return "common/fail";
       }
   }


明天计划的事情:

对所有编辑和新增接口进行逻辑修改,

对有用到课时下任务数的接口进行修改,

学习定时任务.


遇到的困难 :

暂无.



任务进度:接口编写

任务开始时间:2017-12-12

预计demo时间:2017-02-09

是否有延期风险:暂无

禅道地址:http://task.ptteng.com/zentao/task-view-17095.html




返回列表 返回列表
评论

    分享到