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; +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 551fe7f..8f22cdd 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -20,23 +20,23 @@ spring: # 大小限制 max-file-size: 10MB #测试站数据库 - env: dev - cloud: - azure: - cosmos: - endpoint: https://cdhabookdep-free.documents.azure.cn:443 - database: TEAMModelOS - key: JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A== - populate-query-metrics: true - #正式站数据库 -# env: prod +# env: dev # cloud: # azure: # cosmos: -# endpoint: https://teammodelos.documents.azure.cn:443 +# endpoint: https://cdhabookdep-free.documents.azure.cn:443 # database: TEAMModelOS -# key: clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg== +# key: JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A== # populate-query-metrics: true + #正式站数据库 + env: prod + cloud: + azure: + cosmos: + endpoint: https://teammodelos.documents.azure.cn:443 + database: TEAMModelOS + key: clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg== + populate-query-metrics: true security: oauth2: resourceserver: @@ -80,4 +80,5 @@ ies: server-url-blob-sas-rcwld: /blob/sas-rcwld server-url-exam-analysis-list: /common/exam/find-by-analysis server-url-exam-find-record: /common/exam/find-summary-record - server-url-analysis-simple: /analysis/simple \ No newline at end of file + server-url-analysis-simple: /analysis/simple + server-url-find-summary-by-student: /common/exam/find-summary-by-student \ No newline at end of file