package com.tofly.watermeter.em;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.StringUtils;

/**
 * @ClassName: ExcelExportFileTypeEnum
 * @Description: 导出文件枚举
 * @Author Zev
 * @Date 2021/3/25
 * @Version 1.0.0
 */
@Getter
@AllArgsConstructor
public enum ExcelExportFileTypeEnum {

    INSTALL_THE_STAGING_EXPORT("/新装暂存信息.xlsx", "新装暂存", "theStagingExportService", "1"),
    EXPORT_BATCH_COUNT("/入库批次统计.xlsx", "入库批次统计", "batchCountService", "1"),
    EXPORT_BATCH_INFO("/入库批次详情.xlsx", "入库批次详情", "batchInfoService", "1"),
    EXPORT_RUSHTOOWE("/催欠记录统计.xlsx", "催欠记录统计", "rushToOweService", "1"),
    EXPORT_SWITCH_INFO("/开关记录导出.xlsx", "开关记录导出", "switchRecordQueryService", "1"),
    EXPORT_ALLOCATION("/分配客户信息列表.xlsx", "分配客户信息列表", "allocationPageService", "1"),
    EXPORT_OUT_ROUND_COUNT("/统计查询-出库-厂家统计.xlsx", "厂家统计", "outBoundCountNumService", "1"),
    EXPORT_OUT_BOUND_BY_CAL("/统计查询-出库-口径统计.xlsx", "口径统计", "outBoundByCalService", "1"),
    EXPORT_OUT_BOUND_INFO("/统计查询-出库-详细信息.xlsx", "详细信息", "outBoundInfoService", "1"),
    EXPORT_CHANGE_TABLE_COUNT("/统计查询-换表-厂家统计.xlsx", "厂家统计", "changeTableCountService", "1"),
    EXPORT_CHANGE_TABLE_BY_CAL("/统计查询-换表-口径统计.xlsx", "口径统计", "changeTableByCalService", "1"),
    EXPORT_CHANGE_TABLE_INFO("/统计查询-换表-详细信息.xlsx", "详细信息", "changeTableInfoService", "1"),
    EXPORT_SCRAP_COUNT("/统计查询-报废-厂家统计.xlsx", "厂家统计", "scrapCountService", "1"),
    EXPORT_SCRAP_BY_CAL("/统计查询-报废-口径统计.xlsx", "口径统计", "scrapByCalService", "1"),
    EXPORT_SCRAP_INFO("/统计查询-换表-详细信息.xlsx", "详细信息", "scrapInfoService", "1"),
    EXPORT_DISPUTE_COUNT("/统计查询-争议-厂家统计.xlsx", "厂家统计", "disputeCountService", "1"),
    EXPORT_DISPUTE_BY_CAL("/统计查询-争议-厂家统计.xlsx", "口径统计", "disputeByCalService", "1"),
    EXPORT_DISPUTE_INFO("/统计查询-争议-厂家统计.xlsx", "详细信息", "disputeByCalService", "1"),
    EXPORT_NEW_INSTALL_COUNT("/统计报表-新装统计-部门统计.xlsx", "部门统计", "newInstallCountService", "1"),
    EXPORT_NEW_INSTALL_DEPT("/统计报表-新装统计-口径统计.xlsx", "口径统计", "newInstallByDeptService", "1"),
    EXPORT_NEW_INSTALL_INFO("/统计报表-新装统计-详细信息.xlsx", "详细信息", "newInstallInfoService", "1"),
    EXPORT_RETURN_TABLE_COUNT("/退表管理-退表水表统计.xlsx", "退表统计", "rtCountService", "1"),
    EXPORT_RT_QUERY("/退表管理-水表退库详情.xlsx", "退库详情", "returnTableQueryService", "1"),
    EXPORT_RT_COUNT("/退表管理-水表退表汇总.xlsx", "退表汇总", "returnTableCountService", "1"),
    EXPORT_TABLET_INSTALL("/水表新装统计.xlsx", "新装统计", "tableInstallCountService", "1"),
    EXPORT_QUERY_BY_QUIT_TABLE("/水表退表详情.xlsx", "退表详情", "queryByQuitTableService", "1"),
    EXPORT_QUERY_BY_GET_TABLE("/水表领表详情.xlsx", "领表详情", "queryByGetTableService", "1"),
    EXPORT_QUERY_BY_NEW_TABLE("/水表新装详情.xlsx", "新装详情", "queryByNewTableService", "1"),
    EXPORT_TABLE_QUERU_INFO("/水表使用情况详情.xlsx", "水表使用情况详情", "tableQueryInfoService", "1"),
    EXPORT_TABLE_QUERY_COUNT("/水表使用情况统计.xlsx", "水表使用情况统计", "tableQueryCountService", "1"),
    EXPORT_TYPE_CONGIG("配置管理-类型.xlsx", "类型信息", "typeConfigService", "1"),
    EXPORT_CAL_CONGIG("配置管理-口径.xlsx", "口径信息", "calConfigService", "1"),
    EXPORT_VENDOR_CONFIG("/配置管理-厂家.xlsx", "厂家信息", "vendorConfigService", "1"),
    EXPORT_CHANGR_TABLE_QUERY("/表务换表详情.xlsx", "换表详情", "queryChangeTableService", "1"),
    EXPORT_CHANGR_TABLE_COUNT("/表务换表统计.xlsx", "换表统计", "countChangeTableService", "1"),
    EXPORT_STATEMENT_INFO("/报表统计详情表.xlsx", "详情信息", "statementInfoService", "1"),
    EXPORT_STATEMENT_BY_VENDOR("/报表口径类型统计表.xlsx", "报表口径类型统计", "statementByVendorService", "1"),
    EXPORT_STATEMENT("/报表统计表.xlsx", "报表统计", "statementCountService", "1"),
    EXPORT_FSC_FAULT("/故障表抽检详情表.xlsx", "抽检详情", "fscQueryFaultService", "1"),
    EXPORT_FSC_QUERY("/故障表抽检移交详情表.xlsx", "移交详情", "fscQueryService", "1"),
    EXPORT_FSC_COUNT("/故障表抽检统计表.xlsx", "抽检统计", "fscCountService", "1"),
    EXPORT_WSC_WEEK("/周检表抽检详情表.xlsx", "抽检详情", "wscQueryWeekService", "1"),
    EXPORT_WSC_QUERY("/周检表抽检移交详情表.xlsx", "移交详情", "wscQueryInfoService", "1"),
    EXPORT_WSC_COUNT("/周检表抽检统计表.xlsx", "抽检统计", "weekSpotCheckCountService", "1"),
    EXPOET_DIS_WORKORDER("/争议检定工单详情.xlsx", "工单检定详情", "disQueryWorkInfoService", "1"),
    EXPORT_DIS_COUNT("/争议检定统计表.xlsx", "争议统计", "disputedCountService", "1"),
    EXPORT_WEEK_QUERYINFO("/水表周检详情表.xlsx", "周检详情", "weeklyInspectionQueryInfo", "1"),
    EXPORT_WEEK_COUNT("/水表周检统计表.xlsx", "周检统计", "weeklyInspectionCount", "1"),
    EXPORT_TURNOVER_QUERYINFO("/移交详情表.xlsx", "移交详情", "turnOverQueryInfoService", "1"),
    EXPORT_TURNOVER_COUNT("/移交汇总统计-厂家.xlsx", "汇总统计", "turnOverCountService", "1"),
    EXPORT_TURNOVER_COUNT_BY_TIME("/移交汇总统计-时间.xlsx", "汇总统计", "turnOverCountByTimeService", "1"),
    EXPORT_QUERY_FIRSTCHECK("/质检批次统计表.xlsx", "质检批次统计", "queryFirstCheckService", "1"),
    EXPORT_QUERY_INVENTORY("/入库批次统计表.xlsx", "入库批次统计", "queryInventoryService", "1"),
    EXPORT_FIRST_CHECK_COUNT("/水表首检统计表.xlsx", "统计情况", "firstCheckCountService", "1"),
    EXPORT_OUTBOUND_TABLEINFO("/出库水表详情.xlsx", "详情", "outBoundTableInfoService", "1"),
    EXPORT_OUTBOUND_COUNT_WOEK_ORDER("/出库工单信息.xlsx", "出库工单信息", "outBoundCountWorkOrderService", "1"),
    //表务水表出库第一层
    EXPORT_OUTBOUND_COUNT("/出库工单统计.xlsx", "统计详情", "outBoundCountService", "1"),
    //表务水表入库第三层
    EXPORT_WAREHOUSING_COUNT_CALIBER("/入库水表详细信息.xlsx", "水表详情", "countByCaliberService", "1"),
    //表务水表入库第二层
    EXPORT_WAREHOUSING_COUNT_VENDOR("/厂家水表口径统计.xlsx", "口径统计", "countByVendorService", "1"),
    //表务水表入库第一层
    EXPORT_WAREHOUSING_COUNT("/厂家入库信息.xlsx", "入库、库存信息", "countExportService", "1"),
    EXPORT_PLAN("/周期计划检查.xlsx", "周检数据", "zjsbService", "1"),
    //抄表查询导出
    EXPORT_READ_QUERY("/抄表查询.xlsx", "抄表查询", "ReadQueryServcie", "1"),
    //抄表率统计第一层：区域抄表率统计
    EXPORT_READPECENT_ONE("/区域抄表率统计.xlsx", "区域抄表率统计", "QyReadPecentService", "1"),
    //抄表率统计第二层：区段抄表率统计
    EXPORT_READPECENT_TWO("/区域段抄表率统计.xlsx", "区域段抄表率统计", "QydReadPecentService", "1"),
    //抄表率统计第三层：抄表详情信息
    EXPORT_READPECENT_THREE("/区域段抄表详情信息.xlsx", "区域段抄表详情信息", "QydReadInfoService", "1"),
    //抄表时间统计第一层
    EXPORT_READTIME_ONE("/区域段抄表时间统计.xlsx", "区域段抄表时间统计", "QydReadTimeService", "1"),
    //抄表时间统计第二层
    EXPORT_READTIME_TWO("/区域段抄表时间详情.xlsx", "区域段抄表时间详情", "QydReadTimeInfoService", "1"),
    //抄表率统计；根据抄表人员
    EXPORT_READPECENT_CBRY("/抄表人员抄表率统计.xlsx", "抄表人员抄表率统计", "cbryReadPercentService", "1"),
    //水表入库批次导出
    EXPORT_METER_BATCH("/入库批次记录表.xlsx", "入库批次记录表", "meterBatchServiceImpl", "1"),
    //水表安装记录表
    EXPORT_METER_INSTALL("/水表安装记录表.xlsx", "水表安装记录表", "meterInstallServiceImpl", "1"),
    //水表换表记录表
    EXPORT_METER_EXCHANGE("/换表记录表.xlsx", "换表记录表", "meterExchangeService", "1"),
    //水表状态信息表
    EXPORT_METER_FLOW("/水表状态记录表.xlsx", "水表状态记录表", "meterFlowService", "1"),
    //水表使用情况
    EXPORT_METER_SYDATE("/水表使用情况.xlsx", "水表使用情况", "meterSyDateService", "1"),
    //换表统计按照月份查询 没有service，因为不用处理数据操作，没有用策略模式
    EXPORT_METER_EXCHANGEMONTH("/换表统计月份数据.xlsx", "换表统计数据", "exchangeMonthService", "1"),
    //争议检定统计按照月份查询统计 没有service，因为不用处理数据操作，没有用策略模式
    EXPORT_METER_DISPUTE("/争议检定统计月份数据.xlsx", "争议检定统计数据", "disputeMonthService", "1"),
    //以下导出枚举，因为不需要处理数据；不使用策略模式找bean处理数据
    EXPORT_READ_ALLCATION("/抄表分配情况汇总统计表.xlsx", "抄表分配情况汇总统计表", "allcationCollect", "1"),
    EXPORT_READ_ALLCATIONINFO("/抄表客户分配详情信息表.xlsx", "抄表客户分配详情信息表", "allcationInfo", "1"),
    EXPORT_READ_OFFLINEINFO("/机械表情况详情信息.xlsx", "机械表情况详情信息", "offlineInfo", "1"),
    EXPORT_READ_OFFLINEINFO_CARD("/卡表情况详情信息.xlsx", "卡表情况详情信息", "offlineInfo", "2"),
    EXPORT_READ_COLLECT("/抄表情况汇总信息.xlsx", "抄表情况汇总信息", "readCollect", "1"),
    EXPORT_DAY("/日抄表率统计.xlsx", "日抄表率统计", "readPercentDayService", "1"),
    //这一坨的导出，好几个Excel表都重复了，但是里面部分列表又不一样，难搞啊
    EXPORT_DAY_INFO("/客户抄表详细信息.xlsx", "详细信息", "readDayInfoService", "1"),
    EXPORT_DAY_INFO_CARD("/客户抄表详情信息.xlsx", "详细信息", "readDayInfoService", "2"),
    EXPORT_QUALITYINSPECT_COLLECT("/质检抽查汇总信息.xlsx", "质检抽查汇总信息", "qualityInspect", "1"),
    EXPORT_INSPECTCOLLECTDEATILS("/详情列表.xlsx", "详情列表", "inspectCollectDeatils", "1"),
    EXPORT_CLIENT_INFO("/客户信息列表.xlsx", "客户信息列表", "clientInfoDeatils", "1"),
    ;
    /**
     * 导出模板文件
     */
    private String templateFile;
    /**
     * 导出表格名
     */
    private String sheetName;

    /**
     * 模板服务类型
     */
    private String templateServiceType;

    /**
     * 是否为示例模板
     */
    private String flag;

    /**
     * 根据模型类型和是否为示例模板获取对应枚举对象
     *
     * @param templateServiceType 模型类型
     * @param flag                是否为示例模板
     * @return 枚举对象
     */
    public static ExcelExportFileTypeEnum getExcelExportFileTypeEnum(String templateServiceType, String flag) {
        if (StringUtils.isEmpty(templateServiceType)) {
            return null;
        }

        for (ExcelExportFileTypeEnum e : ExcelExportFileTypeEnum.values()) {
            if (e.templateServiceType.equalsIgnoreCase(templateServiceType) && e.flag.equalsIgnoreCase(flag)) {
                return e;
            }
        }
        return null;
    }
}
