package com.willalp.clockingin.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.ArrayList;
import java.util.List;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.willalp.common.annotation.Excel;
import com.willalp.common.core.domain.BaseEntity;

/**
 * 每日考勤信息对象 hs_pns_clocking_in
 *
 * @author willalp
 * @date 2022-04-26
 */

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("hs_pns_clocking_in")
public class HsPnsClockingIn extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @TableId
    private String clockingInId;

    /** 用户编号 */
    @Excel(name = "用户编号")
    private String userNo;

    /** 机构编号 */
    @Excel(name = "机构编号")
    private String orgNo;

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

    /** 当天时间 */
    @Excel(name = "当天时间")
    private String todayTime;

    /** 周几（0123456） */
    @Excel(name = "周几", readConverterExp = "0123456")
    private String week;

    /** 班次类型（0：早班，1：晚班） */
    @Excel(name = "班次类型", readConverterExp = "0=：早班，1：晚班")
    private String shiftId;

    /** 上班打卡时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Excel(name = "上班打卡时间", width = 30, dateFormat = "yyyy-MM-dd  HH:mm:ss")
    private Date dutyClockTime;

    /** 下班打卡时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Excel(name = "下班打卡时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date offDutyClockTime;

    /** 缺勤类型（0：正常，1：迟到，2：旷工，3：请假，4：调休） */
    @Excel(name = "缺勤类型", readConverterExp = "0=：正常，1：迟到，2：旷工，3：请假，4：调休")
    private String clockingInType;

    /** 迟到时长（分钟） */
    @Excel(name = "迟到时长", readConverterExp = "分=钟")
    private String belateTimeNum;

    /** 是否删除（0.未删除；1.已删除） */
    private Integer isDelete = 0;

    /**
     * 考勤班次信息
     */
    @TableField(exist = false)
    private List<HsPnsShift> hsPnsShiftList = new ArrayList<>();

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("clockingInId", getClockingInId())
            .append("userNo", getUserNo())
            .append("orgNo", getOrgNo())
            .append("userName", getUserName())
            .append("todayTime", getTodayTime())
            .append("week", getWeek())
            .append("shiftId", getShiftId())
            .append("dutyClockTime", getDutyClockTime())
            .append("offDutyClockTime", getOffDutyClockTime())
            .append("clockingInType", getClockingInType())
            .append("belateTimeNum", getBelateTimeNum())
            .append("remark", getRemark())
            .append("isDelete", getIsDelete())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("hsPnsShiftList", getHsPnsShiftList())
            .toString();
    }
}
