|
@@ -12,36 +12,27 @@ import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
import com.qmth.teachcloud.common.enums.TaskTypeEnum;
|
|
|
import com.qmth.teachcloud.common.service.TBTaskService;
|
|
|
import com.qmth.teachcloud.common.util.*;
|
|
|
-import com.qmth.teachcloud.report.business.bean.dto.excel.TAExamCourseDto;
|
|
|
import com.qmth.teachcloud.report.business.bean.dto.excel.TAExamCourseExportDto;
|
|
|
import com.qmth.teachcloud.report.business.bean.result.*;
|
|
|
import com.qmth.teachcloud.report.business.bean.result.inspectCourseExamTotal.InspectCourseTotalReportResult;
|
|
|
-import com.qmth.teachcloud.report.business.entity.TBExamCourse;
|
|
|
import com.qmth.teachcloud.report.business.entity.TBPaper;
|
|
|
import com.qmth.teachcloud.report.business.enums.OrderEnum;
|
|
|
import com.qmth.teachcloud.report.business.enums.PublishStatusEnum;
|
|
|
import com.qmth.teachcloud.report.business.enums.SemesterEnum;
|
|
|
-import com.qmth.teachcloud.report.business.service.*;
|
|
|
+import com.qmth.teachcloud.report.business.service.AnalyzeForReportService;
|
|
|
+import com.qmth.teachcloud.report.business.service.CourseReportService;
|
|
|
+import com.qmth.teachcloud.report.business.service.TAExamCourseService;
|
|
|
+import com.qmth.teachcloud.report.business.service.TBPaperService;
|
|
|
import com.qmth.teachcloud.report.business.templete.execute.AsyncDataCalculateTempleteService;
|
|
|
import io.swagger.annotations.*;
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
|
-import org.apache.poi.ss.usermodel.*;
|
|
|
-import org.apache.poi.ss.util.CellRangeAddress;
|
|
|
-import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
|
|
-import org.apache.poi.xssf.usermodel.XSSFCellStyle;
|
|
|
-import org.apache.poi.xssf.usermodel.XSSFColor;
|
|
|
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import javax.servlet.ServletOutputStream;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
-import java.awt.Color;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.net.URLEncoder;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -90,13 +81,12 @@ public class CourseController {
|
|
|
@ApiParam(value = "学期", required = true) @RequestParam SemesterEnum semester,
|
|
|
@ApiParam(value = "学校id", required = false) @RequestParam(required = false) String schoolId,
|
|
|
@ApiParam(value = "排序列", required = false) @RequestParam(required = false) String column,
|
|
|
- @ApiParam(value = "排序规则", required = false) @RequestParam(required = false) OrderEnum order,
|
|
|
- HttpServletResponse response) throws Exception {
|
|
|
+ @ApiParam(value = "排序规则", required = false) @RequestParam(required = false) OrderEnum order) throws Exception {
|
|
|
IPage<TAExamCourseResult> taExamCourseResultIPage = taExamCourseService.surveyTeacherList(new Page<>(SystemConstant.PAGE_NUMBER, SystemConstant.PAGE_SIZE), SystemConstant.convertIdToLong(examId), semester, Objects.isNull(schoolId) ? SystemConstant.convertIdToLong(String.valueOf(ServletUtil.getRequestHeaderSchoolId())) : SystemConstant.convertIdToLong(schoolId), column, order);
|
|
|
Gson gson = new Gson();
|
|
|
List<TAExamCourseExportDto> taExamCourseExportDtoList = gson.fromJson(JacksonUtil.parseJson(taExamCourseResultIPage.getRecords()), new TypeToken<List<TAExamCourseExportDto>>() {
|
|
|
}.getType());
|
|
|
- ExcelUtil.excelExport("开课课程考试总览", TAExamCourseExportDto.class, taExamCourseExportDtoList, response);
|
|
|
+ ExcelUtil.excelExport("开课课程考试总览", TAExamCourseExportDto.class, taExamCourseExportDtoList, ServletUtil.getResponse());
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "导出课程分析接口")
|
|
@@ -105,68 +95,13 @@ public class CourseController {
|
|
|
public void courseExport(@ApiParam(value = "考试id", required = true) @RequestParam String examId,
|
|
|
@ApiParam(value = "学期", required = true) @RequestParam SemesterEnum semester,
|
|
|
@ApiParam(value = "学校id", required = false) @RequestParam(required = false) String schoolId,
|
|
|
- HttpServletResponse response) throws Exception {
|
|
|
- IPage<TAExamCourseResult> taExamCourseResultIPage = taExamCourseService.surveyTeacherList(new Page<>(0, 10), SystemConstant.convertIdToLong(examId), semester, Objects.isNull(schoolId) ? SystemConstant.convertIdToLong(String.valueOf(ServletUtil.getRequestHeaderSchoolId())) : SystemConstant.convertIdToLong(schoolId), null, null);
|
|
|
- Gson gson = new Gson();
|
|
|
- List<TAExamCourseExportDto> taExamCourseExportDtoList = gson.fromJson(JacksonUtil.parseJson(taExamCourseResultIPage.getRecords()), new TypeToken<List<TAExamCourseExportDto>>() {
|
|
|
- }.getType());
|
|
|
- ExcelUtil.excelExportBatchSheet("测试", Arrays.asList("测试1", "测试2"), Arrays.asList(TAExamCourseExportDto.class, TAExamCourseExportDto.class), Arrays.asList(taExamCourseExportDtoList, taExamCourseExportDtoList), response);
|
|
|
-
|
|
|
-// //创建excel
|
|
|
-// XSSFWorkbook wb = new XSSFWorkbook();
|
|
|
-// Sheet sheet = wb.createSheet("成绩对比明细");
|
|
|
-// XSSFCellStyle style = wb.createCellStyle();
|
|
|
-// style.setFillForegroundColor(new XSSFColor(new Color(227, 239, 217)));
|
|
|
-// style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
|
|
-// style.setAlignment(HorizontalAlignment.CENTER); // 水平居中格式
|
|
|
-// style.setVerticalAlignment(VerticalAlignment.CENTER); //垂直居中
|
|
|
-// Row row = sheet.createRow(0);
|
|
|
-//
|
|
|
-// Cell cell = row.createCell(0);
|
|
|
-// cell.setCellValue("测试1");
|
|
|
-// cell.setCellStyle(style);
|
|
|
-//// CellRangeAddress region1 = new CellRangeAddress(0, 1, (short) 0, (short) 0);
|
|
|
-//// sheet.addMergedRegion(region1);
|
|
|
-// sheet.setColumnWidth(0, 15 * 256);
|
|
|
-//
|
|
|
-// Cell cell1 = row.createCell(1);
|
|
|
-// cell1.setCellValue("测试2");
|
|
|
-// cell1.setCellStyle(style);
|
|
|
-//// CellRangeAddress region2 = new CellRangeAddress(0, 1, (short) 1, (short) 1);
|
|
|
-//// sheet.addMergedRegion(region2);
|
|
|
-// sheet.setColumnWidth(1, 15 * 256);
|
|
|
-//
|
|
|
-// /***************************************/
|
|
|
-//
|
|
|
-// Sheet sheet1 = wb.createSheet("全校卷面分数段分布");
|
|
|
-// XSSFCellStyle style1 = wb.createCellStyle();
|
|
|
-// style1.setFillForegroundColor(new XSSFColor(new Color(227, 239, 217)));
|
|
|
-// style1.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
|
|
-// style1.setAlignment(HorizontalAlignment.CENTER); // 水平居中格式
|
|
|
-// style1.setVerticalAlignment(VerticalAlignment.CENTER); //垂直居中
|
|
|
-// Row row1 = sheet1.createRow(0);
|
|
|
-//
|
|
|
-// Cell cell2 = row1.createCell(0);
|
|
|
-// cell2.setCellValue("测试3");
|
|
|
-// cell2.setCellStyle(style);
|
|
|
-//// CellRangeAddress region1 = new CellRangeAddress(0, 1, (short) 0, (short) 0);
|
|
|
-//// sheet.addMergedRegion(region1);
|
|
|
-// sheet1.setColumnWidth(0, 15 * 256);
|
|
|
-//
|
|
|
-// Cell cell3 = row1.createCell(1);
|
|
|
-// cell3.setCellValue("测试4");
|
|
|
-// cell3.setCellStyle(style);
|
|
|
-//// CellRangeAddress region2 = new CellRangeAddress(0, 1, (short) 1, (short) 1);
|
|
|
-//// sheet.addMergedRegion(region2);
|
|
|
-// sheet1.setColumnWidth(1, 15 * 256);
|
|
|
-//
|
|
|
-// response.setHeader("Content-Disposition", "inline; filename="
|
|
|
-// + URLEncoder.encode("测试", "UTF-8") + ".xlsx");
|
|
|
-// response.setContentType("application/vnd.ms-excel");
|
|
|
-// ServletOutputStream outputStream = response.getOutputStream();
|
|
|
-// wb.write(outputStream);
|
|
|
-// outputStream.flush();
|
|
|
-// outputStream.close();
|
|
|
+ @ApiParam(value = "科目编码", required = false) @RequestParam(required = false) String courseCode) throws Exception {
|
|
|
+// IPage<TAExamCourseResult> taExamCourseResultIPage = taExamCourseService.surveyTeacherList(new Page<>(0, 10), SystemConstant.convertIdToLong(examId), semester, Objects.isNull(schoolId) ? SystemConstant.convertIdToLong(String.valueOf(ServletUtil.getRequestHeaderSchoolId())) : SystemConstant.convertIdToLong(schoolId), null, null);
|
|
|
+// Gson gson = new Gson();
|
|
|
+// List<TAExamCourseExportDto> taExamCourseExportDtoList = gson.fromJson(JacksonUtil.parseJson(taExamCourseResultIPage.getRecords()), new TypeToken<List<TAExamCourseExportDto>>() {
|
|
|
+// }.getType());
|
|
|
+// ExcelUtil.excelExportBatchSheet("测试", Arrays.asList("测试1", "测试2"), Arrays.asList(TAExamCourseExportDto.class, TAExamCourseExportDto.class), Arrays.asList(taExamCourseExportDtoList, taExamCourseExportDtoList), response);
|
|
|
+ taExamCourseService.courseExport(SystemConstant.convertIdToLong(examId), semester, Objects.nonNull(schoolId) ? SystemConstant.convertIdToLong(schoolId) : null, courseCode);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "开课课程考试总览-教师各课堂成绩排名接口")
|