From 888cd055ef107ee896060a8bf8eba65301f8cb6a Mon Sep 17 00:00:00 2001 From: mzh820631607 Date: Fri, 25 Sep 2020 09:27:33 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EvaluationRecordController.java | 27 ++++++++++++++++++- .../msdw/tms/controller/UserController.java | 2 ++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java index 343015f..581f58b 100644 --- a/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java +++ b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java @@ -65,7 +65,32 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi EvaluationRecordVO evaluationRecordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo - 1); return R.ok().put("data", evaluationRecordVO); } - +// 备份:上一题/下一题/提交 +// @Override +// @GetMapping("/previous") +// public R previousQuestion(@RequestParam("evaluationRecordId") Integer evaluationRecordId, +// @RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo, +// @RequestParam(value = "userAnswer", required = false) String userAnswer) throws ExecutionException, InterruptedException { +// EvaluationRecordVO evaluationRecordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo - 1); +// return R.ok().put("data", evaluationRecordVO); +// } +// @Override +// @GetMapping("/next") +// public R nextQuestion(@RequestParam("evaluationRecordId") Integer evaluationRecordId, +// @RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo, +// @RequestParam(value = "userAnswer", required = false) String userAnswer) throws ExecutionException, InterruptedException { +// EvaluationRecordVO evaluationRecordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo + 1); +// return R.ok().put("data", evaluationRecordVO); +// } +// @Override +// @GetMapping("/submit") +// public R submitEvaluation(@RequestParam("evaluationRecordId") Integer evaluationRecordId, +// @RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo, +// @RequestParam(value = "userAnswer", required = false) String userAnswer, +// @RequestParam("userId") Integer userId) throws ExecutionException, InterruptedException { +// EvaluationRecordSubmitVO recordSubmitVO = evaluationRecordService.submitEvaluation(evaluationRecordId, currentQuestionSortNo, userAnswer, userId); +// return R.ok().put("data", recordSubmitVO); +// } @Override @GetMapping("/next") public R nextQuestion(@RequestParam("evaluationRecordId") Integer evaluationRecordId, diff --git a/src/main/java/com/msdw/tms/controller/UserController.java b/src/main/java/com/msdw/tms/controller/UserController.java index 84093be..aff7cc1 100644 --- a/src/main/java/com/msdw/tms/controller/UserController.java +++ b/src/main/java/com/msdw/tms/controller/UserController.java @@ -40,6 +40,7 @@ public class UserController implements UserControllerApi { return R.ok().put("growthChangeHistory", userEntity); } + @Override @GetMapping("/userinfo/{id}") public R userInfo(@PathVariable("id") Integer id){ UserEntityVo userEntityVo = userService.queryUserId(id); @@ -59,6 +60,7 @@ public class UserController implements UserControllerApi { /** * 修改 */ + @Override @PutMapping("/update") public R update(@RequestBody UserEntity userEntity){ userService.updateById(userEntity); From 2aa4669707833609d5e63b611f593c7b00563a85 Mon Sep 17 00:00:00 2001 From: mzh820631607 Date: Fri, 25 Sep 2020 10:17:00 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mapper/tms/UserDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/mapper/tms/UserDao.xml b/src/main/resources/mapper/tms/UserDao.xml index 75e6767..c12877f 100644 --- a/src/main/resources/mapper/tms/UserDao.xml +++ b/src/main/resources/mapper/tms/UserDao.xml @@ -3,13 +3,13 @@ - SELECT userName, sex, countries, p.provinceName as provinceName, - c.cityName as provinceName, + c.cityName as cityName, IDNumber, educationDegree, schoolName, From 7ae782207db39ac6bf0899e639f5418ac2781ca0 Mon Sep 17 00:00:00 2001 From: mzh820631607 Date: Fri, 25 Sep 2020 10:54:15 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=B5=8B=E8=AF=84=E6=8F=90=E4=BA=A4=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/EvaluationRecordControllerApi.java | 7 ++-- .../EvaluationRecordController.java | 37 ++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/msdw/tms/api/EvaluationRecordControllerApi.java b/src/main/java/com/msdw/tms/api/EvaluationRecordControllerApi.java index be053af..a6ca51d 100644 --- a/src/main/java/com/msdw/tms/api/EvaluationRecordControllerApi.java +++ b/src/main/java/com/msdw/tms/api/EvaluationRecordControllerApi.java @@ -1,6 +1,7 @@ package com.msdw.tms.api; import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.vo.EvaluationRecordVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -44,13 +45,13 @@ public interface EvaluationRecordControllerApi { * 上一题 */ @ApiOperation(value = "上一题", notes = "上一题") - R previousQuestion(Integer evaluationRecordId, Integer currentQuestionSortNo, String userAnswer) throws ExecutionException, InterruptedException; + R previousQuestion(EvaluationRecordVO evaluationRecordVO) throws ExecutionException, InterruptedException; /** * 下一题 */ @ApiOperation(value = "下一题", notes = "下一题") - R nextQuestion(Integer evaluationRecordId, Integer currentQuestionSortNo, String userAnswer) throws ExecutionException, InterruptedException; + R nextQuestion(EvaluationRecordVO evaluationRecordVO) throws ExecutionException, InterruptedException; /** * 提交之前查询是否还有未做完的试题 @@ -62,7 +63,7 @@ public interface EvaluationRecordControllerApi { * 提交测评 */ @ApiOperation(value = "提交测评", notes = "提交测评") - R submitEvaluation(Integer evaluationRecordId, Integer currentQuestionSortNo, String userAnswer, Integer userId) throws ExecutionException, InterruptedException; + R submitEvaluation(EvaluationRecordVO evaluationRecordVO) throws ExecutionException, InterruptedException; /** * 成绩详情 diff --git a/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java index 581f58b..ed792eb 100644 --- a/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java +++ b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java @@ -58,12 +58,13 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi } @Override - @GetMapping("/previous") - public R previousQuestion(@RequestParam("evaluationRecordId") Integer evaluationRecordId, - @RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo, - @RequestParam(value = "userAnswer", required = false) String userAnswer) throws ExecutionException, InterruptedException { - EvaluationRecordVO evaluationRecordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo - 1); - return R.ok().put("data", evaluationRecordVO); + @PostMapping("/previous") + public R previousQuestion(@RequestBody EvaluationRecordVO evaluationRecordVO) throws ExecutionException, InterruptedException { + Integer evaluationRecordId = evaluationRecordVO.getId(); + String userAnswer = evaluationRecordVO.getUserAnswer(); + Integer currentQuestionSortNo = evaluationRecordVO.getCurrentQuestionSortNo(); + EvaluationRecordVO recordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo + 1); + return R.ok().put("data", recordVO); } // 备份:上一题/下一题/提交 // @Override @@ -92,12 +93,13 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi // return R.ok().put("data", recordSubmitVO); // } @Override - @GetMapping("/next") - public R nextQuestion(@RequestParam("evaluationRecordId") Integer evaluationRecordId, - @RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo, - @RequestParam(value = "userAnswer", required = false) String userAnswer) throws ExecutionException, InterruptedException { - EvaluationRecordVO evaluationRecordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo + 1); - return R.ok().put("data", evaluationRecordVO); + @PostMapping("/next") + public R nextQuestion(@RequestBody EvaluationRecordVO evaluationRecordVO) throws ExecutionException, InterruptedException { + Integer evaluationRecordId = evaluationRecordVO.getId(); + String userAnswer = evaluationRecordVO.getUserAnswer(); + Integer currentQuestionSortNo = evaluationRecordVO.getCurrentQuestionSortNo(); + EvaluationRecordVO recordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo + 1); + return R.ok().put("data", recordVO); } @Override @@ -108,11 +110,12 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi } @Override - @GetMapping("/submit") - public R submitEvaluation(@RequestParam("evaluationRecordId") Integer evaluationRecordId, - @RequestParam("currentQuestionSortNo") Integer currentQuestionSortNo, - @RequestParam(value = "userAnswer", required = false) String userAnswer, - @RequestParam("userId") Integer userId) throws ExecutionException, InterruptedException { + @PostMapping("/submit") + public R submitEvaluation(@RequestBody EvaluationRecordVO evaluationRecordVO) throws ExecutionException, InterruptedException { + Integer evaluationRecordId = evaluationRecordVO.getId(); + String userAnswer = evaluationRecordVO.getUserAnswer(); + Integer currentQuestionSortNo = evaluationRecordVO.getCurrentQuestionSortNo(); + Integer userId = evaluationRecordVO.getUserId(); EvaluationRecordSubmitVO recordSubmitVO = evaluationRecordService.submitEvaluation(evaluationRecordId, currentQuestionSortNo, userAnswer, userId); return R.ok().put("data", recordSubmitVO); }