| 项目 | 信息 |
|---|---|
| 模块名称 | 班级干部信息管理 |
| 模块代码 | ruoyi-xg |
| 基础路径 | /xgClassPosMsg/xgClassPosMsg |
| 权限前缀 | xgClassPosMsg:xgClassPosMsg |
| 版本 | V1.0.0 |
| 创建时间 | 2025-01-27 |
| 更新时间 | 2025-01-27 |
班级干部信息管理模块提供完整的班级干部信息管理功能,包括班级干部的任命、任期管理、状态跟踪等全生命周期管理,以及用户角色关联功能。
{
"id": 1, // 主键ID(雪花ID)
"deleted": 0, // 删除标志(0代表存在 1代表删除)
"classId": 101, // 班级ID,关联xg_class_msg.id
"className": "计算机2023-1班", // 班级名称(联表查询获取)
"studentId": 1001, // 学生ID,关联xg_student_msg.id
"studentNo": "2023001", // 学号
"studentName": "张三", // 学生姓名(冗余字段)
"positionCode": "monitor", // 职务编码,关联xg_class_pos_dict.position_code
"positionName": "班长", // 职务名称(联表查询获取)
"appointmentDate": "2024-09-01", // 任职日期
"termStartDate": "2024-09-01", // 任期开始日期
"termEndDate": "2025-07-01", // 任期结束日期
"termDuration": 10, // 任期时长(月)
"isCurrent": 1, // 是否现任:0-否,1-是
"cadreStatus": "1", // 学生职务任职状态:1-在任,2-到期,3-辞职,4-免职,5-调任,6-休学
"appointmentReason": "综合表现优秀", // 任命原因
"appointmentMethod": "appointment", // 学生职务任命方式:appointment-任命,election-选举,recommendation-推荐
"dismissalDate": null, // 离任日期
"dismissalReason": null, // 离任原因
"remark": "备注信息", // 备注信息
"createBy": 1, // 创建者
"createTime": "2024-09-01 10:00:00", // 创建时间
"updateBy": 1, // 更新者
"updateTime": "2024-09-01 10:00:00" // 更新时间
}
/xgClassPosMsg/xgClassPosMsg/listxgClassPosMsg:xgClassPosMsg:list请求参数: | 参数名 | 类型 | 必填 | 说明 | |--------|------|------|------| | pageNum | integer | 否 | 页码,默认1 | | pageSize | integer | 否 | 每页大小,默认10 | | deptId | long | 否 | 部门ID,用于按部门查询班级干部信息 | | classId | long | 否 | 班级ID | | studentId | long | 否 | 学生ID | | studentNo | string | 否 | 学号(模糊查询) | | studentName | string | 否 | 学生姓名(模糊查询) | | positionCode | string | 否 | 职务编码 | | appointmentDate | string | 否 | 任职日期 | | termStartDate | string | 否 | 任期开始日期 | | termEndDate | string | 否 | 任期结束日期 | | termDuration | integer | 否 | 任期时长(月) | | isCurrent | integer | 否 | 是否现任:0-否,1-是 | | cadreStatus | string | 否 | 学生职务任职状态 | | appointmentReason | string | 否 | 任命原因 | | appointmentMethod | string | 否 | 学生职务任命方式 | | dismissalDate | string | 否 | 离任日期 | | dismissalReason | string | 否 | 离任原因 |
响应数据:
{
"code": 200,
"msg": "查询成功",
"rows": [
{
"id": 1,
"classId": 101,
"className": "计算机2023-1班",
"studentId": 1001,
"studentNo": "2023001",
"studentName": "张三",
"positionCode": "monitor",
"positionName": "班长",
"appointmentDate": "2024-09-01",
"termStartDate": "2024-09-01",
"termEndDate": "2025-07-01",
"termDuration": 10,
"isCurrent": 1,
"cadreStatus": "1",
"appointmentReason": "综合表现优秀",
"appointmentMethod": "appointment",
"createTime": "2024-09-01 10:00:00"
}
],
"total": 1
}
/xgClassPosMsg/xgClassPosMsg/{id}xgClassPosMsg:xgClassPosMsg:query请求参数: | 参数名 | 类型 | 必填 | 说明 | |--------|------|------|------| | id | long | 是 | 主键ID |
响应数据:
{
"code": 200,
"msg": "查询成功",
"data": {
"id": 1,
"classId": 101,
"className": "计算机2023-1班",
"studentId": 1001,
"studentNo": "2023001",
"studentName": "张三",
"positionCode": "monitor",
"positionName": "班长",
"appointmentDate": "2024-09-01",
"termStartDate": "2024-09-01",
"termEndDate": "2025-07-01",
"termDuration": 10,
"isCurrent": 1,
"cadreStatus": "1",
"appointmentReason": "综合表现优秀",
"appointmentMethod": "appointment",
"dismissalDate": null,
"dismissalReason": null,
"remark": "备注信息",
"createTime": "2024-09-01 10:00:00",
"updateTime": "2024-09-01 10:00:00"
}
}
/xgClassPosMsg/xgClassPosMsgxgClassPosMsg:xgClassPosMsg:add请求参数:
{
"classId": 101,
"studentId": 1001,
"studentNo": "2023001",
"studentName": "张三",
"positionCode": "monitor",
"appointmentDate": "2024-09-01",
"termStartDate": "2024-09-01",
"termEndDate": "2025-07-01",
"termDuration": 10,
"isCurrent": 1,
"cadreStatus": "1",
"appointmentReason": "综合表现优秀",
"appointmentMethod": "appointment",
"remark": "备注信息"
}
响应数据:
{
"code": 200,
"msg": "新增成功"
}
重要说明:
sys_user_role 表插入一条数据user_id = 当前记录的 studentIdrole_id = 当前记录的 id(班级干部信息ID)/xgClassPosMsg/xgClassPosMsgxgClassPosMsg:xgClassPosMsg:edit请求参数:
{
"id": 1,
"classId": 101,
"studentId": 1001,
"studentNo": "2023001",
"studentName": "张三",
"positionCode": "monitor",
"appointmentDate": "2024-09-01",
"termStartDate": "2024-09-01",
"termEndDate": "2025-07-01",
"termDuration": 10,
"isCurrent": 1,
"cadreStatus": "1",
"appointmentReason": "综合表现优秀",
"appointmentMethod": "appointment",
"remark": "修改后的备注信息"
}
响应数据:
{
"code": 200,
"msg": "修改成功"
}
/xgClassPosMsg/xgClassPosMsg/{ids}xgClassPosMsg:xgClassPosMsg:remove请求参数: | 参数名 | 类型 | 必填 | 说明 | |--------|------|------|------| | ids | string | 是 | 主键ID,多个用逗号分隔 |
响应数据:
{
"code": 200,
"msg": "删除成功"
}
重要说明:
sys_user_role 表中对应的角色关联/xgClassPosMsg/xgClassPosMsg/exportxgClassPosMsg:xgClassPosMsg:export请求参数: 同列表查询参数
响应数据: Excel文件下载
班级干部信息管理模块集成了用户角色关联功能,确保班级干部信息与系统权限管理的一致性。
新增关联: 新增班级干部信息时,自动建立用户角色关联
sys_user_role.user_id = xg_class_pos_msg.student_idsys_user_role.role_id = xg_class_pos_msg.id删除关联: 删除班级干部信息时,自动删除对应的用户角色关联
role_id 删除 sys_user_role 表中的记录@Transactional(rollbackFor = Exception.class) 确保数据一致性| 编码 | 名称 | 说明 |
|---|---|---|
| 1 | 在任 | 正常任职状态 |
| 2 | 到期 | 任期已结束 |
| 3 | 辞职 | 主动辞职 |
| 4 | 免职 | 被免职 |
| 5 | 调任 | 调任其他职务 |
| 6 | 休学 | 因休学暂停职务 |
| 编码 | 名称 | 说明 |
|---|---|---|
| appointment | 任命 | 直接任命 |
| election | 选举 | 通过选举产生 |
| recommendation | 推荐 | 通过推荐产生 |
| 编码 | 名称 | 说明 |
|---|---|---|
| 0 | 否 | 非现任职务 |
| 1 | 是 | 现任职务 |
| 权限标识 | 权限名称 | 说明 |
|---|---|---|
| xgClassPosMsg:xgClassPosMsg:list | 班级干部信息列表 | 查看班级干部信息列表 |
| xgClassPosMsg:xgClassPosMsg:query | 班级干部信息查询 | 查询班级干部信息详情 |
| xgClassPosMsg:xgClassPosMsg:add | 班级干部信息新增 | 新增班级干部信息 |
| xgClassPosMsg:xgClassPosMsg:edit | 班级干部信息修改 | 修改班级干部信息 |
| xgClassPosMsg:xgClassPosMsg:remove | 班级干部信息删除 | 删除班级干部信息 |
| xgClassPosMsg:xgClassPosMsg:export | 班级干部信息导出 | 导出班级干部信息 |
deptId 参数控制数据权限范围| 错误码 | 错误信息 | 说明 |
|---|---|---|
| 40001 | 学生不存在 | 指定的学生ID不存在 |
| 40002 | 班级不存在 | 指定的班级ID不存在 |
| 40003 | 职务不存在 | 指定的职务编码不存在 |
| 40004 | 学生已担任该职务 | 学生已经担任该职务 |
| 40005 | 班级干部记录不存在 | 指定的班级干部记录不存在 |
| 40006 | 操作权限不足 | 当前用户没有操作权限 |
| 40007 | 数据校验失败 | 提交的数据不符合规则 |
| 40008 | 用户角色关联失败 | 用户角色关联操作失败 |
// 查询指定部门的班级干部信息
const response = await api.get('/xgClassPosMsg/xgClassPosMsg/list', {
params: {
deptId: 101,
pageNum: 1,
pageSize: 10
}
});
console.log(response.data);
// 新增班级干部信息
const addData = {
classId: 101,
studentId: 1001,
studentNo: "2023001",
studentName: "张三",
positionCode: "monitor",
appointmentDate: "2024-09-01",
termStartDate: "2024-09-01",
termEndDate: "2025-07-01",
termDuration: 10,
isCurrent: 1,
cadreStatus: "1",
appointmentReason: "综合表现优秀",
appointmentMethod: "appointment"
};
const response = await api.post('/xgClassPosMsg/xgClassPosMsg', addData);
// 删除班级干部信息
const response = await api.delete('/xgClassPosMsg/xgClassPosMsg/1,2,3');
| 版本 | 日期 | 更新内容 |
|---|---|---|
| V1.0.0 | 2025-01-27 | 初始版本,完整的班级干部信息管理API |
| V1.0.1 | 2025-01-27 | 新增用户角色关联功能 |
文档维护: Cursor AI 辅助
最后更新: 2025-01-27
文档状态: 已完成