From 0d4864f7f73c0621c5a1a7361c53cd2430272906 Mon Sep 17 00:00:00 2001 From: CrazyIter_Bin Date: Tue, 22 Oct 2024 18:24:08 +0800 Subject: [PATCH] update --- .../admin/controller/ExamController.java | 7 +++++++ .../controller/admin/service/ExamService.java | 1 + .../admin/service/impl/ExamServiceImpl.java | 18 ++++++++++++++---- .../model/dto/admin/exam/FindByStudentDto.java | 16 ++++++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 src/main/java/cn/teammodel/model/dto/admin/exam/FindByStudentDto.java diff --git a/src/main/java/cn/teammodel/controller/admin/controller/ExamController.java b/src/main/java/cn/teammodel/controller/admin/controller/ExamController.java index f929bd7..629c0bf 100644 --- a/src/main/java/cn/teammodel/controller/admin/controller/ExamController.java +++ b/src/main/java/cn/teammodel/controller/admin/controller/ExamController.java @@ -49,4 +49,11 @@ public class ExamController { return R.success(res); } + @PostMapping("getExamByStudent") + @ApiOperation("获取单个学生的简易分析结果") + public R> getExamByStudent(@Valid @RequestBody FindByStudentDto findByStudentDto, HttpServletRequest request) { + Map res = examService.getExamByStudent(findByStudentDto,request); + return R.success(res); + } + } diff --git a/src/main/java/cn/teammodel/controller/admin/service/ExamService.java b/src/main/java/cn/teammodel/controller/admin/service/ExamService.java index 5ac51dd..c402a90 100644 --- a/src/main/java/cn/teammodel/controller/admin/service/ExamService.java +++ b/src/main/java/cn/teammodel/controller/admin/service/ExamService.java @@ -10,4 +10,5 @@ public interface ExamService { Map getExamList(AnalysisDto analysisDto, HttpServletRequest request); Map getExamSimpleAnalysis(FindExamDto findExamDto, HttpServletRequest request); Map getExamRecord(ExamRecordDto examRecordDto, HttpServletRequest request); + Map getExamByStudent(FindByStudentDto findByStudentDto, HttpServletRequest request); } diff --git a/src/main/java/cn/teammodel/controller/admin/service/impl/ExamServiceImpl.java b/src/main/java/cn/teammodel/controller/admin/service/impl/ExamServiceImpl.java index 874d472..1a74e3d 100644 --- a/src/main/java/cn/teammodel/controller/admin/service/impl/ExamServiceImpl.java +++ b/src/main/java/cn/teammodel/controller/admin/service/impl/ExamServiceImpl.java @@ -3,10 +3,7 @@ package cn.teammodel.controller.admin.service.impl; import cn.teammodel.common.ErrorCode; import cn.teammodel.config.exception.ServiceException; import cn.teammodel.controller.admin.service.ExamService; -import cn.teammodel.model.dto.admin.exam.AnalysisDto; -import cn.teammodel.model.dto.admin.exam.ExamRecordDto; -import cn.teammodel.model.dto.admin.exam.FindExamDto; -import cn.teammodel.model.dto.admin.exam.OverViewDto; +import cn.teammodel.model.dto.admin.exam.*; import cn.teammodel.model.entity.common.Exam; import cn.teammodel.model.entity.school.School; import cn.teammodel.repository.ExamRepository; @@ -95,4 +92,17 @@ public class ExamServiceImpl implements ExamService { } return record; } + + @Override + public Map getExamByStudent(FindByStudentDto findByStudentDto, HttpServletRequest request) { + Map studentView; + String url = env.getProperty("ies.server-url-find-summary-by-student"); + try { + studentView = GroupUtil.getGroupId(findByStudentDto,new GroupUtil(env), request,url); + }catch (Exception e) { + throw new ServiceException(ErrorCode.SYSTEM_ERROR.getCode(), "数据转换错误"); + + } + return studentView; + } } diff --git a/src/main/java/cn/teammodel/model/dto/admin/exam/FindByStudentDto.java b/src/main/java/cn/teammodel/model/dto/admin/exam/FindByStudentDto.java new file mode 100644 index 0000000..5efc309 --- /dev/null +++ b/src/main/java/cn/teammodel/model/dto/admin/exam/FindByStudentDto.java @@ -0,0 +1,16 @@ +package cn.teammodel.model.dto.admin.exam; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class FindByStudentDto { + @ApiModelProperty("该活动唯一ID") + private String id; + @ApiModelProperty("学校编码") + private String code; + @ApiModelProperty("学生ID") + private String studentId; + @ApiModelProperty("原本活动的完成code,在返回的列表数据中应该有类似Exam-hbcn的字段") + private String scode; +}