在高等教育信息化建设不断深入的背景下,毕业设计作为本科培养环节的关键一环,其选题过程的管理效率与公平性直接关系到教学质量。传统依赖纸质表格、邮件往来或简易在线表单的选题方式,普遍存在信息同步滞后、课题资源分配不均、教务管理负荷沉重等问题。针对这一痛点,设计并实现了一套基于SSM(Spring + Spring MVC + MyBatis)架构的毕业设计选题管理平台,旨在通过技术手段实现选题流程的标准化、透明化和自动化。
该平台采用典型的三层架构设计,清晰分离表示层、业务逻辑层和数据持久层。Spring Framework作为核心控制容器,负责管理所有Bean的生命周期与依赖注入,保障了业务组件的高内聚与低耦合。Spring MVC模块承担Web请求的调度与响应,通过精心设计的控制器处理用户交互。数据持久层则选用MyBatis框架,利用其灵活的SQL映射能力,高效操作MySQL数据库。前端界面结合JSP与JavaScript技术,提供动态、交互良好的用户操作体验。项目管理与依赖由Maven统一管理,确保了构建过程的一致性与可重复性。
数据库设计是系统稳定运行的基石,共规划了24张数据表,全面覆盖用户、课题、流程、审核等业务实体。其中,project_selection(选题记录表)的设计尤为关键,它直接关联学生与课题,记录了双向选择的核心数据。
CREATE TABLE `project_selection` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`student_id` int(11) NOT NULL COMMENT '学生ID',
`project_id` int(11) NOT NULL COMMENT '课题ID',
`selection_order` int(11) DEFAULT NULL COMMENT '志愿顺序',
`selection_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '选课时间',
`status` varchar(20) DEFAULT 'pending' COMMENT '状态: pending, approved, rejected',
`teacher_feedback` text COMMENT '教师审核意见',
PRIMARY KEY (`id`),
UNIQUE KEY `unique_student_project` (`student_id`,`project_id`),
KEY `fk_selection_project` (`project_id`),
CONSTRAINT `fk_selection_project` FOREIGN KEY (`project_id`) REFERENCES `project` (`id`),
CONSTRAINT `fk_selection_student` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='课题选择记录表';
该表通过UNIQUE KEY约束确保了同一学生对同一课题的唯一选择,避免了重复提交。status字段使用枚举字符串清晰定义选题流程状态,selection_order字段支持学生填报多个志愿,为后续的智能分配算法留出了扩展空间。外键约束保证了数据的一致性与完整性。
另一核心表project(课题信息表)的结构设计则体现了课题管理的复杂性。
CREATE TABLE `project` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '课题ID',
`title` varchar(200) NOT NULL COMMENT '课题名称',
`description` text COMMENT '课题描述',
`requirement` text COMMENT '能力要求',
`max_student_num` int(11) DEFAULT '1' COMMENT '最大可选学生数',
`selected_num` int(11) DEFAULT '0' COMMENT '已选学生数',
`teacher_id` int(11) NOT NULL COMMENT '指导教师ID',
`status` varchar(20) DEFAULT 'auditing' COMMENT '状态: drafting, auditing, published, closed',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`publish_time` datetime DEFAULT NULL COMMENT '发布时间',
PRIMARY KEY (`id`),
KEY `fk_project_teacher` (`teacher_id`),
CONSTRAINT `fk_project_teacher` FOREIGN KEY (`teacher_id`) REFERENCES `teacher` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='毕业设计课题表';
该表通过max_student_num和selected_num字段实现了课题容量的精确控制。status字段定义了课题从草稿、审核、发布到关闭的全生命周期状态,并通过publish_time记录发布时间,便于流程追踪。
平台的核心业务流程围绕课题的发布、选择与审核展开。教师登录系统后,可进入课题管理界面创建新课题。相应的后端控制器负责处理课题提交请求。
@Controller
@RequestMapping("/teacher/project")
public class TeacherProjectController {
@Autowired
private ProjectService projectService;
@PostMapping("/create")
@ResponseBody
public ResponseEntity<Map<String, Object>> createProject(@RequestBody Project project, HttpSession session) {
Map<String, Object> result = new HashMap<>();
try {
Teacher teacher = (Teacher) session.getAttribute("currentTeacher");
project.setTeacherId(teacher.getId());
project.setStatus("auditing"); // 设置初始状态为待审核
projectService.createProject(project);
result.put("success", true);
result.put("message", "课题提交成功,等待管理员审核");
return ResponseEntity.ok(result);
} catch (Exception e) {
result.put("success", false);
result.put("message", "课题提交失败: " + e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(result);
}
}
}
该方法从会话中获取当前登录的教师信息,自动关联课题与教师,并将课题状态初始化为“审核中”,体现了业务逻辑的严谨性。

课题通过管理员审核并发布后,学生即可在选题界面浏览所有可选课题。系统通过服务层方法获取已发布且未满额的课题列表。
@Service
public class ProjectSelectionServiceImpl implements ProjectSelectionService {
@Autowired
private ProjectMapper projectMapper;
@Override
public List<ProjectVO> getAvailableProjects() {
// 查询状态为已发布,且未达到人数上限的课题
return projectMapper.selectProjectsByCondition("published", null);
}
}
学生选择心仪课题并提交志愿时,系统会调用选择服务进行处理。服务方法内包含了关键的业务校验逻辑。
@Override
public synchronized SelectionResult submitSelection(SelectionCommand command) {
// 校验选题时间是否在开放期内
if (!isSelectionPeriodOpen()) {
return SelectionResult.error("当前不在选题时间内");
}
// 校验学生是否已经选过该课题(防止前端绕过)
ProjectSelection existing = projectSelectionMapper.selectByStudentAndProject(command.getStudentId(), command.getProjectId());
if (existing != null) {
return SelectionResult.error("您已选择过该课题");
}
// 校验课题是否已满额
Project project = projectMapper.selectById(command.getProjectId());
if (project.getSelectedNum() >= project.getMaxStudentNum()) {
return SelectionResult.error("该课题人数已满");
}
// 创建新的选题记录
ProjectSelection newSelection = new ProjectSelection();
newSelection.setStudentId(command.getStudentId());
newSelection.setProjectId(command.getProjectId());
newSelection.setSelectionOrder(command.getOrder());
newSelection.setStatus("pending");
projectSelectionMapper.insert(newSelection);
return SelectionResult.success("选题提交成功,等待教师确认");
}
该方法使用synchronized关键字确保在高并发场景下,课题名额计算的准确性,防止超选。它综合校验了时间、唯一性和容量等多个业务规则,保证了流程的正确性。

学生提交选择后,教师可在管理端查看待确认的学生列表,并进行审核操作。审核功能不仅改变状态,还可能包含反馈意见。
@PostMapping("/review")
@ResponseBody
public ResponseEntity<Map<String, Object>> reviewSelection(@RequestParam Integer selectionId,
@RequestParam String status,
@RequestParam(required = false) String feedback) {
Map<String, Object> result = new HashMap<>();
try {
ProjectSelection selection = projectSelectionService.getById(selectionId);
if (selection == null) {
result.put("success", false);
result.put("message", "选题记录不存在");
return ResponseEntity.badRequest().body(result);
}
// 更新状态和反馈
selection.setStatus(status);
selection.setTeacherFeedback(feedback);
projectSelectionService.updateSelection(selection);
// 如果审核通过,需要更新课题的已选人数
if ("approved".equals(status)) {
projectService.incrementSelectedCount(selection.getProjectId());
}
result.put("success", true);
result.put("message", "审核操作成功");
return ResponseEntity.ok(result);
} catch (Exception e) {
result.put("success", false);
result.put("message", "操作失败: " + e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(result);
}
}

数据模型的设计精准地反映了业务实体及其关系。以Student(学生)实体类为例,其属性定义与数据库表结构保持映射一致,并包含了必要的业务逻辑方法。
public class Student {
private Integer id;
private String studentNumber; // 学号
private String name;
private String majorClass; // 专业班级
private String phone;
private String email;
private Integer userId; // 关联的用户登录ID
// 省略getter和setter方法
/**
* 检查学生信息是否完整可用于选题
*/
public boolean isEligibleForSelection() {
return this.name != null && !this.name.trim().isEmpty() &&
this.majorClass != null && !this.majorClass.trim().isEmpty();
}
}
系统的数据访问层基于MyBatis的Mapper接口实现,通过XML文件配置复杂的SQL查询。例如,查询教师名下所有课题及其选择情况的SQL映射。
<!-- ProjectMapper.xml -->
<mapper namespace="com.graduation.mapper.ProjectMapper">
<resultMap id="ProjectWithSelectionsMap" type="com.graduation.model.vo.ProjectWithSelectionsVO">
<id property="id" column="id"/>
<result property="title" column="title"/>
<result property="maxStudentNum" column="max_student_num"/>
<result property="selectedNum" column="selected_num"/>
<collection property="selections" ofType="com.graduation.model.vo.SelectionDetailVO">
<id property="selectionId" column="selection_id"/>
<result property="studentName" column="student_name"/>
<result property="studentNumber" column="student_number"/>
<result property="status" column="selection_status"/>
<result property="selectionTime" column="selection_time"/>
</collection>
</resultMap>
<select id="selectProjectsWithSelectionsByTeacher" resultMap="ProjectWithSelectionsMap">
SELECT
p.id,
p.title,
p.max_student_num,
p.selected_num,
ps.id as selection_id,
s.name as student_name,
s.student_number,
ps.status as selection_status,
ps.selection_time
FROM project p
LEFT JOIN project_selection ps ON p.id = ps.project_id
LEFT JOIN student s ON ps.student_id = s.id
WHERE p.teacher_id = #{teacherId}
ORDER BY p.id, ps.selection_time DESC
</select>
</mapper>
该查询使用左连接(LEFT JOIN)将课题表、选题记录表和学生表关联起来,一次性获取教师所有课题及其对应的学生选择信息,减少了数据库的访问次数,提升了性能。

展望未来,平台可在以下几个方向进行深化拓展:
- 智能课题推荐功能:基于学生的历史成绩、兴趣标签以及教师课题的研究方向,利用协同过滤或内容推荐算法,为学生生成个性化课题推荐列表。实现上可引入Elasticsearch建立课题索引,通过分析学生行为数据计算相似度。
- 实时消息通知机制:集成WebSocket技术,实现选题状态变更、审核结果、系统公告等信息的实时推送,替代当前依赖页面刷新的被动获取方式,提升用户体验。
- 多轮次与志愿调剂算法:支持多轮选题,并开发更复杂的志愿调剂算法。在第一轮选择结束后,系统可自动为未中选的学生进行第二轮分配,考虑志愿优先级、学生成绩、课题热度等多维度因素,实现更优的资源匹配。
- 全流程文档管理:将开题报告、中期检查、论文提交、答辩材料等文档的上传、版本控制、在线预览与审阅功能深度集成,形成毕业设计全生命周期的数字化管理。
- 数据可视化大屏:为教务管理人员开发数据统计大屏,使用ECharts等图表库动态展示各专业选题比例、课题完成进度、教师指导负荷等关键指标,为管理决策提供数据支持。
该毕业设计选题管理平台通过SSM框架的稳健组合,构建了一个功能完备、逻辑清晰、扩展性强的业务系统。其严谨的数据库设计、分层的代码架构以及细致的业务规则校验,不仅有效解决了传统选题模式的痛点,也为后续的功能演进奠定了坚实的技术基础。随着教育信息化的持续发展,此类平台将在提升高校教学管理效能方面发挥越来越重要的作用。