Jelajahi Sumber

教师考勤调整导出增加列

dzx 1 bulan lalu
induk
melakukan
f02af657c3

+ 17 - 10
src/main/java/com/xjrsoft/module/attendance/service/impl/AttendanceStatisticsServiceImpl.java

@@ -391,6 +391,7 @@ public class AttendanceStatisticsServiceImpl extends MPJBaseServiceImpl<Attendan
             data.add(recordVo.getName());
             data.add(recordVo.getUserName());
             data.add(recordVo.getDeptName());
+            data.add(statistics.getAttendanceDays() + "");
             data.add(recordVo.getNormalCount() + "");
             data.add(recordVo.getLeaveCount() + "");
             data.add(recordVo.getAbsenteeCount() + "");
@@ -409,7 +410,7 @@ public class AttendanceStatisticsServiceImpl extends MPJBaseServiceImpl<Attendan
             dataList.add(data);
         }
 
-        int allColumn = 7 + statistics.getAttendanceDays();//总列数
+        int allColumn = 8 + statistics.getAttendanceDays();//总列数
         Workbook workbook = new XSSFWorkbook();
         // 创建一个工作表(sheet)
         String sheetName = "数据";
@@ -422,7 +423,7 @@ public class AttendanceStatisticsServiceImpl extends MPJBaseServiceImpl<Attendan
         // 第三行表头
         createThirdTitle(workbook, sheet, weekList);
         // 第四行表头
-        createFourthTitle(workbook, sheet, 7, dateList);
+        createFourthTitle(workbook, sheet, 8, dateList);
         //生成数据
         int dataRowNumber = 4;
 
@@ -438,7 +439,7 @@ public class AttendanceStatisticsServiceImpl extends MPJBaseServiceImpl<Attendan
                 }else if(content != null && content.contains("正常")){
                     font.setColor(IndexedColors.BLUE.getIndex()); // 设置字体颜色为蓝色
                 }else if(content != null && content.contains("请假")){
-                    font.setColor(IndexedColors.YELLOW.getIndex()); // 设置字体颜色为黄
+                    font.setColor(IndexedColors.ORANGE.getIndex()); // 设置字体颜色为橙
                 }
                 font.setFontHeightInPoints((short)12);
 
@@ -533,6 +534,7 @@ public class AttendanceStatisticsServiceImpl extends MPJBaseServiceImpl<Attendan
         cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
         cellStyle.setAlignment(HorizontalAlignment.CENTER);
 
+
         Row row1 = sheet.createRow(rowNumber);
         Cell row1cell1 = row1.createCell(0);
         row1cell1.setCellValue("序号");
@@ -554,22 +556,27 @@ public class AttendanceStatisticsServiceImpl extends MPJBaseServiceImpl<Attendan
         row1cell4.setCellStyle(cellStyle);
         sheet.addMergedRegion(new CellRangeAddress(rowNumber, rowNumber + 1, 3, 3));
 
-        Cell row1cell5 = row1.createCell(4);
+        Cell row1cell8 = row1.createCell(4);
+        row1cell4.setCellValue("考勤组应出勤天数");
+        row1cell4.setCellStyle(cellStyle);
+        sheet.addMergedRegion(new CellRangeAddress(rowNumber, rowNumber + 1, 4, 4));
+
+        Cell row1cell5 = row1.createCell(5);
         row1cell5.setCellValue("正常考勤次数");
         row1cell5.setCellStyle(cellStyle);
-        sheet.addMergedRegion(new CellRangeAddress(rowNumber, rowNumber + 1, 4, 4));
+        sheet.addMergedRegion(new CellRangeAddress(rowNumber, rowNumber + 1, 5, 5));
 
-        Cell row1cell6 = row1.createCell(5);
+        Cell row1cell6 = row1.createCell(6);
         row1cell6.setCellValue("请假次数");
         row1cell6.setCellStyle(cellStyle);
-        sheet.addMergedRegion(new CellRangeAddress(rowNumber, rowNumber + 1, 5, 5));
+        sheet.addMergedRegion(new CellRangeAddress(rowNumber, rowNumber + 1, 6, 6));
 
-        Cell row1cell7 = row1.createCell(6);
+        Cell row1cell7 = row1.createCell(7);
         row1cell7.setCellValue("缺勤次数");
         row1cell7.setCellStyle(cellStyle);
-        sheet.addMergedRegion(new CellRangeAddress(rowNumber, rowNumber + 1, 6, 6));
+        sheet.addMergedRegion(new CellRangeAddress(rowNumber, rowNumber + 1, 7, 7));
 
-        int cellNumber = 7;
+        int cellNumber = 8;
         for (String dayOfWeek : weekList) {
             Cell row1cell = row1.createCell(cellNumber);
             row1cell.setCellValue(dayOfWeek);