feat: 🎸 作业列表
This commit is contained in:
parent
b8e649c13c
commit
40aa49a5ba
@ -218,28 +218,17 @@ public class AiolHomeworkController extends JeecgController<AiolHomework, IAiolH
|
||||
return Result.OK(aiolHomeworkService.listByCourseId(courseId));
|
||||
}
|
||||
|
||||
@AutoLog(value = "作业-教师作业列表")
|
||||
@Operation(summary = "查询教师作业列表", description = "查询当前登录教师创建的作业列表")
|
||||
@AutoLog(value = "作业-教师端查询作业列表")
|
||||
@Operation(summary = "查询课程作业列表", description = "查询当前登录教师创建的作业列表")
|
||||
@GetMapping(value = "/teacher_list")
|
||||
public Result<List<AiolHomework>> teacherList(HttpServletRequest request) {
|
||||
public Result<List<AiolHomework>> teacherList(@RequestParam(value = "courseId") String courseId, HttpServletRequest request) {
|
||||
try {
|
||||
// 1. 获取当前登录用户信息
|
||||
String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
|
||||
String username = JwtUtil.getUsername(token);
|
||||
LoginUser sysUser = sysBaseApi.getUserByName(username);
|
||||
|
||||
if (sysUser == null) {
|
||||
return Result.error("用户未登录或登录已过期");
|
||||
}
|
||||
|
||||
// 2. 查询当前用户创建的作业列表
|
||||
QueryWrapper<AiolHomework> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("create_by", sysUser.getUsername())
|
||||
queryWrapper.eq("course_id", courseId)
|
||||
.orderByDesc("create_time");
|
||||
|
||||
List<AiolHomework> homeworkList = aiolHomeworkService.list(queryWrapper);
|
||||
|
||||
log.info("查询教师作业列表成功: teacherId={}, 作业数量={}", sysUser.getId(), homeworkList.size());
|
||||
return Result.OK(homeworkList);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
@ -15,9 +15,6 @@ public class AiolHomeworkSaveDTO extends AiolHomework {
|
||||
@Schema(description = "班级ID,多个用逗号分割")
|
||||
private String classId;
|
||||
|
||||
@Schema(description = "课程ID")
|
||||
private String courseId;
|
||||
|
||||
@Schema(description = "章节ID")
|
||||
private String sectionId;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
|
||||
/**
|
||||
* @Description: 作业
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-19
|
||||
* @Date: 2025-09-20
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@ -37,6 +37,10 @@ public class AiolHomework implements Serializable {
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private java.lang.String id;
|
||||
/**所属课程id*/
|
||||
@Excel(name = "所属课程id", width = 15)
|
||||
@Schema(description = "所属课程id")
|
||||
private java.lang.String courseId;
|
||||
/**标题*/
|
||||
@Excel(name = "标题", width = 15)
|
||||
@Schema(description = "标题")
|
||||
|
@ -5,6 +5,11 @@ import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '所属课程id',
|
||||
align:"center",
|
||||
dataIndex: 'courseId'
|
||||
},
|
||||
{
|
||||
title: '标题',
|
||||
align:"center",
|
||||
@ -66,6 +71,11 @@ export const searchFormSchema: FormSchema[] = [
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '所属课程id',
|
||||
field: 'courseId',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '标题',
|
||||
field: 'title',
|
||||
@ -150,17 +160,18 @@ export const formSchema: FormSchema[] = [
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
title: {title: '标题',order: 0,view: 'text', type: 'string',},
|
||||
description: {title: '说明',order: 1,view: 'umeditor', type: 'string',},
|
||||
attachment: {title: '附件',order: 2,view: 'file', type: 'string',},
|
||||
maxScore: {title: '满分',order: 3,view: 'number', type: 'number',},
|
||||
passScore: {title: '及格分数',order: 4,view: 'number', type: 'number',},
|
||||
startTime: {title: '开始时间',order: 5,view: 'datetime', type: 'string',},
|
||||
endTime: {title: '结束时间',order: 6,view: 'datetime', type: 'string',},
|
||||
status: {title: '状态',order: 7,view: 'number', type: 'number',dictCode: 'course_status',},
|
||||
allowMakeup: {title: '是否允许补交',order: 8,view: 'number', type: 'number',},
|
||||
makeupTime: {title: '补交截止时间',order: 9,view: 'datetime', type: 'string',},
|
||||
notifyTime: {title: '作业通知时间',order: 10,view: 'number', type: 'number',},
|
||||
courseId: {title: '所属课程id',order: 0,view: 'text', type: 'string',},
|
||||
title: {title: '标题',order: 1,view: 'text', type: 'string',},
|
||||
description: {title: '说明',order: 2,view: 'umeditor', type: 'string',},
|
||||
attachment: {title: '附件',order: 3,view: 'file', type: 'string',},
|
||||
maxScore: {title: '满分',order: 4,view: 'number', type: 'number',},
|
||||
passScore: {title: '及格分数',order: 5,view: 'number', type: 'number',},
|
||||
startTime: {title: '开始时间',order: 6,view: 'datetime', type: 'string',},
|
||||
endTime: {title: '结束时间',order: 7,view: 'datetime', type: 'string',},
|
||||
status: {title: '状态',order: 8,view: 'number', type: 'number',dictCode: 'course_status',},
|
||||
allowMakeup: {title: '是否允许补交',order: 9,view: 'number', type: 'number',},
|
||||
makeupTime: {title: '补交截止时间',order: 10,view: 'datetime', type: 'string',},
|
||||
notifyTime: {title: '作业通知时间',order: 11,view: 'number', type: 'number',},
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user