dev-tmp1
luotaiqian 2026-08-17 18:18:06 +08:00
parent 983d75efbd
commit 7941877be9
12 changed files with 314 additions and 258 deletions

View File

@ -4,22 +4,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.qinan.cedu.model.dto.PaperImportDTO; import org.qinan.cedu.model.dto.PaperImportDTO;
import org.qinan.cedu.model.entity.PaperDO; import org.qinan.cedu.model.dto.PaperPageQueryDTO;
import org.qinan.cedu.model.dto.PaperUpdateDTO;
import org.qinan.cedu.model.vo.PaperImportVO; import org.qinan.cedu.model.vo.PaperImportVO;
import org.qinan.cedu.model.vo.PaperPageVO;
import org.qinan.cedu.service.PaperService; import org.qinan.cedu.service.PaperService;
import org.qinan.safetyeval.client.dto.PageResponse;
import org.qinan.safetyeval.client.dto.SingleResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* *
@ -34,49 +28,25 @@ public class PaperController {
@ApiOperation("分页查询试卷") @ApiOperation("分页查询试卷")
@GetMapping("/page") @GetMapping("/page")
public IPage<PaperDO> page(@RequestParam(defaultValue = "1") long current, public PageResponse<PaperPageVO> page(PaperPageQueryDTO query) {
@RequestParam(defaultValue = "10") long size, IPage<PaperPageVO> page = paperService.pageQuery(query);
@RequestParam(required = false) String paperName, return PageResponse.of(page.getRecords(), page.getTotal());
@RequestParam(required = false) String status) {
return paperService.pageQuery(current, size, paperName, status);
} }
@ApiOperation("查询试卷详情") @ApiOperation("修改试卷基本信息")
@GetMapping("/{id}")
public PaperDO getById(@PathVariable Long id) {
return paperService.getById(id);
}
@ApiOperation("新增试卷")
@PostMapping
public boolean save(@RequestBody PaperDO paperEntity) {
return paperService.savePaper(paperEntity);
}
@ApiOperation("修改试卷")
@PutMapping @PutMapping
public boolean update(@RequestBody PaperDO paperEntity) { public SingleResponse<Void> update(@Validated @RequestBody PaperUpdateDTO updateDTO) {
return paperService.updatePaper(paperEntity); paperService.updatePaper(updateDTO);
return SingleResponse.success();
} }
@ApiOperation("删除试卷") @ApiOperation("删除试卷")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
public boolean delete(@PathVariable Long id) { public SingleResponse<Void> delete(@PathVariable Long id) {
return paperService.deleteById(id); paperService.deleteById(id);
return SingleResponse.success();
} }
@ApiOperation("绑定试卷试题")
@PostMapping("/{id}/questions")
public boolean bindQuestions(@PathVariable("id") Long paperId,
@RequestBody List<Long> questionIds) {
return paperService.bindQuestions(paperId, questionIds);
}
@ApiOperation("查询试卷试题id列表")
@GetMapping("/{id}/questionIds")
public List<Long> questionIds(@PathVariable("id") Long paperId) {
return paperService.getQuestionIds(paperId);
}
@ApiOperation("新建试卷-导入试题") @ApiOperation("新建试卷-导入试题")
@PostMapping("/import") @PostMapping("/import")

View File

@ -1,19 +1,9 @@
package org.qinan.cedu.controller; package org.qinan.cedu.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.qinan.cedu.model.entity.QuestionDO;
import org.qinan.cedu.service.QuestionService; import org.qinan.cedu.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/** /**
@ -27,36 +17,5 @@ public class QuestionController {
@Autowired @Autowired
private QuestionService questionService; private QuestionService questionService;
@ApiOperation("分页查询试题")
@GetMapping("/page")
public IPage<QuestionDO> page(@RequestParam(defaultValue = "1") long current,
@RequestParam(defaultValue = "10") long size,
@RequestParam(required = false) String title,
@RequestParam(required = false) String questionType) {
return questionService.pageQuery(current, size, title, questionType);
}
@ApiOperation("查询试题详情(含选项)")
@GetMapping("/{id}")
public QuestionDO getDetail(@PathVariable Long id) {
return questionService.getDetail(id);
}
@ApiOperation("新增试题(含选项)")
@PostMapping
public boolean save(@RequestBody QuestionDO questionDO) {
return questionService.saveWithOptions(questionDO, questionDO.getOptions());
}
@ApiOperation("修改试题(含选项)")
@PutMapping
public boolean update(@RequestBody QuestionDO questionDO) {
return questionService.updateWithOptions(questionDO, questionDO.getOptions());
}
@ApiOperation("删除试题")
@DeleteMapping("/{id}")
public boolean delete(@PathVariable Long id) {
return questionService.deleteById(id);
}
} }

View File

@ -0,0 +1,15 @@
package org.qinan.cedu.convertor;
import org.mapstruct.Mapper;
import org.qinan.cedu.model.entity.PaperDO;
import org.qinan.cedu.model.vo.PaperPageVO;
import java.util.List;
@Mapper(componentModel = "spring")
public interface PaperConvertor {
PaperPageVO convertEToVo(PaperDO entity);
List<PaperPageVO> convertEListToVoList(List<PaperDO> list);
}

View File

@ -0,0 +1,30 @@
package org.qinan.cedu.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.qinan.cedu.model.query.BasePageQuery;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
/**
*
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "PaperPageQueryDTO", description = "试卷分页查询请求")
public class PaperPageQueryDTO extends BasePageQuery {
@ApiModelProperty("试卷名称(模糊)")
private String paperName;
@ApiModelProperty("创建时间-开始yyyy-MM-dd含当天")
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
private LocalDate createTimeStart;
@ApiModelProperty("创建时间-结束yyyy-MM-dd含当天")
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
private LocalDate createTimeEnd;
}

View File

@ -0,0 +1,41 @@
package org.qinan.cedu.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
/**
*
*/
@Data
@ApiModel(value = "PaperUpdateDTO", description = "修改试卷基本信息请求")
public class PaperUpdateDTO {
@ApiModelProperty(value = "试卷id", required = true)
@NotNull(message = "试卷id不能为空")
private Long id;
@ApiModelProperty(value = "试卷名称", required = true)
@NotBlank(message = "试卷名称不能为空")
@Size(max = 128, message = "试卷名称长度不能超过128个字符")
private String paperName;
@ApiModelProperty(value = "试卷总分", required = true)
@NotNull(message = "试卷总分不能为空")
@DecimalMin(value = "0.01", message = "试卷总分必须大于0")
@DecimalMax(value = "9999.99", message = "试卷总分不能超过9999.99")
private BigDecimal paperTotalScore;
@ApiModelProperty(value = "合格分数", required = true)
@NotNull(message = "合格分数不能为空")
@DecimalMin(value = "0", message = "合格分数不能小于0")
@DecimalMax(value = "9999.99", message = "合格分数不能超过9999.99")
private BigDecimal paperPassScore;
}

View File

@ -54,8 +54,8 @@ public class QuestionDO extends BaseEntity {
@ApiModelProperty("试题号") @ApiModelProperty("试题号")
private Integer questionNum; private Integer questionNum;
@ApiModelProperty("关联课件") @ApiModelProperty("关联课件管理id")
private Long coursewareId; private Long coursewareManagementId;
@ApiModelProperty("试题选项列表") @ApiModelProperty("试题选项列表")
@TableField(exist = false) @TableField(exist = false)

View File

@ -0,0 +1,31 @@
package org.qinan.cedu.model.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
*
*/
@Data
@ApiModel(value = "PaperPageVO", description = "试卷分页查询返回")
public class PaperPageVO {
@ApiModelProperty("试卷id")
private Long id;
@ApiModelProperty("试卷名称")
private String paperName;
@ApiModelProperty("试卷总分")
private BigDecimal paperTotalScore;
@ApiModelProperty("合格分数")
private BigDecimal paperPassScore;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -3,8 +3,11 @@ package org.qinan.cedu.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.qinan.cedu.model.dto.PaperImportDTO; import org.qinan.cedu.model.dto.PaperImportDTO;
import org.qinan.cedu.model.dto.PaperPageQueryDTO;
import org.qinan.cedu.model.dto.PaperUpdateDTO;
import org.qinan.cedu.model.entity.PaperDO; import org.qinan.cedu.model.entity.PaperDO;
import org.qinan.cedu.model.vo.PaperImportVO; import org.qinan.cedu.model.vo.PaperImportVO;
import org.qinan.cedu.model.vo.PaperPageVO;
import java.util.List; import java.util.List;
@ -16,13 +19,10 @@ public interface PaperService extends IService<PaperDO> {
/** /**
* *
* *
* @param current * @param query
* @param size
* @param paperName
* @param status
* @return * @return
*/ */
IPage<PaperDO> pageQuery(long current, long size, String paperName, String status); IPage<PaperPageVO> pageQuery(PaperPageQueryDTO query);
/** /**
* *
@ -33,12 +33,12 @@ public interface PaperService extends IService<PaperDO> {
boolean savePaper(PaperDO paperEntity); boolean savePaper(PaperDO paperEntity);
/** /**
* *
* *
* @param paperEntity * @param updateDTO
* @return * @return
*/ */
boolean updatePaper(PaperDO paperEntity); boolean updatePaper(PaperUpdateDTO updateDTO);
/** /**
* *

View File

@ -45,7 +45,7 @@ public class CoursewareManagementServiceImpl extends ServiceImpl<CoursewareManag
.page(new Page<>(query.getCurrent(), query.getSize())); .page(new Page<>(query.getCurrent(), query.getSize()));
IPage<CoursewareManagementVO> convert = page.convert(coursewareManagementConvertor::convertEToVo); IPage<CoursewareManagementVO> convert = page.convert(coursewareManagementConvertor::convertEToVo);
for (CoursewareManagementVO record : convert.getRecords()) { for (CoursewareManagementVO record : convert.getRecords()) {
record.setExerciseCount(questionMapper.selectCount(new LambdaQueryWrapper<QuestionDO>().eq(QuestionDO::getCoursewareId, record.getId()))); record.setExerciseCount(questionMapper.selectCount(new LambdaQueryWrapper<QuestionDO>().eq(QuestionDO::getCoursewareManagementId, record.getId())));
} }
return convert; return convert;
} }
@ -57,7 +57,7 @@ public class CoursewareManagementServiceImpl extends ServiceImpl<CoursewareManag
.eq(CoursewareManagementDO::getDeleteEnum, DeleteEnum.FALSE.getCode()) .eq(CoursewareManagementDO::getDeleteEnum, DeleteEnum.FALSE.getCode())
.one(); .one();
CoursewareManagementVO coursewareManagementVO = coursewareManagementConvertor.convertEToVo(entity); CoursewareManagementVO coursewareManagementVO = coursewareManagementConvertor.convertEToVo(entity);
coursewareManagementVO.setExerciseCount(questionMapper.selectCount(new LambdaQueryWrapper<QuestionDO>().eq(QuestionDO::getCoursewareId, coursewareManagementVO.getId()))); coursewareManagementVO.setExerciseCount(questionMapper.selectCount(new LambdaQueryWrapper<QuestionDO>().eq(QuestionDO::getCoursewareManagementId, coursewareManagementVO.getId())));
return coursewareManagementVO; return coursewareManagementVO;
} }

View File

@ -5,19 +5,22 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.Db; import com.baomidou.mybatisplus.extension.toolkit.Db;
import org.qinan.cedu.convertor.PaperConvertor;
import org.qinan.cedu.enums.DeleteEnum;
import org.qinan.cedu.enums.PaperStatusEnum;
import org.qinan.cedu.mapper.PaperMapper;
import org.qinan.cedu.mapper.QuestionMapper; import org.qinan.cedu.mapper.QuestionMapper;
import org.qinan.cedu.model.dto.PaperImportDTO; import org.qinan.cedu.model.dto.PaperImportDTO;
import org.qinan.cedu.model.dto.PaperPageQueryDTO;
import org.qinan.cedu.model.dto.PaperUpdateDTO;
import org.qinan.cedu.model.entity.PaperDO; import org.qinan.cedu.model.entity.PaperDO;
import org.qinan.cedu.model.entity.PaperQuestionRelDO; import org.qinan.cedu.model.entity.PaperQuestionRelDO;
import org.qinan.cedu.model.entity.QuestionDO; import org.qinan.cedu.model.entity.QuestionDO;
import org.qinan.cedu.model.entity.QuestionOptionDO; import org.qinan.cedu.model.entity.QuestionOptionDO;
import org.qinan.cedu.model.vo.PaperImportVO; import org.qinan.cedu.model.vo.PaperImportVO;
import org.qinan.cedu.enums.DeleteEnum; import org.qinan.cedu.model.vo.PaperPageVO;
import org.qinan.cedu.enums.PaperStatusEnum;
import org.qinan.cedu.mapper.PaperMapper;
import org.qinan.cedu.service.PaperQuestionRelService; import org.qinan.cedu.service.PaperQuestionRelService;
import org.qinan.cedu.service.PaperService; import org.qinan.cedu.service.PaperService;
import org.qinan.cedu.service.QuestionOptionService;
import org.qinan.cedu.service.QuestionService; import org.qinan.cedu.service.QuestionService;
import org.qinan.cedu.service.support.QuestionExcelImporter; import org.qinan.cedu.service.support.QuestionExcelImporter;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -48,14 +51,19 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, PaperDO> implemen
@Autowired @Autowired
private QuestionExcelImporter questionExcelImporter; private QuestionExcelImporter questionExcelImporter;
@Autowired
private PaperConvertor paperConvertor;
@Override @Override
public IPage<PaperDO> pageQuery(long current, long size, String paperName, String status) { public IPage<PaperPageVO> pageQuery(PaperPageQueryDTO query) {
return this.lambdaQuery() IPage<PaperDO> page = this.lambdaQuery()
.eq(PaperDO::getDeleteEnum, DeleteEnum.FALSE.getCode()) .eq(PaperDO::getDeleteEnum, DeleteEnum.FALSE.getCode())
.like(StringUtils.hasText(paperName), PaperDO::getPaperName, paperName) .like(StringUtils.hasText(query.getPaperName()), PaperDO::getPaperName, query.getPaperName())
.eq(StringUtils.hasText(status), PaperDO::getStatus, status) .ge(query.getCreateTimeStart() != null, PaperDO::getCreateTime, query.getCreateTimeStart().atStartOfDay())
.lt(query.getCreateTimeEnd() != null, PaperDO::getCreateTime, query.getCreateTimeEnd().plusDays(1).atStartOfDay())
.orderByDesc(PaperDO::getCreateTime) .orderByDesc(PaperDO::getCreateTime)
.page(new Page<>(current, size)); .page(new Page<>(query.getCurrent(), query.getSize()));
return page.convert(paperConvertor::convertEToVo);
} }
@Override @Override
@ -71,9 +79,14 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, PaperDO> implemen
} }
@Override @Override
public boolean updatePaper(PaperDO paperEntity) { public boolean updatePaper(PaperUpdateDTO updateDTO) {
paperEntity.setUpdateTime(LocalDateTime.now()); PaperDO paper = new PaperDO();
return this.updateById(paperEntity); paper.setId(updateDTO.getId());
paper.setPaperName(updateDTO.getPaperName().trim());
paper.setPaperTotalScore(updateDTO.getPaperTotalScore());
paper.setPaperPassScore(updateDTO.getPaperPassScore());
paper.setUpdateTime(LocalDateTime.now());
return this.updateById(paper);
} }
@Override @Override

View File

@ -22,15 +22,7 @@ import javax.validation.ConstraintViolation;
import javax.validation.Validator; import javax.validation.Validator;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -43,7 +35,9 @@ import java.util.stream.Collectors;
@Component @Component
public class QuestionExcelImporter { public class QuestionExcelImporter {
/** 模板前2行为说明和表头数据从第3行开始 */ /**
* 23
*/
private static final int HEAD_ROW_NUMBER = 2; private static final int HEAD_ROW_NUMBER = 2;
private static final int SINGLE_SHEET_NO = 0; private static final int SINGLE_SHEET_NO = 0;
@ -91,12 +85,12 @@ public class QuestionExcelImporter {
errors.add(new PaperImportErrorVO(null, sheetName(sheetNames, JUDGE_SHEET_NO), "读取判断题sheet失败" + e.getMessage())); errors.add(new PaperImportErrorVO(null, sheetName(sheetNames, JUDGE_SHEET_NO), "读取判断题sheet失败" + e.getMessage()));
} }
Map<String, Long> coursewareIdByName = loadCoursewareIdByName(singleRows, multipleRows, judgeRows); Map<String, Long> coursewareManagementIdByName = loadCoursewareIdByName(singleRows, multipleRows, judgeRows);
List<QuestionDO> questions = new ArrayList<>(); List<QuestionDO> questions = new ArrayList<>();
convertChoiceRows(singleRows, sheetName(sheetNames, SINGLE_SHEET_NO), QuestionTypeEnum.SINGLE, coursewareIdByName, questions, errors); convertChoiceRows(singleRows, sheetName(sheetNames, SINGLE_SHEET_NO), QuestionTypeEnum.SINGLE, coursewareManagementIdByName, questions, errors);
convertChoiceRows(multipleRows, sheetName(sheetNames, MULTIPLE_SHEET_NO), QuestionTypeEnum.MULTIPLE, coursewareIdByName, questions, errors); convertChoiceRows(multipleRows, sheetName(sheetNames, MULTIPLE_SHEET_NO), QuestionTypeEnum.MULTIPLE, coursewareManagementIdByName, questions, errors);
convertJudgeRows(judgeRows, sheetName(sheetNames, JUDGE_SHEET_NO), coursewareIdByName, questions, errors); convertJudgeRows(judgeRows, sheetName(sheetNames, JUDGE_SHEET_NO), coursewareManagementIdByName, questions, errors);
return new ParseResult(questions, errors); return new ParseResult(questions, errors);
} }
@ -167,7 +161,7 @@ public class QuestionExcelImporter {
* /sheet * /sheet
*/ */
private void convertChoiceRows(List<ChoiceQuestionImportRow> rows, String sheetName, QuestionTypeEnum questionType, private void convertChoiceRows(List<ChoiceQuestionImportRow> rows, String sheetName, QuestionTypeEnum questionType,
Map<String, Long> coursewareIdByName, List<QuestionDO> questions, Map<String, Long> coursewareManagementIdByName, List<QuestionDO> questions,
List<PaperImportErrorVO> errors) { List<PaperImportErrorVO> errors) {
boolean single = questionType == QuestionTypeEnum.SINGLE; boolean single = questionType == QuestionTypeEnum.SINGLE;
for (int i = 0; i < rows.size(); i++) { for (int i = 0; i < rows.size(); i++) {
@ -222,21 +216,21 @@ public class QuestionExcelImporter {
continue; continue;
} }
// 校验关联课件名称查询到后回填coursewareId // 校验关联课件名称查询到后回填coursewareManagementId
String coursewareName = row.getCoursewareName().trim(); String coursewareName = row.getCoursewareName().trim();
Long coursewareId = coursewareIdByName.get(coursewareName); Long coursewareManagementId = coursewareManagementIdByName.get(coursewareName);
if (coursewareId == null) { if (coursewareManagementId == null) {
errors.add(new PaperImportErrorVO(rowIndex, sheetName, "关联课件名称[" + coursewareName + "]不存在")); errors.add(new PaperImportErrorVO(rowIndex, sheetName, "关联课件名称[" + coursewareName + "]不存在"));
continue; continue;
} }
questions.add(buildChoiceQuestion(row, questionType, options, answerLetters, coursewareId)); questions.add(buildChoiceQuestion(row, questionType, options, answerLetters, coursewareManagementId));
} }
} }
private QuestionDO buildChoiceQuestion(ChoiceQuestionImportRow row, QuestionTypeEnum questionType, private QuestionDO buildChoiceQuestion(ChoiceQuestionImportRow row, QuestionTypeEnum questionType,
Map<String, String> optionTexts, List<String> answerLetters, Map<String, String> optionTexts, List<String> answerLetters,
Long coursewareId) { Long coursewareManagementId) {
QuestionDO question = new QuestionDO(); QuestionDO question = new QuestionDO();
question.setId(IdUtil.getSnowflakeNextId()); question.setId(IdUtil.getSnowflakeNextId());
question.setTitle(row.getTitle().trim()); question.setTitle(row.getTitle().trim());
@ -245,7 +239,7 @@ public class QuestionExcelImporter {
question.setScore(row.getScore()); question.setScore(row.getScore());
question.setAnalysis(row.getAnalysis().trim()); question.setAnalysis(row.getAnalysis().trim());
question.setTagType(row.getTagType().trim()); question.setTagType(row.getTagType().trim());
question.setCoursewareId(coursewareId); question.setCoursewareManagementId(coursewareManagementId);
question.setOptions(buildOptions(question.getId(), optionTexts, answerLetters)); question.setOptions(buildOptions(question.getId(), optionTexts, answerLetters));
question.setAnswerQuestionOptionIds(joinCorrectOptionIds(question.getOptions())); question.setAnswerQuestionOptionIds(joinCorrectOptionIds(question.getOptions()));
return question; return question;
@ -255,7 +249,7 @@ public class QuestionExcelImporter {
* sheetT/F AB * sheetT/F AB
*/ */
private void convertJudgeRows(List<JudgeQuestionImportRow> rows, String sheetName, private void convertJudgeRows(List<JudgeQuestionImportRow> rows, String sheetName,
Map<String, Long> coursewareIdByName, List<QuestionDO> questions, Map<String, Long> coursewareManagementIdByName, List<QuestionDO> questions,
List<PaperImportErrorVO> errors) { List<PaperImportErrorVO> errors) {
for (int i = 0; i < rows.size(); i++) { for (int i = 0; i < rows.size(); i++) {
JudgeQuestionImportRow row = rows.get(i); JudgeQuestionImportRow row = rows.get(i);
@ -278,8 +272,8 @@ public class QuestionExcelImporter {
} }
String coursewareName = row.getCoursewareName().trim(); String coursewareName = row.getCoursewareName().trim();
Long coursewareId = coursewareIdByName.get(coursewareName); Long coursewareManagementId = coursewareManagementIdByName.get(coursewareName);
if (coursewareId == null) { if (coursewareManagementId == null) {
errors.add(new PaperImportErrorVO(rowIndex, sheetName, "关联课件名称[" + coursewareName + "]不存在")); errors.add(new PaperImportErrorVO(rowIndex, sheetName, "关联课件名称[" + coursewareName + "]不存在"));
continue; continue;
} }
@ -293,7 +287,7 @@ public class QuestionExcelImporter {
question.setScore(row.getScore()); question.setScore(row.getScore());
question.setAnalysis(row.getAnalysis().trim()); question.setAnalysis(row.getAnalysis().trim());
question.setTagType(row.getTagType().trim()); question.setTagType(row.getTagType().trim());
question.setCoursewareId(coursewareId); question.setCoursewareManagementId(coursewareManagementId);
Map<String, String> optionTexts = new LinkedHashMap<>(); Map<String, String> optionTexts = new LinkedHashMap<>();
optionTexts.put("A", "对"); optionTexts.put("A", "对");
optionTexts.put("B", "错"); optionTexts.put("B", "错");

View File

@ -15,114 +15,120 @@
*/ */
SET NAMES utf8mb4; SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0; SET
FOREIGN_KEY_CHECKS = 0;
-- ---------------------------- -- ----------------------------
-- Table structure for paperEntity -- Table structure for paperEntity
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `paperEntity`; DROP TABLE IF EXISTS `paperEntity`;
CREATE TABLE `paperEntity` ( CREATE TABLE `paperEntity`
`id` bigint NOT NULL COMMENT 'id', (
`paper_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '试卷名称', `id` bigint NOT NULL COMMENT 'id',
`paper_total_score` decimal(6, 2) NOT NULL DEFAULT 0.00 COMMENT '试卷总分', `paper_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '试卷名称',
`paper_pass_score` decimal(6, 2) NOT NULL DEFAULT 0.00 COMMENT '合格分数', `paper_total_score` decimal(6, 2) NOT NULL DEFAULT 0.00 COMMENT '试卷总分',
`status` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '试卷试卷状态 normal 正常', `paper_pass_score` decimal(6, 2) NOT NULL DEFAULT 0.00 COMMENT '合格分数',
`delete_enum` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '删除标识true false', `status` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '试卷试卷状态 normal 正常',
`remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注', `delete_enum` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '删除标识true false',
`create_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人姓名', `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
`update_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人姓名', `create_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人姓名',
`tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', `update_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人姓名',
`version` int NULL DEFAULT NULL COMMENT '版本', `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', `version` int NULL DEFAULT NULL COMMENT '版本',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`create_id` bigint NULL DEFAULT NULL COMMENT '创建人id', `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`update_id` bigint NULL DEFAULT NULL COMMENT '修改人id', `create_id` bigint NULL DEFAULT NULL COMMENT '创建人id',
`env` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '环境', `update_id` bigint NULL DEFAULT NULL COMMENT '修改人id',
PRIMARY KEY (`id`) USING BTREE `env` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '环境',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '试卷' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '试卷' ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Table structure for paper_question_rel -- Table structure for paper_question_rel
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `paper_question_rel`; DROP TABLE IF EXISTS `paper_question_rel`;
CREATE TABLE `paper_question_rel` ( CREATE TABLE `paper_question_rel`
`id` bigint NOT NULL COMMENT 'id', (
`paper_id` bigint NOT NULL COMMENT '试卷id', `id` bigint NOT NULL COMMENT 'id',
`question_id` bigint NOT NULL COMMENT '试题id', `paper_id` bigint NOT NULL COMMENT '试卷id',
`delete_enum` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '删除标识true false', `question_id` bigint NOT NULL COMMENT '试题id',
`remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注', `delete_enum` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '删除标识true false',
`create_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人姓名', `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
`update_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人姓名', `create_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人姓名',
`tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', `update_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人姓名',
`version` int NULL DEFAULT NULL COMMENT '版本', `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', `version` int NULL DEFAULT NULL COMMENT '版本',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`create_id` bigint NULL DEFAULT NULL COMMENT '创建人id', `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`update_id` bigint NULL DEFAULT NULL COMMENT '修改人id', `create_id` bigint NULL DEFAULT NULL COMMENT '创建人id',
`env` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '环境', `update_id` bigint NULL DEFAULT NULL COMMENT '修改人id',
PRIMARY KEY (`id`) USING BTREE, `env` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '环境',
INDEX `idx_paper_id`(`paper_id` ASC) USING BTREE PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_paper_id`(`paper_id` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '试卷试题关系表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '试卷试题关系表' ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Table structure for questionDO -- Table structure for questionDO
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `questionDO`; DROP TABLE IF EXISTS `questionDO`;
CREATE TABLE `questionDO` ( CREATE TABLE `questionDO`
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '试题ID', (
`title` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目内容', `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '试题ID',
`question_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'single' COMMENT '题型single单选/multiple多选/judge判断/fill填空/short简答', `title` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '题目内容',
`answer` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '参考答案:逗号隔开', `question_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'single' COMMENT '题型single单选/multiple多选/judge判断/fill填空/short简答',
`answer_question_option_ids` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '答案选项id 多个逗号隔开', `answer` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '参考答案:逗号隔开',
`score` decimal(5, 2) NOT NULL DEFAULT 0.00 COMMENT '分值', `answer_question_option_ids` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '答案选项id 多个逗号隔开',
`analysis` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '答案解析', `score` decimal(5, 2) NOT NULL DEFAULT 0.00 COMMENT '分值',
`tag_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '标签类型', `analysis` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '答案解析',
`question_num` int NULL DEFAULT NULL COMMENT '试题号', `tag_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '标签类型',
`courseware_id` bigint NULL DEFAULT NULL COMMENT '关联课件', `question_num` int NULL DEFAULT NULL COMMENT '试题号',
`delete_enum` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '删除标识true false', `courseware_management_id` bigint NULL DEFAULT NULL COMMENT '关联课件管理id',
`remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注', `delete_enum` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '删除标识true false',
`create_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人姓名', `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
`update_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人姓名', `create_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人姓名',
`tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', `update_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人姓名',
`version` int NULL DEFAULT NULL COMMENT '版本', `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', `version` int NULL DEFAULT NULL COMMENT '版本',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`create_id` bigint NULL DEFAULT NULL COMMENT '创建人id', `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`update_id` bigint NULL DEFAULT NULL COMMENT '修改人id', `create_id` bigint NULL DEFAULT NULL COMMENT '创建人id',
`env` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '环境', `update_id` bigint NULL DEFAULT NULL COMMENT '修改人id',
PRIMARY KEY (`id`) USING BTREE, `env` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '环境',
INDEX `idx_courseware_id`(`courseware_id` ASC) USING BTREE PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_courseware_management_id`(`courseware_management_id` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '试题表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '试题表' ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Table structure for question_option -- Table structure for question_option
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `question_option`; DROP TABLE IF EXISTS `question_option`;
CREATE TABLE `question_option` ( CREATE TABLE `question_option`
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '选项ID', (
`question_id` bigint UNSIGNED NOT NULL COMMENT '所属试题ID', `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '选项ID',
`option_key` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '选项标识A,B,C,D,E,F', `question_id` bigint UNSIGNED NOT NULL COMMENT '所属试题ID',
`option_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '选项标志名称', `option_key` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '选项标识A,B,C,D,E,F',
`option_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '选项内容', `option_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '选项标志名称',
`is_correct` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否正确答案1是0否', `option_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '选项内容',
`sort_order` int NOT NULL DEFAULT 0 COMMENT '选项显示顺序', `is_correct` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否正确答案1是0否',
`delete_enum` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '删除标识true false', `sort_order` int NOT NULL DEFAULT 0 COMMENT '选项显示顺序',
`remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注', `delete_enum` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '删除标识true false',
`create_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人姓名', `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
`update_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人姓名', `create_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人姓名',
`tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', `update_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人姓名',
`version` int NULL DEFAULT NULL COMMENT '版本', `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', `version` int NULL DEFAULT NULL COMMENT '版本',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`create_id` bigint NULL DEFAULT NULL COMMENT '创建人id', `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`update_id` bigint NULL DEFAULT NULL COMMENT '修改人id', `create_id` bigint NULL DEFAULT NULL COMMENT '创建人id',
`env` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '环境', `update_id` bigint NULL DEFAULT NULL COMMENT '修改人id',
PRIMARY KEY (`id`) USING BTREE, `env` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '环境',
INDEX `idx_question_id`(`question_id` ASC) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
CONSTRAINT `fk_question_option_question` FOREIGN KEY (`question_id`) REFERENCES `questionDO` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT INDEX `idx_question_id`(`question_id` ASC) USING BTREE,
CONSTRAINT `fk_question_option_question` FOREIGN KEY (`question_id`) REFERENCES `questionDO` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '试题选项表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '试题选项表' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1; SET
FOREIGN_KEY_CHECKS = 1;
create table course_management create table course_management
( (
@ -130,37 +136,35 @@ create table course_management
remarks varchar(255) charset utf8mb4 null comment '备注', remarks varchar(255) charset utf8mb4 null comment '备注',
create_name varchar(50) charset utf8mb4 null comment '创建人姓名', create_name varchar(50) charset utf8mb4 null comment '创建人姓名',
update_name varchar(50) charset utf8mb4 null comment '更新人姓名', update_name varchar(50) charset utf8mb4 null comment '更新人姓名',
tenant_id bigint null comment '租户id', tenant_id bigint null comment '租户id',
version int null comment '版本', version int null comment '版本',
create_time datetime null comment '创建时间', create_time datetime null comment '创建时间',
update_time datetime null comment '修改时间', update_time datetime null comment '修改时间',
create_id bigint null comment '创建人id', create_id bigint null comment '创建人id',
update_id bigint null comment '修改人id', update_id bigint null comment '修改人id',
env varchar(50) charset utf8mb4 null comment '环境', env varchar(50) charset utf8mb4 null comment '环境',
id bigint not null comment '主键' id bigint not null comment '主键'
primary key, primary key,
course_name varchar(200) null comment '课程名称', course_name varchar(200) null comment '课程名称',
training_type varchar(100) null comment '培训类型', training_type varchar(100) null comment '培训类型',
course_description varchar(512) null comment '课称描述', course_description varchar(512) null comment '课称描述',
course_cover varchar(255) null comment '课程封面', course_cover varchar(255) null comment '课程封面',
class_hour_duration decimal(5, 1) unsigned default 0.0 null comment '课时时长(小时)', class_hour_duration decimal(5, 1) unsigned default 0.0 null comment '课时时长(小时)',
upload_unit varchar(200) null comment '上传单位', upload_unit varchar(200) null comment '上传单位',
status int default 0 null comment '状态1启用/0禁用', status int default 0 null comment '状态1启用/0禁用',
used int default 0 null comment '是否已被使用0-未使用1-已使用)' used int default 0 null comment '是否已被使用0-未使用1-已使用)'
) ) comment '课程管理';
comment '课程管理';
create table course_rel_courseware create table course_rel_courseware
( (
id bigint not null comment '主键' id bigint not null comment '主键'
primary key, primary key,
courseware_name varchar(200) null comment '课件名称', courseware_name varchar(200) null comment '课件名称',
courseware_document varchar(512) null comment '课件文档(文件名或路径)', courseware_document varchar(512) null comment '课件文档(文件名或路径)',
courseware_id bigint null comment '课件id', courseware_id bigint null comment '课件id',
course_id bigint null comment '课程id', course_id bigint null comment '课程id',
sort int null comment '排序' sort int null comment '排序'
) ) comment '课程关联课件表';
comment '课程关联课件表';
create table courseware_management create table courseware_management
( (
@ -168,25 +172,24 @@ create table courseware_management
remarks varchar(255) charset utf8mb4 null comment '备注', remarks varchar(255) charset utf8mb4 null comment '备注',
create_name varchar(50) charset utf8mb4 null comment '创建人姓名', create_name varchar(50) charset utf8mb4 null comment '创建人姓名',
update_name varchar(50) charset utf8mb4 null comment '更新人姓名', update_name varchar(50) charset utf8mb4 null comment '更新人姓名',
tenant_id bigint null comment '租户id', tenant_id bigint null comment '租户id',
version int null comment '版本', version int null comment '版本',
create_time datetime null comment '创建时间', create_time datetime null comment '创建时间',
update_time datetime null comment '修改时间', update_time datetime null comment '修改时间',
create_id bigint null comment '创建人id', create_id bigint null comment '创建人id',
update_id bigint null comment '修改人id', update_id bigint null comment '修改人id',
env varchar(50) charset utf8mb4 null comment '环境', env varchar(50) charset utf8mb4 null comment '环境',
id bigint not null comment '主键' id bigint not null comment '主键'
primary key, primary key,
courseware_name varchar(200) null comment '课件名称', courseware_name varchar(200) null comment '课件名称',
training_type varchar(100) null comment '培训类型', training_type varchar(100) null comment '培训类型',
lecturer_name varchar(100) null comment '讲师名称', lecturer_name varchar(100) null comment '讲师名称',
credit_hours decimal(5, 1) unsigned default 0.0 null comment '学时', credit_hours decimal(5, 1) unsigned default 0.0 null comment '学时',
class_hour_duration decimal(5, 1) unsigned default 0.0 null comment '课时时长(小时)', class_hour_duration decimal(5, 1) unsigned default 0.0 null comment '课时时长(小时)',
upload_unit varchar(200) null comment '上传单位', upload_unit varchar(200) null comment '上传单位',
status int default 0 null comment '状态1启用/0禁用', status int default 0 null comment '状态1启用/0禁用',
courseware_type int null comment '课件类型1视频课件/2文档课件', courseware_type int null comment '课件类型1视频课件/2文档课件',
courseware_document varchar(512) null comment '课件文档(文件名或路径)', courseware_document varchar(512) null comment '课件文档(文件名或路径)',
courseware_description varchar(512) null comment '课件描述' courseware_description varchar(512) null comment '课件描述'
) ) comment '课件表';
comment '课件表';