|
|
|
@ -2,6 +2,7 @@ package com.ibeetl.jlw.web;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.jlw.Interceptor.SCoreUser;
|
|
|
|
|
import cn.jlw.Interceptor.TStudent;
|
|
|
|
@ -33,10 +34,8 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.TreeSet;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static cn.jlw.util.CacheUserUtil.getStudent;
|
|
|
|
|
import static com.ibeetl.admin.core.util.ExcelUtil.convertData;
|
|
|
|
@ -345,6 +344,45 @@ public class TeacherOpenCourseQuestionLogController {
|
|
|
|
|
write(resp, filename,"Sheet1", header.values(), convertData(header.keySet(), maps));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 作业详情导出
|
|
|
|
|
* @param condition 日志记录查询条件
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@SneakyThrows
|
|
|
|
|
@GetMapping(API + "/zyDetailExport.do")
|
|
|
|
|
public void zyDetailExport(HttpServletResponse resp, TeacherOpenCourseQuestionLogQuery condition) {
|
|
|
|
|
|
|
|
|
|
/** 构建表头 */
|
|
|
|
|
Map<String, String> header = new LinkedHashMap<>(11);
|
|
|
|
|
header.put("studentName", "学生姓名");
|
|
|
|
|
header.put("studentSn", "学生学号");
|
|
|
|
|
header.put("className", "班级");
|
|
|
|
|
header.put("questionStem", "题干");
|
|
|
|
|
header.put("questionTypeText", "题型");
|
|
|
|
|
header.put("teacherOpenCourseQuestionLogAnswer", "我的选项");
|
|
|
|
|
header.put("questionAnswer", "答案");
|
|
|
|
|
header.put("studentScore", "得分");
|
|
|
|
|
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> datas = new ArrayList<>();
|
|
|
|
|
PageQuery pageQuery = condition.getPageQuery();
|
|
|
|
|
condition.setTeacherOpenCourseQuestionLogStatus(1);
|
|
|
|
|
condition.setQuestionLogAddType(FINALLY_SUBMIT);
|
|
|
|
|
pageQuery.setPageSize(Integer.MAX_VALUE);
|
|
|
|
|
pageQuery.setPageNumber(1L);
|
|
|
|
|
PageQuery<TeacherOpenCourseQuestionLog> teacherOpenCourseQuestionLogPageQuery = teacherOpenCourseQuestionLogService.queryByConditionQuery(pageQuery);
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(teacherOpenCourseQuestionLogPageQuery)) {
|
|
|
|
|
datas = teacherOpenCourseQuestionLogPageQuery.getList().stream().filter(item -> null != item.get("studentName")).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> maps = BeanCopyUtil.baseEntity2MapWithParallel(datas);
|
|
|
|
|
|
|
|
|
|
String filename = StrUtil.format("题目日志详情-导出 {}.xlsx", DateUtil.now());
|
|
|
|
|
write(resp, filename,"Sheet1", header.values(), convertData(header.keySet(), maps));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能描述: <br>
|
|
|
|
|
* 题目获取答案,并锁定题目(改变为LOCK状态)
|
|
|
|
|