package com.sundot.airport.attendance.domain;

import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.sundot.airport.common.annotation.Excel;
import com.sundot.airport.common.core.domain.BaseEntity;


/**
 * 上岗记录对象 gitattendance_post_record
 *
 * @author wangchong
 * @date 2025-07-10
 */
@Data
public class AttendancePostRecord extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 租户号
     */
    private String tenantId;

    /**
     * 乐观锁
     */
    private Long revision;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 通道编码
     */
    private String channelCode;

    /**
     * 班次编码
     */
    private String shiftCode;

    /**
     * 上岗时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "上岗时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 5)
    private Date checkInTime;

    /**
     * 离岗时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "离岗时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 6)
    private Date checkOutTime;

    /**
     * 工作时长(分钟)
     */
    @Excel(name = "工作时长(分钟)", sort = 7)
    private Long workDuration;

    /**
     * 考勤状态
     */
    private String status;

    /**
     * 考勤日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "考勤日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 4)
    private Date attendanceDate;

    /**
     * 考勤班组ID
     */
    private Long attendanceTeamId;

    /**
     * 加班时长(分钟)
     */
    private Long overDuration;

    /**
     * 主键
     */
    private Long id;

    /**
     * 考勤班组名称
     */
    @Excel(name = "班组名称", sort = 2)
    private String attendanceTeamName;

    /**
     * 考勤科室ID
     */
    private Long attendanceDepartmentId;

    /**
     * 考勤科室名称
     */
    @Excel(name = "科室名称", sort = 3)
    private String attendanceDepartmentName;

    /**
     * 考勤大队ID
     */
    private Long attendanceBrigadeId;

    /**
     * 考勤大队名称
     */
    @Excel(name = "大队名称", sort = 13)
    private String attendanceBrigadeName;

    /**
     * 考勤机构站ID
     */
    private Long attendanceStationId;

    /**
     * 考勤机构站名称
     */
    private String attendanceStationName;

    /**
     * 通道名称
     */
    @Excel(name = "通道名称", sort = 10)
    private String channelName;

    /**
     * 区域编码
     */
    private String regionalCode;

    /**
     * 区域名称
     */
    @Excel(name = "区域名称", sort = 9)
    private String regionalName;

    /**
     * 航站楼编码
     */
    private String terminlCode;

    /**
     * 航站楼名称
     */
    @Excel(name = "航站楼名称", sort = 8)
    private String terminlName;

    /**
     * 用户名称
     */
    @Excel(name = "用户姓名", sort = 1)
    private String userName;

    /**
     * 班次名称
     */
    private String shiftName;

    /**
     * 备注
     */
    @Excel(name = "备注", sort = 12)
    private String remark;

    /**
     * 考勤状态名称
     */
    private String statusDesc;

    /**
     * 岗位编码
     */
    private String positionCode;

    @Override
    public String toString() {
        return "AttendancePostRecord{" +
                "tenantId='" + tenantId + '\'' +
                ", revision=" + revision +
                ", userId=" + userId +
                ", channelCode='" + channelCode + '\'' +
                ", shiftCode='" + shiftCode + '\'' +
                ", checkInTime=" + checkInTime +
                ", checkOutTime=" + checkOutTime +
                ", workDuration=" + workDuration +
                ", status='" + status + '\'' +
                ", attendanceDate=" + attendanceDate +
                ", attendanceTeamId=" + attendanceTeamId +
                ", overDuration=" + overDuration +
                ", id=" + id +
                ", attendanceTeamName='" + attendanceTeamName + '\'' +
                ", attendanceDepartmentId=" + attendanceDepartmentId +
                ", attendanceDepartmentName='" + attendanceDepartmentName + '\'' +
                ", attendanceBrigadeId=" + attendanceBrigadeId +
                ", attendanceBrigadeName='" + attendanceBrigadeName + '\'' +
                ", attendanceStationId=" + attendanceStationId +
                ", attendanceStationName='" + attendanceStationName + '\'' +
                ", channelName='" + channelName + '\'' +
                ", regionalCode='" + regionalCode + '\'' +
                ", regionalName='" + regionalName + '\'' +
                ", terminlCode='" + terminlCode + '\'' +
                ", terminlName='" + terminlName + '\'' +
                ", userName='" + userName + '\'' +
                ", shiftName='" + shiftName + '\'' +
                ", remark='" + remark + '\'' +
                ", statusDesc='" + statusDesc + '\'' +
                ", positionCode='" + positionCode + '\'' +
                ", positionName='" + positionName + '\'' +
                ", locked=" + locked +
                ", lockTime=" + lockTime +
                '}';
    }

    /**
     * 岗位名称
     */
    @Excel(name = "岗位名称", sort = 11)
    private String positionName;


    /**
     * 是否锁定
     */
    private Boolean locked;

    /**
     * 锁定时间
     */
    private Date lockTime;

    private Date checkInTimeStart;

    private Date checkInTimeEnd;

    private Integer checkOutTimeType;
    /**
     * 考勤开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date beginTime;
    /**
     * 考勤结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

    /**
     * 用户ID列表
     */
    private List<Long> userIdList;
}
