PaperBasicInfo

dev-tmp1
luotaiqian 2026-08-21 09:52:41 +08:00
parent 6f69edc8a4
commit 7775928024
6 changed files with 17 additions and 212 deletions

View File

@ -25,8 +25,8 @@ public class PaperCopyDTO {
@ApiModelProperty(value = "新试卷总分", required = true)
@NotNull(message = "试卷总分不能为空")
@DecimalMin(value = "0.01", message = "试卷总分必须大于0")
@DecimalMax(value = "9999.99", message = "试卷总分不能超过9999.99")
@DecimalMin(value = "0.1", message = "试卷总分必须大于0")
@DecimalMax(value = "9999.9", message = "试卷总分不能超过9999.99")
private BigDecimal paperTotalScore;
@ApiModelProperty(value = "新合格分数", required = true)

View File

@ -23,8 +23,8 @@ public class PaperImportDTO {
@ApiModelProperty(value = "试卷总分", required = true)
@NotNull(message = "试卷总分不能为空")
@DecimalMin(value = "0.01", message = "试卷总分必须大于0")
@DecimalMax(value = "9999.99", message = "试卷总分不能超过9999.99")
@DecimalMin(value = "0.1", message = "试卷总分必须大于0")
@DecimalMax(value = "9999.9", message = "试卷总分不能超过9999.99")
private BigDecimal paperTotalScore;
@ApiModelProperty(value = "合格分数", required = true)

View File

@ -59,6 +59,7 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -93,6 +94,9 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, PaperDO> implemen
if (query.getCreateTimeEnd() != null) {
wrapper.lt(PaperDO::getCreateTime, query.getCreateTimeEnd().plusDays(1).atStartOfDay());
}
if (StringUtils.hasText(query.getPaperType())) {
wrapper.eq(PaperDO::getPaperType, query.getPaperType());
}
wrapper.orderByDesc(PaperDO::getId);
IPage<PaperDO> page = this.page(new Page<>(query.getCurrent(), query.getSize()), wrapper);
return page.convert(paperConvertor::convertEToVo);
@ -162,9 +166,9 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, PaperDO> implemen
if (questions.isEmpty()) {
return;
}
Map<Long, Integer> questionNumByQuestionId = rels.stream()
Map<Long, PaperQuestionRelDO> questionNumByQuestionId = rels.stream()
.filter(rel -> rel.getQuestionNum() != null)
.collect(Collectors.toMap(PaperQuestionRelDO::getQuestionId, PaperQuestionRelDO::getQuestionNum, (a, b) -> a));
.collect(Collectors.toMap(PaperQuestionRelDO::getQuestionId, Function.identity(), (a, b) -> a));
List<QuestionOptionDO> newOptions = new ArrayList<>();
List<PaperQuestionRelDO> newRels = new ArrayList<>();
for (QuestionDO question : questions) {
@ -190,10 +194,12 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, PaperDO> implemen
question.setAnswer(newQueOptions.stream().filter(QuestionOptionDO::getIsCorrect)
.map(QuestionOptionDO::getOptionKey).collect(Collectors.joining(",")));
PaperQuestionRelDO oldRel = questionNumByQuestionId.get(oldQuestionId);
PaperQuestionRelDO rel = new PaperQuestionRelDO();
rel.setScore(oldRel.getScore());
rel.setPaperId(target.getId());
rel.setQuestionId(newQuestionId);
rel.setQuestionNum(questionNumByQuestionId.get(oldQuestionId));
rel.setQuestionNum(oldRel.getQuestionNum());
newRels.add(rel);
InsertFieldDefaults.applyIgnoreOrgId(rel);
}

View File

@ -40,8 +40,8 @@ public class ChoiceQuestionImportRow {
@ExcelProperty(value = "分值", index = 6)
@NotNull(message = "分值不能为空")
@DecimalMin(value = "0.01", message = "分值必须大于0")
@DecimalMax(value = "999.99", message = "分值不能超过999.99")
@DecimalMin(value = "0.1", message = "分值必须大于0")
@DecimalMax(value = "999.9", message = "分值不能超过999.9")
private BigDecimal score;
@ExcelProperty(value = "答案解析", index = 7)

View File

@ -28,8 +28,8 @@ public class JudgeQuestionImportRow {
@ExcelProperty(value = "分值", index = 2)
@NotNull(message = "分值不能为空")
@DecimalMin(value = "0.01", message = "分值必须大于0")
@DecimalMax(value = "999.99", message = "分值不能超过999.99")
@DecimalMin(value = "0.1", message = "分值必须大于0")
@DecimalMax(value = "999.9", message = "分值不能超过999.99")
private BigDecimal score;
@ExcelProperty(value = "答案解析", index = 3)

View File

@ -1,201 +0,0 @@
/*
Navicat Premium Dump SQL
Source Server : dev
Source Server Type : MySQL
Source Server Version : 80035 (8.0.35)
Source Host : 192.168.20.100:33080
Source Schema : cedu-service
Target Server Type : MySQL
Target Server Version : 80035 (8.0.35)
File Encoding : 65001
Date: 17/08/2026 15:51:24
*/
SET NAMES utf8mb4;
SET
FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for paperEntity
-- ----------------------------
DROP TABLE IF EXISTS `paperEntity`;
CREATE TABLE `paperEntity`
(
`id` bigint NOT NULL COMMENT 'id',
`paper_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '试卷名称',
`paper_total_score` decimal(6, 2) NOT NULL DEFAULT 0.00 COMMENT '试卷总分',
`paper_pass_score` decimal(6, 2) NOT NULL DEFAULT 0.00 COMMENT '合格分数',
`exam_time` int NULL COMMENT '考试时长(分钟)',
`status` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '试卷试卷状态 normal 正常',
`delete_enum` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '删除标识true false',
`remarks` varchar(255) 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 '创建人姓名',
`update_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人姓名',
`tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id',
`version` int NULL DEFAULT NULL COMMENT '版本',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`create_id` bigint NULL DEFAULT NULL COMMENT '创建人id',
`update_id` bigint NULL DEFAULT NULL COMMENT '修改人id',
`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;
-- ----------------------------
-- Table structure for paper_question_rel
-- ----------------------------
DROP TABLE IF EXISTS `paper_question_rel`;
CREATE TABLE `paper_question_rel`
(
`id` bigint NOT NULL COMMENT 'id',
`paper_id` bigint NOT NULL COMMENT '试卷id',
`question_id` bigint NOT NULL COMMENT '试题id',
`score` decimal(5, 1) NOT NULL DEFAULT 0.0 COMMENT '分值',
`delete_enum` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '删除标识true false',
`remarks` varchar(255) 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 '创建人姓名',
`update_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人姓名',
`tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id',
`version` int NULL DEFAULT NULL COMMENT '版本',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`create_id` bigint NULL DEFAULT NULL COMMENT '创建人id',
`update_id` bigint NULL DEFAULT NULL COMMENT '修改人id',
`env` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '环境',
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;
-- ----------------------------
-- Table structure for questionDO
-- ----------------------------
DROP TABLE IF EXISTS `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 '题目内容',
`question_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'single' COMMENT '题型single单选/multiple多选/judge判断/fill填空/short简答',
`answer` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '参考答案:逗号隔开',
`answer_question_option_ids` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '答案选项id 多个逗号隔开',
`score` decimal(5, 2) NOT NULL DEFAULT 0.00 COMMENT '分值',
`analysis` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '答案解析',
`tag_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '标签类型',
`courseware_management_id` bigint NULL DEFAULT NULL COMMENT '关联课件管理id',
`delete_enum` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '删除标识true false',
`remarks` varchar(255) 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 '创建人姓名',
`update_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人姓名',
`tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id',
`version` int NULL DEFAULT NULL COMMENT '版本',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`create_id` bigint NULL DEFAULT NULL COMMENT '创建人id',
`update_id` bigint NULL DEFAULT NULL COMMENT '修改人id',
`env` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '环境',
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;
-- ----------------------------
-- Table structure for question_option
-- ----------------------------
DROP TABLE IF EXISTS `question_option`;
CREATE TABLE `question_option`
(
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '选项ID',
`question_id` bigint UNSIGNED NOT NULL COMMENT '所属试题ID',
`option_key` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '选项标识A,B,C,D,E,F',
`option_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '选项标志名称',
`option_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '选项内容',
`is_correct` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否正确答案1是0否',
`sort_order` int NOT NULL DEFAULT 0 COMMENT '选项显示顺序',
`delete_enum` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '删除标识true false',
`remarks` varchar(255) 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 '创建人姓名',
`update_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人姓名',
`tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id',
`version` int NULL DEFAULT NULL COMMENT '版本',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`create_id` bigint NULL DEFAULT NULL COMMENT '创建人id',
`update_id` bigint NULL DEFAULT NULL COMMENT '修改人id',
`env` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '环境',
PRIMARY KEY (`id`) USING BTREE,
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;
SET
FOREIGN_KEY_CHECKS = 1;
create table course_management
(
delete_enum varchar(32) charset utf8mb4 null comment '删除标识true false',
remarks varchar(255) charset utf8mb4 null comment '备注',
create_name varchar(50) charset utf8mb4 null comment '创建人姓名',
update_name varchar(50) charset utf8mb4 null comment '更新人姓名',
tenant_id bigint null comment '租户id',
version int null comment '版本',
create_time datetime null comment '创建时间',
update_time datetime null comment '修改时间',
create_id bigint null comment '创建人id',
update_id bigint null comment '修改人id',
env varchar(50) charset utf8mb4 null comment '环境',
id bigint not null comment '主键'
primary key,
course_name varchar(200) null comment '课程名称',
training_type varchar(100) null comment '培训类型',
course_description varchar(512) null comment '课称描述',
course_cover varchar(255) null comment '课程封面',
class_hour_duration decimal(5, 1) unsigned default 0.0 null comment '课时时长(小时)',
upload_unit varchar(200) null comment '上传单位',
status int default 0 null comment '状态1启用/0禁用',
used int default 0 null comment '是否已被使用0-未使用1-已使用)'
) comment '课程管理';
create table course_rel_courseware
(
id bigint not null comment '主键'
primary key,
courseware_name varchar(200) null comment '课件名称',
courseware_document varchar(512) null comment '课件文档(文件名或路径)',
courseware_id bigint null comment '课件id',
course_id bigint null comment '课程id',
sort int null comment '排序',
class_hour_duration_unit varchar(10) default '小时' null comment '课时时长单位',
credit_hours decimal(5, 1) unsigned default 0.0 null comment '学时'
)
comment '课程关联课件表';
create table courseware_management
(
delete_enum varchar(32) charset utf8mb4 null comment '删除标识true false',
remarks varchar(255) charset utf8mb4 null comment '备注',
create_name varchar(50) charset utf8mb4 null comment '创建人姓名',
update_name varchar(50) charset utf8mb4 null comment '更新人姓名',
tenant_id bigint null comment '租户id',
version int null comment '版本',
create_time datetime null comment '创建时间',
update_time datetime null comment '修改时间',
create_id bigint null comment '创建人id',
update_id bigint null comment '修改人id',
env varchar(50) charset utf8mb4 null comment '环境',
id bigint not null comment '主键'
primary key,
courseware_name varchar(200) null comment '课件名称',
training_type varchar(100) null comment '培训类型',
lecturer_name varchar(100) 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 '课时时长(小时)',
upload_unit varchar(200) null comment '上传单位',
status int default 0 null comment '状态1启用/0禁用',
courseware_type int null comment '课件类型1视频课件/2文档课件',
courseware_document varchar(512) null comment '课件文档(文件名或路径)',
courseware_description varchar(512) null comment '课件描述'
) comment '课件表';