package com.yida.data.common.core.entity.attendance;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.time.LocalTime;

@Data
@ApiModel(value = "com-yida-data-common-core-entity-attendance-EduAttendanceConfig")
@TableName(value = "edu_attendance_config")
public class EduAttendanceConfig {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "")
    private Long id;

    @TableField(value = "create_id")
    @ApiModelProperty(value = "")
    private Long createId;

    @TableField(value = "create_date")
    @ApiModelProperty(value = "")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;

    @TableField(value = "update_id")
    @ApiModelProperty(value = "")
    private Long updateId;

    @TableField(value = "update_date")
    @ApiModelProperty(value = "")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateDate;

    @TableField(value = "state")
    @ApiModelProperty("是否启用考勤（1是，其他否）")
    private String state;

    @TableField(value = "push_state")
    @ApiModelProperty("门禁进出策略：1=启用缴费可推送，其他=不启用")
    private String pushState;

    /**
     * 旷宿截止时间
     */
    @ApiModelProperty(value = "中午旷宿截止时间")
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "HH:mm:ss")
    private LocalTime dormitoryNoonDdl;

    /**
     * 旷宿截止时间
     */
    @ApiModelProperty(value = "晚上旷宿截止时间")
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "HH:mm:ss")
    private LocalTime dormitoryNightDdl;

    /**
     * 未到是否重复推送给家长状态 0-只推送一次，1-重复推送
     */
    @TableField(value = "school_repeat_push_status")
    @ApiModelProperty("未到是否重复推送给家长状态")
    private String schoolRepeatPushStatus;

    /**
     * 未到推送间隔时间
     */
    @TableField(value = "school_push_interval", updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "未到推送间隔时间")
    private Integer schoolPushInterval;

    /**
     * 未到推送对象，0-家长
     */
    @TableField(value = "school_push_obj")
    @ApiModelProperty(value = "未到推送对象，0-家长")
    private Integer schoolPushObj;

    /**
     * 旷宿是否重复推送给家长状态 0-只推送一次，1-重复推送
     */
    @TableField(value = "dormitory_repeat_push_status")
    @ApiModelProperty("旷宿是否重复推送给家长状态")
    private String dormitoryRepeatPushStatus;

    /**
     * 旷宿推送间隔时间
     */
    @TableField(value = "dormitory_push_interval", updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "旷宿推送间隔时间")
    private Integer dormitoryPushInterval;

    /**
     * 旷宿推送对象，0-家长
     */
    @TableField(value = "dormitory_push_obj")
    @ApiModelProperty(value = "旷宿推送对象，0-家长")
    private Integer dormitoryPushObj;

    /**
     * 0-只推送一次，1-重复推送
     */
    @TableField(value = "manage_repeat_push_status")
    @ApiModelProperty("是否重复推送给管理员")
    private String manageRepeatPushStatus;

    /**
     * 旷宿管理员推送间隔时间
     */
    @TableField(value = "dormitory_manage_push_interval", updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "旷宿管理员推送间隔时间")
    private Integer dormitoryManagePushInterval;

    /**
     * 旷宿管理员推送对象
     */
    @TableField(value = "dormitory_manage_push_obj")
    @ApiModelProperty(value = "旷宿管理员推送对象，0-宿管，1-班主任，2-年级长，3-副校长。多个用英文逗号隔开")
    private String dormitoryManagePushObj;

    /**
     * 学校id
     */
    @TableField(value = "school_id")
    @ApiModelProperty(value = "学校id")
    private Long schoolId;

    public static final LocalTime DORMITORY_NOON_DDL_DEFAULT = LocalTime.of(6, 0, 0);
    public static final LocalTime DORMITORY_NIGHT_DDL_DEFAULT = LocalTime.of(6, 0, 0);
    public static final Integer SCHOOL_PUSH_INTERVAL_DEFAULT = 30;
    public static final Integer SCHOOL_PUSH_OBJ_DEFAULT = 0;
    public static final Integer DORMITORY_PUSH_INTERVAL_DEFAULT = 30;
    public static final Integer DORMITORY_PUSH_OBJ_DEFAULT = 0;

    public static final String NOT_REPEAT_PUSH_STATUS = "0";
    public static final String REPEAT_PUSH_STATUS = "1";


    public static final Integer DORMITORY_MANAGE_PUSH_INTERVAL_DEFAULT = 30;
    public static final String DORMITORY_MANAGE_PUSH_OBJ_DEFAULT = "0";
}