diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/ExamController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/ExamController.java new file mode 100644 index 00000000..ad9d5b53 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/ExamController.java @@ -0,0 +1,129 @@ +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.exam.dto.ExamDTO; +import com.ruoyi.system.domain.exam.dto.request.ExamSaveReqDTO; +import com.ruoyi.system.domain.repo.ElRepo; +import com.ruoyi.web.controller.manager.ExamManager; +import com.ruoyi.web.controller.manager.RepoManager; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * packageName com.ruoyi.web.controller.examination + * + * @author wangxy + * @version JDK 8 + * @className ExamController + * @date 2024/6/28 + * @description 涉密考试 + */ +@Api("考试") +@Controller +@RequestMapping("/system/newExam") +public class ExamController extends BaseController { + + + private String prefix = "system/elExam/exam"; + + @Resource + private ExamManager examManager; + + @Resource + private RepoManager elRepoManager; + + + + @ApiOperation("考试") + @RequiresPermissions("system:exam:view") + @GetMapping() + public String exam() { + return prefix + "/exam"; + } + + + @ApiOperation("考试") + //@RequiresPermissions("system:exam:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(ExamDTO examDTO) { + startPage(); + List list = examManager.selectExamList(examDTO); + return getDataTable(list); + } + + /** + * 新增 + */ + @GetMapping("/add") + public String add(ModelMap mmap) { + mmap.put("repo",elRepoManager.selectRepoList(new ElRepo())); + return prefix + "/add"; + } + + @ApiOperation("新增") + //@RequiresPermissions("system:exam:add") + @Log(title = "考试", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(@Validated ExamSaveReqDTO reqDTO) { + return toAjax(examManager.saveOrUpdate(reqDTO)); + } + + @ApiOperation("修改") + //@RequiresPermissions("system:exam:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") String id, ModelMap mmap) { + mmap.put("repo",elRepoManager.selectRepoList(new ElRepo())); + mmap.put("detailDTO", examManager.detail(id)); + return prefix + "/edit"; + } + + @ApiOperation("试题修改") + //@RequiresPermissions("system:exam:edit") + @Log(title = "考试", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(@Validated ExamSaveReqDTO reqDTO) { + return toAjax(examManager.saveOrUpdate(reqDTO)); + } + + @ApiOperation("删除") + //@RequiresPermissions("system:exam:remove") + @Log(title = "考试", businessType = BusinessType.DELETE) + @PostMapping("/remove") + @ResponseBody + public AjaxResult remove(String ids) { + return toAjax(examManager.deleteQuByIds(ids)); + } + + @ApiOperation("详情") + @Log(title = "考试", businessType = BusinessType.OTHER) + @GetMapping("/detail") + @ResponseBody + public AjaxResult detail(String id) { + return success(examManager.detail(id)); + } + + + + + + + + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/OnlineExamController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/OnlineExamController.java new file mode 100644 index 00000000..601db9e6 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/OnlineExamController.java @@ -0,0 +1,66 @@ +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.exam.dto.response.ExamOnlineRespDTO; +import com.ruoyi.web.controller.manager.ExamManager; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * packageName com.ruoyi.web.controller.examination + * + * @author wangxy + * @version JDK 8 + * @className OnlineExam + * @date 2024/6/28 + * @description 在线考试 + */ +@Api("在线考试") +@Controller +@RequestMapping("/system/onlineExam") +public class OnlineExamController extends BaseController { + + @Resource + private ExamManager examManager; + + private String prefix = "system/elExam/onlineExam"; + + + @ApiOperation("在线考试") + @RequiresPermissions("system:onlineExam:view") + @GetMapping() + public String onlineExam() { + return prefix + "/onlineExam"; + } + + @ApiOperation("在线考试") + //@RequiresPermissions("system:onlineExam:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(ExamDTO examDTO) { + startPage(); + examDTO.setUserId(getUserId()); + List list = examManager.onlineExamList(examDTO); + return getDataTable(list); + } + + @ApiOperation("去考试") + @GetMapping("/toExam/{id}") + public String add(@PathVariable("id") String id, ModelMap mmap) { + mmap.put("exam",examManager.view(id)); + return prefix + "/toExam"; + } + + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/PaperController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/PaperController.java new file mode 100644 index 00000000..204770e7 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/PaperController.java @@ -0,0 +1,81 @@ +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.enums.BusinessType; +import com.ruoyi.system.domain.paper.dto.request.PaperAnswerDTO; +import com.ruoyi.system.domain.paper.dto.request.PaperQuQueryDTO; +import com.ruoyi.web.controller.manager.PaperManager; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.stereotype.Controller; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * packageName com.ruoyi.web.controller.examination + * + * @author wangxy + * @version JDK 8 + * @className PaperController + * @date 2024/6/28 + * @description 试卷 + */ +@Api("在线考试") +@Controller +@RequestMapping("/system/paper") +public class PaperController extends BaseController { + + + @Resource + private PaperManager paperManager; + + + @ApiOperation("创建试卷") + @Log(title = "创建试卷", businessType = BusinessType.INSERT) + @GetMapping("/create/{examId}") + @ResponseBody + public AjaxResult create(@PathVariable("examId") String examId) { + return AjaxResult.success(paperManager.createPaper(examId,getUserId())); + } + + @ApiOperation("试卷详情") + @GetMapping("/detail/{paperId}") + @ResponseBody + public AjaxResult detail(@PathVariable("paperId") String paperId) { + return AjaxResult.success(paperManager.paperDetail(paperId)); + } + + @ApiOperation("试题详情") + @PostMapping("/quDetail") + @ResponseBody + public AjaxResult quDetail(@Validated PaperQuQueryDTO reqDTO) { + return AjaxResult.success(paperManager.findQuDetail(reqDTO.getPaperId(), reqDTO.getQuId())); + } + + @ApiOperation("保存答案") + @PostMapping("/fillAnswer") + @ResponseBody + public AjaxResult fillAnswer(@Validated PaperAnswerDTO reqDTO) { + return toAjax(paperManager.fillAnswer(reqDTO)); + } + + + @ApiOperation("交卷") + @GetMapping("/submitExam/{paperId}") + @Log(title = "交卷", businessType = BusinessType.INSERT) + @ResponseBody + public AjaxResult submitExam(@PathVariable("paperId") String paperId) { + return toAjax(paperManager.submitExam(paperId)); + } + + + + + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/QuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/QuController.java new file mode 100644 index 00000000..d1939ed1 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/QuController.java @@ -0,0 +1,124 @@ +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.qu.ElQu; +import com.ruoyi.system.domain.qu.dto.ext.QuDetailDTO; +import com.ruoyi.system.domain.qu.dto.request.QuQueryReqDTO; +import com.ruoyi.web.controller.manager.QuManager; +import com.ruoyi.web.controller.manager.RepoManager; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * packageName com.ruoyi.web.controller.examination + * + * @author wangxy + * @version JDK 8 + * @className QuController + * @date 2024/6/27 + * @description 试题 + */ +@Api("试题") +@Controller +@RequestMapping("/system/qu") +public class QuController extends BaseController { + + private String prefix = "system/elExam/qu"; + + @Resource + private QuManager quManager; + + @Resource + private RepoManager elRepoManager; + + + @ApiOperation("试题") + @RequiresPermissions("system:qu:view") + @GetMapping() + public String qu() { + return prefix + "/qu"; + } + + + @ApiOperation("试题") + //@RequiresPermissions("system:qu:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(QuQueryReqDTO qu) { + startPage(); + List list = quManager.selectQuList(qu); + return getDataTable(list); + } + + /** + * 新增 + */ + @GetMapping("/add") + public String add(ModelMap mmap) { + mmap.put("repo",elRepoManager.getList()); + return prefix + "/add"; + } + + + @ApiOperation("新增") + //@RequiresPermissions("system:qu:add") + @Log(title = "试题", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(@Validated QuDetailDTO reqDTO) { + return toAjax(quManager.saveOrUpdate(reqDTO)); + } + + + @ApiOperation("修改") + //@RequiresPermissions("system:qu:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") String id, ModelMap mmap) { + mmap.put("repo",elRepoManager.getList()); + mmap.put("detailDTO", quManager.detail(id)); + return prefix + "/edit"; + } + + @ApiOperation("试题修改") + //@RequiresPermissions("system:qu:edit") + @Log(title = "试题", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(@Validated QuDetailDTO reqDTO) { + return toAjax(quManager.saveOrUpdate(reqDTO)); + } + + + @ApiOperation("删除") + //@RequiresPermissions("system:qu:remove") + @Log(title = "题库", businessType = BusinessType.DELETE) + @PostMapping("/remove") + @ResponseBody + public AjaxResult remove(String ids) { + return toAjax(quManager.deleteQuByIds(ids)); + } + + + @ApiOperation("详情") + @Log(title = "试题", businessType = BusinessType.OTHER) + @GetMapping ("/detail") + @ResponseBody + public AjaxResult detail(String id) { + return success(quManager.detail(id)); + } + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/RepoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/RepoController.java new file mode 100644 index 00000000..69e886fa --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/RepoController.java @@ -0,0 +1,126 @@ +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.repo.ElRepo; +import com.ruoyi.system.domain.repo.vo.RepoVO; +import com.ruoyi.web.controller.manager.RepoManager; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * packageName com.ruoyi.web.controller.examination + * + * @author wangxy + * @version JDK 8 + * @className RepoController + * @date 2024/6/27 + * @description 题库 + */ +@Api("题库") +@Controller +@RequestMapping("/system/repo") +public class RepoController extends BaseController { + + + private String prefix = "system/elExam/repo"; + + @Resource + private RepoManager elRepoManager; + + @ApiOperation("题库列表") + @RequiresPermissions("system:repo:view") + @GetMapping() + public String repo() { + return prefix + "/repo"; + } + + + @ApiOperation("列表") + @RequiresPermissions("system:repo:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(ElRepo repo) { + startPage(); + List list = elRepoManager.selectRepoList(repo); + return getDataTable(list); + } + + + /** + * 新增公告 + */ + @GetMapping("/add") + public String add() { + return prefix + "/add"; + } + + + @ApiOperation("新增") + @RequiresPermissions("system:repo:add") + @Log(title = "题库", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(@Validated ElRepo repo) { + return toAjax(elRepoManager.saveOrUpdate(repo)); + } + + + @ApiOperation("修改") + @RequiresPermissions("system:repo:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") String id, ModelMap mmap) { + mmap.put("repo", elRepoManager.getById(id)); + return prefix + "/edit"; + } + + + @ApiOperation("题库修改") + @RequiresPermissions("system:repo:edit") + @Log(title = "题库", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(@Validated ElRepo repo) { + return toAjax(elRepoManager.saveOrUpdate(repo)); + } + + + @ApiOperation("删除") + @RequiresPermissions("system:repo:remove") + @Log(title = "题库", businessType = BusinessType.DELETE) + @PostMapping("/remove") + @ResponseBody + public AjaxResult remove(String ids) { + return toAjax(elRepoManager.deleteRepoByIds(ids)); + } + + + @ApiOperation("详情") + @Log(title = "题库", businessType = BusinessType.OTHER) + @GetMapping("/detail") + @ResponseBody + public AjaxResult detail(String id) { + return success(elRepoManager.getById(id)); + } + + @ApiOperation("查询所有的题库") + @Log(title = "题库", businessType = BusinessType.OTHER) + @GetMapping("/repoList") + @ResponseBody + public AjaxResult repoList() { + return success(elRepoManager.getList()); + } + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ExamManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ExamManager.java new file mode 100644 index 00000000..9bed3e87 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ExamManager.java @@ -0,0 +1,189 @@ +package com.ruoyi.web.controller.manager; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.exam.ElExam; +import com.ruoyi.system.domain.exam.ElExamDepart; +import com.ruoyi.system.domain.exam.ElExamRepo; +import com.ruoyi.system.domain.exam.dto.ExamDTO; +import com.ruoyi.system.domain.exam.dto.ExamRepoDTO; +import com.ruoyi.system.domain.exam.dto.ext.ExamRepoExtDTO; +import com.ruoyi.system.domain.exam.dto.request.ExamSaveReqDTO; +import com.ruoyi.system.domain.exam.dto.response.ExamOnlineRespDTO; +import com.ruoyi.system.domain.exam.enums.OpenType; +import com.ruoyi.system.service.ElExamDepartService; +import com.ruoyi.system.service.ElExamRepoService; +import com.ruoyi.system.service.ElExamService; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +/** + * packageName com.ruoyi.web.controller.manager + * + * @author wangxy + * @version JDK 8 + * @className Exammanager + * @date 2024/6/28 + * @description 考试 + */ +@Component +public class ExamManager { + + + @Resource + private ElExamService elExamService; + + + @Resource + private ElExamRepoService examRepoService; + + + @Resource + private ElExamDepartService elExamDepartService; + + + /** + * 查询 + * + * @param examDTO + * @return java.util.List + */ + public List selectExamList(ExamDTO examDTO) { + return elExamService.selectExamList(examDTO); + } + + @Transactional(rollbackFor = Exception.class) + public boolean saveOrUpdate(ExamSaveReqDTO reqDTO) { + // 计算分值 + this.calcScore(reqDTO); + ElExam elExam = Convert.convert(ElExam.class, reqDTO); + // 修复状态 + if (Objects.nonNull(reqDTO.getTimeLimit()) && !reqDTO.getTimeLimit() + && Objects.nonNull(reqDTO.getState()) + && Objects.equals(reqDTO.getState(), 2)) { + elExam.setState(0); + } else { + elExam.setState(reqDTO.getState()); + } + if (StringUtils.isNotEmpty(reqDTO.getId())) { + elExam.setUpdateTime(new Date()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ElExamRepo::getExamId, reqDTO.getId()); + examRepoService.remove(wrapper); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ElExamDepart::getExamId, reqDTO.getId()); + elExamDepartService.remove(queryWrapper); + } else { + elExam.setCreateTime(new Date()); + } + if (CollUtil.isNotEmpty(reqDTO.getRepoList())) { + List examRepos = Convert.toList(ElExamRepo.class, reqDTO.getRepoList()); + examRepos.forEach(elExamRepo -> elExamRepo.setExamId(elExam.getId())); + examRepoService.saveBatch(examRepos); + } + if (CollUtil.isNotEmpty(reqDTO.getDepartIds()) && OpenType.DEPT_OPEN.equals(reqDTO.getOpenType())) { + List list = new ArrayList<>(); + reqDTO.getDepartIds().forEach(deptId -> { + ElExamDepart ref = new ElExamDepart(); + ref.setExamId(elExam.getId()); + ref.setDepartId(deptId); + list.add(ref); + }); + elExamDepartService.saveBatch(list); + } + return elExamService.saveOrUpdate(elExam); + } + + + @Transactional(rollbackFor = Exception.class) + public boolean deleteQuByIds(String ids) { + List list = Arrays.asList(Convert.toStrArray(ids)); + elExamService.removeByIds(list); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(ElExamDepart::getExamId, list); + elExamDepartService.remove(queryWrapper); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(ElExamRepo::getExamId, list); + return examRepoService.remove(wrapper); + } + + /** + * 详情 + * + * @param id + * @return com.ruoyi.system.domain.exam.dto.request.ExamSaveReqDTO + */ + + + public ExamSaveReqDTO detail(String id) { + ElExam exam = elExamService.getById(id); + ExamSaveReqDTO respDTO = Convert.convert(ExamSaveReqDTO.class, exam); + // 考试部门 + List departIds = elExamDepartService.lambdaQuery() + .eq(ElExamDepart::getExamId, id).list().stream() + .map(ElExamDepart::getDepartId).collect(Collectors.toList()); + respDTO.setDepartIds(departIds); + // 题库 + List list = examRepoService.listByExam(id); + respDTO.setRepoList(list); + return respDTO; + } + + + public ExamDTO view(String id) { + ElExam exam = elExamService.getById(id); + return Convert.convert(ExamDTO.class, exam); + } + + + /** + * 在线考试 + * + * @param examDTO + * @return java.util.List + */ + public List onlineExamList(ExamDTO examDTO) { + return elExamService.onlineExamList(examDTO); + } + + + /** + * 计算分值 + * + * @param reqDTO + */ + private void calcScore(ExamSaveReqDTO reqDTO) { + // 主观题分数 + int objScore = 0; + // 题库组卷 + List repoList = reqDTO.getRepoList(); + for (ExamRepoDTO item : repoList) { + if (item.getRadioCount() != null + && item.getRadioCount() > 0 + && item.getRadioScore() != null + && item.getRadioScore() > 0) { + objScore += item.getRadioCount() * item.getRadioScore(); + } + if (item.getMultiCount() != null + && item.getMultiCount() > 0 + && item.getMultiScore() != null + && item.getMultiScore() > 0) { + objScore += item.getMultiCount() * item.getMultiScore(); + } + if (item.getJudgeCount() != null + && item.getJudgeCount() > 0 + && item.getJudgeScore() != null + && item.getJudgeScore() > 0) { + objScore += item.getJudgeCount() * item.getJudgeScore(); + } + } + reqDTO.setTotalScore(objScore); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/PaperManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/PaperManager.java new file mode 100644 index 00000000..e28396c3 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/PaperManager.java @@ -0,0 +1,469 @@ +package com.ruoyi.web.controller.manager; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.quartz.service.ISysJobService; +import com.ruoyi.system.domain.exam.ElExam; +import com.ruoyi.system.domain.exam.dto.ExamRepoDTO; +import com.ruoyi.system.domain.exam.dto.ext.ExamRepoExtDTO; +import com.ruoyi.system.domain.exam.enums.ExamState; +import com.ruoyi.system.domain.paper.ElPaper; +import com.ruoyi.system.domain.paper.ElPaperQu; +import com.ruoyi.system.domain.paper.ElPaperQuAnswer; +import com.ruoyi.system.domain.paper.dto.PaperQuDTO; +import com.ruoyi.system.domain.paper.dto.ext.PaperQuAnswerExtDTO; +import com.ruoyi.system.domain.paper.dto.ext.PaperQuDetailDTO; +import com.ruoyi.system.domain.paper.dto.request.PaperAnswerDTO; +import com.ruoyi.system.domain.paper.dto.response.ExamDetailRespDTO; +import com.ruoyi.system.domain.paper.enums.PaperState; +import com.ruoyi.system.domain.qu.ElQu; +import com.ruoyi.system.domain.qu.ElQuAnswer; +import com.ruoyi.system.domain.qu.enums.QuType; +import com.ruoyi.system.service.*; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.*; + +/** + * packageName com.ruoyi.web.controller.manager + * + * @author wangxy + * @version JDK 8 + * @className PaperManager + * @date 2024/6/28 + * @description 试卷 + */ +@Component +public class PaperManager { + + + @Resource + private ElPaperService paperService; + + @Resource + private ElPaperQuService paperQuService; + + @Resource + private ElPaperQuAnswerService paperQuAnswerService; + + + @Autowired + private ElExamService examService; + + + @Autowired + private ElExamRepoService examRepoService; + + @Resource + private ElQuService quService; + + @Autowired + private ISysUserService sysUserService; + + @Autowired + private ElQuAnswerService quAnswerService; + + @Autowired + private ISysJobService jobService; + + + @Resource + private UserExamManager userExamManager; + + @Resource + private UserBookManager userBookManager; + + + + + /** + * 展示的选项,ABC这样 + */ + private static List ABC = Arrays.asList(new String[]{ + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K","L","M","N","O","P","Q","R","S","T","U","V","W","X" + ,"Y","Z" + }); + + + /** + * + * 创建试卷 + * @param examId + * @param userId + * @return java.lang.String + */ + + @Transactional(rollbackFor = Exception.class) + public String createPaper(String examId,Long userId) { + // 校验是否有正在考试的试卷 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda() + .eq(ElPaper::getUserId, userId) + .eq(ElPaper::getState, PaperState.ING); + long exists = paperService.count(wrapper); + if (exists > 0) { + throw new ServiceException("您有正在进行的考试!"); + } + // 查找考试 + ElExam exam = examService.getById(examId); + + if(Objects.isNull(exam)){ + throw new ServiceException( "考试不存在!"); + } + if(!ExamState.ENABLE.equals(exam.getState())){ + throw new ServiceException( "考试状态不正确!"); + } + // 考试题目列表 + List quList = this.generateByRepo(examId); + + if(CollectionUtils.isEmpty(quList)){ + throw new ServiceException("规则不正确,无对应的考题!"); + } + //保存试卷内容 + ElPaper paper = this.savePaper(userId, exam, quList); + return paper.getId(); + } + + + + + + + /** + * 题库组题方式产生题目列表 + * @param examId + * @return + */ + private List generateByRepo(String examId){ + // 查找规则指定的题库 + List list = examRepoService.listByExam(examId); + //最终的题目列表 + List quList = new ArrayList<>(); + //排除ID,避免题目重复 + List excludes = new ArrayList<>(); + excludes.add("none"); + if (!CollectionUtils.isEmpty(list)) { + for (ExamRepoExtDTO item : list) { + // 单选题 + if(item.getRadioCount() > 0){ + List radioList = quService.listByRandom(item.getRepoId(), QuType.RADIO, excludes, item.getRadioCount()); + for (ElQu qu : radioList) { + ElPaperQu paperQu = this.processPaperQu(item, qu); + quList.add(paperQu); + excludes.add(qu.getId()); + } + } + //多选题 + if(item.getMultiCount() > 0) { + List multiList = quService.listByRandom(item.getRepoId(), QuType.MULTI, excludes, + item.getMultiCount()); + for (ElQu qu : multiList) { + ElPaperQu paperQu = this.processPaperQu(item, qu); + quList.add(paperQu); + excludes.add(qu.getId()); + } + } + // 判断题 + if(item.getJudgeCount() > 0) { + List judgeList = quService.listByRandom(item.getRepoId(), QuType.JUDGE, excludes, + item.getJudgeCount()); + for (ElQu qu : judgeList) { + ElPaperQu paperQu = this.processPaperQu(item, qu); + quList.add(paperQu); + excludes.add(qu.getId()); + } + } + } + } + return quList; + } + + + /** + * 填充试题题目信息 + * @param repo + * @param qu + * @return + */ + private ElPaperQu processPaperQu(ExamRepoDTO repo, ElQu qu) { + + //保存试题信息 + ElPaperQu paperQu = new ElPaperQu(); + paperQu.setQuId(qu.getId()); + paperQu.setAnswered(false); + paperQu.setIsRight(false); + paperQu.setQuType(qu.getQuType()); + + if (QuType.RADIO.equals(qu.getQuType())) { + paperQu.setScore(repo.getRadioScore()); + paperQu.setActualScore(repo.getRadioScore()); + } + + if (QuType.MULTI.equals(qu.getQuType())) { + paperQu.setScore(repo.getMultiScore()); + paperQu.setActualScore(repo.getMultiScore()); + } + + if (QuType.JUDGE.equals(qu.getQuType())) { + paperQu.setScore(repo.getJudgeScore()); + paperQu.setActualScore(repo.getJudgeScore()); + } + + return paperQu; + } + + + /** + * 保存试卷 + * + * @param userId + * @param exam + * @param quList + * @return + */ + private ElPaper savePaper(Long userId, ElExam exam, List quList) { + // 查找用户 + SysUser user = sysUserService.selectUserById(userId); + //保存试卷基本信息 + ElPaper paper = new ElPaper(); + paper.setDepartId(user.getDeptId()); + paper.setExamId(exam.getId()); + paper.setTitle(exam.getTitle()); + paper.setTotalScore(exam.getTotalScore()); + paper.setTotalTime(exam.getTotalTime()); + paper.setUserScore(0); + paper.setUserId(userId); + paper.setCreateTime(new Date()); + paper.setUpdateTime(new Date()); + paper.setQualifyScore(exam.getQualifyScore()); + paper.setState(PaperState.ING); + paper.setHasSaq(false); + // 截止时间 + Calendar cl = Calendar.getInstance(); + cl.setTimeInMillis(System.currentTimeMillis()); + cl.add(Calendar.MINUTE, exam.getTotalTime()); + paper.setLimitTime(cl.getTime()); + paperService.save(paper); + if (CollUtil.isNotEmpty(quList)) { + this.savePaperQu(paper.getId(), quList); + } + return paper; + } + + /** + * 保存试卷试题列表 + * @param paperId + * @param quList + */ + private void savePaperQu(String paperId, List quList){ + + List batchQuList = new ArrayList<>(); + List batchAnswerList = new ArrayList<>(); + int sort = 0; + for (ElPaperQu item : quList) { + item.setPaperId(paperId); + item.setSort(sort); + item.setId(IdWorker.getIdStr()); + //回答列表 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(ElQuAnswer::getQuId, item.getQuId()); + wrapper.last(" ORDER BY RAND() "); + List answerList = quAnswerService.list(wrapper); + if (CollUtil.isNotEmpty(answerList)) { + int ii = 0; + for (ElQuAnswer answer : answerList) { + ElPaperQuAnswer paperQuAnswer = new ElPaperQuAnswer(); + paperQuAnswer.setId(UUID.randomUUID().toString()); + paperQuAnswer.setPaperId(paperId); + paperQuAnswer.setQuId(answer.getQuId()); + paperQuAnswer.setAnswerId(answer.getId()); + paperQuAnswer.setChecked(false); + paperQuAnswer.setSort(ii); + paperQuAnswer.setAbc(ABC.get(ii)); + paperQuAnswer.setIsRight(answer.getIsRight()); + ii++; + batchAnswerList.add(paperQuAnswer); + } + } + batchQuList.add(item); + sort++; + } + //添加问题 + paperQuService.saveBatch(batchQuList); + //批量添加问题答案 + paperQuAnswerService.saveBatch(batchAnswerList); + } + + /** + * + * 试卷详情 + * @param paperId + * @return com.ruoyi.system.domain.paper.dto.response.ExamDetailRespDTO + */ + + public ExamDetailRespDTO paperDetail(String paperId) { + // 试题基本信息 + ElPaper paper = paperService.getById(paperId); + ExamDetailRespDTO respDTO = Convert.convert(ExamDetailRespDTO.class, paper); + //查询条件 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(ElPaperQu::getPaperId, paperId) + .orderByAsc(ElPaperQu::getSort); + List paperQus = paperQuService.list(wrapper); + // 查找题目列表 + List list = Convert.toList(PaperQuDTO.class, paperQus); + List radioList = new ArrayList<>(); + List multiList = new ArrayList<>(); + List judgeList = new ArrayList<>(); + for(PaperQuDTO item: list){ + if(QuType.RADIO.equals(item.getQuType())){ + radioList.add(item); + } + if(QuType.MULTI.equals(item.getQuType())){ + multiList.add(item); + } + if(QuType.JUDGE.equals(item.getQuType())){ + judgeList.add(item); + } + } + respDTO.setRadioList(radioList); + respDTO.setMultiList(multiList); + respDTO.setJudgeList(judgeList); + return respDTO; + } + + /** + * + * 试题详情 + * @param paperId + * @param quId + * @return com.ruoyi.system.domain.paper.dto.ext.PaperQuDetailDTO + */ + + public PaperQuDetailDTO findQuDetail(String paperId, String quId) { + // 问题 + ElQu qu = quService.getById(quId); + // 基本信息 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda().eq(ElPaperQu::getPaperId, paperId) + .eq(ElPaperQu::getQuId, quId); + ElPaperQu paperQu = paperQuService.getOne(wrapper); + PaperQuDetailDTO respDTO = Convert.convert(PaperQuDetailDTO.class, paperQu); + respDTO.setContent(qu.getContent()); + respDTO.setImage(qu.getImage()); + // 答案列表 + List list = paperQuAnswerService.list(paperId, quId); + respDTO.setAnswerList(list); + return respDTO; + } + + @Transactional(rollbackFor = Exception.class) + public Boolean fillAnswer(PaperAnswerDTO reqDTO) { + // 未作答 + if(CollectionUtils.isEmpty(reqDTO.getAnswers()) + && StringUtils.isBlank(reqDTO.getAnswer())){ + return null; + } + //查找答案列表 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda() + .eq(ElPaperQuAnswer::getPaperId, reqDTO.getPaperId()) + .eq(ElPaperQuAnswer::getQuId, reqDTO.getQuId()); + List list = paperQuAnswerService.list(wrapper); + //是否正确 + boolean right = true; + //更新正确答案 + for (ElPaperQuAnswer item : list) { + + if (reqDTO.getAnswers().contains(item.getId())) { + item.setChecked(true); + } else { + item.setChecked(false); + } + //有一个对不上就是错的 + if (item.getIsRight()!=null && !item.getIsRight().equals(item.getChecked())) { + right = false; + } + paperQuAnswerService.updateById(item); + } + //修改为已回答 + ElPaperQu qu = new ElPaperQu(); + qu.setQuId(reqDTO.getQuId()); + qu.setPaperId(reqDTO.getPaperId()); + qu.setIsRight(right); + qu.setAnswer(reqDTO.getAnswer()); + qu.setAnswered(true); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ElPaperQu::getPaperId, qu.getPaperId()) + .eq(ElPaperQu::getQuId, qu.getQuId()); + paperQuService.update(qu,queryWrapper); + return true; + } + + /** + * + * 交卷 + * @param paperId + * @return boolean + */ + + @Transactional(rollbackFor = Exception.class) + public boolean submitExam(String paperId) { + //获取试卷信息 + ElPaper paper = paperService.getById(paperId); + //如果不是正常的,抛出异常 + if(!PaperState.ING.equals(paper.getState())){ + throw new ServiceException("试卷状态不正确!"); + } + // 客观分 + int objScore = paperQuService.sumObjective(paperId); + paper.setObjScore(objScore); + paper.setUserScore(objScore); + // 主观分,因为要阅卷,所以给0 + paper.setSubjScore(0); + // 待阅卷 + if(Boolean.TRUE.equals(paper.getHasSaq())) { + paper.setState(PaperState.WAIT_OPT); + }else { + // 同步保存考试成绩 + userExamManager.joinResult(paper.getUserId(), paper.getExamId(), objScore, objScore>=paper.getQualifyScore()); + paper.setState(PaperState.FINISHED); + } + paper.setUpdateTime(new Date()); + //计算考试时长 + Calendar cl = Calendar.getInstance(); + cl.setTimeInMillis(System.currentTimeMillis()); + int userTime = (int)((System.currentTimeMillis() - paper.getCreateTime().getTime()) / 1000 / 60); + if(userTime == 0){ + userTime = 1; + } + paper.setUserTime(userTime); + //更新试卷 + paperService.updateById(paper); + List paperQus = paperQuService.lambdaQuery() + .eq(ElPaperQu::getPaperId, paperId) + .orderByAsc(ElPaperQu::getSort).list(); + List list = Convert.toList(PaperQuDTO.class, paperQus); + for(PaperQuDTO qu: list){ + // 主观题和对的都不加入错题库 + if(Boolean.TRUE.equals(qu.getIsRight())){ + continue; + } + //加入错题本 + new Thread(() -> userBookManager.addBook(paper.getExamId(), qu.getQuId())).run(); + } + return true; + } + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/QuManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/QuManager.java new file mode 100644 index 00000000..0818cac2 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/QuManager.java @@ -0,0 +1,197 @@ +package com.ruoyi.web.controller.manager; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.qu.ElQu; +import com.ruoyi.system.domain.qu.ElQuAnswer; +import com.ruoyi.system.domain.qu.ElQuRepo; +import com.ruoyi.system.domain.qu.dto.QuAnswerDTO; +import com.ruoyi.system.domain.qu.dto.ext.QuDetailDTO; +import com.ruoyi.system.domain.qu.dto.request.QuQueryReqDTO; +import com.ruoyi.system.domain.qu.enums.QuType; +import com.ruoyi.system.service.ElQuAnswerService; +import com.ruoyi.system.service.ElQuRepoService; +import com.ruoyi.system.service.ElQuService; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * packageName com.ruoyi.web.controller.manager + * + * @author wangxy + * @version JDK 8 + * @className QuManager + * @date 2024/6/27 + * @description + */ +@Component +public class QuManager { + + + @Resource + private ElQuService quService; + + + @Resource + private ElQuAnswerService quAnswerService; + + @Resource + private ElQuRepoService quRepoService; + + + /** + * 查询 + * + * @param qu + * @return java.util.List + */ + public List selectQuList(QuQueryReqDTO qu) { + return quService.selectQuList(qu); + } + + + /** + * 修改 + * + * @param reqDTO + * @return boolean + */ + @Transactional(rollbackFor = Exception.class) + public boolean saveOrUpdate(QuDetailDTO reqDTO) { + // 校验数据 + this.checkData(reqDTO, ""); + ElQu qu = Convert.convert(ElQu.class, reqDTO); + if (StringUtils.isNotEmpty(reqDTO.getId())) { + qu.setUpdateTime(new Date()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ElQuAnswer::getQuId,reqDTO.getId()); + quAnswerService.remove(wrapper); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ElQuRepo::getQuId,reqDTO.getId()); + quRepoService.remove(queryWrapper); + } else { + qu.setCreateTime(new Date()); + } + if(CollUtil.isNotEmpty(reqDTO.getAnswerList())){ + List answerList = Convert.toList(ElQuAnswer.class, reqDTO.getAnswerList()); + answerList.forEach(elQuAnswer -> elQuAnswer.setQuId(qu.getId())); + quAnswerService.saveBatch(answerList); + } + if(CollUtil.isNotEmpty(reqDTO.getRepoIds())){ + List list = new ArrayList<>(); + reqDTO.getRepoIds().forEach(repoId->{ + ElQuRepo ref = new ElQuRepo(); + ref.setQuId(qu.getId()); + ref.setRepoId(repoId); + ref.setQuType(qu.getQuType()); + list.add(ref); + }); + quRepoService.saveBatch(list); + reqDTO.getRepoIds().forEach(this::sortRepo); + } + return quService.saveOrUpdate(qu); + } + + + /** + * 单个题库进行排序 + * @param repoId + */ + private void sortRepo(String repoId){ + List list = quRepoService.lambdaQuery() + .eq(ElQuRepo::getRepoId, repoId).list(); + if(CollectionUtils.isEmpty(list)){ + return; + } + int sort = 1; + for(ElQuRepo item: list){ + item.setSort(sort); + sort++; + } + quRepoService.saveOrUpdateBatch(list); + } + + public QuDetailDTO detail(String id) { + ElQu qu = quService.getById(id); + QuDetailDTO detailDTO = Convert.convert(QuDetailDTO.class, qu); + List quAnswers = quAnswerService.lambdaQuery().eq(ElQuAnswer::getQuId, id).list(); + List list = Convert.toList(QuAnswerDTO.class, quAnswers); + detailDTO.setAnswerList(list); + List repos = quRepoService.lambdaQuery() + .eq(ElQuRepo::getQuId, id).list(); + List repoIds = repos.stream().map(ElQuRepo::getRepoId).collect(Collectors.toList()); + detailDTO.setRepoIds(repoIds); + return detailDTO; + } + + + @Transactional(rollbackFor = Exception.class) + public boolean deleteQuByIds(String ids) { + List list = Arrays.asList(Convert.toStrArray(ids)); + quService.removeByIds(list); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(ElQuAnswer::getQuId,list); + quAnswerService.remove(wrapper); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(ElQuRepo::getQuId,list); + return quRepoService.remove(queryWrapper); + } + + + + /** + * 校验题目信息 + * + * @param qu + * @param no + * @throws Exception + */ + public void checkData(QuDetailDTO qu, String no) { + if (StringUtils.isEmpty(qu.getContent())) { + throw new ServiceException( no + "题目内容不能为空!"); + } + if (CollectionUtils.isEmpty(qu.getRepoIds())) { + throw new ServiceException(no + "至少要选择一个题库!"); + } + List answers = qu.getAnswerList(); + + if (CollectionUtils.isEmpty(answers)) { + throw new ServiceException( no + "客观题至少要包含一个备选答案!"); + } + int trueCount = 0; + for (QuAnswerDTO a : answers) { + if (a.getIsRight() == null) { + throw new ServiceException( no + "必须定义选项是否正确项!"); + } + if (StringUtils.isEmpty(a.getContent())) { + throw new ServiceException( no + "选项内容不为空!"); + } + if (a.getIsRight()) { + trueCount += 1; + } + } + + if (trueCount == 0) { + throw new ServiceException(no + "至少要包含一个正确项!"); + } + //单选题 + if (qu.getQuType().equals(QuType.RADIO) && trueCount > 1) { + throw new ServiceException( no + "单选题不能包含多个正确项!"); + } + } + + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/RepoManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/RepoManager.java new file mode 100644 index 00000000..6eb5655c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/RepoManager.java @@ -0,0 +1,73 @@ +package com.ruoyi.web.controller.manager; + +import cn.hutool.core.convert.Convert; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.repo.ElRepo; +import com.ruoyi.system.domain.repo.vo.RepoVO; +import com.ruoyi.system.service.ElRepoService; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +/** + * packageName com.ruoyi.web.controller.manager + * + * @author wangxy + * @version JDK 8 + * @className ElRepoManager + * @date 2024/6/27 + * @description 题库 + */ +@Component +public class RepoManager { + + + @Resource + private ElRepoService elRepoService; + + + /** + * 查询 + * + * @param repo + * @return java.util.List + */ + public List selectRepoList(ElRepo repo) { + return elRepoService.selectRepoList(repo); + } + + + /** + * 修改 + * + * @param repo + * @return boolean + */ + @Transactional(rollbackFor = Exception.class) + public boolean saveOrUpdate(ElRepo repo) { + if (StringUtils.isNotEmpty(repo.getId())) { + repo.setUpdateTime(new Date()); + } else { + repo.setCreateTime(new Date()); + } + return elRepoService.saveOrUpdate(repo); + } + + + public ElRepo getById(String id) { + return elRepoService.getById(id); + } + + + public List getList() { + return elRepoService.lambdaQuery().list(); + } + + public boolean deleteRepoByIds(String ids) { + return elRepoService.removeByIds(Arrays.asList(Convert.toStrArray(ids))); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserBookManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserBookManager.java new file mode 100644 index 00000000..a5b52a4f --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserBookManager.java @@ -0,0 +1,78 @@ +package com.ruoyi.web.controller.manager; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.system.domain.qu.ElQu; +import com.ruoyi.system.domain.userbook.ElUserBook; +import com.ruoyi.system.service.ElQuService; +import com.ruoyi.system.service.ElUserBookService; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.Objects; + +/** + * packageName com.ruoyi.web.controller.manager + * + * @author wangxy + * @version JDK 8 + * @className UserBookManager + * @date 2024/7/1 + * @description 错题本 + */ +@Component +public class UserBookManager { + + + @Resource + private ElUserBookService userBookService; + + @Resource + private ElQuService quService; + + + public void addBook(String examId, String quId) { + + ElUserBook book = userBookService.lambdaQuery() + .eq(ElUserBook::getUserId, ShiroUtils.getUserId()) + .eq(ElUserBook::getExamId, examId) + .eq(ElUserBook::getQuId, quId).one(); + // 问题 + ElQu qu = quService.getById(quId); + if (Objects.isNull(book)) { + book = new ElUserBook(); + book.setExamId(examId); + book.setUserId(ShiroUtils.getUserId()); + book.setTitle(qu.getContent()); + book.setQuId(quId); + book.setWrongCount(1); + Integer maxSort = this.findMaxSort(examId, ShiroUtils.getUserId()); + book.setSort(maxSort+1); + userBookService.save(book); + } else { + book.setWrongCount(book.getWrongCount()+1); + userBookService.updateById(book); + } + } + + /** + * 查找最大的排序 + * @param userId + * @return + */ + private Integer findMaxSort(String examId, Long userId){ + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.lambda() + .eq(ElUserBook::getExamId, examId) + .eq(ElUserBook::getUserId, userId); + wrapper.last(" ORDER BY `sort` DESC"); + ElUserBook book = userBookService.getOne(wrapper, false); + if(Objects.isNull(book)){ + return 0; + } + return book.getSort(); + } + + + +} 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 new file mode 100644 index 00000000..023e23c9 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java @@ -0,0 +1,61 @@ +package com.ruoyi.web.controller.manager; + +import com.ruoyi.system.domain.userexam.ElUserExam; +import com.ruoyi.system.service.ElUserExamService; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.Objects; + +/** + * packageName com.ruoyi.web.controller.manager + * + * @author wangxy + * @version JDK 8 + * @className UserExamManager + * @date 2024/7/1 + * @description 考试记录业务 + */ +@Component +public class UserExamManager { + + @Resource + private ElUserExamService elUserExamService; + + /** + * + * 考试记录保存 + * @param userId + * @param examId + * @param score + * @param passed + * @return void + */ + + public void joinResult(Long userId, String examId, Integer score, boolean passed) { + //查询条件 + ElUserExam record = elUserExamService.lambdaQuery() + .eq(ElUserExam::getUserId, userId) + .eq(ElUserExam::getExamId, examId).one(); + if(Objects.isNull(record)){ + record = new ElUserExam(); + record.setCreateTime(new Date()); + record.setUpdateTime(new Date()); + record.setUserId(userId); + record.setExamId(examId); + record.setMaxScore(score); + record.setPassed(passed); + elUserExamService.save(record); + return; + } + // 修复低分数不加入统计问题 + record.setTryCount(record.getTryCount()+1); + record.setUpdateTime(new Date()); + if(record.getMaxScore() < score){ + record.setMaxScore(score); + record.setPassed(passed); + } + elUserExamService.updateById(record); + } +} diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml index 49fbb1cd..98fa86ed 100644 --- a/ruoyi-admin/src/main/resources/application-dev.yml +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -8,7 +8,7 @@ spring: # 主库数据源 master: # url: jdbc:mysql://192.168.254.123:3306/zhky?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - url: jdbc:kingbase8://192.168.254.197:54321/zhky?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&clientEncoding=UTF8 + url: jdbc:kingbase8://192.168.254.197:54321/test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&clientEncoding=UTF8 #username: root #password: qwer1234 diff --git a/ruoyi-admin/src/main/resources/templates/system/elExam/repo/add.html b/ruoyi-admin/src/main/resources/templates/system/elExam/repo/add.html new file mode 100644 index 00000000..6583b3b9 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/elExam/repo/add.html @@ -0,0 +1,42 @@ + + + + + + + +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+ + + + + diff --git a/ruoyi-admin/src/main/resources/templates/system/elExam/repo/edit.html b/ruoyi-admin/src/main/resources/templates/system/elExam/repo/edit.html new file mode 100644 index 00000000..84f34aa4 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/elExam/repo/edit.html @@ -0,0 +1,45 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+ + + + + diff --git a/ruoyi-admin/src/main/resources/templates/system/elExam/repo/repo.html b/ruoyi-admin/src/main/resources/templates/system/elExam/repo/repo.html new file mode 100644 index 00000000..6d273253 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/elExam/repo/repo.html @@ -0,0 +1,95 @@ + + + + + + +
+
+
+
+
+ +
+
+
+ + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/elExam/test.html b/ruoyi-admin/src/main/resources/templates/system/elExam/test.html new file mode 100644 index 00000000..91ecd782 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/elExam/test.html @@ -0,0 +1,117 @@ + + + + + + +
+
+
+
+
+
    +
  • + 公告标题: +
  • +
  • + 操作人员: +
  • +
  • + 公告类型: +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml index 50fb9865..2d5a236b 100644 --- a/ruoyi-system/pom.xml +++ b/ruoyi-system/pom.xml @@ -28,6 +28,13 @@ provided + + + io.swagger + swagger-models + 1.6.2 + + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/ElExam.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/ElExam.java new file mode 100644 index 00000000..6d30e5ae --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/ElExam.java @@ -0,0 +1,88 @@ +package com.ruoyi.system.domain.exam; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * 考试主表 + * @TableName el_exam + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ElExam implements Serializable { + /** + * ID + */ + @TableId + private String id; + + /** + * 考试名称 + */ + private String title; + + /** + * 考试描述 + */ + private String content; + + /** + * 1公开2部门3定员 + */ + private Integer openType; + + /** + * 考试状态 + */ + private Integer state; + + /** + * 是否限时 + */ + private Integer timeLimit; + + /** + * 开始时间 + */ + private Date startTime; + + /** + * 结束时间 + */ + private Date endTime; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 总分数 + */ + private Integer totalScore; + + /** + * 总时长(分钟) + */ + private Integer totalTime; + + /** + * 及格分数 + */ + private Integer qualifyScore; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/ElExamDepart.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/ElExamDepart.java new file mode 100644 index 00000000..1d8a5305 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/ElExamDepart.java @@ -0,0 +1,38 @@ +package com.ruoyi.system.domain.exam; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 考试部门 + * @author 13560 + * @TableName el_exam_depart + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ElExamDepart implements Serializable { + /** + * ID + */ + @TableId + private String id; + + /** + * 考试ID + */ + private String examId; + + /** + * 部门ID + */ + private Long departId; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/ElExamRepo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/ElExamRepo.java new file mode 100644 index 00000000..412fffdf --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/ElExamRepo.java @@ -0,0 +1,77 @@ +package com.ruoyi.system.domain.exam; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 考试题库 + * @TableName el_exam_repo + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ElExamRepo implements Serializable { + /** + * ID + */ + @TableId + private String id; + + /** + * 考试ID + */ + private String examId; + + /** + * 题库ID + */ + private String repoId; + + /** + * 单选题数量 + */ + private Integer radioCount; + + /** + * 单选题分数 + */ + private Integer radioScore; + + /** + * 多选题数量 + */ + private Integer multiCount; + + /** + * 多选题分数 + */ + private Integer multiScore; + + /** + * 判断题数量 + */ + private Integer judgeCount; + + /** + * 判断题分数 + */ + private Integer judgeScore; + + /** + * 简答题数量 + */ + private Integer saqCount; + + /** + * 简答题分数 + */ + private Integer saqScore; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/ExamDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/ExamDTO.java new file mode 100644 index 00000000..77b2f31a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/ExamDTO.java @@ -0,0 +1,103 @@ +package com.ruoyi.system.domain.exam.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.system.domain.exam.enums.ExamState; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** +*

+* 考试数据传输类 +*

+* +* @author 聪明笨狗 +* @since 2020-07-25 16:18 +*/ +@Data +@ApiModel(value="考试", description="考试") +public class ExamDTO implements Serializable { + + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "ID") + private String id; + + @ApiModelProperty(value = "考试名称") + private String title; + + @ApiModelProperty(value = "考试描述") + private String content; + + @ApiModelProperty(value = "1公开2部门3定员") + private Integer openType; + + @ApiModelProperty(value = "考试状态") + private Integer state; + + @ApiModelProperty(value = "是否限时") + private Boolean timeLimit; + + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "开始时间") + private Date startTime; + + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "结束时间") + private Date endTime; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + @ApiModelProperty(value = "总分数") + private Integer totalScore; + + @ApiModelProperty(value = "总时长(分钟)") + private Integer totalTime; + + @ApiModelProperty(value = "及格分数") + private Integer qualifyScore; + + @ApiModelProperty(value = "用户id") + @TableField(exist = false) + private Long userId; + + + + + /** + * 是否结束 + * @return + */ + public Integer getState(){ + + if(this.timeLimit!=null && this.timeLimit){ + + if(System.currentTimeMillis() < startTime.getTime() ){ + return ExamState.READY_START; + } + + if(System.currentTimeMillis() > endTime.getTime()){ + return ExamState.OVERDUE; + } + + if(System.currentTimeMillis() > startTime.getTime() + && System.currentTimeMillis() < endTime.getTime() + && !ExamState.DISABLED.equals(this.state)){ + return ExamState.ENABLE; + } + + } + + return this.state; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/ExamDepartDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/ExamDepartDTO.java new file mode 100644 index 00000000..9e2e1302 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/ExamDepartDTO.java @@ -0,0 +1,33 @@ +package com.ruoyi.system.domain.exam.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** +*

+* 考试部门数据传输类 +*

+* +* @author 聪明笨狗 +* @since 2020-09-03 17:24 +*/ +@Data +@ApiModel(value="考试部门", description="考试部门") +public class ExamDepartDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "ID") + private String id; + + @ApiModelProperty(value = "考试ID") + private String examId; + + @ApiModelProperty(value = "部门ID") + private String departId; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/ExamRepoDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/ExamRepoDTO.java new file mode 100644 index 00000000..b0209fd7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/ExamRepoDTO.java @@ -0,0 +1,51 @@ +package com.ruoyi.system.domain.exam.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** +*

+* 考试题库数据传输类 +*

+* +* @author 聪明笨狗 +* @since 2020-09-05 11:14 +*/ +@Data +@ApiModel(value="考试题库", description="考试题库") +public class ExamRepoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "ID") + private String id; + + @ApiModelProperty(value = "考试ID") + private String examId; + + @ApiModelProperty(value = "题库ID") + private String repoId; + + @ApiModelProperty(value = "单选题数量") + private Integer radioCount; + + @ApiModelProperty(value = "单选题分数") + private Integer radioScore; + + @ApiModelProperty(value = "多选题数量") + private Integer multiCount; + + @ApiModelProperty(value = "多选题分数") + private Integer multiScore; + + @ApiModelProperty(value = "判断题数量") + private Integer judgeCount; + + @ApiModelProperty(value = "判断题分数") + private Integer judgeScore; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/ext/ExamRepoExtDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/ext/ExamRepoExtDTO.java new file mode 100644 index 00000000..2bfd98dc --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/ext/ExamRepoExtDTO.java @@ -0,0 +1,31 @@ +package com.ruoyi.system.domain.exam.dto.ext; +import com.ruoyi.system.domain.exam.dto.ExamRepoDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** +*

+* 考试题库数据传输类 +*

+* +* @author 聪明笨狗 +* @since 2020-09-05 11:14 +*/ +@Data +@ApiModel(value="考试题库扩展响应类", description="考试题库扩展响应类") +public class ExamRepoExtDTO extends ExamRepoDTO { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "单选题总量", required=true) + private Integer totalRadio; + + @ApiModelProperty(value = "多选题总量", required=true) + private Integer totalMulti; + + @ApiModelProperty(value = "判断题总量", required=true) + private Integer totalJudge; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/request/ExamSaveReqDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/request/ExamSaveReqDTO.java new file mode 100644 index 00000000..fdb9daf7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/request/ExamSaveReqDTO.java @@ -0,0 +1,32 @@ +package com.ruoyi.system.domain.exam.dto.request; + +import com.ruoyi.system.domain.exam.dto.ExamDTO; +import com.ruoyi.system.domain.exam.dto.ext.ExamRepoExtDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** +*

+* 考试保存请求类 +*

+* +* @author 聪明笨狗 +* @since 2020-07-25 16:18 +*/ +@Data +@ApiModel(value="考试保存请求类", description="考试保存请求类") +public class ExamSaveReqDTO extends ExamDTO { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "题库列表", required=true) + private List repoList; + + @ApiModelProperty(value = "考试部门列表", required=true) + private List departIds; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/response/ExamOnlineRespDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/response/ExamOnlineRespDTO.java new file mode 100644 index 00000000..a763b437 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/response/ExamOnlineRespDTO.java @@ -0,0 +1,22 @@ +package com.ruoyi.system.domain.exam.dto.response; + +import com.ruoyi.system.domain.exam.dto.ExamDTO; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +/** +*

+* 考试分页响应类 +*

+* +* @author 聪明笨狗 +* @since 2020-07-25 16:18 +*/ +@Data +@ApiModel(value="在线考试分页响应类", description="在线考试分页响应类") +public class ExamOnlineRespDTO extends ExamDTO { + + private static final long serialVersionUID = 1L; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/response/ExamReviewRespDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/response/ExamReviewRespDTO.java new file mode 100644 index 00000000..5af2a326 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/dto/response/ExamReviewRespDTO.java @@ -0,0 +1,31 @@ +package com.ruoyi.system.domain.exam.dto.response; + +import com.ruoyi.system.domain.exam.dto.ExamDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** +*

+* 考试分页响应类 +*

+* +* @author 聪明笨狗 +* @since 2020-07-25 16:18 +*/ +@Data +@ApiModel(value="阅卷分页响应类", description="阅卷分页响应类") +public class ExamReviewRespDTO extends ExamDTO { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "考试人数", required=true) + private Integer examUser; + + @ApiModelProperty(value = "待阅试卷", required=true) + private Integer unreadPaper; + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/enums/ExamState.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/enums/ExamState.java new file mode 100644 index 00000000..1ee3bdae --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/enums/ExamState.java @@ -0,0 +1,33 @@ +package com.ruoyi.system.domain.exam.enums; + + +/** + * 考试状态 + * @author bool + * @date 2019-10-30 13:11 + */ +public interface ExamState { + + + /** + * 考试中 + */ + Integer ENABLE = 0; + + /** + * 待阅卷 + */ + Integer DISABLED = 1; + + /** + * 已完成 + */ + Integer READY_START = 2; + + /** + * 已结束 + */ + Integer OVERDUE = 3; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/enums/OpenType.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/enums/OpenType.java new file mode 100644 index 00000000..4603ae08 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/enums/OpenType.java @@ -0,0 +1,18 @@ +package com.ruoyi.system.domain.exam.enums; + +/** + * 开放方式 + * @author bool + */ +public interface OpenType { + + /** + * 完全开放 + */ + Integer OPEN = 1; + + /** + * 部门开放 + */ + Integer DEPT_OPEN = 2; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/ElPaper.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/ElPaper.java new file mode 100644 index 00000000..4e604f74 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/ElPaper.java @@ -0,0 +1,108 @@ +package com.ruoyi.system.domain.paper; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * 考试记录 + * @TableName el_paper + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ElPaper implements Serializable { + /** + * 试卷ID + */ + @TableId + private String id; + + /** + * 用户ID + */ + private Long userId; + + /** + * 部门ID + */ + private Long departId; + + /** + * 规则ID + */ + private String examId; + + /** + * 考试标题 + */ + private String title; + + /** + * 考试时长 + */ + private Integer totalTime; + + /** + * 用户时长 + */ + private Integer userTime; + + /** + * 试卷总分 + */ + private Integer totalScore; + + /** + * 及格分 + */ + private Integer qualifyScore; + + /** + * 客观分 + */ + private Integer objScore; + + /** + * 主观分 + */ + private Integer subjScore; + + /** + * 用户得分 + */ + private Integer userScore; + + /** + * 是否包含简答题 + */ + private Boolean hasSaq; + + /** + * 试卷状态 + */ + private Integer state; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 截止时间 + */ + private Date limitTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/ElPaperQu.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/ElPaperQu.java new file mode 100644 index 00000000..43805f0f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/ElPaperQu.java @@ -0,0 +1,72 @@ +package com.ruoyi.system.domain.paper; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 考试记录考题 + * @TableName el_paper_qu + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ElPaperQu implements Serializable { + /** + * ID + */ + @TableId + private String id; + + /** + * 试卷ID + */ + private String paperId; + + /** + * 题目ID + */ + private String quId; + + /** + * 题目类型 + */ + private Integer quType; + + /** + * 是否已答 + */ + private Boolean answered; + + /** + * 主观答案 + */ + private String answer; + + /** + * 问题排序 + */ + private Integer sort; + + /** + * 单题分分值 + */ + private Integer score; + + /** + * 实际得分(主观题) + */ + private Integer actualScore; + + /** + * 是否答对 + */ + private Boolean isRight; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/ElPaperQuAnswer.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/ElPaperQuAnswer.java new file mode 100644 index 00000000..f2e531fc --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/ElPaperQuAnswer.java @@ -0,0 +1,62 @@ +package com.ruoyi.system.domain.paper; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 考试记录答案 + * @TableName el_paper_qu_answer + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ElPaperQuAnswer implements Serializable { + /** + * 自增ID + */ + @TableId + private String id; + + /** + * 试卷ID + */ + private String paperId; + + /** + * 回答项ID + */ + private String answerId; + + /** + * 题目ID + */ + private String quId; + + /** + * 是否正确项 + */ + private Boolean isRight; + + /** + * 是否选中 + */ + private Boolean checked; + + /** + * 排序 + */ + private Integer sort; + + /** + * 选项标签 + */ + private String abc; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file 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 new file mode 100644 index 00000000..20844cf7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/PaperDTO.java @@ -0,0 +1,76 @@ +package com.ruoyi.system.domain.paper.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-05-25 17:31 +*/ +@Data +@ApiModel(value="试卷", description="试卷") +public class PaperDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "试卷ID") + private String id; + + @ApiModelProperty(value = "用户ID") + private String userId; + + @ApiModelProperty(value = "部门ID") + private String departId; + + @ApiModelProperty(value = "规则ID") + private String examId; + + @ApiModelProperty(value = "考试标题") + private String title; + + @ApiModelProperty(value = "考试时长") + private Integer totalTime; + + @ApiModelProperty(value = "用户时长") + private Integer userTime; + + @ApiModelProperty(value = "试卷总分") + private Integer totalScore; + + @ApiModelProperty(value = "及格分") + private Integer qualifyScore; + + @ApiModelProperty(value = "客观分") + private Integer objScore; + + @ApiModelProperty(value = "主观分") + private Integer subjScore; + + @ApiModelProperty(value = "用户得分") + private Integer userScore; + + @ApiModelProperty(value = "是否包含简答题") + private Boolean hasSaq; + + @ApiModelProperty(value = "试卷状态") + private Integer state; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + @ApiModelProperty(value = "截止时间") + private Date limitTime; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/PaperQuAnswerDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/PaperQuAnswerDTO.java new file mode 100644 index 00000000..aad9c1af --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/PaperQuAnswerDTO.java @@ -0,0 +1,48 @@ +package com.ruoyi.system.domain.paper.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** +*

+* 试卷考题备选答案请求类 +*

+* +* @author 聪明笨狗 +* @since 2020-05-25 17:31 +*/ +@Data +@ApiModel(value="试卷考题备选答案", description="试卷考题备选答案") +public class PaperQuAnswerDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "自增ID") + private String id; + + @ApiModelProperty(value = "试卷ID") + private String paperId; + + @ApiModelProperty(value = "回答项ID") + private String answerId; + + @ApiModelProperty(value = "题目ID") + private String quId; + + @ApiModelProperty(value = "是否正确项") + private Boolean isRight; + + @ApiModelProperty(value = "是否选中") + private Boolean checked; + + @ApiModelProperty(value = "排序") + private Integer sort; + + @ApiModelProperty(value = "选项标签") + private String abc; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/PaperQuDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/PaperQuDTO.java new file mode 100644 index 00000000..677b539a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/PaperQuDTO.java @@ -0,0 +1,54 @@ +package com.ruoyi.system.domain.paper.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** +*

+* 试卷考题请求类 +*

+* +* @author 聪明笨狗 +* @since 2020-05-25 17:31 +*/ +@Data +@ApiModel(value="试卷考题", description="试卷考题") +public class PaperQuDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "ID") + private String id; + + @ApiModelProperty(value = "试卷ID") + private String paperId; + + @ApiModelProperty(value = "题目ID") + private String quId; + + @ApiModelProperty(value = "题目类型") + private Integer quType; + + @ApiModelProperty(value = "是否已答") + private Boolean answered; + + @ApiModelProperty(value = "主观答案") + private String answer; + + @ApiModelProperty(value = "问题排序") + private Integer sort; + + @ApiModelProperty(value = "单题分分值") + private Integer score; + + @ApiModelProperty(value = "实际得分(主观题)") + private Integer actualScore; + + @ApiModelProperty(value = "是否答对") + private Boolean isRight; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/ext/PaperQuAnswerExtDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/ext/PaperQuAnswerExtDTO.java new file mode 100644 index 00000000..fd12ecc2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/ext/PaperQuAnswerExtDTO.java @@ -0,0 +1,29 @@ +package com.ruoyi.system.domain.paper.dto.ext; + +import com.ruoyi.system.domain.paper.dto.PaperQuAnswerDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** +*

+* 试卷考题备选答案请求类 +*

+* +* @author 聪明笨狗 +* @since 2020-05-25 17:31 +*/ +@Data +@ApiModel(value="试卷考题备选答案", description="试卷考题备选答案") +public class PaperQuAnswerExtDTO extends PaperQuAnswerDTO { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "试题图片") + private String image; + + @ApiModelProperty(value = "答案内容") + private String content; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/ext/PaperQuDetailDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/ext/PaperQuDetailDTO.java new file mode 100644 index 00000000..3c92a494 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/ext/PaperQuDetailDTO.java @@ -0,0 +1,32 @@ +package com.ruoyi.system.domain.paper.dto.ext; + +import com.ruoyi.system.domain.paper.dto.PaperQuDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** +*

+* 试卷考题请求类 +*

+* +* @author 聪明笨狗 +* @since 2020-05-25 17:31 +*/ +@Data +@ApiModel(value="试卷题目详情类", description="试卷题目详情类") +public class PaperQuDetailDTO extends PaperQuDTO { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "图片") + private String image; + + @ApiModelProperty(value = "题目内容") + private String content; + + @ApiModelProperty(value = "答案内容") + List answerList; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperAnswerDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperAnswerDTO.java new file mode 100644 index 00000000..2fb4ca03 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperAnswerDTO.java @@ -0,0 +1,22 @@ +package com.ruoyi.system.domain.paper.dto.request; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author bool + */ +@Data +@ApiModel(value="查找试卷题目详情请求类", description="查找试卷题目详情请求类") +public class PaperAnswerDTO extends PaperQuQueryDTO { + + @ApiModelProperty(value = "回答列表") + private List answers; + + @ApiModelProperty(value = "主观答案") + private String answer; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperCreateReqDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperCreateReqDTO.java new file mode 100644 index 00000000..1d73a9bf --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperCreateReqDTO.java @@ -0,0 +1,21 @@ +package com.ruoyi.system.domain.paper.dto.request; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author bool + */ +@Data +@ApiModel(value="试卷创建请求类", description="试卷创建请求类") +public class PaperCreateReqDTO { + + @JsonIgnore + private String userId; + + @ApiModelProperty(value = "考试ID") + private String examId; + +} 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 new file mode 100644 index 00000000..aa872376 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperListReqDTO.java @@ -0,0 +1,39 @@ +package com.ruoyi.system.domain.paper.dto.request; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** +*

+* 试卷请求类 +*

+* +* @author 聪明笨狗 +* @since 2020-05-25 17:31 +*/ +@Data +@ApiModel(value="试卷", description="试卷") +public class PaperListReqDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "用户ID") + private String userId; + + @ApiModelProperty(value = "部门ID") + private String departId; + + @ApiModelProperty(value = "规则ID") + private String examId; + + @ApiModelProperty(value = "用户昵称") + private String realName; + + @ApiModelProperty(value = "试卷状态") + private Integer state; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperQuQueryDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperQuQueryDTO.java new file mode 100644 index 00000000..ff91acf0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/request/PaperQuQueryDTO.java @@ -0,0 +1,20 @@ +package com.ruoyi.system.domain.paper.dto.request; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author bool + */ +@Data +@ApiModel(value="查找试卷题目详情请求类", description="查找试卷题目详情请求类") +public class PaperQuQueryDTO { + + @ApiModelProperty(value = "试卷ID") + private String paperId; + + @ApiModelProperty(value = "题目ID") + private String quId; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/response/ExamDetailRespDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/response/ExamDetailRespDTO.java new file mode 100644 index 00000000..00831006 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/response/ExamDetailRespDTO.java @@ -0,0 +1,42 @@ +package com.ruoyi.system.domain.paper.dto.response; + + +import com.ruoyi.system.domain.paper.dto.PaperDTO; +import com.ruoyi.system.domain.paper.dto.PaperQuDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Calendar; +import java.util.List; + +/** + * @author 13560 + */ +@Data +@ApiModel(value="考试详情", description="考试详情") +public class ExamDetailRespDTO extends PaperDTO { + + + @ApiModelProperty(value = "单选题列表") + private List radioList; + + @ApiModelProperty(value = "多选题列表") + private List multiList; + + @ApiModelProperty(value = "判断题") + private List judgeList; + + + @ApiModelProperty(value = "剩余结束秒数") + public Long getLeftSeconds(){ + + // 结束时间 + Calendar cl = Calendar.getInstance(); + cl.setTime(this.getCreateTime()); + cl.add(Calendar.MINUTE, getTotalTime()); + + return (cl.getTimeInMillis() - System.currentTimeMillis()) / 1000; + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/response/ExamResultRespDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/response/ExamResultRespDTO.java new file mode 100644 index 00000000..86c3daec --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/response/ExamResultRespDTO.java @@ -0,0 +1,18 @@ +package com.ruoyi.system.domain.paper.dto.response; + +import com.ruoyi.system.domain.paper.dto.PaperDTO; +import com.ruoyi.system.domain.paper.dto.ext.PaperQuDetailDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@Data +@ApiModel(value="考试结果展示响应类", description="考试结果展示响应类") +public class ExamResultRespDTO extends PaperDTO { + + @ApiModelProperty(value = "问题列表") + private List quList; + +} 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 new file mode 100644 index 00000000..98144a15 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/dto/response/PaperListRespDTO.java @@ -0,0 +1,26 @@ +package com.ruoyi.system.domain.paper.dto.response; + +import com.ruoyi.system.domain.paper.dto.PaperDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** +*

+* 试卷请求类 +*

+* +* @author 聪明笨狗 +* @since 2020-05-25 17:31 +*/ +@Data +@ApiModel(value="试卷列表响应类", description="试卷列表响应类") +public class PaperListRespDTO extends PaperDTO { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "人员") + private String realName; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/enums/PaperState.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/enums/PaperState.java new file mode 100644 index 00000000..b11b1868 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/paper/enums/PaperState.java @@ -0,0 +1,33 @@ +package com.ruoyi.system.domain.paper.enums; + + +/** + * 试卷状态 + * @author bool + * @date 2019-10-30 13:11 + */ +public interface PaperState { + + + /** + * 考试中 + */ + Integer ING = 0; + + /** + * 待阅卷 + */ + Integer WAIT_OPT = 1; + + /** + * 已完成 + */ + Integer FINISHED = 2; + + /** + * 弃考 + */ + Integer BREAK = 3; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/ElQu.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/ElQu.java new file mode 100644 index 00000000..d33de1c3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/ElQu.java @@ -0,0 +1,68 @@ +package com.ruoyi.system.domain.qu; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * 试题主表 + * @TableName el_qu + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ElQu implements Serializable { + /** + * 题目ID + */ + @TableId + private String id; + + /** + * 题目类型 + */ + private Integer quType; + + /** + * 1普通,2较难 + */ + private Integer level; + + /** + * 题目图片 + */ + private String image; + + /** + * 题目内容 + */ + private String content; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 题目备注 + */ + private String remark; + + /** + * 整题解析 + */ + private String analysis; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/ElQuAnswer.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/ElQuAnswer.java new file mode 100644 index 00000000..a21b48bf --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/ElQuAnswer.java @@ -0,0 +1,52 @@ +package com.ruoyi.system.domain.qu; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 试题答案选项 + * @TableName el_qu_answer + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ElQuAnswer implements Serializable { + /** + * 答案ID + */ + @TableId + private String id; + + /** + * 问题ID + */ + private String quId; + + /** + * 是否正确 + */ + private Boolean isRight; + + /** + * 选项图片 + */ + private String image; + + /** + * 答案内容 + */ + private String content; + + /** + * 答案分析 + */ + private String analysis; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/ElQuRepo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/ElQuRepo.java new file mode 100644 index 00000000..3982cd75 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/ElQuRepo.java @@ -0,0 +1,47 @@ +package com.ruoyi.system.domain.qu; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 试题题库关联 + * @TableName el_qu_repo + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ElQuRepo implements Serializable { + /** + * + */ + @TableId + private String id; + + /** + * 试题 + */ + private String quId; + + /** + * 归属题库 + */ + private String repoId; + + /** + * 题目类型 + */ + private Integer quType; + + /** + * 排序 + */ + private Integer sort; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuAnswerDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuAnswerDTO.java new file mode 100644 index 00000000..00f0f424 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuAnswerDTO.java @@ -0,0 +1,42 @@ +package com.ruoyi.system.domain.qu.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** +*

+* 候选答案请求类 +*

+* +* @author 聪明笨狗 +* @since 2020-05-25 13:23 +*/ +@Data +@ApiModel(value="候选答案", description="候选答案") +public class QuAnswerDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "答案ID") + private String id; + + @ApiModelProperty(value = "问题ID") + private String quId; + + @ApiModelProperty(value = "是否正确") + private Boolean isRight; + + @ApiModelProperty(value = "选项图片") + private String image; + + @ApiModelProperty(value = "答案内容") + private String content; + + @ApiModelProperty(value = "答案分析") + private String analysis; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuDTO.java new file mode 100644 index 00000000..ed2c71af --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuDTO.java @@ -0,0 +1,53 @@ +package com.ruoyi.system.domain.qu.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-05-25 13:23 +*/ +@Data +@ApiModel(value="问题题目", description="问题题目") +public class QuDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "题目ID") + private String id; + + @ApiModelProperty(value = "题目类型") + private Integer quType; + + @ApiModelProperty(value = "1普通,2较难") + private Integer level; + + @ApiModelProperty(value = "题目图片") + private String image; + + @ApiModelProperty(value = "题目内容") + private String content; + + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + @ApiModelProperty(value = "题目备注") + private String remark; + + @ApiModelProperty(value = "整题解析") + private String analysis; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuRepoDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuRepoDTO.java new file mode 100644 index 00000000..2fc520a2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuRepoDTO.java @@ -0,0 +1,38 @@ +package com.ruoyi.system.domain.qu.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** +*

+* 试题题库请求类 +*

+* +* @author 聪明笨狗 +* @since 2020-05-25 13:23 +*/ +@Data +@ApiModel(value="试题题库", description="试题题库") +public class QuRepoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + private String id; + + @ApiModelProperty(value = "试题", required=true) + private String quId; + + @ApiModelProperty(value = "归属题库", required=true) + private String repoId; + + @ApiModelProperty(value = "题目类型", required=true) + private Integer quType; + + @ApiModelProperty(value = "排序", required=true) + private Integer sort; + +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/ext/QuDetailDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/ext/QuDetailDTO.java new file mode 100644 index 00000000..9c2e673b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/ext/QuDetailDTO.java @@ -0,0 +1,33 @@ +package com.ruoyi.system.domain.qu.dto.ext; + +import com.ruoyi.system.domain.qu.dto.QuAnswerDTO; +import com.ruoyi.system.domain.qu.dto.QuDTO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** +*

+* 问题题目请求类 +*

+* +* @author 聪明笨狗 +* @since 2020-05-25 13:23 +*/ +@Data +@ApiModel(value="问题题目详情", description="问题题目详情") +public class QuDetailDTO extends QuDTO { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "备选项列表", required=true) + private List answerList; + + @ApiModelProperty(value = "题库列表", required=true) + private List repoIds; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/request/QuQueryReqDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/request/QuQueryReqDTO.java new file mode 100644 index 00000000..5bc3dc13 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/request/QuQueryReqDTO.java @@ -0,0 +1,36 @@ +package com.ruoyi.system.domain.qu.dto.request; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** +*

+* 问题题目请求类 +*

+* +* @author 聪明笨狗 +* @since 2020-05-25 13:23 +*/ +@Data +@ApiModel(value="题目查询请求类", description="题目查询请求类") +public class QuQueryReqDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "题目类型") + private Integer quType; + + @ApiModelProperty(value = "归属题库") + private List repoIds; + + @ApiModelProperty(value = "题目内容") + private String content; + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/request/QuRepoBatchReqDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/request/QuRepoBatchReqDTO.java new file mode 100644 index 00000000..53c5207f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/request/QuRepoBatchReqDTO.java @@ -0,0 +1,34 @@ +package com.ruoyi.system.domain.qu.dto.request; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** +*

+* 问题题目请求类 +*

+* +* @author 聪明笨狗 +* @since 2020-05-25 13:23 +*/ +@Data +@ApiModel(value="试题题库批量操作类", description="试题题库批量操作类") +public class QuRepoBatchReqDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "题目ID", required=true) + private List quIds; + + @ApiModelProperty(value = "题目类型", required=true) + private List repoIds; + + @ApiModelProperty(value = "是否移除,否就新增;是就移除", required=true) + private Boolean remove; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/enums/QuType.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/enums/QuType.java new file mode 100644 index 00000000..940eb392 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/enums/QuType.java @@ -0,0 +1,26 @@ +package com.ruoyi.system.domain.qu.enums; + + +/** + * 题目类型 + * @author bool + * @date 2019-10-30 13:11 + */ +public interface QuType { + + /** + * 单选题 + */ + Integer RADIO = 1; + + /** + * 多选题 + */ + Integer MULTI = 2; + + /** + * 判断题 + */ + Integer JUDGE = 3; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/repo/ElRepo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/repo/ElRepo.java new file mode 100644 index 00000000..51e501b4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/repo/ElRepo.java @@ -0,0 +1,48 @@ +package com.ruoyi.system.domain.repo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * 题库信息 + * @author 13560 + * @TableName el_repo + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ElRepo implements Serializable { + /** + * 题库ID + */ + @TableId + private String id; + + + @ApiModelProperty(value = "题库编号") + private String code; + + + @ApiModelProperty(value = "题库名称") + private String title; + + @ApiModelProperty(value = "题库备注") + private String remark; + + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/repo/vo/RepoVO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/repo/vo/RepoVO.java new file mode 100644 index 00000000..d43f4dd3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/repo/vo/RepoVO.java @@ -0,0 +1,51 @@ +package com.ruoyi.system.domain.repo.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** +*

+* 题库请求类 +*

+* +* @author 聪明笨狗 +* @since 2020-05-25 13:23 +*/ +@Data +@ApiModel(value="题库", description="题库") +public class RepoVO implements Serializable { + + private static final long serialVersionUID = 1L; + + + @ApiModelProperty(value = "题库ID") + private String id; + + @ApiModelProperty(value = "题库编号") + private String code; + + @ApiModelProperty(value = "题库名称") + private String title; + + @ApiModelProperty(value = "题库备注") + private String remark; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "更新时间") + private Date updateTime; + + @ApiModelProperty(value = "单选题数量") + private Integer radioCount; + + @ApiModelProperty(value = "多选题数量") + private Integer multiCount; + + @ApiModelProperty(value = "判断题数量") + private Integer judgeCount; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/userbook/ElUserBook.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userbook/ElUserBook.java new file mode 100644 index 00000000..9f48b8f2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userbook/ElUserBook.java @@ -0,0 +1,69 @@ +package com.ruoyi.system.domain.userbook; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * 错题本 + * @author 13560 + * @TableName el_user_book + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ElUserBook implements Serializable { + /** + * ID + */ + @TableId + private String id; + + /** + * 考试ID + */ + private String examId; + + /** + * 用户ID + */ + private Long userId; + + /** + * 题目ID + */ + private String quId; + + /** + * 加入时间 + */ + private Date createTime; + + /** + * 最近错误时间 + */ + private Date updateTime; + + /** + * 错误时间 + */ + private Integer wrongCount; + + /** + * 题目标题 + */ + private String title; + + /** + * 错题序号 + */ + private Integer sort; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/ElUserExam.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/ElUserExam.java new file mode 100644 index 00000000..0dba06b8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/userexam/ElUserExam.java @@ -0,0 +1,64 @@ +package com.ruoyi.system.domain.userexam; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * 考试记录 + * @author 13560 + * @TableName el_user_exam + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class ElUserExam implements Serializable { + /** + * + */ + @TableId + private String id; + + /** + * 用户ID + */ + private Long userId; + + /** + * 考试ID + */ + private String examId; + + /** + * 考试次数 + */ + private Integer tryCount; + + /** + * 最高分数 + */ + private Integer maxScore; + + /** + * 是否通过 + */ + private Boolean passed; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElExamDepartMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElExamDepartMapper.java new file mode 100644 index 00000000..45437581 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElExamDepartMapper.java @@ -0,0 +1,18 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.exam.ElExamDepart; + +/** +* @author 13560 +* @description 针对表【el_exam_depart(考试部门)】的数据库操作Mapper +* @createDate 2024-06-28 10:53:44 +* @Entity generator.domain.ElExamDepart +*/ +public interface ElExamDepartMapper extends BaseMapper { + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElExamMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElExamMapper.java new file mode 100644 index 00000000..edadac1c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElExamMapper.java @@ -0,0 +1,30 @@ +package com.ruoyi.system.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.exam.ElExam; +import com.ruoyi.system.domain.exam.dto.ExamDTO; +import com.ruoyi.system.domain.exam.dto.response.ExamOnlineRespDTO; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_exam(考试主表)】的数据库操作Mapper +* @createDate 2024-06-28 08:51:41 +* @Entity generator.domain.ElExam +*/ +public interface ElExamMapper extends BaseMapper { + + + + public List selectExamList(ExamDTO examDTO); + + + public List onlineExamList(ExamDTO examDTO); + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElExamRepoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElExamRepoMapper.java new file mode 100644 index 00000000..9cfb985b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElExamRepoMapper.java @@ -0,0 +1,24 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.exam.ElExamRepo; +import com.ruoyi.system.domain.exam.dto.ext.ExamRepoExtDTO; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_exam_repo(考试题库)】的数据库操作Mapper +* @createDate 2024-06-28 08:51:41 +* @Entity generator.domain.ElExamRepo +*/ +public interface ElExamRepoMapper extends BaseMapper { + + + public List listByExam(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 new file mode 100644 index 00000000..c1cb30f1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElPaperMapper.java @@ -0,0 +1,18 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.paper.ElPaper; + +/** +* @author 13560 +* @description 针对表【el_paper(考试记录)】的数据库操作Mapper +* @createDate 2024-06-28 15:02:53 +* @Entity generator.domain.ElPaper +*/ +public interface ElPaperMapper extends BaseMapper { + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElPaperQuAnswerMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElPaperQuAnswerMapper.java new file mode 100644 index 00000000..5aeb7db9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElPaperQuAnswerMapper.java @@ -0,0 +1,31 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.paper.ElPaperQuAnswer; +import com.ruoyi.system.domain.paper.dto.ext.PaperQuAnswerExtDTO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_paper_qu_answer(考试记录答案)】的数据库操作Mapper +* @createDate 2024-06-28 15:02:53 +* @Entity generator.domain.ElPaperQuAnswer +*/ +public interface ElPaperQuAnswerMapper extends BaseMapper { + + + /** + * 查找试卷试题答案列表 + * @param paperId + * @param quId + * @return + */ + List list(@Param("paperId") String paperId, @Param("quId") String quId); + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElPaperQuMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElPaperQuMapper.java new file mode 100644 index 00000000..6efdb9b2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElPaperQuMapper.java @@ -0,0 +1,26 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.paper.ElPaperQu; + +/** +* @author 13560 +* @description 针对表【el_paper_qu(考试记录考题)】的数据库操作Mapper +* @createDate 2024-06-28 15:02:53 +* @Entity generator.domain.ElPaperQu +*/ +public interface ElPaperQuMapper extends BaseMapper { + + + /** + * 统计客观分 + * @param paperId + * @return + */ + int sumObjective(String paperId); + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElQuAnswerMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElQuAnswerMapper.java new file mode 100644 index 00000000..b28b1fcc --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElQuAnswerMapper.java @@ -0,0 +1,18 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.qu.ElQuAnswer; + +/** +* @author 13560 +* @description 针对表【el_qu_answer(试题答案选项)】的数据库操作Mapper +* @createDate 2024-06-27 14:33:59 +* @Entity generator.domain.ElQuAnswer +*/ +public interface ElQuAnswerMapper extends BaseMapper { + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElQuMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElQuMapper.java new file mode 100644 index 00000000..1515998d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElQuMapper.java @@ -0,0 +1,48 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.qu.ElQu; +import com.ruoyi.system.domain.qu.dto.request.QuQueryReqDTO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_qu(试题主表)】的数据库操作Mapper +* @createDate 2024-06-27 14:33:59 +* @Entity generator.domain.ElQu +*/ +public interface ElQuMapper extends BaseMapper { + + + + /** + * 查询公告列表 + * + * @param qu 公告信息 + * @return 公告集合 + */ + public List selectQuList(QuQueryReqDTO qu); + + + + /** + * 随机抽取题库的数据 + * @param repoId + * @param quType + * @param size + * @param excludes 要排除的ID列表 + * @param size + * @return + */ + List listByRandom(@Param("repoId") String repoId, + @Param("quType") Integer quType, + @Param("excludes") List excludes, + @Param("size") Integer size); + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElQuRepoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElQuRepoMapper.java new file mode 100644 index 00000000..bddeb906 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElQuRepoMapper.java @@ -0,0 +1,18 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.qu.ElQuRepo; + +/** +* @author 13560 +* @description 针对表【el_qu_repo(试题题库关联)】的数据库操作Mapper +* @createDate 2024-06-27 14:33:59 +* @Entity generator.domain.ElQuRepo +*/ +public interface ElQuRepoMapper extends BaseMapper { + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElRepoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElRepoMapper.java new file mode 100644 index 00000000..faf451d9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElRepoMapper.java @@ -0,0 +1,30 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.repo.ElRepo; +import com.ruoyi.system.domain.repo.vo.RepoVO; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_repo(题库信息)】的数据库操作Mapper +* @createDate 2024-06-27 10:03:50 +* @Entity generator.domain.ElRepo +*/ +public interface ElRepoMapper extends BaseMapper { + + + /** + * 查询公告列表 + * + * @param repo 公告信息 + * @return 公告集合 + */ + public List selectRepoList(ElRepo repo); + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElUserBookMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElUserBookMapper.java new file mode 100644 index 00000000..4c606d06 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElUserBookMapper.java @@ -0,0 +1,18 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.userbook.ElUserBook; + +/** +* @author 13560 +* @description 针对表【el_user_book(错题本)】的数据库操作Mapper +* @createDate 2024-07-01 14:45:33 +* @Entity generator.domain.ElUserBook +*/ +public interface ElUserBookMapper extends BaseMapper { + +} + + + + 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 new file mode 100644 index 00000000..e3f9c746 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElUserExamMapper.java @@ -0,0 +1,18 @@ +package com.ruoyi.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.userexam.ElUserExam; + +/** +* @author 13560 +* @description 针对表【el_user_exam(考试记录)】的数据库操作Mapper +* @createDate 2024-07-01 14:31:30 +* @Entity generator.domain.ElUserExam +*/ +public interface ElUserExamMapper extends BaseMapper { + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElExamDepartService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElExamDepartService.java new file mode 100644 index 00000000..00382b67 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElExamDepartService.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.exam.ElExamDepart; + +/** +* @author 13560 +* @description 针对表【el_exam_depart(考试部门)】的数据库操作Service +* @createDate 2024-06-28 10:53:44 +*/ +public interface ElExamDepartService extends IService { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElExamRepoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElExamRepoService.java new file mode 100644 index 00000000..3d0de107 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElExamRepoService.java @@ -0,0 +1,19 @@ +package com.ruoyi.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.exam.ElExamRepo; +import com.ruoyi.system.domain.exam.dto.ext.ExamRepoExtDTO; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_exam_repo(考试题库)】的数据库操作Service +* @createDate 2024-06-28 08:51:41 +*/ +public interface ElExamRepoService extends IService { + + + public List listByExam(String examId); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElExamService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElExamService.java new file mode 100644 index 00000000..45abaca1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElExamService.java @@ -0,0 +1,23 @@ +package com.ruoyi.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.exam.ElExam; +import com.ruoyi.system.domain.exam.dto.ExamDTO; +import com.ruoyi.system.domain.exam.dto.response.ExamOnlineRespDTO; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_exam(考试主表)】的数据库操作Service +* @createDate 2024-06-28 08:51:41 +*/ +public interface ElExamService extends IService { + + + public List selectExamList(ExamDTO examDTO); + + + public List onlineExamList(ExamDTO examDTO); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElPaperQuAnswerService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElPaperQuAnswerService.java new file mode 100644 index 00000000..1e48a9f8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElPaperQuAnswerService.java @@ -0,0 +1,26 @@ +package com.ruoyi.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.paper.ElPaperQuAnswer; +import com.ruoyi.system.domain.paper.dto.ext.PaperQuAnswerExtDTO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_paper_qu_answer(考试记录答案)】的数据库操作Service +* @createDate 2024-06-28 15:02:53 +*/ +public interface ElPaperQuAnswerService extends IService { + + + /** + * 查找试卷试题答案列表 + * @param paperId + * @param quId + * @return + */ + List list(@Param("paperId") String paperId, @Param("quId") String quId); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElPaperQuService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElPaperQuService.java new file mode 100644 index 00000000..c8caabb3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElPaperQuService.java @@ -0,0 +1,21 @@ +package com.ruoyi.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.paper.ElPaperQu; + +/** +* @author 13560 +* @description 针对表【el_paper_qu(考试记录考题)】的数据库操作Service +* @createDate 2024-06-28 15:02:53 +*/ +public interface ElPaperQuService extends IService { + + /** + * 统计客观分 + * @param paperId + * @return + */ + int sumObjective(String paperId); + + +} 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 new file mode 100644 index 00000000..f635c838 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElPaperService.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.paper.ElPaper; + +/** +* @author 13560 +* @description 针对表【el_paper(考试记录)】的数据库操作Service +* @createDate 2024-06-28 15:02:53 +*/ +public interface ElPaperService extends IService { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElQuAnswerService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElQuAnswerService.java new file mode 100644 index 00000000..07bfb2fe --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElQuAnswerService.java @@ -0,0 +1,14 @@ +package com.ruoyi.system.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.qu.ElQuAnswer; + +/** +* @author 13560 +* @description 针对表【el_qu_answer(试题答案选项)】的数据库操作Service +* @createDate 2024-06-27 14:33:59 +*/ +public interface ElQuAnswerService extends IService { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElQuRepoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElQuRepoService.java new file mode 100644 index 00000000..ba4a7fa0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElQuRepoService.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.qu.ElQuRepo; + +/** +* @author 13560 +* @description 针对表【el_qu_repo(试题题库关联)】的数据库操作Service +* @createDate 2024-06-27 14:33:59 +*/ +public interface ElQuRepoService extends IService { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElQuService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElQuService.java new file mode 100644 index 00000000..c5c81cef --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElQuService.java @@ -0,0 +1,34 @@ +package com.ruoyi.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.qu.ElQu; +import com.ruoyi.system.domain.qu.dto.request.QuQueryReqDTO; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_qu(试题主表)】的数据库操作Service +* @createDate 2024-06-27 14:33:59 +*/ +public interface ElQuService extends IService { + + + public List selectQuList(QuQueryReqDTO qu); + + + /** + * 随机抽取题库的数据 + * @param repoId + * @param quType + * @param size 难度等级 + * @param excludes 要排除的ID列表 + * @param size + * @return + */ + List listByRandom(String repoId, + Integer quType, + List excludes, + Integer size); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElRepoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElRepoService.java new file mode 100644 index 00000000..eddc90df --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElRepoService.java @@ -0,0 +1,25 @@ +package com.ruoyi.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.repo.ElRepo; +import com.ruoyi.system.domain.repo.vo.RepoVO; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_repo(题库信息)】的数据库操作Service +* @createDate 2024-06-27 10:03:50 +*/ +public interface ElRepoService extends IService { + + + /** + * 查询公告列表 + * + * @param repo 公告信息 + * @return 公告集合 + */ + public List selectRepoList(ElRepo repo); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElUserBookService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElUserBookService.java new file mode 100644 index 00000000..1d9fff00 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElUserBookService.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.userbook.ElUserBook; + +/** +* @author 13560 +* @description 针对表【el_user_book(错题本)】的数据库操作Service +* @createDate 2024-07-01 14:45:33 +*/ +public interface ElUserBookService extends IService { + +} 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 new file mode 100644 index 00000000..9d7a10a6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElUserExamService.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.userexam.ElUserExam; + +/** +* @author 13560 +* @description 针对表【el_user_exam(考试记录)】的数据库操作Service +* @createDate 2024-07-01 14:31:30 +*/ +public interface ElUserExamService extends IService { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElExamDepartServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElExamDepartServiceImpl.java new file mode 100644 index 00000000..1fcccdb3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElExamDepartServiceImpl.java @@ -0,0 +1,22 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.exam.ElExamDepart; +import com.ruoyi.system.mapper.ElExamDepartMapper; +import com.ruoyi.system.service.ElExamDepartService; +import org.springframework.stereotype.Service; + +/** +* @author 13560 +* @description 针对表【el_exam_depart(考试部门)】的数据库操作Service实现 +* @createDate 2024-06-28 10:53:44 +*/ +@Service +public class ElExamDepartServiceImpl extends ServiceImpl + implements ElExamDepartService { + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElExamRepoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElExamRepoServiceImpl.java new file mode 100644 index 00000000..04e27519 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElExamRepoServiceImpl.java @@ -0,0 +1,33 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.exam.ElExamRepo; +import com.ruoyi.system.domain.exam.dto.ext.ExamRepoExtDTO; +import com.ruoyi.system.mapper.ElExamRepoMapper; +import com.ruoyi.system.service.ElExamRepoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_exam_repo(考试题库)】的数据库操作Service实现 +* @createDate 2024-06-28 08:51:41 +*/ +@Service +public class ElExamRepoServiceImpl extends ServiceImpl + implements ElExamRepoService { + + @Autowired + private ElExamRepoMapper elExamRepoMapper; + + @Override + public List listByExam(String examId) { + return elExamRepoMapper.listByExam(examId); + } +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElExamServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElExamServiceImpl.java new file mode 100644 index 00000000..ab13cd98 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElExamServiceImpl.java @@ -0,0 +1,39 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.exam.ElExam; +import com.ruoyi.system.domain.exam.dto.ExamDTO; +import com.ruoyi.system.domain.exam.dto.response.ExamOnlineRespDTO; +import com.ruoyi.system.mapper.ElExamMapper; +import com.ruoyi.system.service.ElExamService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_exam(考试主表)】的数据库操作Service实现 +* @createDate 2024-06-28 08:51:41 +*/ +@Service +public class ElExamServiceImpl extends ServiceImpl + implements ElExamService { + + @Autowired + private ElExamMapper elExamMapper; + + @Override + public List selectExamList(ExamDTO examDTO) { + return elExamMapper.selectExamList(examDTO); + } + + @Override + public List onlineExamList(ExamDTO examDTO) { + return elExamMapper.onlineExamList(examDTO); + } +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElPaperQuAnswerServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElPaperQuAnswerServiceImpl.java new file mode 100644 index 00000000..9b642ac9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElPaperQuAnswerServiceImpl.java @@ -0,0 +1,33 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.paper.ElPaperQuAnswer; +import com.ruoyi.system.domain.paper.dto.ext.PaperQuAnswerExtDTO; +import com.ruoyi.system.mapper.ElPaperQuAnswerMapper; +import com.ruoyi.system.service.ElPaperQuAnswerService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_paper_qu_answer(考试记录答案)】的数据库操作Service实现 +* @createDate 2024-06-28 15:02:53 +*/ +@Service +public class ElPaperQuAnswerServiceImpl extends ServiceImpl + implements ElPaperQuAnswerService { + + @Resource + private ElPaperQuAnswerMapper paperQuAnswerMapper; + + @Override + public List list(String paperId, String quId) { + return paperQuAnswerMapper.list(paperId, quId); + } +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElPaperQuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElPaperQuServiceImpl.java new file mode 100644 index 00000000..d2df82ab --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElPaperQuServiceImpl.java @@ -0,0 +1,31 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.paper.ElPaperQu; +import com.ruoyi.system.mapper.ElPaperQuMapper; +import com.ruoyi.system.service.ElPaperQuService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** +* @author 13560 +* @description 针对表【el_paper_qu(考试记录考题)】的数据库操作Service实现 +* @createDate 2024-06-28 15:02:53 +*/ +@Service +public class ElPaperQuServiceImpl extends ServiceImpl + implements ElPaperQuService { + + @Resource + private ElPaperQuMapper paperQuMapper; + + @Override + public int sumObjective(String paperId) { + return paperQuMapper.sumObjective(paperId); + } +} + + + + 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 new file mode 100644 index 00000000..79219ad4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElPaperServiceImpl.java @@ -0,0 +1,22 @@ +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.mapper.ElPaperMapper; +import com.ruoyi.system.service.ElPaperService; +import org.springframework.stereotype.Service; + +/** +* @author 13560 +* @description 针对表【el_paper(考试记录)】的数据库操作Service实现 +* @createDate 2024-06-28 15:02:53 +*/ +@Service +public class ElPaperServiceImpl extends ServiceImpl + implements ElPaperService { + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElQuAnswerServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElQuAnswerServiceImpl.java new file mode 100644 index 00000000..a36dcb62 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElQuAnswerServiceImpl.java @@ -0,0 +1,22 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.qu.ElQuAnswer; +import com.ruoyi.system.mapper.ElQuAnswerMapper; +import com.ruoyi.system.service.ElQuAnswerService; +import org.springframework.stereotype.Service; + +/** +* @author 13560 +* @description 针对表【el_qu_answer(试题答案选项)】的数据库操作Service实现 +* @createDate 2024-06-27 14:33:59 +*/ +@Service +public class ElQuAnswerServiceImpl extends ServiceImpl + implements ElQuAnswerService { + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElQuRepoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElQuRepoServiceImpl.java new file mode 100644 index 00000000..e6c0a5f2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElQuRepoServiceImpl.java @@ -0,0 +1,22 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.qu.ElQuRepo; +import com.ruoyi.system.mapper.ElQuRepoMapper; +import com.ruoyi.system.service.ElQuRepoService; +import org.springframework.stereotype.Service; + +/** +* @author 13560 +* @description 针对表【el_qu_repo(试题题库关联)】的数据库操作Service实现 +* @createDate 2024-06-27 14:33:59 +*/ +@Service +public class ElQuRepoServiceImpl extends ServiceImpl + implements ElQuRepoService { + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElQuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElQuServiceImpl.java new file mode 100644 index 00000000..391deee7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElQuServiceImpl.java @@ -0,0 +1,39 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.qu.ElQu; +import com.ruoyi.system.domain.qu.dto.request.QuQueryReqDTO; +import com.ruoyi.system.mapper.ElQuMapper; +import com.ruoyi.system.service.ElQuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_qu(试题主表)】的数据库操作Service实现 +* @createDate 2024-06-27 14:33:59 +*/ +@Service +public class ElQuServiceImpl extends ServiceImpl + implements ElQuService { + + + @Autowired + private ElQuMapper quMapper; + + @Override + public List selectQuList(QuQueryReqDTO qu) { + return quMapper.selectQuList(qu); + } + + @Override + public List listByRandom(String repoId, Integer quType, List excludes, Integer size) { + return quMapper.listByRandom(repoId, quType, excludes, size); + } +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElRepoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElRepoServiceImpl.java new file mode 100644 index 00000000..c1dfd3b8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElRepoServiceImpl.java @@ -0,0 +1,34 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.repo.ElRepo; +import com.ruoyi.system.domain.repo.vo.RepoVO; +import com.ruoyi.system.mapper.ElRepoMapper; +import com.ruoyi.system.service.ElRepoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** +* @author 13560 +* @description 针对表【el_repo(题库信息)】的数据库操作Service实现 +* @createDate 2024-06-27 10:03:50 +*/ +@Service +public class ElRepoServiceImpl extends ServiceImpl + implements ElRepoService { + + + @Autowired + private ElRepoMapper elRepoMapper; + + @Override + public List selectRepoList(ElRepo repo) { + return elRepoMapper.selectRepoList(repo); + } +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElUserBookServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElUserBookServiceImpl.java new file mode 100644 index 00000000..69a05d8b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElUserBookServiceImpl.java @@ -0,0 +1,22 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.userbook.ElUserBook; +import com.ruoyi.system.mapper.ElUserBookMapper; +import com.ruoyi.system.service.ElUserBookService; +import org.springframework.stereotype.Service; + +/** +* @author 13560 +* @description 针对表【el_user_book(错题本)】的数据库操作Service实现 +* @createDate 2024-07-01 14:45:33 +*/ +@Service +public class ElUserBookServiceImpl extends ServiceImpl + implements ElUserBookService { + +} + + + + 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 new file mode 100644 index 00000000..85ee1c76 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElUserExamServiceImpl.java @@ -0,0 +1,22 @@ +package com.ruoyi.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.userexam.ElUserExam; +import com.ruoyi.system.mapper.ElUserExamMapper; +import com.ruoyi.system.service.ElUserExamService; +import org.springframework.stereotype.Service; + +/** +* @author 13560 +* @description 针对表【el_user_exam(考试记录)】的数据库操作Service实现 +* @createDate 2024-07-01 14:31:30 +*/ +@Service +public class ElUserExamServiceImpl extends ServiceImpl + implements ElUserExamService { + +} + + + + diff --git a/ruoyi-system/src/main/resources/mapper/system/ElExamDepartMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElExamDepartMapper.xml new file mode 100644 index 00000000..1785a818 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ElExamDepartMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + id,exam_id,depart_id + + diff --git a/ruoyi-system/src/main/resources/mapper/system/ElExamMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElExamMapper.xml new file mode 100644 index 00000000..96d67a8b --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ElExamMapper.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + id,title,content, + open_type,state,time_limit, + start_time,end_time,create_time, + update_time,total_score,total_time, + qualify_score + + + + diff --git a/ruoyi-system/src/main/resources/mapper/system/ElExamRepoMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElExamRepoMapper.xml new file mode 100644 index 00000000..01615856 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ElExamRepoMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + id,exam_id,repo_id, + radio_count,radio_score,multi_count, + multi_score,judge_count,judge_score, + saq_count,saq_score + + + + + diff --git a/ruoyi-system/src/main/resources/mapper/system/ElPaperMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElPaperMapper.xml new file mode 100644 index 00000000..fcdd6131 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ElPaperMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + id,user_id,depart_id, + exam_id,title,total_time, + user_time,total_score,qualify_score, + obj_score,subj_score,user_score, + has_saq,state,create_time, + update_time,limit_time + + diff --git a/ruoyi-system/src/main/resources/mapper/system/ElPaperQuAnswerMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElPaperQuAnswerMapper.xml new file mode 100644 index 00000000..150c378b --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ElPaperQuAnswerMapper.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + id,paper_id,answer_id, + qu_id,is_right,checked, + sort,abc + + + + + + + + + + diff --git a/ruoyi-system/src/main/resources/mapper/system/ElPaperQuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElPaperQuMapper.xml new file mode 100644 index 00000000..9e9bbfe1 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ElPaperQuMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + id,paper_id,qu_id, + qu_type,answered,answer, + sort,score,actual_score, + is_right + + + + + + diff --git a/ruoyi-system/src/main/resources/mapper/system/ElQuAnswerMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElQuAnswerMapper.xml new file mode 100644 index 00000000..166daf90 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ElQuAnswerMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + id,qu_id,is_right, + image,content,analysis + + diff --git a/ruoyi-system/src/main/resources/mapper/system/ElQuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElQuMapper.xml new file mode 100644 index 00000000..ff853d17 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ElQuMapper.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + id,qu_type,level, + image,content,create_time, + update_time,remark,analysis + + + + + + + diff --git a/ruoyi-system/src/main/resources/mapper/system/ElQuRepoMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElQuRepoMapper.xml new file mode 100644 index 00000000..f5405825 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ElQuRepoMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + id,qu_id,repo_id, + qu_type,sort + + diff --git a/ruoyi-system/src/main/resources/mapper/system/ElRepoMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElRepoMapper.xml new file mode 100644 index 00000000..92ef6690 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ElRepoMapper.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + id,code,title, + remark,create_time,update_time + + + + + + + + + diff --git a/ruoyi-system/src/main/resources/mapper/system/ElUserBookMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElUserBookMapper.xml new file mode 100644 index 00000000..aff78633 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ElUserBookMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + id,exam_id,user_id, + qu_id,create_time,update_time, + wrong_count,title,sort + + diff --git a/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml new file mode 100644 index 00000000..a9702dcd --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + id,user_id,exam_id, + try_count,max_score,passed, + create_time,update_time + +