package com.hotent.constant;

/**
 * 任务状态枚举
 *
 * @author 超级管理员
 * @company 山西清众科技股份有限公司
 */
public enum TaskStatusConstant {

    WAIT_SUBMIT("100", "待提交", 1),
    AUDITING("200", "审核中", 2),
    WAIT_FEEDBACK("250", "待反馈", 3),
    FEEDBACKED("260", "已反馈", 3),
    SUSPENDED("300", "中止", 3),
    COMPLETED("400", "办结", 4),
    NOT_PASSED("500", "不通过", 5),
    BCCL("600", "补充材料", 6);


    private String statusCode;
    private String statusName;
    private Integer orderNum;

    TaskStatusConstant(String statusCode, String statusName, Integer orderNum) {
        this.statusCode = statusCode;
        this.statusName = statusName;
        this.orderNum = orderNum;
    }

    public String getStatusCode() {
        return statusCode;
    }

    public String getStatusName() {
        return statusName;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    /**
     * 根据状态码获取状态名称
     * @param statusCode 状态码
     * @return 状态名称
     */
    public static String getStatusNameByCode(String statusCode) {
        for (TaskStatusConstant status : TaskStatusConstant.values()) {
            if (status.getStatusCode().equals(statusCode)) {
                return status.getStatusName();
            }
        }
        return null;
    }

    /**
     * 根据状态码获取排序号
     * @param statusCode 状态码
     * @return 排序号
     */
    public static Integer getOrderNumByCode(String statusCode) {
        for (TaskStatusConstant status : TaskStatusConstant.values()) {
            if (status.getStatusCode().equals(statusCode)) {
                return status.getOrderNum();
            }
        }
        return null;
    }

    /**
     * 根据状态码获取枚举对象
     * @param statusCode 状态码
     * @return 枚举对象
     */
    public static TaskStatusConstant getByCode(String statusCode) {
        for (TaskStatusConstant status : TaskStatusConstant.values()) {
            if (status.getStatusCode().equals(statusCode)) {
                return status;
            }
        }
        return null;
    }
}

