diff --git a/inspur-service/inspur-admin/pom.xml b/inspur-service/inspur-admin/pom.xml index 45ff544..52d7598 100644 --- a/inspur-service/inspur-admin/pom.xml +++ b/inspur-service/inspur-admin/pom.xml @@ -96,6 +96,12 @@ 3.8.7 compile + + com.inspur + inspur-examine + 3.8.7 + compile + diff --git a/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/examine/ExamInfoController.java b/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/examine/ExamInfoController.java new file mode 100644 index 0000000..7af79a3 --- /dev/null +++ b/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/examine/ExamInfoController.java @@ -0,0 +1,105 @@ +package com.inspur.web.controller.examine; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.inspur.common.utils.poi.ExcelUtil; +import com.inspur.examine.domain.ExamInfo; +import com.inspur.examine.service.IExamInfoService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.inspur.common.annotation.Log; +import com.inspur.common.core.controller.BaseController; +import com.inspur.common.core.domain.AjaxResult; +import com.inspur.common.enums.BusinessType; +import com.inspur.common.core.page.TableDataInfo; + +/** + * 考试信息Controller + * + * @author inspur + * @date 2024-05-06 + */ +@RestController +@RequestMapping("/examine/examInfo") +public class ExamInfoController extends BaseController +{ + @Autowired + private IExamInfoService examInfoService; + + /** + * 查询考试信息列表 + */ + @PreAuthorize("@ss.hasPermi('examine:examInfo:list')") + @GetMapping("/list") + public TableDataInfo list(ExamInfo examInfo) + { + startPage(); + List list = examInfoService.selectExamInfoList(examInfo); + return getDataTable(list); + } + + /** + * 导出考试信息列表 + */ + @PreAuthorize("@ss.hasPermi('examine:examInfo:export')") + @Log(title = "考试信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ExamInfo examInfo) + { + List list = examInfoService.selectExamInfoList(examInfo); + ExcelUtil util = new ExcelUtil(ExamInfo.class); + util.exportExcel(response, list, "考试信息数据"); + } + + /** + * 获取考试信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('examine:examInfo:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return success(examInfoService.selectExamInfoById(id)); + } + + /** + * 新增考试信息 + */ + @PreAuthorize("@ss.hasPermi('examine:examInfo:add')") + @Log(title = "考试信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ExamInfo examInfo) + { + return toAjax(examInfoService.insertExamInfo(examInfo)); + } + + /** + * 修改考试信息 + */ + @PreAuthorize("@ss.hasPermi('examine:examInfo:edit')") + @Log(title = "考试信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ExamInfo examInfo) + { + return toAjax(examInfoService.updateExamInfo(examInfo)); + } + + /** + * 删除考试信息 + */ + @PreAuthorize("@ss.hasPermi('examine:examInfo:remove')") + @Log(title = "考试信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) + { + return toAjax(examInfoService.deleteExamInfoByIds(ids)); + } +} diff --git a/inspur-service/inspur-examine/pom.xml b/inspur-service/inspur-examine/pom.xml new file mode 100644 index 0000000..ff5dc7c --- /dev/null +++ b/inspur-service/inspur-examine/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + com.inspur + inspur + 3.8.7 + + + inspur-examine + + + 8 + 8 + UTF-8 + + + + + com.inspur + inspur-common + + + org.projectlombok + lombok + + + cn.hutool + hutool-all + 5.0.7 + + + + \ No newline at end of file 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 new file mode 100644 index 0000000..2c305be --- /dev/null +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/domain/ExamInfo.java @@ -0,0 +1,109 @@ +package com.inspur.examine.domain; + +import java.math.BigDecimal; + +import com.inspur.common.annotation.Excel; +import com.inspur.common.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 考试信息对象 exam_info + * + * @author inspur + * @date 2024-05-06 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class ExamInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 考试名称 + */ + @Excel(name = "考试名称") + private String examName; + + /** + * 考试等级 + */ + @Excel(name = "考试等级" ,dictType = "exam_level") + private String examLevel; + + /** + * 考试类型 + */ + @Excel(name = "考试类型" ,dictType = "exam_type") + private String examType; + + /** + * 考试时长 + */ + private Integer examDuration; + + /** + * 考试时长(分钟) + */ + @Excel(name = "考试时长") + private String examDurationHaveUnit; + + /** + * 考试规则 + */ + @Excel(name = "考试规则") + private String examRules; + + /** + * 单选题数量 + */ + @Excel(name = "单选题数量") + private Integer singleChoice; + + /** + * 多选题数量 + */ + @Excel(name = "多选题数量") + private Integer multipleChoice; + + /** + * 判断题数量 + */ + @Excel(name = "判断题数量") + private Integer judge; + + /** + * 单选题分数 + */ + @Excel(name = "单选题分数") + private BigDecimal singleChoiceScore; + + /** + * 多选题分数 + */ + @Excel(name = "多选题分数") + private BigDecimal multipleChoiceScore; + + /** + * 判断题分数 + */ + @Excel(name = "判断题分数") + private BigDecimal judgeScore; + + /** + * 总分数 + */ + @Excel(name = "总分数") + private BigDecimal totalScore; + + /** + * 通过分数 + */ + @Excel(name = "通过分数") + private BigDecimal passScore; + +} diff --git a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/mapper/ExamInfoMapper.java b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/mapper/ExamInfoMapper.java new file mode 100644 index 0000000..2ad45be --- /dev/null +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/mapper/ExamInfoMapper.java @@ -0,0 +1,61 @@ +package com.inspur.examine.mapper; + +import java.util.List; +import com.inspur.examine.domain.ExamInfo; + +/** + * 考试信息Mapper接口 + * + * @author inspur + * @date 2024-05-06 + */ +public interface ExamInfoMapper +{ + /** + * 查询考试信息 + * + * @param id 考试信息主键 + * @return 考试信息 + */ + public ExamInfo selectExamInfoById(String id); + + /** + * 查询考试信息列表 + * + * @param examInfo 考试信息 + * @return 考试信息集合 + */ + public List selectExamInfoList(ExamInfo examInfo); + + /** + * 新增考试信息 + * + * @param examInfo 考试信息 + * @return 结果 + */ + public int insertExamInfo(ExamInfo examInfo); + + /** + * 修改考试信息 + * + * @param examInfo 考试信息 + * @return 结果 + */ + public int updateExamInfo(ExamInfo examInfo); + + /** + * 删除考试信息 + * + * @param id 考试信息主键 + * @return 结果 + */ + public int deleteExamInfoById(String id); + + /** + * 批量删除考试信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteExamInfoByIds(String[] ids); +} diff --git a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/IExamInfoService.java b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/IExamInfoService.java new file mode 100644 index 0000000..022491e --- /dev/null +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/IExamInfoService.java @@ -0,0 +1,61 @@ +package com.inspur.examine.service; + +import java.util.List; +import com.inspur.examine.domain.ExamInfo; + +/** + * 考试信息Service接口 + * + * @author inspur + * @date 2024-05-06 + */ +public interface IExamInfoService +{ + /** + * 查询考试信息 + * + * @param id 考试信息主键 + * @return 考试信息 + */ + public ExamInfo selectExamInfoById(String id); + + /** + * 查询考试信息列表 + * + * @param examInfo 考试信息 + * @return 考试信息集合 + */ + public List selectExamInfoList(ExamInfo examInfo); + + /** + * 新增考试信息 + * + * @param examInfo 考试信息 + * @return 结果 + */ + public int insertExamInfo(ExamInfo examInfo); + + /** + * 修改考试信息 + * + * @param examInfo 考试信息 + * @return 结果 + */ + public int updateExamInfo(ExamInfo examInfo); + + /** + * 批量删除考试信息 + * + * @param ids 需要删除的考试信息主键集合 + * @return 结果 + */ + public int deleteExamInfoByIds(String[] ids); + + /** + * 删除考试信息信息 + * + * @param id 考试信息主键 + * @return 结果 + */ + public int deleteExamInfoById(String id); +} diff --git a/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/ExamInfoServiceImpl.java b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/ExamInfoServiceImpl.java new file mode 100644 index 0000000..8d6e561 --- /dev/null +++ b/inspur-service/inspur-examine/src/main/java/com/inspur/examine/service/impl/ExamInfoServiceImpl.java @@ -0,0 +1,106 @@ +package com.inspur.examine.service.impl; + +import java.util.List; +import java.util.Objects; + +import com.inspur.common.utils.DateUtils; +import com.inspur.common.utils.SecurityUtils; +import com.inspur.common.utils.StringUtils; +import com.inspur.common.utils.uuid.IdUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.inspur.examine.mapper.ExamInfoMapper; +import com.inspur.examine.domain.ExamInfo; +import com.inspur.examine.service.IExamInfoService; + +/** + * 考试信息Service业务层处理 + * + * @author inspur + * @date 2024-05-06 + */ +@Service +public class ExamInfoServiceImpl implements IExamInfoService { + @Autowired + private ExamInfoMapper examInfoMapper; + + /** + * 查询考试信息 + * + * @param id 考试信息主键 + * @return 考试信息 + */ + @Override + public ExamInfo selectExamInfoById(String id) { + return examInfoMapper.selectExamInfoById(id); + } + + /** + * 查询考试信息列表 + * + * @param examInfo 考试信息 + * @return 考试信息 + */ + @Override + public List selectExamInfoList(ExamInfo examInfo) { + List list = examInfoMapper.selectExamInfoList(examInfo); + if (StringUtils.isNotEmpty(list)){ + list.forEach(item->{ + if (Objects.nonNull(item.getExamDuration())){ + item.setExamDurationHaveUnit(item.getExamDuration() + "分钟"); + } + }); + } + return list; + } + + /** + * 新增考试信息 + * + * @param examInfo 考试信息 + * @return 结果 + */ + @Override + public int insertExamInfo(ExamInfo examInfo) { + examInfo.setId(IdUtils.fastSimpleUUID()); + examInfo.setCreateBy(String.valueOf(SecurityUtils.getUserId())); + examInfo.setCreateTime(DateUtils.getNowDate()); + return examInfoMapper.insertExamInfo(examInfo); + } + + /** + * 修改考试信息 + * + * @param examInfo 考试信息 + * @return 结果 + */ + @Override + public int updateExamInfo(ExamInfo examInfo) { + examInfo.setUpdateBy(String.valueOf(SecurityUtils.getUserId())); + examInfo.setUpdateTime(DateUtils.getNowDate()); + return examInfoMapper.updateExamInfo(examInfo); + } + + /** + * 批量删除考试信息 + * + * @param ids 需要删除的考试信息主键 + * @return 结果 + */ + @Override + public int deleteExamInfoByIds(String[] ids) { + return examInfoMapper.deleteExamInfoByIds(ids); + } + + /** + * 删除考试信息信息 + * + * @param id 考试信息主键 + * @return 结果 + */ + @Override + public int deleteExamInfoById(String id) { + return examInfoMapper.deleteExamInfoById(id); + } + +} diff --git a/inspur-service/inspur-examine/src/main/resources/mapper/ExamInfoMapper.xml b/inspur-service/inspur-examine/src/main/resources/mapper/ExamInfoMapper.xml new file mode 100644 index 0000000..14ac1e7 --- /dev/null +++ b/inspur-service/inspur-examine/src/main/resources/mapper/ExamInfoMapper.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into exam_info + + 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, + + + #{id}, + #{examName}, + #{examLevel}, + #{examType}, + #{examDuration}, + #{examRules}, + #{singleChoice}, + #{multipleChoice}, + #{judge}, + #{singleChoiceScore}, + #{multipleChoiceScore}, + #{judgeScore}, + #{totalScore}, + #{passScore}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update exam_info + + exam_name = #{examName}, + exam_level = #{examLevel}, + exam_type = #{examType}, + exam_duration = #{examDuration}, + exam_rules = #{examRules}, + single_choice = #{singleChoice}, + multiple_choice = #{multipleChoice}, + judge = #{judge}, + single_choice_score = #{singleChoiceScore}, + multiple_choice_score = #{multipleChoiceScore}, + judge_score = #{judgeScore}, + total_score = #{totalScore}, + pass_score = #{passScore}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from exam_info where id = #{id} + + + + delete from exam_info where id in + + #{id} + + + \ No newline at end of file diff --git a/inspur-service/pom.xml b/inspur-service/pom.xml index f38a8a6..b76eb6e 100644 --- a/inspur-service/pom.xml +++ b/inspur-service/pom.xml @@ -201,6 +201,7 @@ inspur-knowledgeBase inspur-operations inspur-develop + inspur-examine pom diff --git a/inspur-ui/src/api/examine/examInfo.js b/inspur-ui/src/api/examine/examInfo.js new file mode 100644 index 0000000..965ad76 --- /dev/null +++ b/inspur-ui/src/api/examine/examInfo.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询考试信息列表 +export function listExamInfo(query) { + return request({ + url: '/examine/examInfo/list', + method: 'get', + params: query + }) +} + +// 查询考试信息详细 +export function getExamInfo(id) { + return request({ + url: '/examine/examInfo/' + id, + method: 'get' + }) +} + +// 新增考试信息 +export function addExamInfo(data) { + return request({ + url: '/examine/examInfo', + method: 'post', + data: data + }) +} + +// 修改考试信息 +export function updateExamInfo(data) { + return request({ + url: '/examine/examInfo', + method: 'put', + data: data + }) +} + +// 删除考试信息 +export function delExamInfo(id) { + return request({ + url: '/examine/examInfo/' + id, + method: 'delete' + }) +} diff --git a/inspur-ui/src/views/examine/examInfo/index.vue b/inspur-ui/src/views/examine/examInfo/index.vue new file mode 100644 index 0000000..5686ffb --- /dev/null +++ b/inspur-ui/src/views/examine/examInfo/index.vue @@ -0,0 +1,397 @@ + + +