package jnpf.enums.attendance;

import jnpf.constants.AttendanceConstant;
import lombok.Getter;

@Getter
public enum AttendanceNoticeEnum {
    CHECK_IN(1, AttendanceConstant.BEFORE_CLOCK_IN,"上班打卡"),
    CHECK_OUT(3,AttendanceConstant.BEFORE_CLOCK_IN,"下班打卡"),
    IN_MISSING(2,AttendanceConstant.WORK_MISSING,"上班缺卡"),
    OUT_MISSING(4,AttendanceConstant.WORK_MISSING,"下班缺卡"),
    ABSENCE(5,AttendanceConstant.WORK_MISSING,"班次旷工"),
    CONSECUTIVE_ABSENCE(5,AttendanceConstant.CONSECUTIVE_ABSENCE,"连续旷工"),
    CHECK_IN_QUICK(6,AttendanceConstant.FAST_CLOCK_IN,"上班极速打卡"),
    CHECK_OUT_QUICK(7,AttendanceConstant.FAST_CLOCK_IN,"下班极速打卡"),

    GROUP_LOCK(20,AttendanceConstant.GROUP_LOCK,"考勤组锁定"),
    GROUP_UNLOCK(21,AttendanceConstant.GROUP_UNLOCK,"考勤组解锁"),
    RULE_CHANGE_RATIO(22,AttendanceConstant.RULE_CHANGE_RATIO,"出勤换算比变动"),
    RULE_CHANGE_FIELD(23,AttendanceConstant.RULE_CHANGE_RATIO,"外勤打卡规则变动"),
    RULE_CHANGE_CARD_MAKEUP(24,AttendanceConstant.RULE_CHANGE_RATIO,"补卡规则变动"),
    RULE_CHANGE_GPS_SWIFT(25,AttendanceConstant.RULE_CHANGE_RATIO,"GPS打卡开关变动"),
    RULE_CHANGE_WIFI_SWIFT(26,AttendanceConstant.RULE_CHANGE_RATIO,"WIFI打卡开关变动"),
    RULE_CHANGE_KQJ_SWIFT(27,AttendanceConstant.RULE_CHANGE_RATIO,"考勤机打卡开关变动"),
    RULE_CHANGE_SHIFT_SYSTEM(28,AttendanceConstant.RULE_CHANGE_SHIFT_SYSTEM,"班制变动"),
    ADMINISTRATOR_CHANGE(29,AttendanceConstant.ADMINISTRATOR_CHANGE,"管理员变动"),
    CHECK_RESULT_CHANGE(30,AttendanceConstant.CHECK_RESULT_CHANGE,"出勤结果变动"),

    INDIVIDUAL_DAILY_STATISTICS(40,AttendanceConstant.INDIVIDUAL_DAILY_STATISTICS,"个人考勤日报"),
    INDIVIDUAL_MONTHLY_STATISTICS(41,AttendanceConstant.INDIVIDUAL_MONTHLY_STATISTICS,"个人统计月报"),
    TEAM_MONTHLY_STATISTICS(42,AttendanceConstant.TEAM_MONTHLY_STATISTICS,"团队统计月报"),

    SHIFT_CHANG(60,AttendanceConstant.SHIFT_CHANG,"班次变动"),
    LINE_SHIFT_CHANG(62,AttendanceConstant.LINE_SHIFT_CHANG,"划线班次变动"),
    LINE_SHIFT_NOT_SCHEDUING(63,AttendanceConstant.LINE_SHIFT_NOT_SCHEDUING,"划线班次未排班"),
    APPROVE(61, AttendanceConstant.APPROVE,"审批"),

    JOIN_GROUP(200,AttendanceConstant.JOIN_GROUP,"加入考勤组"),
    REMOVE_USER(201,AttendanceConstant.JOIN_GROUP,"考勤组离组"),
    REMOVE_USER_REMOVE_GROUP(202,AttendanceConstant.JOIN_GROUP,"考勤组解散-考勤组离组"),
    GROUP_CHANGE_REMOVE_JOIN_GROUP(203,AttendanceConstant.JOIN_GROUP,"考勤组解散加入新组-考勤组变动"),
    GROUP_CHANGE_SECONDMENT(204,AttendanceConstant.JOIN_GROUP,"借调-考勤组变动"),
    GROUP_CHANGE_TRANSFER_POSITION(205,AttendanceConstant.JOIN_GROUP,"调岗-考勤组变动"),
    GROUP_CHANGE(207,AttendanceConstant.JOIN_GROUP,"调动-考勤组变动"),
    GROUP_CHANGE_PROMOTION(206,AttendanceConstant.JOIN_GROUP,"晋升-考勤组变动"),
    CONSEC_UNSCHEDULED(43,AttendanceConstant.CONSEC_UNSCHEDULED,"连续未排班"),
    ;
    private Integer code;
    private final String serviceName;
    private String desc;
    AttendanceNoticeEnum(Integer code,String serviceName, String desc) {
        this.code = code;
        this.desc = desc;
        this.serviceName = serviceName;
    }
    public Integer getCode() {
        return code;
    }
    public String getServiceName() {
        return serviceName;
    }

    public static AttendanceNoticeEnum getAttendanceNoticeEnum(Integer code) {
        AttendanceNoticeEnum[] values = AttendanceNoticeEnum.values();
        for (AttendanceNoticeEnum value : values) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
