package cn.superdesk.uniorder.service.invoice.customer.impl;

import cn.hutool.core.util.StrUtil;
import cn.superdesk.uniorder.dto.vo.invoice.customer.ExportExcelInvoiceApplyCustomerForceScoreDimCreditVo;

public class InvoiceApplyCustomerExportExcelFocusScoreDimCreditStatic {


    public static String fetchGroupKeyById(ExportExcelInvoiceApplyCustomerForceScoreDimCreditVo invoiceApplyExportExcelForceScore) {
        return invoiceApplyExportExcelForceScore.getInvoiceApplyId() +
                "_" + invoiceApplyExportExcelForceScore.getAccountingOrderId() +
                "_" + invoiceApplyExportExcelForceScore.getUnifiedOrderGoodsId();
    }

    /**
     * 当前用的分组合并规则
     *
     * @param invoiceApplyExportExcelForceScore
     * @return
     */
    public static String fetchGroupKeyByName(ExportExcelInvoiceApplyCustomerForceScoreDimCreditVo invoiceApplyExportExcelForceScore) {
        return
                invoiceApplyExportExcelForceScore.getInvoiceApplySn() +                         // 开票申请编号
                        "_" + invoiceApplyExportExcelForceScore.getAccountingOrderSn() +        // 对账单编号
                        "_" + invoiceApplyExportExcelForceScore.getOrderSn() +                  // 订单编号 add at 20220411调整需求
                        "_" + invoiceApplyExportExcelForceScore.getBatchs() +                   // 积分批次 add at 20220411调整需求
                        "_" + invoiceApplyExportExcelForceScore.getCreditName() +               // 积分类型名称
                        // 2022-04-19 14:00 项目兼产品要求修改此规则 已联系侨城汇 说是后补邮件
                        // 问题的产生于商城正单与退单商品名不一致 已联系商城组处理
//                        "_" + StrUtil.trim(invoiceApplyExportExcelForceScore.getGoodsName()) +  // 商品名称 (第三方系统 商品名称) add at 20220411调整需求
                        "_" + invoiceApplyExportExcelForceScore.getGoodsId() +                  // 商品Id (第三方系统 商品Id)
                        "_" + invoiceApplyExportExcelForceScore.getOperationTaxRate() +         // 商品税率
                        "_" + invoiceApplyExportExcelForceScore.getOperationTaxCode() +         // 商品税务编码
                        "_" + invoiceApplyExportExcelForceScore.getPrice();                     // 销售单价(单价(含税))


//        【【20220411调整需求】积分结算-创建对账单以及合并规则调整需求。】
//        https://www.tapd.cn/33003868/prong/stories/view/1133003868001004207
    }

    public static String fetchGroupKeyByOrderSnGoodsIdForSub(ExportExcelInvoiceApplyCustomerForceScoreDimCreditVo invoiceApplyExportExcelForceScore) {
        return invoiceApplyExportExcelForceScore.getOrderSn() +
                "_" + invoiceApplyExportExcelForceScore.getGoodsId();
    }

//            String[] fieldHeadMode1 = {"发票申请编号", "对账单编号", "销售单据编号",
//                    "购方名称", "购方税号", "购方地址电话", "购方银行账号", "备注",
//                    "税收编码",
//                    "货品名称", // 侨城汇要改成 货品名称 20200826 周可军 胡军知悉
//                    "规格型号", "计量单位", "数量", "金额", "税率", "折扣金额",
//                    "供应商"
//
////					"商品信息", "商品编码", "商品规格", "商品数量", "商品单价(折扣后)",
////					"商品价格(折扣后)", "商品单位", "财务代码", "收货人姓名", "收货人手机号", "发货时间", "运费", "快递公司", "快递单号", "完成时间", "回款状态", "发票号", "开票时间", "发票状态", "开票申请编号", "开票申请备注", "发票抬头", "发票种类"
//            };

    // mark by linjinyu 20201109 https://www.tapd.cn/33003868/prong/stories/view/1133003868001001019?url_cache_key=722526bfe72624f3973e0d0955c03a7f&action_entry_type=story_tree_list
    public static String[] fieldHeadMode1Static = {
            "销售单据编号",
            "对账单编号",
            "订单编号",

            "购方名称",
            "购方税号",
            "购方地址电话",
            "购方银行账号",


            "备注",
            "税收编码",
            "货物名称",
            "规格",
            "计量单位",
            "数量",
            "金额",
            "平台税率",
            "折扣金额",
            "供应商"
    };

    // 附件2:企业对账-开票格式.xls
    public static String[] fieldValueMode1Static = {
            "invoiceApplySn",
            "accountingOrderSn",
            "orderSn",

            "purchaserCompanyName",
            "purchaserTaxpayersIDCode",
            "purchaserAddressPhone",
            "purchaserBankAccountNumber",

            "remark",
//			"unifiedOrderGoodsTaxCode",
            "operationTaxCode",
            "goodsName",
            "selfOption",
            "unit",
            "quantity",
            "price",
//			"unifiedOrderGoodsTaxRate",
            "operationTaxRate",
            "",
            "saleName"
    };


    // mark by linjinyu 20201109 https://www.tapd.cn/33003868/prong/stories/view/1133003868001001019?url_cache_key=722526bfe72624f3973e0d0955c03a7f&action_entry_type=story_tree_list
    public static String[] fieldHeadMode2Static = {
            "销售单据编号",
            "对账单编号",
            "订单编号",
            "订单创建时间",

            "购方名称",
            "购方税号",
            "购方地址电话",
            "购方银行账号",


            "备注",
            "税收编码",
            "货物名称",
            "规格",
            "计量单位",
            "数量",
            "销售单价",
            "积分类型",
            "金额",
            /****************************************** 侨城汇需求 20210922 start ******************************************/
//			"平台税率",
//			"折扣金额",
//			"供应商"


            "税率",
            "编码版本号",
            "享受优惠政策",
            "发票种类",
            "收款人",
            "复核人",
//            "开票人", // 邮件20220419 1453 侨城汇结算中心导出开票数据Excel字段调整 20220419 1453 mark by linjinyu 202204201839
            "购方企业类型填写\n" +
                    "\"01\"或\"04\"\n" +
                    "01:企业\n" +
                    "04:个人及非企业性机构", // 01:企业;04:个人及非企业性机构
            "含税标识填写\n" +
                    "\"含税\"或\"不含税\"", // 含税;不含税
            "供应商"

            /****************************************** 侨城汇需求 20210922 start ******************************************/
    };

    public static String[] fieldValueMode2Static = {
            "invoiceApplySn",
            "accountingOrderSn",
            "orderSn",
            "orderCreateTime",

            "purchaserCompanyName",
            "purchaserTaxpayersIDCode",
            "purchaserAddressPhone",
            "purchaserBankAccountNumber",

            "remark",
//			"unifiedOrderGoodsTaxCode",
            "operationTaxCode",
            "goodsName",
            "selfOption",
            "unit",
            "quantity",
            "price",
            "creditName",
            "balance",
//			"unifiedOrderGoodsTaxRate",
            /****************************************** 侨城汇需求 20210922 start ******************************************/
//			"operationTaxRate",
//			"",
//			"saleName"

            "operationTaxRate",
            "encryptedVersionNumber", // 编码版本号 加密版本号
            "flagTaxIncentives", // 享受优惠政策
            "invoiceTypeName",// 发票种类
            "personNameCashier", // 收款人
            "personNameReview", // 复核人
//            "personNameInvoice", // 开票人 // 邮件20220419 1453 侨城汇结算中心导出开票数据Excel字段调整 20220419 1453 mark by linjinyu 202204201839
            "purchaserCompanyType", // 购方企业类型:01-企业;04-个人及非企业性机构
            "flagTaxIncluded", // 含税标识:含税;不含税
            "saleName"

            /****************************************** 侨城汇需求 20210922 start ******************************************/
    };

    /****************************************** 甲方要求减几个字段 mark by linjinyu at 20210317 start ******************************************/

    public static String[] fieldHeadMode2StaticMerge = {
            "销售单据编号",
            "对账单编号",
            "订单编号",

            "购方名称",
            "购方税号",
            "购方地址电话",
            "购方银行账号",

            "备注",
            "税收编码",
            "货物名称",
            "规格",
            "计量单位",
            "数量",
            "销售单价",
            "积分类型",
            "金额",

            /****************************************** 侨城汇需求 20210922 start ******************************************/
//			"平台税率",
//			"折扣金额",
//			"供应商"


            "税率",
            "编码版本号",
            "享受优惠政策",
            "发票种类",
            "收款人",
            "复核人",
//            "开票人",// 邮件20220419 1453 侨城汇结算中心导出开票数据Excel字段调整 20220419 1453 mark by linjinyu 202204201839
            "购方企业类型填写\n" +
                    "\"01\"或\"04\"\n" +
                    "01:企业\n" +
                    "04:个人及非企业性机构", // 01:企业;04:个人及非企业性机构
            "含税标识填写\n" +
                    "\"含税\"或\"不含税\"", // 含税;不含税
            "供应商"
            /****************************************** 侨城汇需求 20210922 start ******************************************/
    };

    public static String[] fieldValueMode2StaticMerge = {
            "invoiceApplySn",
            "accountingOrderSn",
            "orderSn",

            "purchaserCompanyName",
            "purchaserTaxpayersIDCode",
            "purchaserAddressPhone",
            "purchaserBankAccountNumber",

            "remark",
//			"unifiedOrderGoodsTaxCode",
            "operationTaxCode",
            "goodsName",
            "selfOption",
            "unit", "quantity",
            "price",
            "creditName",
            "balance",


//			"unifiedOrderGoodsTaxRate",

            /****************************************** 侨城汇需求 20210922 start ******************************************/
//			"operationTaxRate",
//			"",
//			"saleName"

            "operationTaxRate",
            "encryptedVersionNumber", // 编码版本号 加密版本号
            "flagTaxIncentives", // 享受优惠政策
            "invoiceTypeName",// 发票种类
            "personNameCashier", // 收款人
            "personNameReview", // 复核人
//            "personNameInvoice", // 开票人 // 邮件20220419 1453 侨城汇结算中心导出开票数据Excel字段调整 20220419 1453 mark by linjinyu 202204201839
            "purchaserCompanyType", // 购方企业类型:01-企业;04-个人及非企业性机构
            "flagTaxIncluded", // 含税标识:含税;不含税
            "saleName"
            /****************************************** 侨城汇需求 20210922 start ******************************************/
    };


    public static String[] fieldHeadMode3Static = {
            "销售单据编号",
//			"对账单编号",
//			"订单编号",

            "购方名称",
            "购方税号",
            "购方地址电话",
            "购方银行账号",

            "备注",
            "税收编码",
            "货物名称",
            "规格",
            "计量单位",
            "数量",
//			"销售单价",
//			"积分类型",
            "金额",
            "平台税率",
            "折扣金额",
            "供应商"
    };

    public static String[] fieldValueMode3Static = {
            "invoiceApplySn",
//			"accountingOrderSn",
//			"orderSn",

            "purchaserCompanyName", // enterpriseName // 购方名称
            "purchaserTaxpayersIDCode",
            "purchaserAddressPhone", // 购方地址电话
            "purchaserBankAccountNumber", // 购方银行账号

            "remark",
//			"unifiedOrderGoodsTaxCode",
            "operationTaxCode",
            "goodsName",
            "selfOption",
            "unit", "quantity",
//			"price",
//			"creditName",
            "balance",
//			"unifiedOrderGoodsTaxRate",
            " ",
            "",
            "saleName"
    };

    public static String[] fieldHeadMode3StaticMerge = {
            "销售单据编号",
//			"对账单编号",
//			"订单编号",

            "购方名称",
            "购方税号",
            "购方地址电话",
            "购方银行账号",

            "备注",
            "税收编码",
            "货物名称",
            "规格",
            "计量单位",
            "数量",
//			"销售单价",
//			"积分类型",
            "金额",

            /****************************************** 侨城汇需求 20210922 start ******************************************/
//			"平台税率",
//			"折扣金额",
//			"供应商"


            "税率",
            "编码版本号",
            "享受优惠政策",
            "发票种类",
            "收款人",
            "复核人",
//            "开票人", // 邮件20220419 1453 侨城汇结算中心导出开票数据Excel字段调整 20220419 1453 mark by linjinyu 202204201839
            "购方企业类型填写\n" +
                    "\"01\"或\"04\"\n" +
                    "01:企业\n" +
                    "04:个人及非企业性机构", // 01:企业;04:个人及非企业性机构
            "含税标识填写\n" +
                    "\"含税\"或\"不含税\"", // 含税;不含税
            "供应商"
            /****************************************** 侨城汇需求 20210922 start ******************************************/
    };

    public static String[] fieldValueMode3StaticMerge = {
            "invoiceApplySn",
//			"accountingOrderSn",
//			"orderSn",

            "purchaserCompanyName",// enterpriseName // 购方名称
            "purchaserTaxpayersIDCode",// companyName // 购方税号
            "purchaserAddressPhone",// invoiceAccount // 购方地址电话
            "purchaserBankAccountNumber",// invoiceBank // 购方银行账号

            "remark",
//			"unifiedOrderGoodsTaxCode",
            "operationTaxCode",
            "goodsName",
            "selfOption",
            "unit",
            "quantity",
//			"price",
//			"creditName",
            "balance",
//			"unifiedOrderGoodsTaxRate",


            /****************************************** 侨城汇需求 20210922 start ******************************************/
//			"operationTaxRate",
//			"",
//			"saleName"

            "operationTaxRate",
            "encryptedVersionNumber", // 编码版本号 加密版本号
            "flagTaxIncentives", // 享受优惠政策
            "invoiceTypeName",// 发票种类
            "personNameCashier", // 收款人
            "personNameReview", // 复核人
//            "personNameInvoice", // 开票人 // 邮件20220419 1453 侨城汇结算中心导出开票数据Excel字段调整 20220419 1453 mark by linjinyu 202204201839
            "purchaserCompanyType", // 购方企业类型:01-企业;04-个人及非企业性机构
            "flagTaxIncluded", // 含税标识:含税;不含税
            "saleName"
            /****************************************** 侨城汇需求 20210922 start ******************************************/
    };
}
