|
@@ -487,15 +487,18 @@ public class MyController {
|
|
|
@RequestMapping(value = "/prepare", method = RequestMethod.PUT)
|
|
|
@ApiOperation(value = "修改备考信息", notes = "修改用户备考信息", httpMethod = "PUT")
|
|
|
public Response<Boolean> editPrepare(@RequestBody @Validated UserPrepareDto dto) {
|
|
|
- User entity = Transform.dtoToEntity(dto);
|
|
|
User user = (User) shiroHelp.getLoginUser();
|
|
|
- entity.setId(user.getId());
|
|
|
- if (user.getPrepareTime() == null){
|
|
|
- // 邀请奖励
|
|
|
+ User entity = usersService.get(user.getId());
|
|
|
+
|
|
|
+ User prepareUser = Transform.dtoToEntity(dto);
|
|
|
+ prepareUser.setId(user.getId());
|
|
|
+ prepareUser.setPrepareTime(new Date());
|
|
|
+ usersService.edit(prepareUser);
|
|
|
+
|
|
|
+ if (entity.getPrepareTime() == null){
|
|
|
+ // 备考奖励
|
|
|
orderFlowService.givePrepare(user);
|
|
|
}
|
|
|
- entity.setPrepareTime(new Date());
|
|
|
- usersService.edit(entity);
|
|
|
|
|
|
return ResponseHelp.success(true);
|
|
|
}
|
|
@@ -552,7 +555,7 @@ public class MyController {
|
|
|
for(UserStudyStatRelation type:typeList){
|
|
|
exerciseTime += type.getUserTime();
|
|
|
exerciseQuestion += type.getUserNumber();
|
|
|
- exerciseList.add(new UserExerciseExtendDto(m.get(type.getModule()), type.getUserNumber(), type.getUserTime(), type.getUserCorrect()));
|
|
|
+ exerciseList.add(new UserExerciseExtendDto(type.getModule(), m.get(type.getModule()), type.getUserNumber(), type.getUserTime(), type.getUserCorrect()));
|
|
|
}
|
|
|
// todo 练习统计排行
|
|
|
UserRankStatRelation exerciseRank = userReportService.rankExerciseByTime(user.getId(), start, end);
|
|
@@ -1017,7 +1020,7 @@ public class MyController {
|
|
|
|
|
|
// 最近做题
|
|
|
List<UserQuestion> lastList = userQuestionService.listWithLast(user.getId(), questionIds);
|
|
|
- Map lastMap = Transform.getMap(lastList, UserQuestion.class, "id", "createTime");
|
|
|
+ Map lastMap = Transform.getMap(lastList, UserQuestion.class, "questionId", "createTime");
|
|
|
Transform.combine(pr, lastMap, UserCollectQuestionInfoDto.class, "questionId", "latestTime");
|
|
|
|
|
|
// 收藏、笔记
|
|
@@ -1076,7 +1079,7 @@ public class MyController {
|
|
|
List<Question> questionList = questionService.select(questionIds);
|
|
|
Transform.combine(pr, questionList, UserQuestionErrorInfoDto.class, "questionId", "question", Question.class, "id", QuestionExtendDto.class);
|
|
|
|
|
|
- Collection questionNoIds = Transform.getIds(pr, UserQuestionErrorInfoDto.class, "questionId");
|
|
|
+ Collection questionNoIds = Transform.getIds(pr, UserQuestionErrorInfoDto.class, "questionNoId");
|
|
|
List<QuestionNo> questionNoList = questionNoService.select(questionNoIds);
|
|
|
Transform.combine(pr, questionNoList, UserQuestionErrorInfoDto.class, "questionNoId", "questionNo", QuestionNo.class, "id", QuestionNoExtendDto.class);
|
|
|
|
|
@@ -1087,7 +1090,7 @@ public class MyController {
|
|
|
|
|
|
// 最近做题
|
|
|
List<UserQuestion> lastList = userQuestionService.listWithLast(user.getId(), questionIds);
|
|
|
- Map lastMap = Transform.getMap(lastList, UserQuestion.class, "id", "createTime");
|
|
|
+ Map lastMap = Transform.getMap(lastList, UserQuestion.class, "questionId", "createTime");
|
|
|
Transform.combine(pr, lastMap, UserQuestionErrorInfoDto.class, "questionId", "latestTime");
|
|
|
|
|
|
// 收藏、笔记
|