package cn.iocoder.yudao.module.order.enums;

import cn.hutool.core.util.ArrayUtil;
import cn.iocoder.yudao.framework.common.util.json.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@AllArgsConstructor
@Getter
public enum OrderSeaTimeEnum implements IntArrayValuable {

    SEA_ORDER_PLACED(200, "下单", "Order placed", "",""),
    //    SEA_IN_WAREHOUSE(520201, "入仓", "Warehousing", "货物已入捷道%s，本次入仓%s件，总入仓%s件","The There are %s ctns been arrived in E&C %s，TTL ctns are %s."),
    SEA_IN_WAREHOUSE(520201, "入仓", "Received", "货物已入捷道%s，本次入仓%s件，总入仓%s件","%s ctns have been arrived at E&C %s warehouse，TTL ctns are %s."),
    //    SEA_IN_WAREHOUSE_REMARK(520201, "入仓", "Warehousing", "货物已入捷道%s，本次入仓%s件，总入仓%s件，未到齐","%s ctns have been arrived at E&C %s warehouse，TTL ctns are %s. Incomplete"),
    SEA_IN_WAREHOUSE_REMARK(520201, "入仓", "Received", "货物已入捷道%s，总入仓%s件，未到齐","%s ctns have been arrived at E&C %s warehouse，TTL ctns are %s. Incomplete"),
    SEA_INSTALLED_CABINET(320412,"装柜", "loaded","货物已装柜，发往码头，预计%s日期开船","The shipment have been loaded into container and sent to the port, done with custom clearance by an estimated sailing date of %s."),
    SEA_CUSTOMS_IN_PROGRESS(120413, "报关", "Customs Declaration", "由于%s原因，待放行","Due to %s reasons, awaiting release"),
    SEA_CUSTOMS_PASS_SEA(120325, "报关", "Customs Declaration", "货物报关已放行，等待起运","Shipment is released by China customs, waiting to depart China, with an extimated sailing date of %s"),
    SEA_CUSTOMS_FULL_EXIT(120323, "报关", "Customs Declaration", "报关查验退场，返回仓库中","Shipment is inspected by China customs, waiting to return back to the warehouse"),
    SEA_HAS_TAKEN_OFF(13042601, "起运", "In shipment", "货物航运中，预计在%s日期到港","the shipment's estimated arrival time is:%s."),
    SEA_HAS_TAKEN_OFF_DELAY(13042602, "起运", "Departed", "由于%s原因，延误起运","Delayed takeoff due to %s"),
    SEA_ARRIVED(14032801, "到港", "Arrived", "货物已到港，清关中","The shipment has arrived the port of destination port, waiting for custom declaration to be done."),
    SEA_ARRIVED_DELAY(14032802, "到港", "Arrived", "由于%s原因，延误抵达目的地","Due to %s reasons, delayed arrival at the destination"),
    SEA_CLEARED_DELAY(14032803, "清关", "Cleared out", "由于%s原因，待清关","Due to %s reasons, customs clearance is pending"),
    SEA_CLEARED(150330, "清关", "Customs cleared", "货物已清关","Customs clearance of the shipment has been completed."),
    SEA_UNLOADED_CABINET(162180,"到仓", "Delivered","货物已抵达捷道%s提货仓","The shipment has been delivered to E&C %s branch."),
    SEA_UNLOADED_CABINET_DELAY(16043502,"到仓", "Delivered","由于%s原因，延误到仓时间","Due to %s reasons, the arrival time is delayed"),
    SEA_PICKED_UP(2000, "提货", "Collected", "货物已提货，本次提货%s件，剩余%s件","%s ctns has been collected by the consignee，remaining %s ctns in E&C destination branch. "),
//    SEA_PICKED_UP_FINISH(2000, "提货", "Picked up", "货物已提货","The shipment been picked up"),
    SEA_WAREHOUSE_WITHDRAWAL(7206, "退仓", "Warehouse Withdrawal", "货物已退仓","The shipment have been withdrawn from warehouse"),
    SEA_ORDER_CANCEL(8800, "取消订单", "Order Cancelled", "",""),


    ;


    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(OrderSeaTimeEnum::getValue).toArray();

    /**
     * key
     */
    private final Integer value;
    /**
     * 类型中文名
     */
    private final String nameZh;

    /**
     * 类型英文名
     */
    private final String nameEn;

    /**
     * 备注中文名
     */
    private final String remarksZh;

    /**
     * 备注英文名
     */
    private final String remarksEn;



    public static OrderSeaTimeEnum valueOf(Integer value) {
        return ArrayUtil.firstMatch(orderStatus -> orderStatus.getValue().equals(value), OrderSeaTimeEnum.values());
    }

    @Override
    public int[] array() {
        return ARRAYS;
    }

}
