|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package com.ibeetl.jlw.web;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.jlw.Interceptor.SCoreUser;
|
|
|
|
|
import cn.jlw.validate.ValidateConfig;
|
|
|
|
|
import com.ibeetl.admin.core.annotation.Function;
|
|
|
|
@ -11,6 +13,7 @@ import com.ibeetl.jlw.entity.ResourcesQuestionSnapshot;
|
|
|
|
|
import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionLogScoreInfo;
|
|
|
|
|
import com.ibeetl.jlw.entity.TeacherOpenCourseQuestionTestSimpleInfo;
|
|
|
|
|
import com.ibeetl.jlw.entity.dto.TeacherOpenCourseQuestionTestDetailDTO;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.TeacherOpenCourseQuestionTestDetailVO;
|
|
|
|
|
import com.ibeetl.jlw.service.ResourcesQuestionSnapshotService;
|
|
|
|
|
import com.ibeetl.jlw.web.query.ResourcesQuestionSnapshotQuery;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
@ -26,16 +29,24 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
import static com.ibeetl.admin.core.util.BeanCopyUtil.baseEntity2MapWithParallel;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 题目快照 资源管理 - 题库管理-快照-关联来源 接口
|
|
|
|
|
* 切记不要对非线程安全的静态变量进行写操作
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
public class ResourcesQuestionSnapshotController{
|
|
|
|
|
public class ResourcesQuestionSnapshotController extends BaseController {
|
|
|
|
|
|
|
|
|
|
private final Log log = LogFactory.getLog(this.getClass());
|
|
|
|
|
private static final String MODEL = "/jlw/resourcesQuestionSnapshot";
|
|
|
|
@ -120,6 +131,38 @@ public class ResourcesQuestionSnapshotController{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 教师端-获取题目的练习成绩
|
|
|
|
|
* 支持根据来源类型查询
|
|
|
|
|
*
|
|
|
|
|
* @param condition
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping(API + "/exportQuestionTestResults.do")
|
|
|
|
|
public void exportQuestionTestResults(TeacherOpenCourseQuestionTestDetailDTO condition) throws IOException {
|
|
|
|
|
Assert.notNull(getUser(), "请登录后再操作");
|
|
|
|
|
|
|
|
|
|
/** 构建表头 */
|
|
|
|
|
Map<String, String> header = new LinkedHashMap<>(11);
|
|
|
|
|
header.put("studentName", "学生姓名");
|
|
|
|
|
header.put("studentSn", "学号");
|
|
|
|
|
header.put("teacherOpenCourseIdText", "开课名称");
|
|
|
|
|
header.put("className", "班级名称");
|
|
|
|
|
header.put("finishTime", "完成时间");
|
|
|
|
|
header.put("correctCount", "答对数量");
|
|
|
|
|
header.put("wrongCount", "答错数量");
|
|
|
|
|
header.put("correctRate", "正确率 (100)%");
|
|
|
|
|
header.put("totalScore", "总得分");
|
|
|
|
|
|
|
|
|
|
PageQuery<TeacherOpenCourseQuestionTestDetailVO> data = resourcesQuestionSnapshotService.questionTestResults(condition.getPageQuery());
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> maps = baseEntity2MapWithParallel(data.getList());
|
|
|
|
|
|
|
|
|
|
String filename = StrUtil.format("签到日志导出 {}.xlsx", DateUtil.formatDate(DateUtil.date()));
|
|
|
|
|
write(response, filename,"Sheet1", header.values(), convertData(header.keySet(), maps));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 后台页面 */
|
|
|
|
|
|
|
|
|
|
@GetMapping(MODEL + "/index.do")
|
|
|
|
|