package com.dahe.gldriver.utils

import com.dahe.mylibrary.base.SingletonNoPHolder

/**
 * @ClassName OrderUtils
 * @Author john
 * @Date 2024/3/4 14:48
 * @Description 订单状态转换
 */
class OrderUtils private constructor() {

    companion object : SingletonNoPHolder<OrderUtils>(::OrderUtils)


    fun getOrderStatu(statu: String): String {
        return when (statu) {
            "102010" -> "草稿箱"
            "102020" -> "待调度"
            "102030" -> "待接单"
            "102040" -> "待装货"
            "102050" -> "待卸货"
            "102060" -> "待签收"
            "102070" -> "待结算"
            "102080" -> "待评价"
            "103000" -> "已取消"
            else -> {
                ""
            }
        }
    }


    fun getNextByStatu(statu: String): String {
        return when (statu) {
            "102010" -> "草稿箱"
            "102020" -> "待调度"
            "102030" -> "去接单"
            "102040" -> "去装货"
            "102050" -> "去卸货"
            "102060" -> "待签收"
            "102070" -> "待结算"
            "102080" -> "去评价"
            "103000" -> "已取消"
            else -> {
                ""
            }
        }
    }

    fun getStatuByString(statu: String): String {
        return when (statu) {
            "草稿箱" -> "102010"
            "待调度" -> "102020"
            "待接单" -> "102030"
            "待装货" -> "102040"
            "待卸货" -> "102050"
            "待签收" -> "102060"
            "待结算" -> "102070"
            "待评价" -> "102080"
            "已取消" -> "103000"
            else -> {
                ""
            }
        }
    }
}