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 84d1cda..3b35830 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 @@ -4,6 +4,7 @@ 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.UserExamCountDTO; import com.ruoyi.system.domain.userexam.dto.response.UserExamRespDTO; import com.ruoyi.system.service.ElPaperService; import com.ruoyi.system.service.ElUserExamService; @@ -89,4 +90,10 @@ public class UserExamManager { paperListReqDTO.setExamId(examId); return paperService.paging(paperListReqDTO); } + + + public UserExamCountDTO selectCountList() { + return elUserExamService.selectCountList(); + } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdExamnumController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdExamnumController.java index 0fa803a..80fddfc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdExamnumController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdExamnumController.java @@ -3,20 +3,18 @@ package com.ruoyi.web.controller.system.count; import java.util.List; import cn.hutool.core.convert.Convert; +import com.ruoyi.system.domain.userbook.dto.UserBookDTO; import com.ruoyi.system.domain.userexam.dto.request.UserExamReqDTO; import com.ruoyi.system.domain.userexam.dto.response.UserExamExportDTO; import com.ruoyi.system.domain.userexam.dto.response.UserExamRespDTO; import com.ruoyi.web.controller.manager.UserExamManager; +import io.swagger.annotations.ApiOperation; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.system.domain.TdExamnum; @@ -81,6 +79,14 @@ public class TdExamnumController extends BaseController } + @ApiOperation("查找考试总数") + @PostMapping("/countList") + @ResponseBody + public AjaxResult countList() { + return AjaxResult.success(userExamManager.selectCountList()); + } + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/response/UserExamCountDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/response/UserExamCountDTO.java new file mode 100644 index 0000000..d71edee --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/dto/response/UserExamCountDTO.java @@ -0,0 +1,34 @@ +package com.ruoyi.system.domain.userexam.dto.response; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * packageName com.ruoyi.system.domain.userexam.dto.response + * + * @author wangxy + * @version JDK 8 + * @className UserExamCountDTO + * @date 2024/8/7 + * @description 考试统计 + */ +@Data +@ApiModel(value="考试统计", description="考试统计") +public class UserExamCountDTO implements Serializable { + + @ApiModelProperty(value = "总数") + private Integer total; + + @ApiModelProperty(value = "通过数") + private Integer tg; + + @ApiModelProperty(value = "未通过数") + private Integer wtg; + + + + +} 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 63b3e26..cf9edba 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 @@ -3,6 +3,7 @@ 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.UserExamCountDTO; import com.ruoyi.system.domain.userexam.dto.response.UserExamRespDTO; import org.apache.ibatis.annotations.Mapper; @@ -20,6 +21,9 @@ public interface ElUserExamMapper extends BaseMapper { public List selectExamList(UserExamReqDTO reqDTO); + + public UserExamCountDTO selectCountList(); + } 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 ef10b15..f90fc15 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 @@ -4,6 +4,7 @@ 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.UserExamCountDTO; import com.ruoyi.system.domain.userexam.dto.response.UserExamRespDTO; import java.util.List; @@ -19,4 +20,7 @@ public interface ElUserExamService extends IService { public List selectExamList(UserExamReqDTO reqDTO); + + public UserExamCountDTO selectCountList(); + } 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 0fb1c27..b1a963e 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 @@ -4,6 +4,7 @@ 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.UserExamCountDTO; import com.ruoyi.system.domain.userexam.dto.response.UserExamRespDTO; import com.ruoyi.system.mapper.ElUserExamMapper; import com.ruoyi.system.service.ElUserExamService; @@ -28,6 +29,11 @@ public class ElUserExamServiceImpl extends ServiceImpl selectExamList(UserExamReqDTO reqDTO) { return userExamMapper.selectExamList(reqDTO); } + + @Override + public UserExamCountDTO selectCountList() { + return userExamMapper.selectCountList(); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml index c9fed60..d0e1117 100644 --- a/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml @@ -39,4 +39,17 @@ AND uc.user_name LIKE CONCAT('%',#{userName},'%') + + + + +