发表于: 2018-01-04 21:48:30

1 437


一.今天完成的主要事情

1.修复昨天有问题的表以及实现

主要是修改 添加已做题目接口 的实现方式

因为要求当用户打开某个开关时,重复做某题时后做的结果会覆盖掉之前做的结果,而关闭该按钮时,用户做错的题会覆盖之前做的结果,但是做对的题则不覆盖之前做题的结果,所以这里要重新加一些判断

代码如下

/**
* 记录做题结果
*
* @param
* @return
* @throws ServiceException
* @throws ServiceDaoException
*/
@RequestMapping(value = "/a/u/note", method = RequestMethod.POST)
public String recordPracticeResult(HttpServletRequest request, HttpServletResponse response, ModelMap model, Long studentId,
Long practiceId, Integer subjectType, Integer result, Integer isRemoved) throws Exception {
log.info("Interface POST /a/u/note, Method recordPracticeResult() parameters: studentId : " + studentId + ", practiceId" +
practiceId + ", subjectType: " + subjectType +", result: " + result +", isRemoved: " + isRemoved);

int validateResult = ParamsUtil.checkParamsOfRecordPracticeResult(studentId, practiceId, subjectType, result, isRemoved);
if (validateResult != 0){
model.addAttribute("code", validateResult);
return "/common/failure";
}

try{
Long noteId = noteService.getNoteIdByStudentIdAndPracticeId(studentId, practiceId);
log.info("get note id by studentId and practiceId, note id is : " + noteId);
if (DataUtils.isNullOrEmpty(noteId)){
Note note = new Note();
note.setStudentId(studentId);
note.setPracticeId(practiceId);
note.setSubjectType(subjectType);
note.setResult(result);
note.setCreateBy(studentId);
note.setUpdateBy(studentId);
noteId = noteService.insert(note);
log.info("insert note success, note id is : " + noteId);
} else{
if (isRemoved == 1 || result == 0){
Note note = noteService.getObjectById(noteId);
log.info("get note data by id, note is : " + note);

note.setResult(result);
noteService.update(note);
log.info("update note success, note id is : " + note.getId());
}
}
model.addAttribute("code", 0);
return "/common/success";
} catch (Throwable t){
log.error(t.getMessage());
log.error("Method recordPracticeResult() failed, parameters: studentId : " + studentId + ", practiceId" +
practiceId + ", subjectType: " + subjectType +", result: " + result);
model.addAttribute("code", -1);
return "/common/failure";
}
}

2.完成计划中的开发任务

标注已完成的task就是今天完成的任务,由于实现比较简单,所以具体就不贴了

3.修复昨天说的后台的科目三的音频部分的问题

这里也是要加一个字段,要对表和代码进行一些修改,不过还好,很快就修改完了,具体也没什么好说的


二.明天计划完成的事情

1.将考点相关的数据导入到数据库中

2.如果有时间,将考点部分的功能实现了.


三.遇到的问题

暂无


四.收获

以上


五,项目进度情况

暂无延期风险


返回列表 返回列表
评论

    分享到