package com.cool.store.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * @Author: WangShuo
 * @Date: 2025/04/28/19:52
 * @Version 1.0
 * @注释:
 */
public enum DeclareGoodsTypeEnum {
  //   0-按1周/次报货 1-按月报货 2-自提 3-按2周/次投货  4-按3周/次投货”
    WEEK_ONCE("0", "按1周/次报货"),
    MONTH("1", "按月报货"),
    SELF_PICKUP("2", "自提"),
    TWO_WEEK_ONCE("3", "按2周/次投货"),
    THREE_WEEK_ONCE("4", "按3周/次投货");

    private String code;
    private String name;

    DeclareGoodsTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }


    public String getName() {
        return name;
    }

    public static String getNameByCode(String code) {
        if (StringUtils.isBlank(code)){
            return null;
        }
        for (DeclareGoodsTypeEnum declareGoodsTypeEnum : DeclareGoodsTypeEnum.values()) {
            if (declareGoodsTypeEnum.getCode().equals(code)) {
                return declareGoodsTypeEnum.getName();
            }
        }
        return null;
    }

}
