package com.zfire.mall.manager.enums;

import cn.hutool.core.util.EnumUtil;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

@Getter
public enum JiaXianProcessStatusEnum {
    COST_CAN_NOT_START_CHECK("COST_CAN_NOT_START_CHECK","账单不能发起对账"),
    COST_CAN_START_MERCHANT_CHECK("COST_CAN_START_MERCHANT_CHECK","账单能发起商家对账"),
    COST_WAIT_START_MERCHANT_CHECK("COST_WAIT_START_MERCHANT_CHECK","等待发起商家对账"),
    COST_IN_MERCHANT_CHECK("COST_IN_MERCHANT_CHECK","商家对账中"),
    COST_MERCHANT_CHECK_EXCEPTION("COST_MERCHANT_CHECK_EXCEPTION","商家对账异常"),
    COST_IN_MERCHANT_TICKET("COST_IN_MERCHANT_TICKET","商家工单流程中"),
    COST_CAN_START_SALES_CHECK("COST_CAN_START_SALES_CHECK","账单能发起销司对账"),
    COST_WAIT_START_SALES_CHECK("COST_WAIT_START_SALES_CHECK","等待发起销司对账"),
    COST_IN_SALES_CHECK("COST_IN_SALES_CHECK","销司对账中"),
    COST_SALES_CHECK_EXCEPTION("COST_SALES_CHECK_EXCEPTION","销司对账异常"),
    COST_IN_SALES_TICKET("COST_IN_SALES_TICKET","销司工单流程中"),
    COST_OVER_SALES_TICKET("COST_OVER_SALES_TICKET","销司异常工单完结（等待再次发起流程）"),
    COST_INVALID("COST_INVALID","无效"),
    COST_FINISH_CHECK("COST_FINISH_CHECK","对账完成"),
    TICKET_CREATE("TICKET_CREATE","制单"),
    TICKET_REVIEWING("TICKET_REVIEWING","审核"),
    TICKET_DOC("TICKET_DOC","归档"),


    ;
    @JsonValue
    @EnumValue
    private String key;
    private String value;

    JiaXianProcessStatusEnum(String key, String value){
        this.key=key;
        this.value = value;
    }

    public static String getMsg(String examineStatus) {
        if (StringUtils.isNotBlank(examineStatus)) {
            Map<String, Object> enumMap = EnumUtil.getNameFieldMap(JiaXianProcessStatusEnum.class, "value");
            return enumMap.get(examineStatus).toString();
        }
        return "";
    }
}
