| | |
| | | workbook = new SXSSFWorkbook(); |
| | | workbook.setCompressTempFiles(false); |
| | | |
| | | Sheet sheet = workbook.createSheet("月考勤表"); |
| | | Sheet sheet = workbook.createSheet(reqJson.getIntValue("taskYear") + "年" + reqJson.getIntValue("taskMonth") + "月考勤表"); |
| | | Row row = sheet.createRow(0); |
| | | row.createCell(0).setCellValue("部门"); |
| | | row.createCell(1).setCellValue("员工"); |
| | |
| | | calendar.set(Calendar.MONTH, reqJson.getIntValue("taskMonth") - 1); |
| | | int maxDayOfMonth = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); |
| | | for (int day = 1; day <= maxDayOfMonth; day++) { |
| | | row.createCell(day + 2).setCellValue(day + "日"); |
| | | row.createCell(day + 1).setCellValue(day + "日"); |
| | | } |
| | | |
| | | row.createCell(2 + maxDayOfMonth + 1).setCellValue("正常考勤"); |
| | | row.createCell(2 + maxDayOfMonth + 2).setCellValue("迟到"); |
| | | row.createCell(2 + maxDayOfMonth + 3).setCellValue("早退"); |
| | | row.createCell(2 + maxDayOfMonth + 4).setCellValue("旷工"); |
| | | row.createCell(2 + maxDayOfMonth + 5).setCellValue("免考勤"); |
| | | row.createCell(1 + maxDayOfMonth + 1).setCellValue("正常考勤"); |
| | | row.createCell(1 + maxDayOfMonth + 2).setCellValue("迟到"); |
| | | row.createCell(1 + maxDayOfMonth + 3).setCellValue("早退"); |
| | | row.createCell(1 + maxDayOfMonth + 4).setCellValue("旷工"); |
| | | row.createCell(1 + maxDayOfMonth + 5).setCellValue("免考勤"); |
| | | |
| | | |
| | | AttendanceClassesTaskDto attendanceClassesTaskDto = BeanConvertUtil.covertBean(reqJson, AttendanceClassesTaskDto.class); |
| | |
| | | dayObj = attendanceClassesTaskDto.getDays(); |
| | | for (int day = 1; day <= maxDayOfMonth; day++) { |
| | | if (!dayObj.containsKey(day)) { |
| | | row.createCell(day + 2).setCellValue("无需考勤"); |
| | | row.createCell(day + 1).setCellValue("休息"); |
| | | continue; |
| | | } |
| | | if (dayObj.get(day) == null) { |
| | | row.createCell(day + 2).setCellValue("无需考勤"); |
| | | row.createCell(day + 1).setCellValue("休息"); |
| | | continue; |
| | | } |
| | | detailDtos = (List<AttendanceClassesTaskDetailDto>) dayObj.get(day); |
| | | if (detailDtos == null || detailDtos.size() < 1) { |
| | | row.createCell(day + 2).setCellValue("无需考勤"); |
| | | row.createCell(day + 1).setCellValue("休息"); |
| | | continue; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (!AttendanceClassesTaskDetailDto.STATE_WAIT.equals(detailDto.getState())) { |
| | | value += (detailDto.getCheckTime()+"("+detailDto.getStateName()+");"); |
| | | value += (detailDto.getCheckTime() + "(" + detailDto.getStateName() + ");" + String.valueOf((char) 10)); |
| | | } else { |
| | | value += (" - ("+detailDto.getStateName()+");"); |
| | | value += (" - (" + detailDto.getStateName() + ");" + String.valueOf((char) 10)); |
| | | } |
| | | } |
| | | row.createCell(day + 2).setCellValue(value); |
| | | row.createCell(day + 1).setCellValue(value); |
| | | } |
| | | |
| | | row.createCell(2 + maxDayOfMonth + 1).setCellValue(attendanceClassesTaskDto.getClockIn()); |
| | | row.createCell(2 + maxDayOfMonth + 2).setCellValue(attendanceClassesTaskDto.getLate()); |
| | | row.createCell(2 + maxDayOfMonth + 3).setCellValue(attendanceClassesTaskDto.getEarly()); |
| | | row.createCell(2 + maxDayOfMonth + 4).setCellValue(attendanceClassesTaskDto.getNoClockIn()); |
| | | row.createCell(2 + maxDayOfMonth + 5).setCellValue(attendanceClassesTaskDto.getFree()); |
| | | row.createCell(1 + maxDayOfMonth + 1).setCellValue(attendanceClassesTaskDto.getClockIn()); |
| | | row.createCell(1 + maxDayOfMonth + 2).setCellValue(attendanceClassesTaskDto.getLate()); |
| | | row.createCell(1 + maxDayOfMonth + 3).setCellValue(attendanceClassesTaskDto.getEarly()); |
| | | row.createCell(1 + maxDayOfMonth + 4).setCellValue(attendanceClassesTaskDto.getNoClockIn()); |
| | | row.createCell(1 + maxDayOfMonth + 5).setCellValue(attendanceClassesTaskDto.getFree()); |
| | | } |
| | | } |
| | | |