|
@@ -245,15 +245,10 @@ public class MailTemplateController {
|
|
|
studentAttendanceService.getStudentAttendanceListForTeacher(attendanceReqVO),
|
|
|
StudentAttendanceCollegeTemplateVO.class
|
|
|
);
|
|
|
- List<StudentAttendanceCollegeTemplateVO> errorList
|
|
|
- = studentAttendanceService.getStudentAttendanceErrorListForTeacher(attendanceReqVO)
|
|
|
- .stream()
|
|
|
- .map(studentAttendance -> {
|
|
|
- StudentAttendanceCollegeTemplateVO vo = BeanUtils.toBean(studentAttendance, StudentAttendanceCollegeTemplateVO.class);
|
|
|
- vo.setClockInTime("未打卡");
|
|
|
- return vo;
|
|
|
- })
|
|
|
- .collect(Collectors.toList());
|
|
|
+ List<StudentAttendanceCollegeErrorTemplateVO> errorList = BeanUtils.toBean(
|
|
|
+ studentAttendanceService.getStudentAttendanceErrorListForTeacher(attendanceReqVO),
|
|
|
+ StudentAttendanceCollegeErrorTemplateVO.class);
|
|
|
+
|
|
|
|
|
|
// List<StudentAttendanceCollegeTemplateVO> excusedList = studentAttendanceService.getStudentAttendanceExcusedListForTeacher(attendanceReqVO)
|
|
|
// .stream()
|
|
@@ -268,14 +263,18 @@ public class MailTemplateController {
|
|
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
|
|
|
|
// 写入 Excel 文件
|
|
|
- try (ExcelWriter excelWriter = EasyExcel.write(byteArrayOutputStream, StudentAttendanceCollegeTemplateVO.class).build()) {
|
|
|
- WriteSheet writeSheetNormal = EasyExcel.writerSheet("正常打卡信息").build();
|
|
|
- WriteSheet writeSheetError = EasyExcel.writerSheet("未打卡信息").build();
|
|
|
-// WriteSheet writeSheetExcused = EasyExcel.writerSheet("请假信息").build();
|
|
|
- excelWriter.write(errorList, writeSheetError);
|
|
|
- excelWriter.write(normalList, writeSheetNormal);
|
|
|
-
|
|
|
-// excelWriter.write(excusedList, writeSheetExcused);
|
|
|
+ try (ExcelWriter excelWriter = EasyExcel.write(byteArrayOutputStream).build()) {
|
|
|
+ WriteSheet writeSheetNormal = EasyExcel.writerSheet("正常打卡信息")
|
|
|
+ .head(StudentAttendanceCollegeTemplateVO.class) // 指定模板类
|
|
|
+ .build();
|
|
|
+
|
|
|
+ WriteSheet writeSheetError = EasyExcel.writerSheet("未打卡信息")
|
|
|
+ .head(StudentAttendanceCollegeErrorTemplateVO.class) // 指定模板类
|
|
|
+ .build();
|
|
|
+ // 将各个 List 数据写入不同的 Sheet 中
|
|
|
+ excelWriter.write(normalList, writeSheetNormal); // 写入正常打卡数据
|
|
|
+ excelWriter.write(errorList, writeSheetError); // 写入未打卡数据
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 附件
|
|
@@ -571,18 +570,15 @@ public class MailTemplateController {
|
|
|
for (AdminUserDO college : collegeList) {
|
|
|
|
|
|
attendanceReqVO.setDate(yesterday);
|
|
|
+
|
|
|
List<StudentAttendanceCollegeTemplateVO> normalList = BeanUtils.toBean(
|
|
|
studentAttendanceService.getStudentAttendanceListForTeacher(attendanceReqVO),
|
|
|
StudentAttendanceCollegeTemplateVO.class
|
|
|
);
|
|
|
- List<StudentAttendanceCollegeTemplateVO> errorList = studentAttendanceService.getStudentAttendanceErrorListForTeacher(attendanceReqVO)
|
|
|
- .stream()
|
|
|
- .map(studentAttendance -> {
|
|
|
- StudentAttendanceCollegeTemplateVO vo = BeanUtils.toBean(studentAttendance, StudentAttendanceCollegeTemplateVO.class);
|
|
|
- vo.setClockInTime("未打卡");
|
|
|
- return vo;
|
|
|
- })
|
|
|
- .collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<StudentAttendanceCollegeErrorTemplateVO> errorList = BeanUtils.toBean(
|
|
|
+ studentAttendanceService.getStudentAttendanceErrorListForTeacher(attendanceReqVO),
|
|
|
+ StudentAttendanceCollegeErrorTemplateVO.class);
|
|
|
|
|
|
// List<StudentAttendanceCollegeTemplateVO> excusedList = studentAttendanceService.getStudentAttendanceExcusedListForTeacher(attendanceReqVO)
|
|
|
// .stream()
|
|
@@ -597,15 +593,18 @@ public class MailTemplateController {
|
|
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
|
|
|
|
// 写入 Excel 文件
|
|
|
- try (ExcelWriter excelWriter = EasyExcel.write(byteArrayOutputStream, StudentAttendanceCollegeTemplateVO.class).build()) {
|
|
|
- WriteSheet writeSheetNormal = EasyExcel.writerSheet("正常打卡信息").build();
|
|
|
- WriteSheet writeSheetError = EasyExcel.writerSheet("未打卡信息").build();
|
|
|
-// WriteSheet writeSheetExcused = EasyExcel.writerSheet("请假信息").build();
|
|
|
-
|
|
|
+ try (ExcelWriter excelWriter = EasyExcel.write(byteArrayOutputStream).build()) {
|
|
|
+ WriteSheet writeSheetNormal = EasyExcel.writerSheet("正常打卡信息")
|
|
|
+ .head(StudentAttendanceCollegeTemplateVO.class) // 指定模板类
|
|
|
+ .build();
|
|
|
+
|
|
|
+ WriteSheet writeSheetError = EasyExcel.writerSheet("未打卡信息")
|
|
|
+ .head(StudentAttendanceCollegeErrorTemplateVO.class) // 指定模板类
|
|
|
+ .build();
|
|
|
// 将各个 List 数据写入不同的 Sheet 中
|
|
|
- excelWriter.write(normalList, writeSheetNormal);
|
|
|
- excelWriter.write(errorList, writeSheetError);
|
|
|
-// excelWriter.write(excusedList, writeSheetExcused);
|
|
|
+ excelWriter.write(normalList, writeSheetNormal); // 写入正常打卡数据
|
|
|
+ excelWriter.write(errorList, writeSheetError); // 写入未打卡数据
|
|
|
+
|
|
|
}
|
|
|
|
|
|
Map<String, InputStream> attachments = new HashMap<>();
|