diff --git a/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/examine/ExamAttestationController.java b/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/examine/ExamAttestationController.java index dd14e11..2753fb0 100644 --- a/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/examine/ExamAttestationController.java +++ b/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/examine/ExamAttestationController.java @@ -115,4 +115,13 @@ public class ExamAttestationController extends BaseController List list = examAttestationService.selectPeopleList(examAttestationPeople); return getDataTable(list); } + + /** + * 下拉 + */ + @PreAuthorize("@ss.hasPermi('examine:attestation:selection')") + @GetMapping("/selection") + public List selection(){ + return examAttestationService.selection(); + } } diff --git a/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/examine/ExamMyExamineController.java b/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/examine/ExamMyExamineController.java new file mode 100644 index 0000000..984c36e --- /dev/null +++ b/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/examine/ExamMyExamineController.java @@ -0,0 +1,94 @@ +package com.inspur.web.controller.examine; + +import com.inspur.common.core.controller.BaseController; +import com.inspur.common.core.domain.AjaxResult; +import com.inspur.common.core.page.TableDataInfo; +import com.inspur.examine.domain.ExamAttestation; +import com.inspur.examine.domain.ExamInfo; +import com.inspur.examine.domain.ExamPaperInfo; +import com.inspur.examine.service.IMyExamineService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 我的考试 + * + * @Author xusd + * @Date 2024/5/8 10:57 + **/ +@RestController +@RequestMapping("/examine/myExamine") +public class ExamMyExamineController extends BaseController { + + @Autowired + private IMyExamineService myExamineService; + + /** + * 查询考试信息列表 + */ + @PreAuthorize("@ss.hasPermi('examine:myExamine:examList')") + @GetMapping("/examList") + public TableDataInfo examList(ExamInfo examInfo) { + startPage(); + List list = myExamineService.examList(examInfo); + return getDataTable(list); + } + + /** + * 生成考试信息 + */ + @PreAuthorize("@ss.hasPermi('examine:myExamine:generateExam')") + @PostMapping("/generateExam/{id}") + public AjaxResult generateExam(@PathVariable("id") String id){ + return toAjax(myExamineService.generateExam(id)); + } + + /** + * 待考试列表 + */ + @PreAuthorize("@ss.hasPermi('examine:myExamine:waitExamList')") + @GetMapping("/waitExamList") + public TableDataInfo waitExamList(ExamPaperInfo examPaperInfo) + { + startPage(); + List list = myExamineService.waitExamList(examPaperInfo); + return getDataTable(list); + } + + /** + * 获取考试信息以及试题 + */ + @PreAuthorize("@ss.hasPermi('examine:myExamine:getExam')") + @GetMapping("/getExam/{id}") + public void getExam(@PathVariable("id") String id){ + //todo: 获取考试信息以及试题 + } + + /** + * 历史考试成绩 + */ + @PreAuthorize("@ss.hasPermi('examine:myExamine:examHistoryList')") + @GetMapping("/examHistoryList") + public TableDataInfo examHistoryList(ExamPaperInfo examPaperInfo) + { + startPage(); + List list = myExamineService.examHistoryList(examPaperInfo); + return getDataTable(list); + } + + /** + * 查询我的认证管理列表 + */ + @PreAuthorize("@ss.hasPermi('examine:myExamine:attestationList')") + @GetMapping("/attestationList") + public TableDataInfo attestationList(ExamAttestation examAttestation) + { + startPage(); + List list = myExamineService.attestationList(examAttestation); + return getDataTable(list); + } + +} diff --git a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/domain/ExamAttestation.java b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/domain/ExamAttestation.java index 5948d42..0d22f70 100644 --- a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/domain/ExamAttestation.java +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/domain/ExamAttestation.java @@ -56,4 +56,15 @@ public class ExamAttestation { * 租户id */ private String tenantId; + + /** + * 用户id + */ + private Long userId; + + /** + * 认证时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date attestationTime; } diff --git a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/domain/ExamInfo.java b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/domain/ExamInfo.java index 2c305be..0875faf 100644 --- a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/domain/ExamInfo.java +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/domain/ExamInfo.java @@ -41,6 +41,17 @@ public class ExamInfo extends BaseEntity { @Excel(name = "考试类型" ,dictType = "exam_type") private String examType; + /** + * 证书id + */ + private String attestationId; + + /** + * 证书名称 + */ + @Excel(name = "相关证书") + private String attestationName; + /** * 考试时长 */ @@ -106,4 +117,6 @@ public class ExamInfo extends BaseEntity { @Excel(name = "通过分数") private BigDecimal passScore; + private Long userId; + } diff --git a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/domain/ExamPaperInfo.java b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/domain/ExamPaperInfo.java index 765f9d1..032d9a1 100644 --- a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/domain/ExamPaperInfo.java +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/domain/ExamPaperInfo.java @@ -75,4 +75,19 @@ public class ExamPaperInfo { * 租户id */ private String tenantId; + + /** + * 考试时长 + */ + private Integer examDuration; + + /** + * 考试时长(带单位) + */ + private String examDurationHaveUnit; + + /** + * 总分数 + */ + private BigDecimal totalScore; } diff --git a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/mapper/ExamAttestationMapper.java b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/mapper/ExamAttestationMapper.java index 23889d3..5aef84c 100644 --- a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/mapper/ExamAttestationMapper.java +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/mapper/ExamAttestationMapper.java @@ -58,4 +58,9 @@ public interface ExamAttestationMapper * @return 结果 */ public int deleteExamAttestationByIds(String[] ids); + + /** + * 下拉 + */ + List selection(); } diff --git a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/mapper/MyExamineMapper.java b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/mapper/MyExamineMapper.java new file mode 100644 index 0000000..75b11eb --- /dev/null +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/mapper/MyExamineMapper.java @@ -0,0 +1,34 @@ +package com.inspur.examine.mapper; + +import com.inspur.examine.domain.ExamAttestation; +import com.inspur.examine.domain.ExamInfo; +import com.inspur.examine.domain.ExamPaperInfo; + +import java.util.List; + +/** + * @Author xusd + * @Date 2024/5/8 11:03 + **/ +public interface MyExamineMapper { + + /** + * 查询考试信息列表 + */ + List examList(ExamInfo examInfo); + + /** + * 待考试列表 + */ + List waitExamList(ExamPaperInfo examPaperInfo); + + /** + * 历史考试成绩 + */ + List examHistoryList(ExamPaperInfo examPaperInfo); + + /** + * 查询我的认证管理列表 + */ + List attestationList(ExamAttestation examAttestation); +} diff --git a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/IExamAttestationService.java b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/IExamAttestationService.java index ba4a103..4f67249 100644 --- a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/IExamAttestationService.java +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/IExamAttestationService.java @@ -66,4 +66,9 @@ public interface IExamAttestationService * 查询证书认证名单 */ List selectPeopleList(ExamAttestationPeople examAttestationPeople) throws ServiceException; + + /** + * 下拉 + */ + List selection(); } diff --git a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/IMyExamineService.java b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/IMyExamineService.java new file mode 100644 index 0000000..fead92f --- /dev/null +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/IMyExamineService.java @@ -0,0 +1,42 @@ +package com.inspur.examine.service; + +import com.inspur.common.core.domain.AjaxResult; +import com.inspur.examine.domain.ExamAttestation; +import com.inspur.examine.domain.ExamInfo; +import com.inspur.examine.domain.ExamPaperInfo; + +import java.util.List; + +/** + * 我的考试 + * + * @Author xusd + * @Date 2024/5/8 10:58 + **/ +public interface IMyExamineService { + + /** + * 查询考试信息列表 + */ + List examList(ExamInfo examInfo); + + /** + * 生成考试信息 + */ + int generateExam(String id); + + /** + * 待考试列表 + */ + List waitExamList(ExamPaperInfo examPaperInfo); + + /** + * 历史考试成绩 + */ + List examHistoryList(ExamPaperInfo examPaperInfo); + + /** + * 查询我的认证管理列表 + */ + List attestationList(ExamAttestation examAttestation); +} diff --git a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/ExamAttestationServiceImpl.java b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/ExamAttestationServiceImpl.java index ecd0f18..da6a3af 100644 --- a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/ExamAttestationServiceImpl.java +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/ExamAttestationServiceImpl.java @@ -127,4 +127,12 @@ public class ExamAttestationServiceImpl implements IExamAttestationService } return list; } + + /** + * 下拉 + */ + @Override + public List selection() { + return examAttestationMapper.selection(); + } } diff --git a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/ExamPaperInfoServiceImpl.java b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/ExamPaperInfoServiceImpl.java index df2eb98..ab5b929 100644 --- a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/ExamPaperInfoServiceImpl.java +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/ExamPaperInfoServiceImpl.java @@ -1,6 +1,9 @@ package com.inspur.examine.service.impl; import java.util.List; + +import com.inspur.common.utils.SecurityUtils; +import com.inspur.common.utils.uuid.IdUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.inspur.examine.mapper.ExamPaperInfoMapper; @@ -40,6 +43,7 @@ public class ExamPaperInfoServiceImpl implements IExamPaperInfoService @Override public List selectExamPaperInfoList(ExamPaperInfo examPaperInfo) { + examPaperInfo.setTenantId(SecurityUtils.getLoginUser().getTenantId()); return examPaperInfoMapper.selectExamPaperInfoList(examPaperInfo); } @@ -52,6 +56,8 @@ public class ExamPaperInfoServiceImpl implements IExamPaperInfoService @Override public int insertExamPaperInfo(ExamPaperInfo examPaperInfo) { + examPaperInfo.setId(IdUtils.fastSimpleUUID()); + examPaperInfo.setTenantId(SecurityUtils.getLoginUser().getTenantId()); return examPaperInfoMapper.insertExamPaperInfo(examPaperInfo); } diff --git a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/MyExamineServiceImpl.java b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/MyExamineServiceImpl.java new file mode 100644 index 0000000..7611b49 --- /dev/null +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/MyExamineServiceImpl.java @@ -0,0 +1,102 @@ +package com.inspur.examine.service.impl; + +import com.inspur.common.utils.SecurityUtils; +import com.inspur.common.utils.StringUtils; +import com.inspur.examine.domain.ExamAttestation; +import com.inspur.examine.domain.ExamInfo; +import com.inspur.examine.domain.ExamPaperInfo; +import com.inspur.examine.mapper.MyExamineMapper; +import com.inspur.examine.service.IExamInfoService; +import com.inspur.examine.service.IExamPaperInfoService; +import com.inspur.examine.service.IMyExamineService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +/** + * 我的考试 + * + * @Author xusd + * @Date 2024/5/8 10:58 + **/ +@Service +public class MyExamineServiceImpl implements IMyExamineService { + + @Autowired + private MyExamineMapper myExamineMapper; + + @Autowired + private IExamPaperInfoService examPaperInfoService; + + /** + * 查询考试信息列表 + */ + @Override + public List examList(ExamInfo examInfo) { + examInfo.setUserId(SecurityUtils.getUserId()); + List list = myExamineMapper.examList(examInfo); + if (StringUtils.isNotEmpty(list)){ + list.forEach(item->{ + if (Objects.nonNull(item.getExamDuration())){ + item.setExamDurationHaveUnit(item.getExamDuration() + "分钟"); + } + }); + } + return list; + } + + /** + * 生成考试信息 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int generateExam(String id) { + ExamPaperInfo examPaperInfo = new ExamPaperInfo(); + examPaperInfo.setExamId(id); + examPaperInfo.setExamineId(SecurityUtils.getUserId()); + examPaperInfo.setStatus("0"); + int i = examPaperInfoService.insertExamPaperInfo(examPaperInfo); + if (i > 0){ + //todo:生成考试试题等 + } + return i; + } + + /** + * 待考试列表 + */ + @Override + public List waitExamList(ExamPaperInfo examPaperInfo) { + examPaperInfo.setExamineId(SecurityUtils.getUserId()); + examPaperInfo.setTenantId(SecurityUtils.getLoginUser().getTenantId()); + List list = myExamineMapper.waitExamList(examPaperInfo); + if (StringUtils.isNotEmpty(list)){ + list.forEach(item->item.setExamDurationHaveUnit(item.getExamDuration() + "分钟")); + } + return list; + } + + /** + * 历史考试成绩 + */ + @Override + public List examHistoryList(ExamPaperInfo examPaperInfo) { + examPaperInfo.setTenantId(SecurityUtils.getLoginUser().getTenantId()); + examPaperInfo.setExamineId(SecurityUtils.getUserId()); + return myExamineMapper.examHistoryList(examPaperInfo); + } + + /** + * 查询我的认证管理列表 + */ + @Override + public List attestationList(ExamAttestation examAttestation) { + examAttestation.setTenantId(SecurityUtils.getLoginUser().getTenantId()); + examAttestation.setUserId(SecurityUtils.getUserId()); + return myExamineMapper.attestationList(examAttestation); + } +} diff --git a/inspur-service/inspur-examine/src/main/resources/mapper/ExamAttestationMapper.xml b/inspur-service/inspur-examine/src/main/resources/mapper/ExamAttestationMapper.xml index a07fa1e..436cfbd 100644 --- a/inspur-service/inspur-examine/src/main/resources/mapper/ExamAttestationMapper.xml +++ b/inspur-service/inspur-examine/src/main/resources/mapper/ExamAttestationMapper.xml @@ -30,9 +30,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN exam_attestation_people AS eap ON ea.id = eap.attestation_id AND eap.tenant_id = #{tenantId} - and attestation_name like concat('%', #{attestationName}, '%') - and attestation_unit like concat('%', #{attestationUnit}, '%') - and attestation_info like concat('%', #{attestationInfo}, '%') + and ea.attestation_name like concat('%', #{attestationName}, '%') + and ea.attestation_unit like concat('%', #{attestationUnit}, '%') + and ea.attestation_info like concat('%', #{attestationInfo}, '%') GROUP BY ea.id order by ea.create_time desc @@ -42,7 +42,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - + + + insert into exam_attestation diff --git a/inspur-service/inspur-examine/src/main/resources/mapper/ExamInfoMapper.xml b/inspur-service/inspur-examine/src/main/resources/mapper/ExamInfoMapper.xml index 2567682..ce1305c 100644 --- a/inspur-service/inspur-examine/src/main/resources/mapper/ExamInfoMapper.xml +++ b/inspur-service/inspur-examine/src/main/resources/mapper/ExamInfoMapper.xml @@ -23,25 +23,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + - select id, exam_name, exam_level, exam_type, exam_duration, exam_rules, single_choice, multiple_choice, judge, single_choice_score, multiple_choice_score, judge_score, total_score, pass_score, create_by, create_time, update_by, update_time from exam_info + SELECT + ei.id, + ei.exam_name, + ei.exam_level, + ei.exam_type, + ei.exam_duration, + ei.exam_rules, + ei.single_choice, + ei.multiple_choice, + ei.judge, + ei.single_choice_score, + ei.multiple_choice_score, + ei.judge_score, + ei.total_score, + ei.pass_score, + ei.create_by, + ei.create_time, + ei.update_by, + ei.update_time, + ei.attestation_id, + ea.attestation_name + FROM + exam_info AS ei + LEFT JOIN exam_attestation AS ea ON ei.attestation_id = ea.id + SELECT + ei.id, + ei.exam_name, + ei.exam_level, + ei.exam_type, + ei.exam_duration, + ei.exam_rules, + ei.single_choice, + ei.multiple_choice, + ei.judge, + ei.single_choice_score, + ei.multiple_choice_score, + ei.judge_score, + ei.total_score, + ei.pass_score, + ei.create_by, + ei.create_time, + ei.update_by, + ei.update_time, + ei.attestation_id, + ea.attestation_name + FROM + exam_info AS ei + LEFT JOIN exam_attestation AS ea ON ei.attestation_id = ea.id + + and ei.id not in (SELECT exam_id from exam_paper_info where examine_id = #{userId}) + and ei.exam_name like concat('%', #{examName}, '%') + and ei.exam_level = #{examLevel} + and ei.exam_type = #{examType} + + order by create_time desc + + + + + + + + + \ No newline at end of file diff --git a/inspur-ui/src/api/examine/attestation.js b/inspur-ui/src/api/examine/attestation.js index aeaabfa..f81cca9 100644 --- a/inspur-ui/src/api/examine/attestation.js +++ b/inspur-ui/src/api/examine/attestation.js @@ -51,3 +51,11 @@ export function listAttestationPeople(query) { params: query }) } + +// 下拉 +export function attestationSelection() { + return request({ + url: '/examine/attestation/selection', + method: 'get' + }) +} diff --git a/inspur-ui/src/api/examine/myExamine.js b/inspur-ui/src/api/examine/myExamine.js new file mode 100644 index 0000000..2514a58 --- /dev/null +++ b/inspur-ui/src/api/examine/myExamine.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询考试信息列表 +export function getExamList(query) { + return request({ + url: '/examine/myExamine/examList', + method: 'get', + params: query + }) +} + +// 参与考试 +export function generateExam(id) { + return request({ + url: '/examine/myExamine/generateExam/' + id, + method: 'post' + }) +} + +// 待考试列表 +export function waitExamList(query) { + return request({ + url: '/examine/myExamine/waitExamList', + method: 'get', + params: query + }) +} + +// 获取考试信息以及试题 +export function getExam(id) { + return request({ + url: '/examine/myExamine/getExam/' + id, + method: 'get' + }) +} + +// 历史考试成绩 +export function getExamHistoryList(query) { + return request({ + url: '/examine/myExamine/examHistoryList', + method: 'get', + params: query + }) +} + +// 认证记录 +export function getAttestationList(query) { + return request({ + url: '/examine/myExamine/attestationList', + method: 'get', + params: query + }) +} diff --git a/inspur-ui/src/views/examine/examInfo/index.vue b/inspur-ui/src/views/examine/examInfo/index.vue index 5686ffb..9c96171 100644 --- a/inspur-ui/src/views/examine/examInfo/index.vue +++ b/inspur-ui/src/views/examine/examInfo/index.vue @@ -29,6 +29,16 @@ /> + + + + + 搜索 重置 @@ -96,6 +106,7 @@ + @@ -164,6 +175,16 @@ + + + + + @@ -199,12 +220,14 @@