package jnpf.constants;

import jnpf.util.DateUtil;

import java.util.Date;

public class AttendanceConstant {
    public final static String APPLY_FAIL_RESULT1 = "申请时间与原%s时间冲突，请重新选择";
    public final static String SCHEDULING_FAIL_RESULT2 = "用户%s %s已存在%s，不能进行%s";
    public final static String LEAVE = "请假";
    public final static String REST = "排休";
    public final static String ORDINARY = "上班";
    public final static String WORKOVERTIME = "加班";
    public final static String STEP_OUT = "外出、出差";

    public final static String HOLIDAYS_COLOR = "31,192,138";

    public static final String FTB_ATTENDANCE_NOTICE_CONFIRM_KEY = "ftb:attendance:notice:confirm:%s:%s";
    //考勤模块头像
    public final static String ATTENDANCE_APP_LOGO = "https://jnpf-resource-1304460613.cos.ap-chengdu.myqcloud.com/jnpf-resources/WebAnnexFile/66b96888e4b0ac7b700b2ef3.png";
    //考勤通知-确认接口
    public final static String ATTENDANCE_NOTICE_CONFIRM_URL = "/api/ftb/attendance/notice/confirm/%s";
    //考勤小程序id
    public final static String MP_ID = "__UNI__748697E";
    //确认列表页面地址
    public final static String ATTENDANCE_NOTICE_CONFIRM_LIST_VIEW_URL = "/pages/clockingInV2/InfoPush/ConfirmList?id=%s";
    //确认列表页面地址
    public final static String ATTENDANCE_NOTICE_CONFIRM_LIST_BUTTON_NAME = "确认人员名单";
    public final static String ATTENDANCE_NOTICE_CONFIRM = "确认收到";
    public final static String ATTENDANCE_NOTICE_CONFIRMED = "已收到";
    public final static String ATTENDANCE_NOTICE_DETAIL_BUTTON_NAME = "查看详情";
    //出勤规则页面
    public final static String ATTENDANCE_NOTICE_RULE_URL = "/pages/clockingInV2/AttendanceRules";
    public final static String ATTENDANCE_NOTICE_GROUP_CHANGES_URL = "/pages/clockingInV2/InfoPush/AttendanceGroupChanges?id=%s";
    //详情页面
    public final static String ATTENDANCE_NOTICE_SHIFT_CHANGE_DETAIL_URL = "/pages/clockingInV2/InfoPush/ShiftChanges?id=%s";
    public final static String BTN_SCHEDULE_URL = "/pages/clockingInV2/schedulingPage/index?AttendanceGroup=%s";
    public final static String BTN_LINE_SCHEDULE_URL = "/pages/clockingInV2/lineScheduling/index?AttendanceGroup=%s";
    public final static String BTN_SCHEDULE_GO = "去排班";
    /** 跳转按钮-查看详情 */
    public static final String BTN_NAME_TO_DETAIL = "查看详情";
    /** URL-极速打卡详情 */
    public static final String BTN_FAST_DETAIL_URL = "/pages/clockingInV2/MyAttendance/index";
    /** URL- 连续旷工查看详情 */
    public static final String BTN_CONSECUTIVE_ABSENCE_URL = "/pages/clockingInV2/InfoPush/ContinuousAbsenceNotice?id=%s";
    /** 跳转按钮-极速更新打卡 */
    public static final String BTN_NAME_FAST_UPDATE = "更新打卡";
    /** URL-极速更新打卡 */
    public static final String BTN_FAST_UPDATE_URL = "/pages/clockingInV2/index";
    /** 跳转按钮-申请补卡 */
    public static final String BTN_NAME_REPAIR = "申请补卡";
    /** URL-申请补卡 */
    public static final String BTN_REPAIR_URL = "/pages/oaApproval/manage/template?flowId=%s&templateId=%s&internalLink=%s";
    /** 跳转按钮-去打卡 */
    public static final String BTN_NAME_GO = "去打卡";
    /** URL-考勤规则 */
    public static final String BTN_RULE_URL = "/pages/clockingInV2/AttendanceRules";
    /** 标题-极速打卡成功 */
    public static final String TITLE_FAST = "%s极速打卡成功";
    /** 标题-连续旷工通知 */
    public static final String TITLE_CONSECUTIVE_ABSENCE = "成员连续旷工通知";
    public static final String TITLE_ABSENCE = "班次旷工提醒";
    public static final String TITLE_ON_WORK = "上班缺卡提醒";
    public static final String TITLE_OFF_WORK = "下班缺卡提醒";
    public static final String TITLE_BEFORE_ON_WORK = "上班打卡提醒";
    public static final String TITLE_BEFORE_OFF_WORK = "下班打卡提醒";
    public static final String TITLE_CLOCK_IN_CHANGE = "您的出勤结果已被管理员变更";
    /** 上班 */
    public static final String ON_WORK = "上班";
    /** 下班 */
    public static final String OFF_WORK = "下班";

    public final static String ATTENDANCE_NOTICE_TO_CLICK = "去打卡";
    public final static String ATTENDANCE_NOTICE_SHIFT_CHANGE_TITLE = "您的班次已被修改";
    public final static String ATTENDANCE_NOTICE_CONSEC_UNSCHEDULED_TITLE = "多天未排班提醒";
    public final static String ATTENDANCE_NOTICE_LINE_SHIFT_CHANGE_TITLE = "划线排班提醒通知";
    public final static String ATTENDANCE_NOTICE_LINE_SCHEDULED_TITLE = "划线排班定时提醒";

    public final static String ATTENDANCE_NOTICE_JOIN_GROUP_CHANGE_TITLE = "加入考勤组提示";
    public final static String ATTENDANCE_NOTICE_GROUP_CHANGE_TITLE = "考勤组变动提示";
    public final static String ATTENDANCE_NOTICE_REMOVE_USER_TITLE = "考勤组离组提示";

    public final static String ATTENDANCE_NOTICE_RULE_CHANGE_TITLE = "当前考勤组规则变动";
    public final static String ATTENDANCE_NOTICE_ADMIN_RULE_CHANGE_TITLE = "管理考勤组规则变动";
    //打卡页面
    public final static String ATTENDANCE_NOTICE_CLICK_URL = "/pages/clockingInV2/index";

    //打卡前提醒
    public final static String BEFORE_CLOCK_IN = "BEFORE_CLOCK_IN";
    //缺卡/旷工提醒
    public final static String WORK_MISSING = "WORK_MISSING";
    //极速打卡
    public final static String FAST_CLOCK_IN = "FAST_CLOCK_IN";
    //连续旷工
    public final static String CONSECUTIVE_ABSENCE = "CONSECUTIVE_ABSENCE";
    //考勤组锁定
    public final static String GROUP_LOCK = "GROUP_LOCK";
    public final static String TITLE_GROUP_LOCK = "当前考勤组被锁定提示";
    public final static String GROUP_LOCK_URL1 = "/pages/message/userDetail/index?userId=%s";
    public final static String GROUP_LOCK_BUTTON_NAME1 = "联系管理员";
    public final static String GROUP_LOCK_BUTTON_NAME2 = "查看详情";
    public final static String GROUP_LOCK_URL2 = "/pages/clockingInV2/InfoPush/attendanceLockedUnlocked?type=1&id=%s";
    //考勤组解锁
    public final static String GROUP_UNLOCK = "GROUP_UNLOCK";
    public final static String TITLE_GROUP_UNLOCK = "当前考勤组解锁提示";
    public final static String GROUP_UNLOCK_URL = "/pages/clockingInV2/InfoPush/attendanceLockedUnlocked?type=2&id=%s";
    //出勤换算比变动
    public final static String RULE_CHANGE_RATIO = "RULE_CHANGE_RATIO";
    //外勤打卡规则变动
    public final static String RULE_CHANGE_FIELD = "RULE_CHANGE_FIELD";
    //补卡规则变动
    public final static String RULE_CHANGE_CARD_MAKEUP = "RULE_CHANGE_CARD_MAKEUP";
    //GPS打卡开关变动
    public final static String RULE_CHANGE_GPS_SWIFT = "RULE_CHANGE_GPS_SWIFT";
    //班制变动
    public final static String RULE_CHANGE_SHIFT_SYSTEM = "RULE_CHANGE_SHIFT_SYSTEM";
    //管理员变动
    public final static String ADMINISTRATOR_CHANGE = "ADMINISTRATOR_CHANGE";
    public final static String ADMINISTRATOR_CHANGE_BUTTON_NAME1 = "查看详情";
    public final static String ADMINISTRATOR_CHANGE_URL1 = "/pages/clockingInV2/InfoPush/AttendanceGroupAdministratorChange?id=%s";
    public final static String ADMINISTRATOR_CHANGE_BUTTON_NAME2 = "进入团队考勤";
    public final static String ADMINISTRATOR_CHANGE_URL2 = "/pages/clockingInV2/TeamAttendance/index?groupId=%s";
    public final static String ADMINISTRATOR_CHANGE_TITLE1 = "您已成为【%s】的管理员";
    public final static String ADMINISTRATOR_CHANGE_TITLE2 = "您已不是【%s】的管理员";
    public final static String ADMINISTRATOR_CHANGE_URL3 = "/pages/message/userDetail/index?userId=%s";
    public final static String ADMINISTRATOR_CHANGE_NAME3 = "联系管理员";
    //出勤结果变动
    public final static String CHECK_RESULT_CHANGE = "CHECK_RESULT_CHANGE";
    //个人考勤日报
    public final static String INDIVIDUAL_DAILY_STATISTICS = "INDIVIDUAL_DAILY_STATISTICS";
    public final static String INDIVIDUAL_DAILY_STATISTICS_BUTTON_NAME1 = "查看报表";
    public final static String INDIVIDUAL_DAILY_STATISTICS_URL1 = "/pages/clockingInV2/InfoPush/AttendanceReport?type=1&id=%s";
    public final static String INDIVIDUAL_DAILY_STATISTICS_BUTTON_NAME2 = "我的考勤";
    public final static String INDIVIDUAL_DAILY_STATISTICS_URL2 = "/pages/clockingInV2/MyAttendance/index";
    //个人统计月报
    public final static String INDIVIDUAL_MONTHLY_STATISTICS = "INDIVIDUAL_MONTHLY_STATISTICS";
    public final static String INDIVIDUAL_MONTHLY_STATISTICS_BUTTON_NAME1 = "查看报表";
    public final static String INDIVIDUAL_MONTHLY_STATISTICS_URL1 = "/pages/clockingInV2/InfoPush/AttendanceReport?type=2&id=%s";
    public final static String INDIVIDUAL_MONTHLY_STATISTICS_BUTTON_NAME2 = "查看详情";
    public final static String INDIVIDUAL_MONTHLY_STATISTICS_URL2 = "/pages/clockingInV2/MyAttendance/AttendanceDataStatistics";
    //团队统计月报
    public final static String TEAM_MONTHLY_STATISTICS = "TEAM_MONTHLY_STATISTICS";
    public final static String TEAM_MONTHLY_STATISTICS_BUTTON_NAME1 = "查看报表";
    public final static String TEAM_MONTHLY_STATISTICS_URL1 = "/pages/clockingInV2/InfoPush/AttendanceReport?type=3&id=%s";
    public final static String TEAM_MONTHLY_STATISTICS_BUTTON_NAME2 = "进入团队考勤";
    public final static String TEAM_MONTHLY_STATISTICS_URL2 = "/pages/clockingInV2/TeamAttendance/index";
    //加入考勤组
    public final static String JOIN_GROUP = "JOIN_GROUP";
    //考勤组解散加入新组
    public final static String GROUP_CHANGE_REMOVE_JOIN_GROUP = "GROUP_CHANGE_REMOVE_JOIN_GROUP";
    //借调-考勤组变动
    public final static String GROUP_CHANGE_SECONDMENT = "GROUP_CHANGE_SECONDMENT";
    //调岗/晋升考勤组变动
    public final static String GROUP_CHANGE_TRANSFER_OR_PROMOTION = "GROUP_CHANGE_TRANSFER_OR_PROMOTION";
    //班次变动
    public final static String SHIFT_CHANG = "SHIFT_CHANG";
    public final static String LINE_SHIFT_CHANG = "LINE_SHIFT_CHANG";
    public final static String LINE_SHIFT_NOT_SCHEDUING = "LINE_SHIFT_NOT_SCHEDUING";
    //连续未排班
    public final static String CONSEC_UNSCHEDULED = "CONSEC_UNSCHEDULED";
    public final static String APPROVE = "APPROVE";
    // 被借调人员查看到的审批页面
    public final static String APPROVE_SECONDED_URL = "/pages/clockingInV2/InfoPush/AttendanceApproval?id=%s";

    public final static String APPROVE_URL = "/pages/workFlow/flowBefore/index?config=";
    //黑色
    public final static String COLOR_BLACK = "#1A1A1A";
    //蓝色
    public final static String COLOR_BLUE = "#3C6DF8";


    public static String getApplyResult(String realName, String oldTypeStr) {
        return String.format(APPLY_FAIL_RESULT1, oldTypeStr);
    }
    public static String getSchedulingResult(String realName, Date date, String oldTypeStr, String currTypeStr) {
        return String.format(SCHEDULING_FAIL_RESULT2, realName, DateUtil.daFormat(date), oldTypeStr,currTypeStr);
    }

    // ==================== 考勤本导入相关常量 ====================

    /**
     * 导入错误：考勤本配置不存在
     */
    public static final String ERR_IMPORT_CONFIG_NOT_FOUND = "考勤本配置不存在";
    /**
     * 导入错误：考勤本配置已禁用
     *
     */
    public static final String ERR_IMPORT_CONFIG_DISABLED = "当前考勤本已被禁用";

    /**
     * 导入错误：导入数据为空
     */
    public static final String ERR_IMPORT_DATA_EMPTY = "导入数据为空，请检查Excel文件内容";

    /**
     * 导入错误：表头日期与月份不匹配
     */
    public static final String ERR_IMPORT_HEADER_DATE_MISMATCH = "表头日期与所选月份不匹配";

    /**
     * 导入错误：数据行超过上限（不含表头）
     */
    public static final String ERR_IMPORT_EXCEED_MAX_ROWS = "导入数据已超过500行上限（不含表头），最多支持500行，请分批导入";
    /**
     * 导入错误：考勤本名称（首列）为空
     */
    public static final String ERR_IMPORT_BOOK_NAME_EMPTY = "考勤本名称不能为空，请填写与所选考勤本一致的名称";

    /**
     * 导入错误：数据行考勤本名称与根据所选考勤本 ID 解析出的名称不一致
     */
    public static final String ERR_IMPORT_BOOK_NAME_ROW_MISMATCH = "考勤本名称与所选考勤本「%s」不一致";

    /**
     * 导入错误：手机号不能为空
     */
    public static final String ERR_IMPORT_PHONE_EMPTY = "手机号不能为空";

    /**
     * 导入错误：手机号重复
     */
    public static final String ERR_IMPORT_PHONE_DUPLICATE = "手机号[%s]重复";

    /**
     * 导入错误：手机号未找到对应员工
     */
    public static final String ERR_IMPORT_PHONE_NOT_FOUND = "手机号[%s]未在考勤本中找到对应员工";

    /**
     * 导入错误：考勤状态不合法
     */
    public static final String ERR_IMPORT_STATUS_INVALID = "考勤状态不合法[%s]，允许值：正常、公休、迟到、早退、缺卡、请假、出差、外出、外勤、旷工，或系统中配置的请假类型名称";

    /**
     * 导入错误：日期不在月份范围内
     */
    public static final String ERR_IMPORT_DATE_OUT_OF_RANGE = "日期不在%s月范围内";

    /**
     * 导入错误：日期解析失败
     */
    public static final String ERR_IMPORT_DATE_PARSE_FAILED = "日期解析失败";

    /**
     * 导入错误：数据解析失败
     */
    public static final String ERR_IMPORT_DATA_PARSE_FAILED = "数据解析失败";

    /**
     * 导入失败前缀
     */
    public static final String ERR_IMPORT_FAILED_PREFIX = "导入失败：";

    // ==================== 考勤本导出相关常量 ====================

    /**
     * 导出模板表头：班次列名
     */
    public static final String HEADER_SHIFT = "班次";

    /**
     * 上半天显示文本
     */
    public static final String PERIOD_MORNING = "上";

    /**
     * 下半天显示文本
     */
    public static final String PERIOD_AFTERNOON = "下";

    // ==================== 考勤本操作日志相关常量 ====================

    /**
     * HTML红色标记开始标签
     */
    public static final String RED_MARK_START = "<span style=\"color:red\">";

    /**
     * HTML红色标记结束标签
     */
    public static final String RED_MARK_END = "</span>";
    /**
     * 操作日志：更新考勤记录
     */
    public static final String LOG_OPERATION_CLEAN = "清空考勤本记录";
    /**
     * 操作日志：更新考勤记录
     */
    public static final String LOG_OPERATION_UPDATE = "更新考勤本记录";

    /**
     * 操作日志：新增考勤记录
     */
    public static final String LOG_OPERATION_ADD = "新增考勤本记录";

    // ==================== 考勤本配置相关常量 ====================

    /**
     * 考勤本名称已存在错误提示
     */
    public static final String ERR_BOOK_NAME_EXISTS = "考勤本名称已存在，请使用其他名称";

    /**
     * 未查询到考勤本配置错误提示
     */
    public static final String ERR_CONFIG_NOT_FOUND = "未查询到考勤本配置";

    /**
     * 未找到考勤本配置错误提示
     */
    public static final String ERR_CONFIG_NOT_EXIST = "未找到考勤本配置";

    /**
     * 考勤本已存在记录时不允许变更使用范围（组织/成员）
     */
    public static final String ERR_BOOK_SCOPE_CHANGE_HAS_RECORDS = "该考勤本已存在考勤记录，不允许变更使用范围（组织）";
}
