package com.template.model.enumModel;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: binguo
 * @Date: 2023/7/6 星期四 16:34
 * @Description: com.template.model.enumModel
 * @Version: 1.0
 * 考勤状态
 */
// 准时：0
// 迟到：1
// 缺卡：3
// 请假：6
// 超时打卡：7
public enum eAttendanceStatu {
    OnTime(0),//准时
    BeLate(1),//迟到
    LackCard(3),//缺卡
    AskLeave(6),//请假
    ClockIn(7);//超时打卡

    private int value;

    eAttendanceStatu(int value){
        this.value = value;
    }

    public int getValue() {
        return value;
    }
    public static eAttendanceStatu valueOf(int value) {
        switch (value) {
            case 0:
                return eAttendanceStatu.OnTime;
            case 1:
                return eAttendanceStatu.BeLate;
            case 3:
                return eAttendanceStatu.LackCard;
            case 6:
                return eAttendanceStatu.AskLeave;
            case 7:
                return eAttendanceStatu.ClockIn;
            default:
                return null;
        }
    }

    public static Integer integerOf(String value) {
        switch (value) {
            case "准时":
                return 0;
            case "迟到":
                return 1;
            case "缺卡":
                return 3;
            case "请假":
                return 6;
            case "超时打卡":
                return 7;
            default:
                return null;
        }
    }

    public static String stringOf(Integer value) {
        switch (value) {
            case 0:
                return "准时";
            case 1:
                return "迟到";
            case 3:
                return "缺卡";
            case 6:
                return "请假";
            case 7:
                return "超时打卡";
            default:
                return null;
        }
    }

    /**
     * 获取考勤状态集合
     * @return
     */
    public static List<Integer> attendanceStatus(){
        List<Integer> result = new ArrayList<>();
        result.add(0);
        result.add(1);
        result.add(3);
        result.add(6);
        result.add(7);
        return result;
    }
}
