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 new file mode 100644 index 0000000..aeff25e --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/UserExamController.java @@ -0,0 +1,45 @@ +package com.ruoyi.web.controller.exam; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.system.domain.exam.dto.ExamDTO; +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; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import java.util.List; + +/** + * packageName com.ruoyi.web.controller.exam + * + * @author wangxy + * @version JDK 8 + * @className UserExamController + * @date 2024/7/3 + * @description 考试详情 + */ +@Api("考试详情") +@Controller +@RequestMapping("/system/userExam") +public class UserExamController extends BaseController { + + @Resource + private UserExamManager userExamManager; + + + @ApiOperation("考试详情") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(UserExamReqDTO reqDTO) { + startPage(); + List list = userExamManager.selectExamList(reqDTO); + return getDataTable(list); + } +} 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 023e23c..77cbcce 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,11 +1,15 @@ package com.ruoyi.web.controller.manager; +import com.ruoyi.system.domain.exam.dto.ExamDTO; 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.ElUserExamService; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.Date; +import java.util.List; import java.util.Objects; /** @@ -23,6 +27,20 @@ public class UserExamManager { @Resource private ElUserExamService elUserExamService; + + + + + /** + * 查询 + * + * @param reqDTO + * @return java.util.List + */ + public List selectExamList(UserExamReqDTO reqDTO) { + return elUserExamService.selectExamList(reqDTO); + } + /** * * 考试记录保存 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 new file mode 100644 index 0000000..2aa0f6e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/UserExamDTO.java @@ -0,0 +1,48 @@ +package com.ruoyi.system.domain.userexam.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** +*

+* 考试记录数据传输类 +*

+* +* @author 聪明笨狗 +* @since 2020-09-21 15:13 +*/ +@Data +@ApiModel(value="考试记录", description="考试记录") +public class UserExamDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + private String id; + + @ApiModelProperty(value = "用户ID") + private String userId; + + @ApiModelProperty(value = "考试ID") + private String examId; + + @ApiModelProperty(value = "考试次数") + private Integer tryCount; + + @ApiModelProperty(value = "最高分数") + private Integer maxScore; + + @ApiModelProperty(value = "是否通过") + private Boolean passed; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "更新时间") + private Date updateTime; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/request/UserExamReqDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/request/UserExamReqDTO.java new file mode 100644 index 0000000..37b2268 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/request/UserExamReqDTO.java @@ -0,0 +1,30 @@ +package com.ruoyi.system.domain.userexam.dto.request; + +import com.ruoyi.system.domain.userexam.dto.UserExamDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** +*

+* 考试记录数据传输类 +*

+* +* @author 聪明笨狗 +* @since 2020-09-21 15:13 +*/ +@Data +@ApiModel(value="考试记录", description="考试记录") +public class UserExamReqDTO extends UserExamDTO { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "考试名称") + private String title; + + @ApiModelProperty(value = "人员名称") + private String userName; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/response/UserExamRespDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/response/UserExamRespDTO.java new file mode 100644 index 0000000..a9b106c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/response/UserExamRespDTO.java @@ -0,0 +1,29 @@ +package com.ruoyi.system.domain.userexam.dto.response; + +import com.ruoyi.system.domain.userexam.dto.UserExamDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** +*

+* 考试记录数据传输类 +*

+* +* @author 聪明笨狗 +* @since 2020-09-21 15:13 +*/ +@Data +@ApiModel(value="考试记录", description="考试记录") +public class UserExamRespDTO extends UserExamDTO { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "考试名称") + private String title; + + @ApiModelProperty(value = "人员名称") + private String userName; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElUserExamMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElUserExamMapper.java index fcf4c52..63b3e26 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElUserExamMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElUserExamMapper.java @@ -2,8 +2,12 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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 org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * @author 13560 * @description 针对表【el_user_exam(考试记录)】的数据库操作Mapper @@ -13,6 +17,9 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ElUserExamMapper extends BaseMapper { + + public List selectExamList(UserExamReqDTO reqDTO); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElUserExamService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElUserExamService.java index 9d7a10a..ef10b15 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElUserExamService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElUserExamService.java @@ -1,7 +1,12 @@ package com.ruoyi.system.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.exam.dto.ExamDTO; 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 java.util.List; /** * @author 13560 @@ -10,4 +15,8 @@ import com.ruoyi.system.domain.userexam.ElUserExam; */ public interface ElUserExamService extends IService { + + + public List selectExamList(UserExamReqDTO reqDTO); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElUserExamServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElUserExamServiceImpl.java index 85ee1c7..0fb1c27 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElUserExamServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElUserExamServiceImpl.java @@ -1,11 +1,17 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.exam.dto.ExamDTO; 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.mapper.ElUserExamMapper; import com.ruoyi.system.service.ElUserExamService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + /** * @author 13560 * @description 针对表【el_user_exam(考试记录)】的数据库操作Service实现 @@ -15,6 +21,13 @@ import org.springframework.stereotype.Service; public class ElUserExamServiceImpl extends ServiceImpl implements ElUserExamService { + @Resource + private ElUserExamMapper userExamMapper; + + @Override + public List selectExamList(UserExamReqDTO reqDTO) { + return userExamMapper.selectExamList(reqDTO); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml index a9702dc..c9fed60 100644 --- a/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml @@ -20,4 +20,23 @@ try_count,max_score,passed, create_time,update_time + +