|
@@ -24,14 +24,25 @@ import com.qmth.teachcloud.report.business.enums.SemesterEnum;
|
|
import com.qmth.teachcloud.report.business.service.*;
|
|
import com.qmth.teachcloud.report.business.service.*;
|
|
import com.qmth.teachcloud.report.business.templete.execute.AsyncDataCalculateTempleteService;
|
|
import com.qmth.teachcloud.report.business.templete.execute.AsyncDataCalculateTempleteService;
|
|
import io.swagger.annotations.*;
|
|
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.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import javax.servlet.ServletOutputStream;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import java.awt.Color;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.net.URLEncoder;
|
|
|
|
+import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
@@ -88,6 +99,76 @@ public class CourseController {
|
|
ExcelUtil.excelExport("开课课程考试总览", TAExamCourseExportDto.class, taExamCourseExportDtoList, response);
|
|
ExcelUtil.excelExport("开课课程考试总览", TAExamCourseExportDto.class, taExamCourseExportDtoList, response);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "导出课程分析接口")
|
|
|
|
+ @RequestMapping(value = "/survey_teacher/course_export", method = RequestMethod.POST)
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "考试科目信息", response = Result.class)})
|
|
|
|
+ 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();
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value = "开课课程考试总览-教师各课堂成绩排名接口")
|
|
@ApiOperation(value = "开课课程考试总览-教师各课堂成绩排名接口")
|
|
@RequestMapping(value = "/survey_teacher/teacher_view", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/survey_teacher/teacher_view", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "考试科目信息", response = TAExamCourseCollegeTeacherResult.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "考试科目信息", response = TAExamCourseCollegeTeacherResult.class)})
|