package com.zfire.jiasm.syncdata.constant;


import lombok.Getter;

/**
 * 平台工单当前状态  分两部分(安装与维修)
 * 左则数值为格力工单系统状态，方便对应处理
 * @author yaozx
 * @version 1.0
 * @date 2023-02-22
 */
@Getter
public enum OrderStatusEnumBak {
    /**
     * 预保存工单
     */
    INSTALL_STATUS_A1100("A1100","预保存工单"),

    /**
     * 已保存工单
     */
    INSTALL_STATUS_A1101("A1101","已保存工单"),

    /**
     * 待分部派工
     */
    INSTALL_STATUS_A1121("A1121","待分部派工"),

    /**
     * 待分部预派工
     */
    INSTALL_STATUS_A1122("A1122","待分部预派工"),

    /**
     * 格力品牌省份信息接口
     */
    INSTALL_STATUS_A1125("A1125","待分中心派工"),

    /**
     * 待网点派工
     */
    INSTALL_STATUS_A1129("A1129","待网点派工"),

    /**
     * 待网点预派工
     */
    INSTALL_STATUS_A1130("A1130","待网点预派工"),

    /**
     * 待审批改派
     */
    INSTALL_STATUS_A1135("A1135","待审批改派"),

    /**
     * 服务人员待接收
     */
    INSTALL_STATUS_A1301("A1301","服务人员待接收"),

    /**
     * 服务人员报完工
     */
    INSTALL_STATUS_A1304("A1304","服务人员报完工"),

    /**
     * 服务人员申请售后处理
     */
    INSTALL_STATUS_A1307("A1307","服务人员申请售后处理"),

    /**
     * 已作废工单
     */
    INSTALL_STATUS_A1308("A1308","已作废工单"),

    /**
     * 已关闭工单
     */
    INSTALL_STATUS_A1309("A1309","已关闭工单"),

    REPAIR_STATUS_B1("B1","保存"),
    REPAIR_STATUS_B2("B2","待分部派工"),
    REPAIR_STATUS_B3("B3","待分中心派工"),
    REPAIR_STATUS_B4("B4","待网点派工"),
    REPAIR_STATUS_B5("B5","待审批改派"),
    REPAIR_STATUS_B6("B6","待审批支援"),
    REPAIR_STATUS_B7("B18","待服务人员处理"),// 20,21,22,23,24
    REPAIR_STATUS_B8("B41","服务人员报完工"),
    REPAIR_STATUS_B9("B51","网点报完工"),
    REPAIR_STATUS_B10("B61","分中心报完工"),
    REPAIR_STATUS_B11("B71","分部报完工"),
    REPAIR_STATUS_B12("B100","历史信息"),
    REPAIR_STATUS_B13("B101","批量关闭"),
    REPAIR_STATUS_B14("B102","正常关闭"),
    REPAIR_STATUS_B15("B103","异常关闭"),


    ;




    /**
     * 编码
     */
    private final String code;


    private final String text;

    OrderStatusEnumBak(String code, String text) {
        this.code = code;
        this.text = text;
    }

    public static OrderStatusEnumBak getByCode(String code) {
        for (OrderStatusEnumBak item : values()) {
            if (code.equals(item.getCode())) {
                return item;
            }
        }
        return null;
    }

    /**
     * @param code: code
     * @return 对应枚举
     **/
    public static String getMessageByCode(String code) {
        String result = null;
        for (OrderStatusEnumBak item : values()) {
            if (code.equals(item.getCode())) {
                result = item.getText();
                break;
            }
        }
        return result;
    }
}
