package com.ms.biz.consts;

import java.util.*;
import java.util.stream.Collectors;

/**
 * @Author: laixw
 * @Date: 2023/9/1
 */
public class LogisticsConst {
    
    public static final String outstorageSourcePurchase = "purchase";
    public static final String outstorageSourceTask = "task";
    public static final String outstorageSourceAfterSaleSellerRefuseRefund = "aftersale_seller_refuse_refund";
    public static final String outstorageSourceAfterSaleSellerExchangeGoods = "aftersale_seller_exchange_goods";
    public static final String outstorageSourceAfterSaleSellerResend = "aftersale_seller_resend";
    public static final String outstorageSourcePrintSingle = "print_single";
    public static final String outstorageSourcePrintPackage = "print_package";
    public static final String outstorageSourcePackageManualSend = "package_manual_send";
    public static final String outstorageSourcePrintBatch = "print_batch";
    public static final String outstorageSourcePrintAfter = "print_after";
    public static final String outstorageSourcePrintUpdate = "print_update";
    public static final String outstorageSourcePlatform = "platform";
    public static final String outstorageSourcePurchasePrint = "purchase_print";
    public static final String outstorageSourceScanAuto = "scan_auto";
    public static final String outstorageSourceUpdatePurchase = "update_purchase";
    public static final String outstorageSourcePurchaseSettingUpdate = "purchase_setting_update";
    public static final String outstorageSourcePurchaseManualUpdate = "purchase_manual_update";
    public static final String outstorageSourcePurchaseManualSend = "purchase_manual_send";
    public static final String outstorageSourceAutoPackageSend = "purchase_auto_package_send";
    public static final String outstorageSourceManual = "manual";
    public static final String outstorageSourceDsAuto = "dsAuto";
    public static final String outstorageSourceDsLogisticsChangeUpdate = "dsLogisticsChangeUpdate";


    public static final String  ddSvcCodeWbHomeDelivery = "SVC-WBHOMEDELIVERY";

    public static List<String> getIgnoreNoticeLogisticsNameList() {
        String[] logisticsNames = {
                "达达快递",
                "龍行天下家居物流",
                "E速宝",
                "壹米滴答快运",
                "壹米滴答快运(95058)",
                "留单",
                "AAE全球专递",
                "菜鸟网络",
                "菜鸟裹裹商家寄件",
                "卖家负责配送",
                "菜鸟仓配业务",
                "其他",
                "其它",
                "其它快递",
                "其他物流",
                "停发",
                "如风达配送",
                "商桥物流",
                "东莞市京广速递有限公司",
                "疫情停发",
                "官方物流",
                "官方直送",
                "立捷广州C2M产地仓",
                "安鲜达快递",
                "九谦物流",
                "贝海国际速递",
                "贝海国际",
                "安世通",
                "安世通国际快递",
                "阿明物流",
                "佳胜物流",
                "西藏新疆",
                "亿隆速运",
                "远成快运",
                "传化陆鲸科技有限公司",
                "黑猫宅急便",
                "农村淘宝",
                "村服务站",
                "ss",
                "八方",
                "平安达腾飞快递",
                "Couriers本地发货",
                "汇森速运",
                "宅急送快递",
                "百世物流(4008856561)",
                "优速",
                "京东",
                "海瑞物流",
                "苏宁快递",
                "百世物流",
                "湘源物流",
                "德邦物流",
                "联昊通物流",
                "CP471906",
                "平安达腾飞快递新业务",
                "东骏快捷",
                "D速物流",
                "长宇",
                "st",
                "递速快运",
                "瑞安置信物流",
                "东骏快捷",
                "未发出",
                "青岛汇海源物流"
        };
        return Arrays.stream(logisticsNames).collect(Collectors.toList());
    }

    public static String getDDLogisticsName(String aliLogisticsName) {
        Map<String, String> logisticsNameMap = new HashMap<>();
        logisticsNameMap.put("顺丰速运", "顺丰速运(常用)");
        logisticsNameMap.put("顺丰快递", "顺丰速运(常用)");
        logisticsNameMap.put("顺丰快运", "顺丰快运");
        logisticsNameMap.put("圆通", "圆通快递(常用)");
        logisticsNameMap.put("圆通速递(YTO)", "圆通快递(常用)");
        logisticsNameMap.put("申通", "申通快递(常用)");
        logisticsNameMap.put("申通快递(STO)", "申通快递(常用)");
        logisticsNameMap.put("韵达", "韵达快递(常用)");
        logisticsNameMap.put("韵达快递", "韵达快递(常用)");
        logisticsNameMap.put("韵达快运", "韵达快运");
        logisticsNameMap.put("邮政国内小包", "邮政快递包裹");
        logisticsNameMap.put("邮政电商标快", "邮政电商标快");
        logisticsNameMap.put("邮政标快", "邮政电商标快");
        logisticsNameMap.put("百世快递", "百世快递(常用)");
        logisticsNameMap.put("百世快运", "百世快运");
        logisticsNameMap.put("百世物流", "百世快运");
        logisticsNameMap.put("EMS", "EMS(常用)");
        logisticsNameMap.put("EMS经济快递", "EMS(常用)");
        logisticsNameMap.put("极兔速递-原百世快递", "极兔速递");
        logisticsNameMap.put("中通", "中通快递(常用)");
        logisticsNameMap.put("中通快递(ZTO)", "中通快递(常用)");
        logisticsNameMap.put("中通快运", "中通快运");
        logisticsNameMap.put("天天", "天天快递");
        logisticsNameMap.put("天天快递", "天天快递");
        logisticsNameMap.put("德邦", "德邦快递(常用)");
        logisticsNameMap.put("德邦快递", "德邦快递(常用)");
        logisticsNameMap.put("德邦物流", "德邦快递(常用)");
        logisticsNameMap.put("速尔快递", "速尔快递");
        logisticsNameMap.put("速尔物流", "速尔快递");
        logisticsNameMap.put("速尔", "速尔快递");
        logisticsNameMap.put("安能物流", "安能物流");
        logisticsNameMap.put("日日顺供应链", "日日顺物流");
        logisticsNameMap.put("加运美速递", "加运美");
        logisticsNameMap.put("丰网顺丰", "丰网速运");
        logisticsNameMap.put("中铁物流", "中铁飞豹");
        if (logisticsNameMap.containsKey(aliLogisticsName)) {
            return logisticsNameMap.get(aliLogisticsName);
        }
        return aliLogisticsName;
    }

    public static String getDDLogisticsCodeByAliLogisticsName(String aliLogisticsName) {
        Map<String, String> logisticsNameAndCodeMap = new HashMap<>();
        logisticsNameAndCodeMap.put("顺丰速运", "shunfeng");
        logisticsNameAndCodeMap.put("顺丰快递", "shunfeng");
        logisticsNameAndCodeMap.put("顺丰快运", "shunfengkuaiyun");
        logisticsNameAndCodeMap.put("圆通", "yuantong");
        logisticsNameAndCodeMap.put("圆通速递(YTO)", "yuantong");
        logisticsNameAndCodeMap.put("申通", "shentong");
        logisticsNameAndCodeMap.put("申通快递(STO)", "shentong");
        logisticsNameAndCodeMap.put("韵达", "yunda");
        logisticsNameAndCodeMap.put("韵达快递", "yunda");
        logisticsNameAndCodeMap.put("韵达快运", "yundakuaiyun");
        logisticsNameAndCodeMap.put("邮政国内小包", "youzhengguonei");
        logisticsNameAndCodeMap.put("邮政电商标快", "yzdsbk");
        logisticsNameAndCodeMap.put("邮政标快", "yzdsbk");
        logisticsNameAndCodeMap.put("百世快递", "huitongkuaidi");
        logisticsNameAndCodeMap.put("百世快运", "baishiwuliu");
        logisticsNameAndCodeMap.put("百世物流", "baishiwuliu");
        logisticsNameAndCodeMap.put("EMS", "ems");
        logisticsNameAndCodeMap.put("EMS经济快递", "ems");
        logisticsNameAndCodeMap.put("极兔速递-原百世快递", "jtexpress");
        logisticsNameAndCodeMap.put("中通", "zhongtong");
        logisticsNameAndCodeMap.put("中通快递(ZTO)", "zhongtong");
        logisticsNameAndCodeMap.put("中通快运", "zhongtongkuaiyun");
        logisticsNameAndCodeMap.put("天天", "tiantian");
        logisticsNameAndCodeMap.put("天天快递", "tiantian");
        logisticsNameAndCodeMap.put("德邦", "debangwuliu");
        logisticsNameAndCodeMap.put("德邦快递", "debangwuliu");
        logisticsNameAndCodeMap.put("德邦物流", "debangwuliu");
        logisticsNameAndCodeMap.put("速尔快递", "suer");
        logisticsNameAndCodeMap.put("速尔", "suer");
        logisticsNameAndCodeMap.put("速尔物流", "suer");
        logisticsNameAndCodeMap.put("安能物流", "annengwuliu");
        logisticsNameAndCodeMap.put("日日顺供应链", "rrs");
        logisticsNameAndCodeMap.put("加运美速递", "jiayunmeiwuliu");
        logisticsNameAndCodeMap.put("丰网顺丰", "fengwang");
        logisticsNameAndCodeMap.put("中铁物流", "zhongtiewuliu");
        if (logisticsNameAndCodeMap.containsKey(aliLogisticsName)) {
            return logisticsNameAndCodeMap.get(aliLogisticsName);
        }
        return aliLogisticsName;
    }
}
