package com.cool.store.enums.point;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: ShopStageStatusEnum
 * @Description:店铺阶段状态
 * @date 2024-04-10 17:34
 */
public enum ShopSubStageStatusEnum {

    SHOP_SUB_STAGE_STATUS_00(null, -100, "未开始", Boolean.FALSE),

    //选址
    SHOP_SUB_STAGE_STATUS_10(ShopSubStageEnum.SHOP_STAGE_1, 100, "待选址", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_11(ShopSubStageEnum.SHOP_STAGE_1, 110, "待审核", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_12(ShopSubStageEnum.SHOP_STAGE_1, 120, "已选址", Boolean.TRUE),

    //上传租赁合同
    SHOP_SUB_STAGE_STATUS_20(ShopSubStageEnum.SHOP_STAGE_2, 200, "待加盟商上传", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_21(ShopSubStageEnum.SHOP_STAGE_2, 210, "待督导审核", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_22(ShopSubStageEnum.SHOP_STAGE_2, 220, "审核未通过", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_23(ShopSubStageEnum.SHOP_STAGE_2, 230, "审核通过", Boolean.TRUE),

    //营业执照办理
     SHOP_SUB_STAGE_STATUS_30(ShopSubStageEnum.SHOP_STAGE_3, 300, "待加盟商提交", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_33(ShopSubStageEnum.SHOP_STAGE_3, 330, "已完成", Boolean.TRUE),
    //食安许可证
    SHOP_SUB_STAGE_STATUS_40(ShopSubStageEnum.SHOP_STAGE_4, 400, "待加盟商提交", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_43(ShopSubStageEnum.SHOP_STAGE_4, 430, "已完成", Boolean.TRUE),

    //培训登记
    SHOP_SUB_STAGE_STATUS_50(ShopSubStageEnum.SHOP_STAGE_5, 500, "登记中", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_51(ShopSubStageEnum.SHOP_STAGE_5, 510, "已完成", Boolean.TRUE),

    //缴纳加盟费/保证金
    SHOP_SUB_STAGE_STATUS_70(ShopSubStageEnum.SHOP_STAGE_7, 700, "待内勤发布账单", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_71(ShopSubStageEnum.SHOP_STAGE_7, 710, "待加盟商缴费", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_72(ShopSubStageEnum.SHOP_STAGE_7, 720, "对账确认中", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_73(ShopSubStageEnum.SHOP_STAGE_7, 730, "已缴费", Boolean.TRUE),
    SHOP_SUB_STAGE_STATUS_74(ShopSubStageEnum.SHOP_STAGE_7, 740, "审核不通过", Boolean.FALSE),

    //加盟合同签约
    SHOP_SUB_STAGE_STATUS_80(ShopSubStageEnum.SHOP_STAGE_8, 800, "待加盟内勤/大区内勤提交", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_83(ShopSubStageEnum.SHOP_STAGE_8, 830, "待分部内勤审核", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_84(ShopSubStageEnum.SHOP_STAGE_8, 840, "已签约", Boolean.TRUE),
    SHOP_SUB_STAGE_STATUS_85(ShopSubStageEnum.SHOP_STAGE_8, 850, "审核失败", Boolean.FALSE),

    //发票回传
    SHOP_SUB_STAGE_STATUS_85_1(ShopSubStageEnum.SHOP_STAGE_8_5, 880, "待提交", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_85_3(ShopSubStageEnum.SHOP_STAGE_8_5, 890, "已完成", Boolean.TRUE),

    //测量阶段
    SHOP_SUB_STAGE_STATUS_861(ShopSubStageEnum.SHOP_STAGE_8_6, 891, "待立规内勤分配", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_862(ShopSubStageEnum.SHOP_STAGE_8_6, 892, "待测量员上传测量图", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_863(ShopSubStageEnum.SHOP_STAGE_8_6, 893, "测量完成", Boolean.TRUE),
    //设计阶段
    SHOP_SUB_STAGE_STATUS_90(ShopSubStageEnum.SHOP_STAGE_9, 900, "待设计组长分配设计师", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_901(ShopSubStageEnum.SHOP_STAGE_9, 901, "待设计师上传设计图", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_902(ShopSubStageEnum.SHOP_STAGE_9, 902, "待报价员领取", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_903(ShopSubStageEnum.SHOP_STAGE_9, 903, "待报价员上传报价单", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_905(ShopSubStageEnum.SHOP_STAGE_9, 905, "待确认", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_91(ShopSubStageEnum.SHOP_STAGE_9, 910, "已完成", Boolean.TRUE),

    //施工阶段
    SHOP_SUB_STAGE_STATUS_110(ShopSubStageEnum.SHOP_STAGE_11, 1100, "待提交", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_110_5(ShopSubStageEnum.SHOP_STAGE_11, 1105, "待进场", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_111(ShopSubStageEnum.SHOP_STAGE_11, 1110, "施工中", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_112(ShopSubStageEnum.SHOP_STAGE_11, 1120, "已完成", Boolean.TRUE),

    //三方验收 （待预约去掉）
    SHOP_SUB_STAGE_STATUS_121(ShopSubStageEnum.SHOP_STAGE_12, 1210, "待加盟商验收", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_122(ShopSubStageEnum.SHOP_STAGE_12, 1220, "待立规内勤验收", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_123(ShopSubStageEnum.SHOP_STAGE_12, 1230, "已验收", Boolean.TRUE),

    //开业运营方案
    SHOP_SUB_STAGE_STATUS_140(ShopSubStageEnum.SHOP_STAGE_14, 1400, "待上传", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_141(ShopSubStageEnum.SHOP_STAGE_14, 1420, "待审核", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_142(ShopSubStageEnum.SHOP_STAGE_14, 1430,"审核不通过", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_143(ShopSubStageEnum.SHOP_STAGE_14, 1440, "已完成", Boolean.TRUE),

    //平台资料提交
    SHOP_SUB_STAGE_STATUS_150(ShopSubStageEnum.SHOP_STAGE_15, 1500, "待加盟商提交", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_151(ShopSubStageEnum.SHOP_STAGE_15, 1510, "待圆规物流填写", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_152(ShopSubStageEnum.SHOP_STAGE_15, 1520, "待财务填写",Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_153(ShopSubStageEnum.SHOP_STAGE_15, 1530, "待分部总监审批",Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_154(ShopSubStageEnum.SHOP_STAGE_15, 1540, "待分管副总裁审批",Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_155(ShopSubStageEnum.SHOP_STAGE_15, 1550, "待总裁审批",Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_156(ShopSubStageEnum.SHOP_STAGE_15, 1560, "已完成", Boolean.TRUE),

    //POS
    SHOP_SUB_STAGE_STATUS_160(ShopSubStageEnum.SHOP_STAGE_16, 1600, "待【火码】提交", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_163(ShopSubStageEnum.SHOP_STAGE_16, 1630, "已完成", Boolean.TRUE),

    //订货系统
    SHOP_SUB_STAGE_STATUS_170(ShopSubStageEnum.SHOP_STAGE_17, 1700, "待【IT部】提交", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_173(ShopSubStageEnum.SHOP_STAGE_17, 1730, "已完成", Boolean.TRUE),

    //抖音
    SHOP_SUB_STAGE_STATUS_180(ShopSubStageEnum.SHOP_STAGE_18, 1800, "待加盟商申请", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_181(ShopSubStageEnum.SHOP_STAGE_18, 1810, "待【豆码】开通", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_182(ShopSubStageEnum.SHOP_STAGE_18, 1820,"开通失败", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_183(ShopSubStageEnum.SHOP_STAGE_18, 1830, "开通成功", Boolean.TRUE),

    //美团外卖
    SHOP_SUB_STAGE_STATUS_190(ShopSubStageEnum.SHOP_STAGE_19, 1900, "待加盟商申请", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_191(ShopSubStageEnum.SHOP_STAGE_19, 1910, "初审中", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_193(ShopSubStageEnum.SHOP_STAGE_19, 1930,"待【火码】开通", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_194(ShopSubStageEnum.SHOP_STAGE_19, 1940,"开通失败", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_195(ShopSubStageEnum.SHOP_STAGE_19, 1950, "开通成功", Boolean.TRUE),

    //美团团购
    SHOP_SUB_STAGE_STATUS_200(ShopSubStageEnum.SHOP_STAGE_20, 2000, "待加盟商申请", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_201(ShopSubStageEnum.SHOP_STAGE_20, 2010, "待【火码】开通", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_202(ShopSubStageEnum.SHOP_STAGE_20, 2020,"开通失败", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_203(ShopSubStageEnum.SHOP_STAGE_20, 2030, "开通成功", Boolean.TRUE),

    //饿了么
    SHOP_SUB_STAGE_STATUS_210(ShopSubStageEnum.SHOP_STAGE_21, 2100, "待加盟商申请", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_211(ShopSubStageEnum.SHOP_STAGE_21, 2110, "初审中", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_213(ShopSubStageEnum.SHOP_STAGE_21, 2130,"待【火码】开通", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_214(ShopSubStageEnum.SHOP_STAGE_21, 2140,"开通失败", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_215(ShopSubStageEnum.SHOP_STAGE_21, 2150, "开通成功", Boolean.TRUE),

    //快手
    SHOP_SUB_STAGE_STATUS_220(ShopSubStageEnum.SHOP_STAGE_22, 2200, "待加盟商申请", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_221(ShopSubStageEnum.SHOP_STAGE_22, 2210, "待【豆码】开通", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_222(ShopSubStageEnum.SHOP_STAGE_22, 2220,"开通失败", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_223(ShopSubStageEnum.SHOP_STAGE_22, 2230, "开通成功", Boolean.TRUE),


    //信发系统开通
    SHOP_SUB_STAGE_STATUS_230(ShopSubStageEnum.SHOP_STAGE_23, 2300, "待【火码】提交", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_235(ShopSubStageEnum.SHOP_STAGE_23, 2350, "已完成", Boolean.TRUE),

    //营帐通开通
    SHOP_SUB_STAGE_STATUS_240(ShopSubStageEnum.SHOP_STAGE_24, 2400, "待【火码】提交", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_244(ShopSubStageEnum.SHOP_STAGE_24, 2440, "无需开通", Boolean.TRUE),
    SHOP_SUB_STAGE_STATUS_245(ShopSubStageEnum.SHOP_STAGE_24, 2450, "已完成", Boolean.TRUE),


    //京东外卖
    SHOP_SUB_STAGE_STATUS_250(ShopSubStageEnum.SHOP_STAGE_25, 2500, "待加盟商申请", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_251(ShopSubStageEnum.SHOP_STAGE_25, 2510, "初审中", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_253(ShopSubStageEnum.SHOP_STAGE_25, 2530,"待【火码】开通", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_254(ShopSubStageEnum.SHOP_STAGE_25, 2540,"开通失败", Boolean.FALSE),
    SHOP_SUB_STAGE_STATUS_255(ShopSubStageEnum.SHOP_STAGE_25, 2550, "开通成功", Boolean.TRUE),

    ;

    private ShopSubStageEnum shopSubStageEnum;

    private Integer shopSubStageStatus;

    private String shopSubStageStatusName;

    private boolean isTerminated;


    ShopSubStageStatusEnum(ShopSubStageEnum shopSubStageEnum, Integer shopSubStageStatus, String shopSubStageStatusName, Boolean isTerminated) {
        this.shopSubStageEnum = shopSubStageEnum;
        this.shopSubStageStatus = shopSubStageStatus;
        this.shopSubStageStatusName = shopSubStageStatusName;
        this.isTerminated = isTerminated;
    }

    public static List<ShopSubStageStatusEnum> getShopSubStageStatusEnum(ShopSubStageEnum shopSubStage) {
        List<ShopSubStageStatusEnum> resultList = new ArrayList<>();
        for (ShopSubStageStatusEnum stageStatusEnum : ShopSubStageStatusEnum.values()) {
            if (Objects.nonNull(stageStatusEnum.getShopSubStageEnum()) && stageStatusEnum.getShopSubStageEnum().equals(shopSubStage)) {
                resultList.add(stageStatusEnum);
            }
        }
        return resultList;
    }

    public ShopSubStageEnum getShopSubStageEnum() {
        return shopSubStageEnum;
    }

    public Integer getShopSubStageStatus() {
        return shopSubStageStatus;
    }

    public String getShopSubStageStatusName() {
        return shopSubStageStatusName;
    }

    public String getShopSubStageName() {
        return shopSubStageEnum.getShopSubStageName();
    }

    public boolean isTerminated() {
        return isTerminated;
    }

    public static ShopSubStageStatusEnum getShopSubStageStatusEnum(Integer shopSubStageStatus) {
        for (ShopSubStageStatusEnum stageStatusEnum : ShopSubStageStatusEnum.values()) {
            if (Objects.nonNull(stageStatusEnum.getShopSubStageStatus()) && stageStatusEnum.getShopSubStageStatus().equals(shopSubStageStatus)) {
                return stageStatusEnum;
            }
        }
        return SHOP_SUB_STAGE_STATUS_00;
    }
}
