|
|
|
@ -14,8 +14,11 @@ import com.ibeetl.admin.core.file.FileService;
|
|
|
|
|
import com.ibeetl.admin.core.util.BeanCopyUtil;
|
|
|
|
|
import com.ibeetl.admin.core.util.TimeTool;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
|
import com.ibeetl.admin.core.web.query.PageParam;
|
|
|
|
|
import com.ibeetl.jlw.entity.FileEntity;
|
|
|
|
|
import com.ibeetl.jlw.entity.QuestionLogSummary;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.QuestionLogSummaryAnalysisVO;
|
|
|
|
|
import com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum;
|
|
|
|
|
import com.ibeetl.jlw.service.QuestionLogSummaryService;
|
|
|
|
|
import com.ibeetl.jlw.web.query.QuestionLogSummaryQuery;
|
|
|
|
|
import lombok.SneakyThrows;
|
|
|
|
@ -40,9 +43,13 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
import static cn.jlw.util.PageUtil.ofDefault;
|
|
|
|
|
import static com.ibeetl.admin.core.util.BeanCopyUtil.baseEntity2MapWithParallel;
|
|
|
|
|
import static com.ibeetl.admin.core.util.BeanUtil.processExcelAnnotationToMap;
|
|
|
|
|
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;
|
|
|
|
@ -54,7 +61,7 @@ import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
@Validated
|
|
|
|
|
public class QuestionLogSummaryController{
|
|
|
|
|
public class QuestionLogSummaryController extends BaseController {
|
|
|
|
|
|
|
|
|
|
private final Log log = LogFactory.getLog(this.getClass());
|
|
|
|
|
private static final String MODEL = "/jlw/questionLogSummary";
|
|
|
|
@ -100,6 +107,46 @@ public class QuestionLogSummaryController{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 题目配置,统计分析接口
|
|
|
|
|
* @param teacherOpenCourseId 开课ID
|
|
|
|
|
* @param questionSettingType 题目配置类型
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping(API + "/analysis.do")
|
|
|
|
|
public JsonResult analysisDo(PageParam param, Long teacherOpenCourseId, ResourcesQuestionSnapshotFromTypeEnum questionSettingType, @SCoreUser CoreUser coreUser) {
|
|
|
|
|
PageQuery<Object> objectPageQuery = ofDefault(new PageQuery<>(), param);
|
|
|
|
|
objectPageQuery.setPara("questionSettingType", questionSettingType);
|
|
|
|
|
objectPageQuery.setPara("teacherOpenCourseId", teacherOpenCourseId);
|
|
|
|
|
|
|
|
|
|
return JsonResult.success(questionLogSummaryService.analysisPageQuery(objectPageQuery));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 题目配置,统计分析接口
|
|
|
|
|
* @param teacherOpenCourseId 开课ID
|
|
|
|
|
* @param questionSettingType 题目配置类型
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping(API + "/exportAnalysis.do")
|
|
|
|
|
public void exportAnalysisDo(Long teacherOpenCourseId, ResourcesQuestionSnapshotFromTypeEnum questionSettingType, @SCoreUser CoreUser coreUser) throws IOException {
|
|
|
|
|
|
|
|
|
|
/** 构建表头 */
|
|
|
|
|
Map<String, String> header = processExcelAnnotationToMap(QuestionLogSummaryAnalysisVO.class);
|
|
|
|
|
|
|
|
|
|
PageQuery<Object> objectPageQuery = new PageQuery<>();
|
|
|
|
|
objectPageQuery.setPageNumber(1L);
|
|
|
|
|
objectPageQuery.setPageSize(Integer.MAX_VALUE);
|
|
|
|
|
objectPageQuery.setPara("questionSettingType", questionSettingType);
|
|
|
|
|
objectPageQuery.setPara("teacherOpenCourseId", teacherOpenCourseId);
|
|
|
|
|
|
|
|
|
|
PageQuery<QuestionLogSummaryAnalysisVO> page = questionLogSummaryService.analysisPageQuery(objectPageQuery);
|
|
|
|
|
List<Map<String, Object>> maps = baseEntity2MapWithParallel(page.getList());
|
|
|
|
|
|
|
|
|
|
String filename = StrUtil.format("题目统计分析导出 {}.xlsx", DateUtil.now());
|
|
|
|
|
write(response, filename,"Sheet1", header.values(), convertData(header.keySet(), maps));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 作业详情导出
|
|
|
|
|
* @param condition 日志记录查询条件
|
|
|
|
@ -469,4 +516,45 @@ public class QuestionLogSummaryController{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 题目配置,统计分析接口
|
|
|
|
|
* @param teacherOpenCourseId 开课ID
|
|
|
|
|
* @param questionSettingType 题目配置类型
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping(MODEL + "/analysisPageList.json")
|
|
|
|
|
public JsonResult analysisPageList(PageParam param, Long teacherOpenCourseId, ResourcesQuestionSnapshotFromTypeEnum questionSettingType, @SCoreUser CoreUser coreUser) {
|
|
|
|
|
PageQuery<Object> objectPageQuery = ofDefault(new PageQuery<>(), param);
|
|
|
|
|
objectPageQuery.setPara("questionSettingType", questionSettingType);
|
|
|
|
|
objectPageQuery.setPara("teacherOpenCourseId", teacherOpenCourseId);
|
|
|
|
|
|
|
|
|
|
return JsonResult.success(questionLogSummaryService.analysisPageQuery(objectPageQuery));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 题目配置,统计分析接口
|
|
|
|
|
* @param teacherOpenCourseId 开课ID
|
|
|
|
|
* @param questionSettingType 题目配置类型
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping(MODEL + "/exportAnalysis.json")
|
|
|
|
|
public void exportAnalysis(Long teacherOpenCourseId, ResourcesQuestionSnapshotFromTypeEnum questionSettingType, @SCoreUser CoreUser coreUser) throws IOException {
|
|
|
|
|
|
|
|
|
|
/** 构建表头 */
|
|
|
|
|
Map<String, String> header = processExcelAnnotationToMap(QuestionLogSummaryAnalysisVO.class);
|
|
|
|
|
|
|
|
|
|
// 不需要分页,直接查询出来所有的
|
|
|
|
|
PageQuery<Object> objectPageQuery = new PageQuery<>();
|
|
|
|
|
objectPageQuery.setPageNumber(1);
|
|
|
|
|
objectPageQuery.setPageSize(Integer.MAX_VALUE);
|
|
|
|
|
objectPageQuery.setPara("questionSettingType", questionSettingType);
|
|
|
|
|
objectPageQuery.setPara("teacherOpenCourseId", teacherOpenCourseId);
|
|
|
|
|
|
|
|
|
|
PageQuery<QuestionLogSummaryAnalysisVO> page = questionLogSummaryService.analysisPageQuery(objectPageQuery);
|
|
|
|
|
List<Map<String, Object>> maps = baseEntity2MapWithParallel(page.getList());
|
|
|
|
|
|
|
|
|
|
String filename = StrUtil.format("题目统计分析导出 {}.xlsx", DateUtil.now());
|
|
|
|
|
write(response, filename,"Sheet1", header.values(), convertData(header.keySet(), maps));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|