|
@@ -11,6 +11,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.LocalTime;
|
|
|
import java.util.*;
|
|
|
import java.io.IOException;
|
|
|
|
|
@@ -94,6 +96,24 @@ public class AttendanceInfoController {
|
|
|
BeanUtils.toBean(list, AttendanceInfoRespVO.class));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/get-import-template")
|
|
|
+ @Operation(summary = "获得导入考勤模板")
|
|
|
+ public void importTemplate(HttpServletResponse response) throws IOException {
|
|
|
+ // 手动创建导出 demo
|
|
|
+ List<AttendanceInfoImportExcelVO> list = Arrays.asList(
|
|
|
+ AttendanceInfoImportExcelVO.builder().employeeName("张三").employeeMobile("13555556666")
|
|
|
+ .deptName("人事部").position("人事专员").attendanceDate(LocalDate.now()).attendanceMonth("2024-07")
|
|
|
+ .workStartTime(LocalTime.of(8, 0)).workEndTime(LocalTime.of(17, 30))
|
|
|
+ .build(),
|
|
|
+ AttendanceInfoImportExcelVO.builder().employeeName("李四").employeeMobile("13555556666")
|
|
|
+ .deptName("财务部").position("财务经理").attendanceDate(LocalDate.now()).attendanceMonth("2024-07")
|
|
|
+ .workStartTime(LocalTime.of(9, 0)).workEndTime(LocalTime.of(18, 30))
|
|
|
+ .build()
|
|
|
+ );
|
|
|
+ // 输出
|
|
|
+ ExcelUtils.write(response, "考勤导入模板.xls", "考勤列表", AttendanceInfoImportExcelVO.class, list);
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/import-excel")
|
|
|
@Operation(summary = "导入考勤信息 Excel")
|
|
|
@Parameters({
|