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 OrderAirTimeEnum implements IntArrayValuable {
    //1未使用
    AIR_ORDER_PLACED(200, "下单", "Order placed", "",""),
//    AIR_IN_WAREHOUSE(520201, "入仓", "Warehousing", "货物已入捷道%s","The shipment has been delivered to E&C %s"),
    //    SEA_IN_WAREHOUSE(520201, "入仓", "Warehousing", "货物已入捷道%s，本次入仓%s件，总入仓%s件","%s ctns have been arrived at E&C %s warehouse，TTL ctns are %s."),
    AIR_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"),
    AIR_IN_WAREHOUSE_REMARK(520201, "入仓", "Received", "货物已入捷道%s，总入仓%s件，未到齐","%s ctns have been arrived at E&C %s warehouse，TTL ctns are %s. Incomplete"),
    AIR_PACKED(520202, "打包", "Packed", "货物已完成二次打包","The shipment has been packed, waiting to be dispatched."),// 打包完成时调用
    AIR_WAREHOUSED(320412,"出仓", "Dispatched","货物已出库，发往国际机场","One the way to China International airport."),
    AIR_CUSTOMS_IN_PROGRESS(120413, "报关", "Customs Declaration", "由于%s原因，待放行","Due to %s reasons, awaiting release"),
    AIR_CUSTOMS_PASS_AIR(120421, "报关", "Customs Declaration", "货物报关已放行，候机中","Shipment has been released by China custom, waiting to departed China."),
    AIR_CUSTOMS_PART_EXIT(120414, "报关", "Customs Inspection", "报关查验退场，返回仓库中","The shipment has been Inspected by China custom,waiting to return back to the warehouse."),
    AIR_CUSTOMS_FULL_EXIT(120415, "报关", "Customs Inspection", "报关查验退场，返回仓库中","The shipment has been Inspected by China custom,waiting to return back to the warehouse."),
    AIR_HAS_TAKEN_OFF(13042601, "起运", "Departed", "货物已起飞，预计在%s日期抵达%s机场","The shipment has departed China.ETA date to %s is %s"),
    AIR_HAS_TAKEN_OFF_DELAY(13042602, "起运", "Departed", "由于%s原因，延误起飞","Delayed takeoff due to %s"),
    AIR_ARRIVED(14032801, "到港", "Arrived", "货物已抵达%s机场，清关中","The shipment has arrived at %s airport.waiting for custom declaration to be done."),
    AIR_ARRIVED_DELAY(14032802, "到港", "Arrived", "由于%s原因，延误抵达目的地","Due to %s reasons, delayed arrival at the destination"),
    AIR_CLEARED_DELAY(14032803, "清关", "Cleared out", "由于%s原因，待清关","Due to %s reasons, customs clearance is pending"),
    AIR_CLEARED(150330, "清关", "Customs cleared", "货物已清关","Customs clearance of the shipment has been completed."),
    AIR_UNLOADED_CABINET(16043501,"到仓", "Delivered","货物已抵达捷道%s提货仓","The shipment has been delivered to E&C %s branch."),
    AIR_UNLOADED_CABINET_DELAY(16043502,"到仓", "Delivered","由于%s原因，延误到仓时间","Due to %s reasons, the arrival time is delayed"),
//    AIR_PICKED_UP(2000, "提货", "Picked up", "货物已提货","The shipment been picked up "),
    AIR_PICKED_UP(2000, "提货", "Collected", "货物已提货，本次提货%s件，剩余%s件","%s ctns has been collected by the consignee，remaining %s ctns in E&C destination branch."),
    AIR_WAREHOUSE_WITHDRAWAL(7206, "退仓", "Warehouse Withdrawal", "货物已退仓","The shipment have been withdrawn from warehouse"),
    AIR_ORDER_CANCEL(8800, "取消订单", "Order Cancelled", "",""),


    ;


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

    /**
     * key status+inWarehouseState+shipmentState的连接值
     */
    private final Integer value;
    /**
     * 类型中文名
     */
    private final String nameZh;

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

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

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



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

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

}
