|
|
@ -1,16 +1,21 @@
|
|
|
|
package com.ibeetl.jlw.web;
|
|
|
|
package com.ibeetl.jlw.web;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.jlw.Interceptor.SCoreUser;
|
|
|
|
import cn.jlw.Interceptor.SCoreUser;
|
|
|
|
import cn.jlw.validate.ValidateConfig;
|
|
|
|
import cn.jlw.validate.ValidateConfig;
|
|
|
|
import com.ibeetl.admin.core.annotation.Function;
|
|
|
|
import com.ibeetl.admin.core.annotation.Function;
|
|
|
|
import com.ibeetl.admin.core.entity.CoreUser;
|
|
|
|
import com.ibeetl.admin.core.entity.CoreUser;
|
|
|
|
import com.ibeetl.admin.core.file.FileService;
|
|
|
|
import com.ibeetl.admin.core.file.FileService;
|
|
|
|
|
|
|
|
import com.ibeetl.admin.core.util.BeanCopyUtil;
|
|
|
|
import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
|
|
|
|
import com.ibeetl.admin.core.web.query.PageParam;
|
|
|
|
import com.ibeetl.jlw.entity.Student;
|
|
|
|
import com.ibeetl.jlw.entity.Student;
|
|
|
|
import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionLog;
|
|
|
|
import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionLog;
|
|
|
|
import com.ibeetl.jlw.service.TeacherOpenCourseQuestionLogService;
|
|
|
|
import com.ibeetl.jlw.service.TeacherOpenCourseQuestionLogService;
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseQuestionLogQuery;
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseQuestionLogQuery;
|
|
|
|
|
|
|
|
import lombok.SneakyThrows;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
@ -21,13 +26,18 @@ import org.springframework.validation.annotation.Validated;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.TreeSet;
|
|
|
|
import java.util.TreeSet;
|
|
|
|
|
|
|
|
|
|
|
|
import static cn.jlw.util.CacheUserUtil.getStudent;
|
|
|
|
import static cn.jlw.util.CacheUserUtil.getStudent;
|
|
|
|
|
|
|
|
import static com.ibeetl.admin.core.util.ExcelUtil.convertData;
|
|
|
|
|
|
|
|
import static com.ibeetl.admin.core.util.ExcelUtil.write;
|
|
|
|
|
|
|
|
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 题目日志 我的课程-题库-做题日志 接口
|
|
|
|
* 题目日志 我的课程-题库-做题日志 接口
|
|
|
@ -177,6 +187,71 @@ public class TeacherOpenCourseQuestionLogController {
|
|
|
|
return JsonResult.success(page);
|
|
|
|
return JsonResult.success(page);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 批量收藏题目 / 取消收藏
|
|
|
|
|
|
|
|
* @param teacherOpenCourseQuestionLogIds 题目日志ID
|
|
|
|
|
|
|
|
* @param isTuck 是否收藏:true, false
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@PostMapping(API + "/tuck.do")
|
|
|
|
|
|
|
|
public JsonResult tuck(String teacherOpenCourseQuestionLogIds, boolean isTuck) {
|
|
|
|
|
|
|
|
teacherOpenCourseQuestionLogService.tuck(teacherOpenCourseQuestionLogIds, isTuck);
|
|
|
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 查询收藏题目
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@GetMapping(API + "/tuckList.do")
|
|
|
|
|
|
|
|
public JsonResult tuckList(PageParam pageParam) {
|
|
|
|
|
|
|
|
Student student = getStudent();
|
|
|
|
|
|
|
|
Assert.notNull(student, "非学生身份,无法获取题目分析!");
|
|
|
|
|
|
|
|
PageQuery query = new PageQuery(pageParam.getPage().longValue(), pageParam.getLimit().longValue());
|
|
|
|
|
|
|
|
query.setPara("studentId", student.getStudentId());
|
|
|
|
|
|
|
|
query.setPara("teacherOpenCourseQuestionLogStatus", 1);
|
|
|
|
|
|
|
|
return JsonResult.success(teacherOpenCourseQuestionLogService.queryByConditionQuery(query));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 教师端-签到日志导出
|
|
|
|
|
|
|
|
* @param condition 日志记录查询条件
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@SneakyThrows
|
|
|
|
|
|
|
|
@PostMapping(API + "/export.do")
|
|
|
|
|
|
|
|
public void tuckExport(HttpServletResponse resp, TeacherOpenCourseQuestionLogQuery condition) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.notNull(getUser(), "请登录后再操作");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 构建表头 */
|
|
|
|
|
|
|
|
Map<String, String> header = new LinkedHashMap<>(11);
|
|
|
|
|
|
|
|
header.put("teacherOpenCourseQuestionSettingIdText", "开课题目名称");
|
|
|
|
|
|
|
|
header.put("questionStem", "题干");
|
|
|
|
|
|
|
|
header.put("questionTypeText", "题型");
|
|
|
|
|
|
|
|
header.put("questionScore", "题目分值");
|
|
|
|
|
|
|
|
header.put("questionOptionA", "选项A");
|
|
|
|
|
|
|
|
header.put("questionOptionB", "选项B");
|
|
|
|
|
|
|
|
header.put("questionOptionC", "选项C");
|
|
|
|
|
|
|
|
header.put("questionOptionD", "选项D");
|
|
|
|
|
|
|
|
header.put("questionOptionE", "选项E");
|
|
|
|
|
|
|
|
header.put("questionAnswer", "答案");
|
|
|
|
|
|
|
|
header.put("questionAnalysis", "解析");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 当前导出的是学生的话,那么只导出他自己的
|
|
|
|
|
|
|
|
Student student = getStudent();
|
|
|
|
|
|
|
|
if (student != null) {
|
|
|
|
|
|
|
|
condition.setStudentId(student.getStudentId());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> datas =
|
|
|
|
|
|
|
|
teacherOpenCourseQuestionLogService.getValuesByQueryNotWithPermission(condition);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> maps = BeanCopyUtil.baseEntity2MapWithParallel(datas);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String filename = StrUtil.format("题目收藏-导出 {}.xlsx", DateUtil.formatDate(DateUtil.date()));
|
|
|
|
|
|
|
|
write(resp, filename,"Sheet1", header.values(), convertData(header.keySet(), maps));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 后台页面 */
|
|
|
|
/* 后台页面 */
|
|
|
|
|
|
|
|
|
|
|
@ -292,12 +367,4 @@ public class TeacherOpenCourseQuestionLogController {
|
|
|
|
teacherOpenCourseQuestionLogService.deleteTeacherOpenCourseQuestionLog(ids);
|
|
|
|
teacherOpenCourseQuestionLogService.deleteTeacherOpenCourseQuestionLog(ids);
|
|
|
|
return JsonResult.success();
|
|
|
|
return JsonResult.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 学生端-教师端-单个学生做题日志详情
|
|
|
|
|
|
|
|
* 转到 {@link #list(TeacherOpenCourseQuestionLogQuery condition)}
|
|
|
|
|
|
|
|
* @param condition 题目配置ID
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|