| 项目 | 信息 |
|---|---|
| 项目名称 | 校园管理系统 - 学生信息批次收集 |
| API模块 | 学生信息批次收集管理 |
| 文档版本 | V1.0.0 |
| 创建时间 | 2025-01-27 |
| 基础路径 | /studentMsgBatch/studentMsgBatch |
学生信息批次收集系统提供学生信息收集、查询、历史记录管理等API接口,支持学生提交个人信息、管理员查询和审核学生信息等功能。
{
"id": 1, // 主键ID(雪花ID)
"deleted": 0, // 删除标志(0存在 1删除)
"studentNo": "2025001", // 学号
"idCard": "110101199901011234", // 身份证号
"name": "张三", // 姓名
"nameEnglish": "Zhang San", // 英文姓名
"formerName": "", // 曾用名
"gender": "0", // 性别(0-男,1-女)
"birthDate": "1999-01-01", // 出生日期
"nationality": "汉族", // 民族
"nativePlace": "北京市", // 籍贯
"politicalStatus": "团员", // 政治面貌
"hukouLocation": "北京市海淀区", // 户籍所在地
"homeAddress": "北京市海淀区中关村南大街1号", // 家庭地址
"currentAddress": "北京市海淀区学院路8号", // 现住址
"postalCode": "100081", // 邮政编码
"photoUrl": "http://example.com/photo.jpg", // 照片URL
"photoPath": "/upload/photo/2025/01/photo.jpg", // 照片存储路径
"phone": "13800138000", // 手机号码
"isBoarder": 1, // 是否住校(0-否,1-是)
"educationLevel": "本科", // 文化程度
"householdRegisterType": "城镇", // 户口类型
"religion": "无", // 宗教信仰
"sourceRegion": "北京市", // 生源地区
"graduateSchool": "北京市第一中学", // 毕业院校
"email": "zhangsan@example.com", // 电子邮箱
"qq": "123456789", // QQ号码
"wechat": "zhangsan_wx", // 微信号
"maritalStatus": "1", // 婚姻状况(1未婚 2已婚 3离异 4丧偶)
"emergencyContactName": "张父亲", // 紧急联系人姓名
"emergencyContactPhone": "13900139000", // 紧急联系人电话
"emergencyContactRelation": "父亲", // 紧急联系人关系
"isPoorStudent": 0, // 是否贫困生(0-否,1-是)
"isMinority": 0, // 是否少数民族(0-否,1-是)
"isDisabled": 0, // 是否残疾(0-否,1-是)
"isOrphan": 0, // 是否孤儿(0-否,1-是)
"isLeftBehindChild": 0, // 是否留守儿童(0-否,1-是)
"isSingleChild": 1, // 是否独生子女(0-否,1-是)
"isLowIncome": 0, // 是否低保(0-否,1-是)
"hasLoan": 0, // 是否有助学贷款(0-否,1-是)
"loanAmount": 0.0, // 助学贷款金额
"specialties": "篮球、编程", // 特长爱好
"awards": "三好学生", // 获奖情况
"violations": "", // 违纪记录
"socialActivities": "志愿服务活动", // 社会活动
"fatherName": "张父亲", // 父亲姓名
"fatherPhone": "13900139001", // 父亲电话
"fatherWorkUnit": "北京某公司", // 父亲工作单位
"motherName": "张母亲", // 母亲姓名
"motherPhone": "13900139002", // 母亲电话
"motherWorkUnit": "北京某事业单位", // 母亲工作单位
"guardianName": "张父亲", // 监护人姓名
"guardianPhone": "13900139001", // 监护人电话
"guardianRelation": "父亲", // 监护人关系
"familyIncome": 100000.0, // 家庭年收入
"perCapitaIncome": 33333.33, // 人均收入
"incomeSource": "工资收入", // 收入来源
"familyEconomicStatus": "一般", // 家庭经济状况
"familyMembers": 3, // 家庭成员数量
"height": 175.5, // 身高(cm)
"weight": 65.0, // 体重(kg)
"bloodType": "A", // 血型
"healthStatus": "健康", // 健康状况
"specialCondition": "", // 特殊体质或疾病
"medicalHistory": "", // 病史
"allergies": "", // 过敏史
"disabilityType": "", // 残疾类型
"disabilityLevel": "", // 残疾等级
"admissionCategory": "统招", // 录取类别
"studentStatus": "1", // 学籍状态(1在籍 2休学 3复学 4退学 5毕业)
"enrollmentYear": 2025, // 入学年份
"enrollmentDate": "2025-09-01", // 入学日期
"bankCardNo": "6222081234567890123", // 银行卡号
"bankName": "中国工商银行", // 开户银行
"bankBranch": "北京中关村支行", // 开户支行
"cardHolderName": "张三", // 持卡人姓名
"infoStatus": "3", // 信息状态(1正常 2待审核 3审核中 4已驳回 5已锁定)
"dataSource": "manual", // 数据来源(manual手工录入 import批量导入 sync系统同步)
"lastBatchId": 1, // 最后修改批次ID
"lastAuditTime": "2025-01-27 10:00:00", // 最后审核时间
"isComplete": 1, // 信息是否完整(0不完整 1完整)
"completionRate": 95.5, // 完整度百分比
"schoolSystem": 4, // 学制(年)
"academicLevel": "本科", // 学历层次
"trainingType": "全日制", // 培养方式
"majorId": "10001", // 专业ID
"majorName": "计算机科学与技术", // 专业名称
"classId": "20250101", // 班级ID
"className": "计算机2025-1班", // 班级名称
"grade": "2025", // 年级
"collegeId": "1001", // 学院ID
"collegeName": "计算机学院", // 学院名称
"counselorId": 1001, // 辅导员ID
"counselorName": "李辅导员", // 辅导员姓名
"classTeacherId": 1002, // 班主任ID
"classTeacherName": "王老师", // 班主任姓名
"dormitoryBuilding": "1号楼", // 宿舍楼栋
"dormitoryRoom": "101", // 宿舍房间号
"extField1": "", // 扩展字段1
"extField2": "", // 扩展字段2
"extField3": "", // 扩展字段3
"extField4": "", // 扩展字段4
"extField5": "", // 扩展字段5
"remark": "备注信息", // 备注信息
"batchId": 1, // 正在进行中的批次ID
"createBy": 1, // 创建者
"createTime": "2025-01-27 10:00:00", // 创建时间
"updateBy": 1, // 更新者
"updateTime": "2025-01-27 10:00:00" // 更新时间
}
/studentMsgBatch/studentMsgBatch/liststudentMsgBatch:studentMsgBatch:list| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| pageNum | Integer | 否 | 页码,默认1 |
| pageSize | Integer | 否 | 每页条数,默认10 |
| batchId | Long | 否 | 批次ID |
| studentNo | String | 否 | 学号 |
| name | String | 否 | 姓名(模糊查询) |
| phone | String | 否 | 手机号码 |
| infoStatus | String | 否 | 信息状态 |
| classId | String | 否 | 班级ID |
{
"code": 200,
"msg": "操作成功",
"rows": [
{
"id": 1,
"studentNo": "2025001",
"name": "张三",
"phone": "13800138000",
"infoStatus": "3",
"className": "计算机2025-1班",
"createTime": "2025-01-27 10:00:00"
}
],
"total": 100
}
📌 排序说明:分页列表默认按照学号
studentNo降序排序;若学号相同,则继续按照createTime降序排列,确保最新学号优先展示。
/studentMsgBatch/studentMsgBatch/exportstudentMsgBatch:studentMsgBatch:export同查询列表接口,用于筛选导出数据。
返回Excel文件流。
/studentMsgBatch/studentMsgBatch/{id}studentMsgBatch:studentMsgBatch:query| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | Long | 是 | 主键ID |
{
"code": 200,
"msg": "操作成功",
"data": {
"id": 1,
"studentNo": "2025001",
"name": "张三",
// ... 完整的学生信息字段
}
}
/studentMsgBatch/studentMsgBatchstudentMsgBatch:studentMsgBatch:add{
"studentNo": "2025001",
"name": "张三",
"gender": "0",
"phone": "13800138000",
"batchId": 1
// ... 其他学生信息字段
}
{
"code": 200,
"msg": "操作成功"
}
/studentMsgBatch/studentMsgBatchstudentMsgBatch:studentMsgBatch:edit{
"id": 1,
"studentNo": "2025001",
"name": "张三",
"gender": "0",
"phone": "13800138000",
"batchId": 1
// ... 其他学生信息字段
}
{
"code": 200,
"msg": "操作成功"
}
/studentMsgBatch/studentMsgBatch/{ids}studentMsgBatch:studentMsgBatch:remove| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| ids | Long[] | 是 | 主键ID数组 |
{
"code": 200,
"msg": "操作成功"
}
/studentMsgBatch/studentMsgBatch/history/{batchId}studentMsgBatch:studentMsgBatch:query| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| batchId | Long | 是 | 批次ID |
{
"code": 200,
"msg": "操作成功",
"data": {
"historyMsg": [
{
"id": 1,
"name": "张三",
"createTime": "2025-01-27 10:00:00",
"createBy": 1,
"createByName": "张三",
"infoStatus": "3",
"remark": "信息已提交"
}
],
"currentMsg": [
{
"id": 1,
"studentNo": "2025001",
"name": "张三",
// ... 完整的当前信息
}
]
}
}
/studentMsgBatch/studentMsgBatch/userHistoryData/{batchId}studentMsgBatch:studentMsgBatch:query| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| batchId | Long | 是 | 批次ID |
{
"code": 200,
"msg": "操作成功",
"data": {
"id": 1,
"studentNo": "2025001",
"name": "张三",
// ... 完整的学生信息字段
}
}
/studentMsgBatch/studentMsgBatch/submitStudentMsgstudentMsgBatch:studentMsgBatch:add{
"id": 1,
"studentNo": "2025001",
"name": "张三",
"gender": "0",
"phone": "13800138000",
"batchId": 1
// ... 其他学生信息字段
}
{
"code": 200,
"msg": "操作成功"
}
/studentMsgBatch/studentMsgBatch/rejectStudentMsgstudentMsgBatch:studentMsgBatch:edit| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| batchId | Long | 是 | 批次ID |
| userId | Long | 是 | 用户ID(学生ID) |
| remark | String | 是 | 驳回原因 |
{
"code": 200,
"msg": "操作成功"
}
更新 xg_student_msg_batch 表中符合条件的记录:
batch_id = #{batchId} AND id = #{userId} AND deleted = 0remark = #{remark} (驳回原因)info_status = '4' (驳回状态)update_by = #{currentUserId} (当前登录人ID)update_time = NOW() (当前时间)记录操作日志,便于审计追踪
// 驳回学生信息提交
fetch('/studentMsgBatch/studentMsgBatch/rejectStudentMsg', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: 'batchId=123&userId=456&remark=信息填写不完整,请重新提交'
})
.then(response => response.json())
.then(data => {
if (data.code === 200) {
console.log('驳回成功');
}
});
| 状态值 | 状态名称 | 说明 |
|---|---|---|
| 1 | 待填写 | 学生尚未开始填写信息 |
| 2 | 填写中 | 学生正在填写信息 |
| 3 | 已提交 | 学生已提交信息,等待审核 |
| 4 | 审核不通过 | 管理员驳回,学生需要重新填写 |
| 5 | 审核通过 | 管理员审核通过 |
/studentMsgBatch/studentMsgBatch/listByDeptstudentMsgBatch:studentMsgBatch:query| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| batchId | Long | 是 | 批次ID |
| deptId | Long | 是 | 部门ID |
| name | String | 否 | 学生姓名(模糊查询) |
| studentNo | String | 否 | 学号(精确查询) |
| phone | String | 否 | 手机号码(精确查询) |
| infoStatus | String | 否 | 信息状态 |
| pageNum | Integer | 否 | 页码,默认1 |
| pageSize | Integer | 否 | 每页条数,默认10 |
{
"code": 200,
"msg": "操作成功",
"rows": [
{
"id": 1,
"studentNo": "2025001",
"name": "张三",
"phone": "13800138000",
"infoStatus": "3",
"className": "计算机2025-1班",
"collegeName": "计算机学院",
"createTime": "2025-01-27 10:00:00"
}
],
"total": 50
}
deptId 在 sys_dept 表中查询该部门及其所有子部门的ID列表xg_student_msg_batch 表中查询:
batch_id = 入参的batchIddeleted = 0class_id IN 部门ID列表(班级ID等于部门ID)// 查询部门ID为101下的所有学生数据
fetch('/studentMsgBatch/studentMsgBatch/listByDept?batchId=1&deptId=101&pageNum=1&pageSize=10')
.then(response => response.json())
.then(data => {
console.log('查询结果:', data);
});
/studentMsgBatch/studentMsgBatch/compareStudentMsgstudentMsgBatch:studentMsgBatch:query| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| batchId | Long | 是 | 批次ID |
| userId | Long | 是 | 用户ID(学生ID) |
{
"code": 200,
"msg": "操作成功",
"data": {
"hasOriginalData": true,
"hasBatchData": true,
"changedFields": [
{
"fieldLabel": "姓名",
"fieldName": "name",
"originalValue": "张三",
"newValue": "张三丰"
},
{
"fieldLabel": "手机号码",
"fieldName": "phone",
"originalValue": "13800138000",
"newValue": "13900139000"
},
{
"fieldLabel": "家庭地址",
"fieldName": "homeAddress",
"originalValue": "北京市海淀区中关村南大街1号",
"newValue": "北京市朝阳区建国门外大街1号"
}
],
"totalChanges": 3,
"originalData": {...},
"batchData": {...}
}
}
| 字段名 | 类型 | 说明 |
|---|---|---|
| hasOriginalData | Boolean | 是否找到原始学生信息 |
| hasBatchData | Boolean | 是否找到批次提交信息 |
| changedFields | Array | 变更字段列表 |
| totalChanges | Integer | 变更字段总数 |
| originalData | Object | 完整的原始数据 |
| batchData | Object | 完整的批次数据 |
| 字段名 | 类型 | 说明 |
|---|---|---|
| fieldLabel | String | 字段中文名称 |
| fieldName | String | 字段英文名称 |
| originalValue | Object | 原始值(可能为null) |
| newValue | Object | 修改后的值(可能为null) |
数据查询:
xg_student_msg 表查询,条件:id = userId AND deleted = 0xg_student_msg_batch 表查询,条件:id = userId AND batch_id = batchId AND deleted = 0字段比较:
异常处理:
hasOriginalData: falsehasBatchData: false// 比较学生ID为1001在批次ID为1中的信息变更
fetch('/studentMsgBatch/studentMsgBatch/compareStudentMsg?batchId=1&userId=1001')
.then(response => response.json())
.then(data => {
console.log('变更详情:', data);
if (data.data.totalChanges > 0) {
console.log('共有', data.data.totalChanges, '个字段发生变更');
data.data.changedFields.forEach(change => {
console.log(`${change.fieldLabel}: ${change.originalValue} → ${change.newValue}`);
});
} else {
console.log('没有字段变更');
}
});
import { request } from '@/utils/request';
// 查询学生信息列表
export function getStudentMsgBatchList(params: any) {
return request({
url: '/studentMsgBatch/studentMsgBatch/list',
method: 'get',
params
});
}
// 根据部门查询学生信息
export function getStudentMsgBatchByDept(params: any) {
return request({
url: '/studentMsgBatch/studentMsgBatch/listByDept',
method: 'get',
params
});
}
// 获取学生详细信息
export function getStudentMsgBatchDetail(id: number) {
return request({
url: `/studentMsgBatch/studentMsgBatch/${id}`,
method: 'get'
});
}
// 学生提交信息
export function submitStudentMsg(data: any) {
return request({
url: '/studentMsgBatch/studentMsgBatch/submitStudentMsg',
method: 'post',
data
});
}
@Test
public void testQueryByDeptId() {
// 测试根据部门ID查询学生数据
PageQuery pageQuery = new PageQuery();
pageQuery.setPageNum(1);
pageQuery.setPageSize(10);
TableDataInfo<XgStudentMsgBatchVo> result =
xgStudentMsgBatchService.queryPageListByDeptId(
1L, // batchId
101L, // deptId
"张", // name
null, // studentNo
null, // phone
"3", // infoStatus
pageQuery // pageQuery
);
Assert.assertNotNull(result);
Assert.assertTrue(result.getTotal() >= 0);
}
listByDept 根据部门ID查询学生数据接口auditDialog.vue)中集成学生信息完善弹窗(stuMsgDialog.vue)compareStudentMsg 学生信息变更详情比较接口文件路径: web/src/views/stuMsgAudit/auditDialog.vue
<!-- 审核按钮点击触发 -->
<el-button link type="primary" icon="View" @click="handleAuditStudent(scope.row)">
审核
</el-button>
<!-- 学生信息详情弹窗 -->
<component
:is="StuMsgDialogComponent"
:visible="stuMsgDialogVisible"
:title="stuMsgDialogTitle"
:batchInfo="stuMsgBatchInfo"
@update:visible="stuMsgDialogVisible = $event"
@confirm="handleStuMsgConfirm"
v-if="StuMsgDialogComponent"
/>
const handleAuditStudent = (row: StudentAuditInfo) => {
// 构建传递给学生信息弹窗的批次信息
stuMsgBatchInfo.value = {
batchId: props.batchInfo?.id, // 批次ID
userId: row.id, // 学生用户ID
...props.batchInfo // 其他批次信息
};
stuMsgDialogTitle.value = `学生信息审核 - ${row.name}`;
stuMsgDialogVisible.value = true;
};
defineAsyncComponent 动态加载组件const StuMsgDialogComponent = defineAsyncComponent(() => import('./stuMsgDialog.vue'));
操作流程:
数据传递:
batchIduserId用户体验:
这次优化显著提升了审核功能的实用性和用户体验,从简单的审核操作升级为完整的学生信息管理功能。