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

import com.brilliance.isc.bo.Bch;
import com.brilliance.isc.mda.dao.BchMapper;
import com.brilliance.isc.vo.component.ore.OreInfoVo;
import lombok.AllArgsConstructor;
import lombok.Getter;

import javax.annotation.Resource;
import java.util.*;

@Getter
@AllArgsConstructor
public enum OrdStaStatus {
    //非收单行流程
    BRK("BRK","经办行经办暂存"),
    TRN("TRN","经办行经办提交"),
    COE("COE","经办行经办退回"),
    COR("COR","经办行复核退回"),
    SIG("SIG","经办行复核"),
    BEL("BEL","经办行复核完成"),

    //收单行流程
    SRK("SRK","收单行经办暂存"),
    SRN("SRN","收单行经办提交"),
    SOE("SOE","收单行经办退回"),
    SOR("SOR","收单行复核退回"),
    SPT("SPT","收单行复核"),

    //押汇中心处理
    CTR("CTR","押汇中心退回分行"),
    CMB("CMB","押汇中心经办暂存"),
    CME("CME","押汇中心经办退回"),
    CMR("CMR","押汇中心复核退回"),
    CMT("CMT","押汇中心经办提交"),
    CIG("CIG","押汇中心复核"),
    CEL("CEL","押汇中心复核完成"),

    //单证中心处理
    RTR("RTR","单证中心退回分行"),
    RIG("RIG","单证中心复核"),
    REL("REL","单证中心复核完成"),

    //业务完成
    FIN("FIN","业务完成"),

    //待处理状态
    ASSIGN("ASG","押汇中心已分配"),
    NEW("NEW","押汇中心待分配"),

    //待处理状态
    TAK("TAK","经办行待经办"),
    SAK("SAK","收单行待经办"),
    CAK("CAK","押汇中心待经办"),
    //------------以下不常用
    ROU("ROU","ReRouting"),
    COM("COM","客户已确认"),
    DEL("DEL","业务删除"),
    INC("INC","报文接收"),
    DES("DES","垃圾篓删除"),
    CAN("CAN","订单取消"),
    CRE("CRE","ORD Waiting"),
    ADD("ADD","手工备注"),
    MAN("MAN","系统备注");

    private final String value;
    private final String name;

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