package com.zfire.jiasm.syncdata.constant;


import lombok.Getter;

/**
 * 平台工单派工状态  分两部分(安装与维修)
 * 左则数值为工单系统派工状态，方便对应处理
 * @author yaozx
 * @version 1.0
 * @date 2023-03-18
 */
@Getter
public enum GDAppointStatusEnumBak {
    // 安装-工单派工状态OK
    /**
     * 预保存工单
     */
    INSTALL_STATUS_A0_0("A1100","预保存工单"),

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

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

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

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

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

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

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

    /**
     * 服务人员待接收
     */
    INSTALL_STATUS_A0_8("A1301","服务人员待接收"),
    /**
     * 服务人员报完工
     */
    INSTALL_STATUS_A4_0("A1304","服务人员报完工"),

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

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

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

    // 维修-工单派工状态OK
    REPAIR_STATUS_G1("B1","保存"),
    REPAIR_STATUS_G2("B2","待分部派工"),
    REPAIR_STATUS_G3("B3","待分中心派工"),
    REPAIR_STATUS_G4("B4","待网点派工"),
    REPAIR_STATUS_G5("B5","待审批改派"),
    REPAIR_STATUS_G6("B6","待审批支援"),
    //REPAIR_STATUS_G7("B18","待服务人员处理"),// 20,21,22,23,24
    //REPAIR_STATUS_G8("B18","服务人员报完工"),
    // REPAIR_STATUS_G9("B51","网点报完工"),
    //REPAIR_STATUS_G10("B18","分中心报完工"),
    //REPAIR_STATUS_G11("B18","分部报完工"),
    //REPAIR_STATUS_G12("B100","历史信息"),
    //REPAIR_STATUS_G13("B101","批量关闭"),
    //REPAIR_STATUS_G14_0("A1304","正常关闭"),
    //REPAIR_STATUS_G14_1("B51","正常关闭"),
    //REPAIR_STATUS_G14_2("B51","正常关闭"),
    //REPAIR_STATUS_G14_3("B71","正常关闭"),
    //REPAIR_STATUS_G15_0("B100","历史信息"),
    //REPAIR_STATUS_G15_1("B101","批量关闭"),
    //REPAIR_STATUS_G15_2("A1309","正常关闭"),
    //REPAIR_STATUS_G16("B103","异常关闭"),

    REPAIR_STATUS_G13("YCJ","已采集"),
    REPAIR_STATUS_G14("YBWG","已报完工"),


    ;




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


    private final String text;

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

    public static GDAppointStatusEnumBak getByCode(String code) {
        for (GDAppointStatusEnumBak 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 (GDAppointStatusEnumBak item : values()) {
            if (code.equals(item.getCode())) {
                result = item.getText();
                break;
            }
        }
        return result;
    }
}
