发表于: 2018-01-24 21:24:22
1 486
今天完成的事情:
准备小课堂 mybatis -generator代码生成.
写接口 .用户收藏课时接口,消息列表接口,消息新增接口.
@RequestMapping(value = "/a/u/user/lessionPeriod/keep", method = RequestMethod.GET)
public String userLessionPeriod(HttpServletRequest request,HttpServletResponse response,ModelMap model)throws Exception{
Long userId = userUtil.getUserIdFromRequest(request, response);
log.info("get user id is" + userId);
if (userId == null) {
log.info("userId is null");
model.addAttribute("code", -5021);
return "/common/fail";
}
log.info("add userKeep userId " + userId);
try{
List<HashMap<String, Object>> realLessionPeriod = new ArrayList<>();
HashMap<String, Object> lessionPeriodMap = new HashMap<>();
List<Long> lessionPeriodIds = keepService.getLessonPeriodIdsByUserId(userId,0,Integer.MAX_VALUE);
// 从小到大排序
Collections.sort(lessionPeriodIds);
List<LessonPeriod> lessonPeriodList= lessonPeriodService.getObjectsByIds(lessionPeriodIds);
// 获取课时下面的任务数
Map<String, Object> param = DynamicUtil.countTaskTotalByCourse(lessionPeriodIds);
List<Long> taskCountids = lessonPeriodService.getIdsByDynamicCondition(Task.class, param, 0, Integer.MAX_VALUE);
// id若为空这说明没有没有解锁
Long unLockId = 0L;
Long dataStatus= 0L;
for (LessonPeriod lessonPeriod:lessonPeriodList){
Long lessonPeriodServiceId = lessonPeriod.getId();
Map<String, Object> param1= DynamicUtil.getLockByLessonPeriodId(lessonPeriodServiceId);
List<Long> lockId = lessonPeriodService.getIdsByDynamicCondition(Lockstitch.class, param, 0, Integer.MAX_VALUE);
if (CollectionUtils.isNotEmpty(lockId)){
unLockId =1L;
}
Map<String, Object> param2= DynamicUtil.getdataIdByLessonPeriodId(lessonPeriodServiceId);
List<Long> dataId = lessonPeriodService.getIdsByDynamicCondition(Data.class, param, 0, Integer.MAX_VALUE);
if (CollectionUtils.isNotEmpty(lockId)){
dataStatus =1L;
}
lessionPeriodMap.put("lessonPeriodServiceId",lessonPeriodServiceId);
lessionPeriodMap.put("dataStatus",dataStatus);
lessionPeriodMap.put("lessonPeriodName",lessonPeriod.getName());
lessionPeriodMap.put("taskCountids",taskCountids);
lessionPeriodMap.put("status",lessonPeriod.getStatus());
lessionPeriodMap.put("unLockId",unLockId);
realLessionPeriod.add(lessionPeriodMap);
}
model.addAttribute("code", 0);
model.addAttribute("realLessionPeriod", realLessionPeriod);
} catch (Throwable t) {
log.error(t.getMessage());
log.error("get course error,id is ");
model.addAttribute("code", -1);
}
return "userLessonPeriod/json/keepLessonPeriod";
}
}
明天计划的事情:
准备小课堂.
完成后台消息模块
完成用户签到接口
遇到的困难:
课程进度,课时进度. 没有专门记录的表,与验收标准不符. 需要重新生成表, 代码也需要重新修改.
任务进度:接口编写
任务开始时间:2017-12-12
预计demo时间:2017-02-09
是否有延期风险:暂无
禅道地址:http://task.ptteng.com/zentao/task-view-17095.html
评论