package cn.superdesk.uniorder.common.bizScene.invoice.customer;

import cn.superdesk.uniorder.common.enums.invoice.customer.InvoiceApplyCustomerBackAccountStatusEnum;
import cn.superdesk.uniorder.common.enums.invoice.customer.InvoiceApplyCustomerInvoiceProgressingStatusEnum;
import cn.superdesk.uniorder.common.enums.invoice.customer.InvoiceApplyCustomerMakeInvoiceStatusEnum;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;
import java.util.List;

/**
 * @Description: 基于场景 一些老拷贝的东西(状态之类)
 * @Author: linjinyu
 * @CreateDate: 2022/4/29 3:35 下午
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/4/29 3:35 下午
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@RequiredArgsConstructor
public class InvoiceApplyCustomerScene {


    /**************************************** 申请状态 start ****************************************/

    /**
     * ArrayUtil.contains
     *
     * @return
     */
    public static Integer[] statusV2_1_Array_InvoiceProgressingSceneRevise() {

        Integer[] invoiceProgressingStatusContains = {
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待开票.getKey(),
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待领票.getKey(),
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待寄票.getKey(),
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待回款.getKey(),
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.已完成.getKey()
        };

        return invoiceProgressingStatusContains;
    }

    public static Integer[] statusV2_1_Array_InvoiceProgressingSceneStateCheck() {

        Integer[] invoiceProgressingStatusContains = {
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待领票.getKey(),
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待寄票.getKey(),
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待回款.getKey()
        };

        return invoiceProgressingStatusContains;
    }


    // TODO 有空再整理吧 mark by linjinyu at 20220429

//    Integer[] passBackAccountStatusArray = {
//            InvoiceApplyCustomerBackAccountStatusEnum.未回款.getKey(),
//            InvoiceApplyCustomerBackAccountStatusEnum.发票红冲.getKey()
//    };


    /**************************************** |---- 发票单 开票申请 start ****************************************/


    /**************************************** |---- 发票单 开票申请   end ****************************************/


    /**************************************** |---- 发票单 发票管理 start ****************************************/

    public static List<Integer> statusV2_0Last_List_InvoiceProgressingSceneManagerList() {

        return Arrays.asList(
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待开票.getKey()
        );
    }

    public static List<Integer> statusV2_1Begin_List_InvoiceProgressingSceneManagerList() {

        return Arrays.asList(
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待开票.getKey(),
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待领票.getKey(),
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待寄票.getKey(),
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待回款.getKey(),
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.已完成.getKey()
        );
    }

    /**
     * op确认领票
     * https://docs.qq.com/doc/DYUZOREhreVhiVlZL
     * ·该对账单下所有开票申请的申请状态为“待领票/待回款”，否则不允许确认领票，1.5s提示“该对账单的开票申请数据发生变更，请返回检查”；【20220510去掉此判断】
     *
     * @return
     */
    public static Integer[] statusV2_1_Array_InvoiceProgressingSceneOpReceiveStateCheck() {

        Integer[] invoiceProgressingStatusContains = {
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待领票.getKey(),
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待回款.getKey()
        };

        return invoiceProgressingStatusContains;
    }

    public static Integer[] statusV2_1_Array_MakeInvoiceSceneOpReceiveStateCheck() {

        Integer[] makeInvoiceStatusContains = {
                InvoiceApplyCustomerMakeInvoiceStatusEnum.待开票.getKey(),
                InvoiceApplyCustomerMakeInvoiceStatusEnum.开票中.getKey()
        };

        return makeInvoiceStatusContains;
    }



    /**************************************** |---- 发票单 发票管理   end ****************************************/

    /**************************************** |---- 事件 start ****************************************/


    public static Integer[] statusV2_3_Array_InvoiceProgressingSceneOpEventQchjcCustomerStatementMakeInvoiceStatusSyncStateCheck() {

        Integer[] invoiceProgressingStatusContains = {
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.待回款.getKey()
        };

        return invoiceProgressingStatusContains;
    }

    public static Integer[] statusV2_3_Array_InvoiceProgressingSceneOpEventQchjcCustomerStatementReceivePaymentStatusSyncStateCheck() {

        Integer[] invoiceProgressingStatusContains = {
                InvoiceApplyCustomerInvoiceProgressingStatusEnum.已完成.getKey()
        };

        return invoiceProgressingStatusContains;
    }

    public static Integer[] statusV2_3_Array_BackAccountSceneOpEventQchjcCustomerStatementReceivePaymentStatusSyncStateCheck() {

        Integer[] backAccountStatusContains = {
                InvoiceApplyCustomerBackAccountStatusEnum.已回款.getKey()
        };

        return backAccountStatusContains;
    }

    // 目前没用
    public static Integer[] statusV2_3_Array_BackAccountSceneOpEventQchjcCustomerStatementMakeInvoiceStatusSyncStateCheck() {

        Integer[] backAccountStatusContains = {

                InvoiceApplyCustomerBackAccountStatusEnum.未回款.getKey(), // (0, "未回款"),
                InvoiceApplyCustomerBackAccountStatusEnum.回款中.getKey(), // (10, "回款中"), // 对映而已 如果过程能监控时用
                InvoiceApplyCustomerBackAccountStatusEnum.部分回款.getKey(), // (1, "部分回款"),
                InvoiceApplyCustomerBackAccountStatusEnum.已回款.getKey(), // (2, "已回款"),

                InvoiceApplyCustomerBackAccountStatusEnum.发票蓝冲.getKey(), // (67, "发票蓝冲"), // ---- 没有
                InvoiceApplyCustomerBackAccountStatusEnum.发票红冲.getKey(), // (69, "发票红冲"), // ---- 积分结算v2.1
                InvoiceApplyCustomerBackAccountStatusEnum.发票作废.getKey()  // (70, "发票作废"), // ---- 积分结算v2.2 mark by linjinyu at 20220427
        };

        return backAccountStatusContains;
    }

    /**************************************** |---- 事件 start ****************************************/


    /**************************************** 申请状态 start ****************************************/


}
