package com.brilliance.isc.common.quemod.vo;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum TrnRelflgStatus {

    RELEASE("R","已复核"),
    CONFIRM("A","分行已复核"),
    HEAD_HANDLE("B","总行已经办"),
    DELETED("D","收单行已完结"),
    REJECTED("N","已删除"),
    WAITING("W","待复核"),
    CORRECT("C","已退回"),
    FINISHED("F","已完成"),
    PICKUP("P","已处理"),
    W1("W1","待总行复核"),
    W2("W2","待分行复核"),
    G1("G1","押汇中心已分配"),
    G2("G2","押汇中心待分配"),
    C1("C1","已退回总行经办"),
    C2("C2","已退回分行经办"),
    P1("P1","总行经办暂存"),
    P2("P2","分行经办暂存");


    private final String value;
    private final String name;

    public static String getNameByValue(String value){
        for (TrnRelflgStatus s : TrnRelflgStatus.values()) {
            if (Objects.equals(s.getValue(), value)) {
                return s.getName();
            }
        }
        return "";
    }

}
