package com.ruoyi.common.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * 高级物流状态
 */
@Getter
public enum Kd100StateEnum
{
    KDLJ("1", "快件揽件"),
    YJXKJD("101", "已经下快件单"),
    DKDGSLS("102", "待快递公司揽收"),
    KDGSYJLS("103", "快递公司已经揽收"),
    KJZTZ("0", "快件在途中"),
    KJDDSJRCS("1001", "快件到达收件人城市"),
    KJCYYSGCZ("1002", "快件处于运输过程中"),
    KJFWWDXDSJDZ("1003", "快件发往到新的收件地址"),
    KJZZPSZ("5", "快件正在派件"),
    KJYJTDDKDGHZKDYZ("501", "快件已经投递到快递柜或者快递驿站"),
    KJYQS("3", "快件已签收"),
    SJRZCQS("301", "收件人正常签收"),
    KJXSPSYC("302", "快件显示派件异常，但后续正常签收"),
    KJYBDQ("303", "快件已被代签"),
    KJYCKDGHZYZQCQS("304", "快件已从快递柜或者驿站取出签收"),
    KJZCYFHFHRDTZ("6", "快件正处于返回发货人的途中"),
    CKJDYTQ("4", "此快件单已退签"),
    CKJDYCX("401", "此快件单已撤销"),
    SJJRJQKJ("14", "收件人拒签快件"),
    KJZGQTKDGSYJ("7", "快件转给其他快递公司邮寄"),
    KJCZYN("2", "快件存在疑难"),
    KJCSJPJHWQS("201", "快件长时间派件后未签收"),
    KJCSJMYPJHQS("202", "快件长时间没有派件或签收"),
    SJRFQJSKDDFHFQR("203", "收件人发起拒收快递，待发货方确认"),
    KJPJSYDYCQK("204", "快件派件时遇到异常情况"),
    KJZKDGHZYZCSSJWQ("205", "快件在快递柜或者驿站长时间未取"),
    WFLXDSJR("206", "无法联系到收件人"),
    CCKDGSDFWQFW("207", "超出快递公司的服务区范围"),
    KJZLZWDDMYPS("208", "快件滞留在网点，没有派送"),
    KJPS("209", "快件破损"),
    JJRSQCXJJ("210", "寄件人申请撤销寄件"),
    KJQG("8", "快件清关"),
    KJDDQG("10", "快件等待清关"),
    KJZZQGLCZ("11", "快件正在清关流程中"),
    KJYWCQGLC("12", "快件已完成清关流程"),
    HWZQGGCZCXYC("13", "货物在清关过程中出现异常"),
    SJRJQKJ1("14", "收件人拒签快件");

    private final String code;
    private final String info;

    Kd100StateEnum(String code, String info)
    {
        this.code = code;
        this.info = info;
    }

    /**
     * 检索高级物流值枚举
     */
    public static Kd100StateEnum getKd100StateEnum(String code){
        Kd100StateEnum[] values = Kd100StateEnum.values();
        return Arrays.stream(values)
                .filter(item -> item.getCode().equals(code))
                .findFirst()
                .orElse(null);
    }

}
