package cn.iocoder.yudao.module.system.controller.admin.biz.vo;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = false) // 设置 chain = false，避免用户导入有问题
public class ElderlyAskLeaveExportExcelVO {
    @ExcelProperty("老人姓名")
    private String elderName;

    @ExcelProperty("楼栋名称")
    private String buildName;

    @ExcelProperty("楼层名称")
    private String floorName;

    @ExcelProperty("房间号")
    private String roomName;

    @ExcelProperty("床位名称")
    private String bedName;

    @ExcelProperty("陪同人")
    private String accompanyPerson;

    @ExcelProperty("外出时间")
    private LocalDate outDate;

    @ExcelProperty("返回时间")
    private LocalDate comeDate;

    @ExcelProperty("外出登记人")
    private String outPerson;

    @ExcelProperty("联系电话")
    private String outPhone;

    @ExcelProperty("外出事由")
    private String remarks;

    @ExcelProperty("外出类型")
    private String type;

    @ExcelProperty("请假状态")
    private Integer leaveStatus;

    @ExcelProperty("预估天数")
    private BigDecimal numberDays;

    @ExcelProperty("租户名称")
    private String tenantName;

    @ExcelProperty("归属月")
    private String belongMonth;

    // 将 Date 转换为 LocalDate 的辅助方法
    public static LocalDate convertToLocalDate(Date date) {
        return date == null ? null : date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
    }
}