package cn.iocoder.yudao.module.attendance.controller.admin.info.vo;

import cn.iocoder.yudao.framework.excel.core.convert.StringToLocalTimeConverter;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalTime;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;

/**
 * 考勤信息 Excel 导入 VO
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = false) // 设置 chain = false，避免用户导入有问题
public class AttendanceInfoImportExcelVO {

    @ExcelProperty("员工姓名")
    private String employeeName;

    @ExcelProperty("员工手机号")
    private String employeeMobile;

    @ExcelIgnore
    private Long deptId;

    @ExcelProperty("部门名称")
    private String deptName;

    @ExcelProperty("职位名称")
    private String position;

    @ExcelProperty("考勤日期")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDate attendanceDate;

    @ExcelIgnore
    private String attendanceMonth;

    @ExcelProperty(value = "上班时间", converter = StringToLocalTimeConverter.class)
    @DateTimeFormat(pattern = FORMAT_HOUR_MINUTE_SECOND)
    private LocalTime workStartTime;

    @ExcelProperty(value = "下班时间", converter = StringToLocalTimeConverter.class)
    @DateTimeFormat(pattern = FORMAT_HOUR_MINUTE_SECOND)
    private LocalTime workEndTime;

}
