diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/UserExamController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/UserExamController.java index e7bb6a7..1070617 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/UserExamController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/UserExamController.java @@ -1,7 +1,10 @@ package com.ruoyi.web.controller.exam; +import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; import com.ruoyi.system.domain.userexam.dto.request.UserExamReqDTO; import com.ruoyi.system.domain.userexam.dto.response.UserExamRespDTO; import com.ruoyi.web.controller.manager.UserExamManager; @@ -52,4 +55,13 @@ public class UserExamController extends BaseController { List list = userExamManager.selectExamList(reqDTO); return getDataTable(list); } + + @ApiOperation("详情") + @GetMapping("/detail") + @ResponseBody + public AjaxResult detail(String examId,Long userId) { + return success(userExamManager.detail(examId,userId)); + } + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java index 77cbcce..fb5cf7d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java @@ -1,9 +1,13 @@ package com.ruoyi.web.controller.manager; import com.ruoyi.system.domain.exam.dto.ExamDTO; +import com.ruoyi.system.domain.exam.dto.request.ExamSaveReqDTO; +import com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO; +import com.ruoyi.system.domain.paper.dto.response.PaperListRespDTO; import com.ruoyi.system.domain.userexam.ElUserExam; import com.ruoyi.system.domain.userexam.dto.request.UserExamReqDTO; import com.ruoyi.system.domain.userexam.dto.response.UserExamRespDTO; +import com.ruoyi.system.service.ElPaperService; import com.ruoyi.system.service.ElUserExamService; import org.springframework.stereotype.Component; @@ -28,6 +32,10 @@ public class UserExamManager { private ElUserExamService elUserExamService; + @Resource + private ElPaperService paperService; + + @@ -76,4 +84,11 @@ public class UserExamManager { } elUserExamService.updateById(record); } + + public List detail(String examId,Long userId) { + PaperListReqDTO paperListReqDTO = new PaperListReqDTO(); + paperListReqDTO.setUserId(userId); + paperListReqDTO.setExamId(examId); + return paperService.paging(paperListReqDTO); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/PaperDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/PaperDTO.java index 20844cf..b6b6a93 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/PaperDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/PaperDTO.java @@ -26,7 +26,7 @@ public class PaperDTO implements Serializable { private String id; @ApiModelProperty(value = "用户ID") - private String userId; + private Long userId; @ApiModelProperty(value = "部门ID") private String departId; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperListReqDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperListReqDTO.java index aa87237..6909630 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperListReqDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperListReqDTO.java @@ -21,7 +21,7 @@ public class PaperListReqDTO implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "用户ID") - private String userId; + private Long userId; @ApiModelProperty(value = "部门ID") private String departId; @@ -30,7 +30,7 @@ public class PaperListReqDTO implements Serializable { private String examId; @ApiModelProperty(value = "用户昵称") - private String realName; + private String userName; @ApiModelProperty(value = "试卷状态") private Integer state; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/response/PaperListRespDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/response/PaperListRespDTO.java index 98144a1..71e9624 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/response/PaperListRespDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/response/PaperListRespDTO.java @@ -20,7 +20,7 @@ public class PaperListRespDTO extends PaperDTO { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "人员") - private String realName; + private String userName; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/UserExamDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/UserExamDTO.java index 2aa0f6e..129554e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/UserExamDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/UserExamDTO.java @@ -25,7 +25,7 @@ public class UserExamDTO implements Serializable { private String id; @ApiModelProperty(value = "用户ID") - private String userId; + private Long userId; @ApiModelProperty(value = "考试ID") private String examId; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElPaperMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElPaperMapper.java index 37b0b9c..742a2ea 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElPaperMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElPaperMapper.java @@ -2,8 +2,12 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.domain.paper.ElPaper; +import com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO; +import com.ruoyi.system.domain.paper.dto.response.PaperListRespDTO; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * @author 13560 * @description 针对表【el_paper(考试记录)】的数据库操作Mapper @@ -13,6 +17,14 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ElPaperMapper extends BaseMapper { + + /** + * 查找试卷分页 + * @param paperListReqDTO + * @return + */ + List paging(PaperListReqDTO paperListReqDTO); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElPaperService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElPaperService.java index f635c83..58bac07 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElPaperService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElPaperService.java @@ -1,7 +1,14 @@ package com.ruoyi.system.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.system.domain.paper.ElPaper; +import com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO; +import com.ruoyi.system.domain.paper.dto.response.PaperListRespDTO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * @author 13560 @@ -10,4 +17,12 @@ import com.ruoyi.system.domain.paper.ElPaper; */ public interface ElPaperService extends IService { + + /** + * 查找试卷分页 + * @param query + * @return + */ + List paging(PaperListReqDTO query); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElPaperServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElPaperServiceImpl.java index 79219ad..a1fc574 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElPaperServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElPaperServiceImpl.java @@ -2,10 +2,15 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.system.domain.paper.ElPaper; +import com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO; +import com.ruoyi.system.domain.paper.dto.response.PaperListRespDTO; import com.ruoyi.system.mapper.ElPaperMapper; import com.ruoyi.system.service.ElPaperService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + /** * @author 13560 * @description 针对表【el_paper(考试记录)】的数据库操作Service实现 @@ -15,6 +20,13 @@ import org.springframework.stereotype.Service; public class ElPaperServiceImpl extends ServiceImpl implements ElPaperService { + @Resource + private ElPaperMapper elPaperMapper; + + @Override + public List paging(PaperListReqDTO paperListReqDTO) { + return elPaperMapper.paging(paperListReqDTO); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/ElPaperMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElPaperMapper.xml index fcdd613..3e96cea 100644 --- a/ruoyi-system/src/main/resources/mapper/system/ElPaperMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/ElPaperMapper.xml @@ -32,4 +32,28 @@ has_saq,state,create_time, update_time,limit_time + +