|
|
|
@ -104,7 +104,7 @@ public class YunXiaoExportExcelUtil {
|
|
|
|
|
* @param list2
|
|
|
|
|
* @param list3
|
|
|
|
|
*/
|
|
|
|
|
public void LessonConstructionInfoByXzqhSchool(String filePath, List<Record> list1, List<Record> list2, List<Record> list3) {
|
|
|
|
|
public void LessonConstructionInfoByXzqhSchool(String filePath, List<Record> list1, List<Record> list2, List<Record> list3, List<Record> list4) {
|
|
|
|
|
try (XSSFWorkbook workbook = new XSSFWorkbook()) {
|
|
|
|
|
// 创建样式
|
|
|
|
|
CellStyle headerStyle = createHeaderStyle(workbook);
|
|
|
|
@ -175,7 +175,7 @@ public class YunXiaoExportExcelUtil {
|
|
|
|
|
XSSFSheet sheet3 = workbook.createSheet("学校课程建设情况");
|
|
|
|
|
// 设置列宽
|
|
|
|
|
sheet3.setColumnWidth(0, 5000); // 县区名称
|
|
|
|
|
sheet3.setColumnWidth(1, 5000); // 学校
|
|
|
|
|
sheet3.setColumnWidth(1, 8000); // 学校
|
|
|
|
|
sheet3.setColumnWidth(2, 5000); // 课程数量
|
|
|
|
|
// 创建表头
|
|
|
|
|
headerRow = sheet3.createRow(0);
|
|
|
|
@ -200,6 +200,47 @@ public class YunXiaoExportExcelUtil {
|
|
|
|
|
// 建设数量
|
|
|
|
|
createCell(row, 2, record.getStr("c"), dataStyle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//第四个 Sheet
|
|
|
|
|
XSSFSheet sheet4 = workbook.createSheet("学校课程建设详情");
|
|
|
|
|
// 设置列宽
|
|
|
|
|
sheet4.setColumnWidth(0, 8000); // 县区名称
|
|
|
|
|
sheet4.setColumnWidth(1, 5000); // 学段
|
|
|
|
|
sheet4.setColumnWidth(2, 8000); // 学校
|
|
|
|
|
sheet4.setColumnWidth(3, 5000); // 科目
|
|
|
|
|
sheet4.setColumnWidth(4, 5000); // 教师
|
|
|
|
|
sheet4.setColumnWidth(5, 10000); // 课程名称
|
|
|
|
|
|
|
|
|
|
// 创建表头
|
|
|
|
|
headerRow = sheet4.createRow(0);
|
|
|
|
|
headerRow.setHeight((short) (28 * 20));
|
|
|
|
|
String[] headers4 = {
|
|
|
|
|
"县区名称", "学段", "学校", "科目", "教师", "课程名称"
|
|
|
|
|
};
|
|
|
|
|
for (int i = 0; i < headers4.length; i++) {
|
|
|
|
|
Cell cell = headerRow.createCell(i);
|
|
|
|
|
cell.setCellValue(headers4[i]);
|
|
|
|
|
cell.setCellStyle(headerStyle);
|
|
|
|
|
}
|
|
|
|
|
rowNum = 1;
|
|
|
|
|
// 填充数据
|
|
|
|
|
for (Record record : list4) {
|
|
|
|
|
Row row = sheet4.createRow(rowNum++);
|
|
|
|
|
row.setHeight((short) (28 * 20));
|
|
|
|
|
//县区名称
|
|
|
|
|
createCell(row, 0, record.getStr("gather_regionc"), dataStyle);
|
|
|
|
|
//学段
|
|
|
|
|
createCell(row, 1, record.getStr("stage_name"), dataStyle);
|
|
|
|
|
// 学校
|
|
|
|
|
createCell(row, 2, record.getStr("organization_name"), dataStyle);
|
|
|
|
|
//科目
|
|
|
|
|
createCell(row, 3, record.getStr("subject_name"), dataStyle);
|
|
|
|
|
// 教师
|
|
|
|
|
createCell(row, 4, record.getStr("teacher_name"), dataStyle);
|
|
|
|
|
// 课程
|
|
|
|
|
createCell(row, 5, record.getStr("lesson_name"), dataStyle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 保存文件
|
|
|
|
|
try (FileOutputStream fileOut = new FileOutputStream(filePath)) {
|
|
|
|
|
workbook.write(fileOut);
|
|
|
|
|