parent
f1c92fed2c
commit
6ab3257f09
@ -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<ExamDTO> 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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -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<ExamOnlineRespDTO> 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";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -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<ElQu> 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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -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<RepoVO> 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());
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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<com.hyp.system.domain.SysNotice>
|
||||
*/
|
||||
public List<ExamDTO> 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<ElExamRepo> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ElExamRepo::getExamId, reqDTO.getId());
|
||||
examRepoService.remove(wrapper);
|
||||
LambdaQueryWrapper<ElExamDepart> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ElExamDepart::getExamId, reqDTO.getId());
|
||||
elExamDepartService.remove(queryWrapper);
|
||||
} else {
|
||||
elExam.setCreateTime(new Date());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(reqDTO.getRepoList())) {
|
||||
List<ElExamRepo> 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<ElExamDepart> 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<String> list = Arrays.asList(Convert.toStrArray(ids));
|
||||
elExamService.removeByIds(list);
|
||||
LambdaQueryWrapper<ElExamDepart> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(ElExamDepart::getExamId, list);
|
||||
elExamDepartService.remove(queryWrapper);
|
||||
LambdaQueryWrapper<ElExamRepo> 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<Long> departIds = elExamDepartService.lambdaQuery()
|
||||
.eq(ElExamDepart::getExamId, id).list().stream()
|
||||
.map(ElExamDepart::getDepartId).collect(Collectors.toList());
|
||||
respDTO.setDepartIds(departIds);
|
||||
// 题库
|
||||
List<ExamRepoExtDTO> 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<com.ruoyi.system.domain.exam.dto.response.ExamOnlineRespDTO>
|
||||
*/
|
||||
public List<ExamOnlineRespDTO> onlineExamList(ExamDTO examDTO) {
|
||||
return elExamService.onlineExamList(examDTO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 计算分值
|
||||
*
|
||||
* @param reqDTO
|
||||
*/
|
||||
private void calcScore(ExamSaveReqDTO reqDTO) {
|
||||
// 主观题分数
|
||||
int objScore = 0;
|
||||
// 题库组卷
|
||||
List<ExamRepoExtDTO> 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);
|
||||
}
|
||||
|
||||
}
|
@ -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<com.hyp.system.domain.SysNotice>
|
||||
*/
|
||||
public List<ElQu> 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<ElQuAnswer> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ElQuAnswer::getQuId,reqDTO.getId());
|
||||
quAnswerService.remove(wrapper);
|
||||
LambdaQueryWrapper<ElQuRepo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ElQuRepo::getQuId,reqDTO.getId());
|
||||
quRepoService.remove(queryWrapper);
|
||||
} else {
|
||||
qu.setCreateTime(new Date());
|
||||
}
|
||||
if(CollUtil.isNotEmpty(reqDTO.getAnswerList())){
|
||||
List<ElQuAnswer> answerList = Convert.toList(ElQuAnswer.class, reqDTO.getAnswerList());
|
||||
answerList.forEach(elQuAnswer -> elQuAnswer.setQuId(qu.getId()));
|
||||
quAnswerService.saveBatch(answerList);
|
||||
}
|
||||
if(CollUtil.isNotEmpty(reqDTO.getRepoIds())){
|
||||
List<ElQuRepo> 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<ElQuRepo> 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<ElQuAnswer> quAnswers = quAnswerService.lambdaQuery().eq(ElQuAnswer::getQuId, id).list();
|
||||
List<QuAnswerDTO> list = Convert.toList(QuAnswerDTO.class, quAnswers);
|
||||
detailDTO.setAnswerList(list);
|
||||
List<ElQuRepo> repos = quRepoService.lambdaQuery()
|
||||
.eq(ElQuRepo::getQuId, id).list();
|
||||
List<String> repoIds = repos.stream().map(ElQuRepo::getRepoId).collect(Collectors.toList());
|
||||
detailDTO.setRepoIds(repoIds);
|
||||
return detailDTO;
|
||||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean deleteQuByIds(String ids) {
|
||||
List<String> list = Arrays.asList(Convert.toStrArray(ids));
|
||||
quService.removeByIds(list);
|
||||
LambdaQueryWrapper<ElQuAnswer> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(ElQuAnswer::getQuId,list);
|
||||
quAnswerService.remove(wrapper);
|
||||
LambdaQueryWrapper<ElQuRepo> 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<QuAnswerDTO> 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 + "单选题不能包含多个正确项!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -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<com.hyp.system.domain.SysNotice>
|
||||
*/
|
||||
public List<RepoVO> 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<ElRepo> getList() {
|
||||
return elRepoService.lambdaQuery().list();
|
||||
}
|
||||
|
||||
public boolean deleteRepoByIds(String ids) {
|
||||
return elRepoService.removeByIds(Arrays.asList(Convert.toStrArray(ids)));
|
||||
}
|
||||
}
|
@ -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<ElUserBook> 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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增题库')" />
|
||||
<th:block th:include="include :: summernote-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-repo-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">题库名称:</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="title" name="title" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group">
|
||||
<label class="col-xs-2 control-label">题库备注:</label>
|
||||
<div class="col-xs-10">
|
||||
<textarea name="remark" maxlength="500" class="form-control" rows="3"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: summernote-js" />
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "system/repo";
|
||||
$("#form-repo-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-repo-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改题库')" />
|
||||
<th:block th:include="include :: summernote-css" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-repo-edit" th:object="${repo}">
|
||||
<input id="noticeId" name="id" th:field="*{id}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">题库标题:</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="title" name="title" th:field="*{title}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group">
|
||||
<label class="col-xs-2 control-label">题库备注:</label>
|
||||
<div class="col-xs-10">
|
||||
<textarea name="remark" maxlength="500" class="form-control" rows="3">[[*{remark}]]</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: summernote-js" />
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "system/repo";
|
||||
|
||||
$("#form-repo-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-repo-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,95 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('题库列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="notice-form">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
题库名称:<input type="text" name="title"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.addFull()" shiro:hasPermission="system:repo:add">
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.editFull()" shiro:hasPermission="system:repo:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:repo:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('system:repo:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('system:repo:remove')}]];
|
||||
var prefix = ctx + "system/repo";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
uniqueId: "id",
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
modalName: "题库",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field : 'title',
|
||||
title : '题库名称'
|
||||
},
|
||||
{
|
||||
field : 'radioCount',
|
||||
title : '单选题数量'
|
||||
},
|
||||
{
|
||||
field : 'multiCount',
|
||||
title : '多选题数量'
|
||||
},
|
||||
{
|
||||
field : 'judgeCount',
|
||||
title : '判断题数量'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,117 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('通知公告列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="notice-form">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
公告标题:<input type="text" name="noticeTitle"/>
|
||||
</li>
|
||||
<li>
|
||||
操作人员:<input type="text" name="createBy"/>
|
||||
</li>
|
||||
<li>
|
||||
公告类型:<select name="noticeType" th:with="type=${@dict.getType('sys_notice_type')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.addFull()" shiro:hasPermission="system:notice:add">
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.editFull()" shiro:hasPermission="system:notice:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:notice:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('system:notice:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('system:notice:remove')}]];
|
||||
var types = [[${@dict.getType('sys_notice_type')}]];
|
||||
var datas = [[${@dict.getType('sys_notice_status')}]];
|
||||
var prefix = ctx + "system/notice";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
modalName: "公告",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field : 'noticeId',
|
||||
title : '序号'
|
||||
},
|
||||
{
|
||||
field : 'noticeTitle',
|
||||
title : '公告标题'
|
||||
},
|
||||
{
|
||||
field: 'noticeType',
|
||||
title: '公告类型',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(types, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(datas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field : 'createBy',
|
||||
title : '创建者'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.noticeId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.noticeId + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 考试数据传输类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 考试部门数据传输类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 考试题库数据传输类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 考试题库数据传输类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 考试保存请求类
|
||||
* </p>
|
||||
*
|
||||
* @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<ExamRepoExtDTO> repoList;
|
||||
|
||||
@ApiModelProperty(value = "考试部门列表", required=true)
|
||||
private List<Long> departIds;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 考试分页响应类
|
||||
* </p>
|
||||
*
|
||||
* @author 聪明笨狗
|
||||
* @since 2020-07-25 16:18
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="在线考试分页响应类", description="在线考试分页响应类")
|
||||
public class ExamOnlineRespDTO extends ExamDTO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 考试分页响应类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.system.domain.exam.enums;
|
||||
|
||||
/**
|
||||
* 开放方式
|
||||
* @author bool
|
||||
*/
|
||||
public interface OpenType {
|
||||
|
||||
/**
|
||||
* 完全开放
|
||||
*/
|
||||
Integer OPEN = 1;
|
||||
|
||||
/**
|
||||
* 部门开放
|
||||
*/
|
||||
Integer DEPT_OPEN = 2;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 试卷请求类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 试卷考题备选答案请求类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 试卷考题请求类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 试卷考题备选答案请求类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 试卷考题请求类
|
||||
* </p>
|
||||
*
|
||||
* @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<PaperQuAnswerExtDTO> answerList;
|
||||
}
|
@ -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<String> answers;
|
||||
|
||||
@ApiModelProperty(value = "主观答案")
|
||||
private String answer;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 试卷请求类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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<PaperQuDTO> radioList;
|
||||
|
||||
@ApiModelProperty(value = "多选题列表")
|
||||
private List<PaperQuDTO> multiList;
|
||||
|
||||
@ApiModelProperty(value = "判断题")
|
||||
private List<PaperQuDTO> 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;
|
||||
}
|
||||
|
||||
}
|
@ -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<PaperQuDetailDTO> quList;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 试卷请求类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 候选答案请求类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 问题题目请求类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 试题题库请求类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 问题题目请求类
|
||||
* </p>
|
||||
*
|
||||
* @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<QuAnswerDTO> answerList;
|
||||
|
||||
@ApiModelProperty(value = "题库列表", required=true)
|
||||
private List<String> repoIds;
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 问题题目请求类
|
||||
* </p>
|
||||
*
|
||||
* @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<String> repoIds;
|
||||
|
||||
@ApiModelProperty(value = "题目内容")
|
||||
private String content;
|
||||
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 问题题目请求类
|
||||
* </p>
|
||||
*
|
||||
* @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<String> quIds;
|
||||
|
||||
@ApiModelProperty(value = "题目类型", required=true)
|
||||
private List<String> repoIds;
|
||||
|
||||
@ApiModelProperty(value = "是否移除,否就新增;是就移除", required=true)
|
||||
private Boolean remove;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 题库请求类
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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<ElExamDepart> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElExam> {
|
||||
|
||||
|
||||
|
||||
public List<ExamDTO> selectExamList(ExamDTO examDTO);
|
||||
|
||||
|
||||
public List<ExamOnlineRespDTO> onlineExamList(ExamDTO examDTO);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElExamRepo> {
|
||||
|
||||
|
||||
public List<ExamRepoExtDTO> listByExam(String examId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElPaper> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElPaperQuAnswer> {
|
||||
|
||||
|
||||
/**
|
||||
* 查找试卷试题答案列表
|
||||
* @param paperId
|
||||
* @param quId
|
||||
* @return
|
||||
*/
|
||||
List<PaperQuAnswerExtDTO> list(@Param("paperId") String paperId, @Param("quId") String quId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElPaperQu> {
|
||||
|
||||
|
||||
/**
|
||||
* 统计客观分
|
||||
* @param paperId
|
||||
* @return
|
||||
*/
|
||||
int sumObjective(String paperId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElQuAnswer> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElQu> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*
|
||||
* @param qu 公告信息
|
||||
* @return 公告集合
|
||||
*/
|
||||
public List<ElQu> selectQuList(QuQueryReqDTO qu);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 随机抽取题库的数据
|
||||
* @param repoId
|
||||
* @param quType
|
||||
* @param size
|
||||
* @param excludes 要排除的ID列表
|
||||
* @param size
|
||||
* @return
|
||||
*/
|
||||
List<ElQu> listByRandom(@Param("repoId") String repoId,
|
||||
@Param("quType") Integer quType,
|
||||
@Param("excludes") List<String> excludes,
|
||||
@Param("size") Integer size);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElQuRepo> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElRepo> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*
|
||||
* @param repo 公告信息
|
||||
* @return 公告集合
|
||||
*/
|
||||
public List<RepoVO> selectRepoList(ElRepo repo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElUserBook> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElUserExam> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElExamDepart> {
|
||||
|
||||
}
|
@ -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<ElExamRepo> {
|
||||
|
||||
|
||||
public List<ExamRepoExtDTO> listByExam(String examId);
|
||||
|
||||
}
|
@ -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<ElExam> {
|
||||
|
||||
|
||||
public List<ExamDTO> selectExamList(ExamDTO examDTO);
|
||||
|
||||
|
||||
public List<ExamOnlineRespDTO> onlineExamList(ExamDTO examDTO);
|
||||
|
||||
}
|
@ -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<ElPaperQuAnswer> {
|
||||
|
||||
|
||||
/**
|
||||
* 查找试卷试题答案列表
|
||||
* @param paperId
|
||||
* @param quId
|
||||
* @return
|
||||
*/
|
||||
List<PaperQuAnswerExtDTO> list(@Param("paperId") String paperId, @Param("quId") String quId);
|
||||
|
||||
}
|
@ -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<ElPaperQu> {
|
||||
|
||||
/**
|
||||
* 统计客观分
|
||||
* @param paperId
|
||||
* @return
|
||||
*/
|
||||
int sumObjective(String paperId);
|
||||
|
||||
|
||||
}
|
@ -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<ElPaper> {
|
||||
|
||||
}
|
@ -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<ElQuAnswer> {
|
||||
|
||||
}
|
@ -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<ElQuRepo> {
|
||||
|
||||
}
|
@ -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<ElQu> {
|
||||
|
||||
|
||||
public List<ElQu> selectQuList(QuQueryReqDTO qu);
|
||||
|
||||
|
||||
/**
|
||||
* 随机抽取题库的数据
|
||||
* @param repoId
|
||||
* @param quType
|
||||
* @param size 难度等级
|
||||
* @param excludes 要排除的ID列表
|
||||
* @param size
|
||||
* @return
|
||||
*/
|
||||
List<ElQu> listByRandom(String repoId,
|
||||
Integer quType,
|
||||
List<String> excludes,
|
||||
Integer size);
|
||||
|
||||
}
|
@ -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<ElRepo> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*
|
||||
* @param repo 公告信息
|
||||
* @return 公告集合
|
||||
*/
|
||||
public List<RepoVO> selectRepoList(ElRepo repo);
|
||||
|
||||
}
|
@ -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<ElUserBook> {
|
||||
|
||||
}
|
@ -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<ElUserExam> {
|
||||
|
||||
}
|
@ -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<ElExamDepartMapper, ElExamDepart>
|
||||
implements ElExamDepartService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElExamRepoMapper, ElExamRepo>
|
||||
implements ElExamRepoService {
|
||||
|
||||
@Autowired
|
||||
private ElExamRepoMapper elExamRepoMapper;
|
||||
|
||||
@Override
|
||||
public List<ExamRepoExtDTO> listByExam(String examId) {
|
||||
return elExamRepoMapper.listByExam(examId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElExamMapper, ElExam>
|
||||
implements ElExamService {
|
||||
|
||||
@Autowired
|
||||
private ElExamMapper elExamMapper;
|
||||
|
||||
@Override
|
||||
public List<ExamDTO> selectExamList(ExamDTO examDTO) {
|
||||
return elExamMapper.selectExamList(examDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExamOnlineRespDTO> onlineExamList(ExamDTO examDTO) {
|
||||
return elExamMapper.onlineExamList(examDTO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElPaperQuAnswerMapper, ElPaperQuAnswer>
|
||||
implements ElPaperQuAnswerService {
|
||||
|
||||
@Resource
|
||||
private ElPaperQuAnswerMapper paperQuAnswerMapper;
|
||||
|
||||
@Override
|
||||
public List<PaperQuAnswerExtDTO> list(String paperId, String quId) {
|
||||
return paperQuAnswerMapper.list(paperId, quId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElPaperQuMapper, ElPaperQu>
|
||||
implements ElPaperQuService {
|
||||
|
||||
@Resource
|
||||
private ElPaperQuMapper paperQuMapper;
|
||||
|
||||
@Override
|
||||
public int sumObjective(String paperId) {
|
||||
return paperQuMapper.sumObjective(paperId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElPaperMapper, ElPaper>
|
||||
implements ElPaperService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElQuAnswerMapper, ElQuAnswer>
|
||||
implements ElQuAnswerService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElQuRepoMapper, ElQuRepo>
|
||||
implements ElQuRepoService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElQuMapper, ElQu>
|
||||
implements ElQuService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ElQuMapper quMapper;
|
||||
|
||||
@Override
|
||||
public List<ElQu> selectQuList(QuQueryReqDTO qu) {
|
||||
return quMapper.selectQuList(qu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ElQu> listByRandom(String repoId, Integer quType, List<String> excludes, Integer size) {
|
||||
return quMapper.listByRandom(repoId, quType, excludes, size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElRepoMapper, ElRepo>
|
||||
implements ElRepoService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ElRepoMapper elRepoMapper;
|
||||
|
||||
@Override
|
||||
public List<RepoVO> selectRepoList(ElRepo repo) {
|
||||
return elRepoMapper.selectRepoList(repo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElUserBookMapper, ElUserBook>
|
||||
implements ElUserBookService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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<ElUserExamMapper, ElUserExam>
|
||||
implements ElUserExamService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.ElExamDepartMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.system.domain.exam.ElExamDepart">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="examId" column="exam_id" jdbcType="VARCHAR"/>
|
||||
<result property="departId" column="depart_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,exam_id,depart_id
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.ElExamMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.system.domain.exam.ElExam">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="title" column="title" jdbcType="VARCHAR"/>
|
||||
<result property="content" column="content" jdbcType="VARCHAR"/>
|
||||
<result property="openType" column="open_type" jdbcType="INTEGER"/>
|
||||
<result property="state" column="state" jdbcType="INTEGER"/>
|
||||
<result property="timeLimit" column="time_limit" jdbcType="TINYINT"/>
|
||||
<result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="totalScore" column="total_score" jdbcType="INTEGER"/>
|
||||
<result property="totalTime" column="total_time" jdbcType="INTEGER"/>
|
||||
<result property="qualifyScore" column="qualify_score" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,title,content,
|
||||
open_type,state,time_limit,
|
||||
start_time,end_time,create_time,
|
||||
update_time,total_score,total_time,
|
||||
qualify_score
|
||||
</sql>
|
||||
<select id="selectExamList" resultType="com.ruoyi.system.domain.exam.dto.ExamDTO" >
|
||||
SELECT <include refid="Base_Column_List"/> FROM el_exam
|
||||
<trim prefix="where" prefixOverrides="and|or">
|
||||
<if test="title!=null and title!=''">
|
||||
AND title LIKE CONCAT('%',#{title},'%')
|
||||
</if>
|
||||
<if test="openType!=null">
|
||||
AND open_type = #{openType}
|
||||
</if>
|
||||
|
||||
<if test="startTime!=null">
|
||||
AND start_time >= #{startTime}
|
||||
</if>
|
||||
|
||||
<if test="endTime!=null">
|
||||
AND end_time <= #{endTime}
|
||||
</if>
|
||||
</trim>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
<select id="onlineExamList" resultType="com.ruoyi.system.domain.exam.dto.response.ExamOnlineRespDTO">
|
||||
SELECT ex.*
|
||||
FROM el_exam ex
|
||||
LEFT JOIN el_exam_depart dept ON ex.id=dept.exam_id AND ex.open_type=2
|
||||
LEFT JOIN sys_user uc ON uc.dept_id=dept.depart_id
|
||||
WHERE ex.state=0 AND (ex.open_type=1 OR ex.open_type=3 OR uc.user_id=#{userId})
|
||||
<if test="title!=null and title!=''">
|
||||
AND ex.title LIKE CONCAT('%',#{title},'%')
|
||||
</if>
|
||||
<if test="openType!=null">
|
||||
AND ex.open_type=#{openType}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.ElExamRepoMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.system.domain.exam.ElExamRepo">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="examId" column="exam_id" jdbcType="VARCHAR"/>
|
||||
<result property="repoId" column="repo_id" jdbcType="VARCHAR"/>
|
||||
<result property="radioCount" column="radio_count" jdbcType="INTEGER"/>
|
||||
<result property="radioScore" column="radio_score" jdbcType="INTEGER"/>
|
||||
<result property="multiCount" column="multi_count" jdbcType="INTEGER"/>
|
||||
<result property="multiScore" column="multi_score" jdbcType="INTEGER"/>
|
||||
<result property="judgeCount" column="judge_count" jdbcType="INTEGER"/>
|
||||
<result property="judgeScore" column="judge_score" jdbcType="INTEGER"/>
|
||||
<result property="saqCount" column="saq_count" jdbcType="INTEGER"/>
|
||||
<result property="saqScore" column="saq_score" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,exam_id,repo_id,
|
||||
radio_count,radio_score,multi_count,
|
||||
multi_score,judge_count,judge_score,
|
||||
saq_count,saq_score
|
||||
</sql>
|
||||
<select id="listByExam" resultType="com.ruoyi.system.domain.exam.dto.ext.ExamRepoExtDTO">
|
||||
SELECT ep.*,
|
||||
(SELECT COUNT(0) FROM el_qu_repo WHERE repo_id=ep.repo_id AND qu_type=1) AS total_radio,
|
||||
(SELECT COUNT(0) FROM el_qu_repo WHERE repo_id=ep.repo_id AND qu_type=2) AS total_multi,
|
||||
(SELECT COUNT(0) FROM el_qu_repo WHERE repo_id=ep.repo_id AND qu_type=3) AS total_judge
|
||||
FROM el_exam_repo ep
|
||||
WHERE ep.exam_id=#{examId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.ElPaperMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.system.domain.paper.ElPaper">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="userId" column="user_id" jdbcType="BIGINT"/>
|
||||
<result property="departId" column="depart_id" jdbcType="BIGINT"/>
|
||||
<result property="examId" column="exam_id" jdbcType="VARCHAR"/>
|
||||
<result property="title" column="title" jdbcType="VARCHAR"/>
|
||||
<result property="totalTime" column="total_time" jdbcType="INTEGER"/>
|
||||
<result property="userTime" column="user_time" jdbcType="INTEGER"/>
|
||||
<result property="totalScore" column="total_score" jdbcType="INTEGER"/>
|
||||
<result property="qualifyScore" column="qualify_score" jdbcType="INTEGER"/>
|
||||
<result property="objScore" column="obj_score" jdbcType="INTEGER"/>
|
||||
<result property="subjScore" column="subj_score" jdbcType="INTEGER"/>
|
||||
<result property="userScore" column="user_score" jdbcType="INTEGER"/>
|
||||
<result property="hasSaq" column="has_saq" jdbcType="TINYINT"/>
|
||||
<result property="state" column="state" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="limitTime" column="limit_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
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
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.ElPaperQuAnswerMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.system.domain.paper.ElPaperQuAnswer">
|
||||
<id column="id" property="id" />
|
||||
<result column="paper_id" property="paperId" />
|
||||
<result column="answer_id" property="answerId" />
|
||||
<result column="qu_id" property="quId" />
|
||||
<result column="is_right" property="isRight" />
|
||||
<result column="checked" property="checked" />
|
||||
<result column="sort" property="sort" />
|
||||
<result column="abc" property="abc" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,paper_id,answer_id,
|
||||
qu_id,is_right,checked,
|
||||
sort,abc
|
||||
</sql>
|
||||
|
||||
<resultMap id="ListResultMap"
|
||||
type="com.ruoyi.system.domain.paper.dto.ext.PaperQuAnswerExtDTO"
|
||||
extends="BaseResultMap">
|
||||
<result column="image" property="image" />
|
||||
<result column="content" property="content" />
|
||||
</resultMap>
|
||||
|
||||
<select id="list" resultMap="ListResultMap">
|
||||
SELECT pa.id,pa.paper_id,pa.answer_id,pa.qu_id,pa.checked,pa.sort,pa.abc,qa.content,qa.image
|
||||
FROM el_paper_qu_answer pa
|
||||
LEFT JOIN el_qu_answer qa ON pa.answer_id=qa.id
|
||||
WHERE pa.paper_id=#{paperId} AND pa.qu_id=#{quId}
|
||||
ORDER BY pa.sort ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue