package com.tofly.xrtygis.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 {
    EXPORT_QUALITY_QUERY("/热线工单-质检统计.xlsx","质检统计","qualityCountService","1"),
    EXPORT_QUALITY_INFO("/热线工单-质检详情.xlsx","质检详情","qualityInfoService","1"),
    EXPORT_NH_RS("/统计报表-录音评分统计.xlsx","录音评分统计","recordingStatisticsService","1"),
    EXPORT_RETURNVISIT("/回访工单详情导出.xlsx","回访工单详情","returnVisitService","1"),
    EXPORT_WORKORDER("/工单详情导出.xlsx","导出详情","workOrderInfoService","1"),
    EXPORT_RECORDSCORE("/录音评分统计.xlsx","评分统计","pfrecordExcelService","1"),
    EXPORT_TABLTCOUNT("/观察表统计分析.xlsx","统计分析","exportTableCountService","1"),
    EXPORT_HISTORY("/scada数据.xlsx","导出数据","itemItvalExportService","1"),
    EXPORT_DMATABLE("/区域表数据.xlsx","区域配置表数据","exportDmaTableService","1"),
    EXPORT_SUPPLYMONTH("/观察表月供水量数据.xlsx","观察表月供水量数据","exportSupplyMonthService","1"),
    EXPROT_TREND("/取供水趋势.xlsx","取供水趋势","waterTrendService","1"),
    EXPORT_SUB_TABLE("/区域分表.xlsx","用户水表数据","exportSubTableService","1"),
    //水量计划值
    EXPORT_WATER_YIELD("/水量数据.xlsx", "水量数据", "waterPlanServiceImpl", "1"),
    EXPORT_UNIT_YIELD("/单耗数据.xlsx", "单耗数据", "unitPlanService", "1"),
    //水量实际值
    EXPORT_WATER_REALITY_YIELD("/水量实际数据.xlsx", "水量实际数据", "waterRealityServiceImpl", "1"),
    //制水材料计划值
    EXPORT_PRODUCE_PLAN_YIELD("/制水材料计划值数据.xlsx", "制水材料计划值", "producePlanServiceImpl", "1"),
    //制水材料实际值
    EXPORT_PRODUCE_REALITY_TIELD("/制水材料实际值数据.xlsx", "制水材料实际值", "produceRealityServiceImpl", "1"),
    //制水成本计划值
    EXPORT_COST_PLAN_YIELD("/制水成本计划值.xlsx", "制水成本计划值", "costPlanServiceImpl", "1"),
    //制水成本实际值
    EXPORT_COST_REALITY_TIELD("/制水成本实际值.xlsx", "制水成本实际值", "costRealityServiceImpl", "1"),
    //指标单价计划值
    EXPORT_TARGETPRICE_PLAN_YIELD("/指标单价计划值.xlsx", "指标单价计划值", "targetPricePlanServiceImpl", "1"),
    //指标单价实际值
    EXPORT_TARGETPRICE_REALITY_YIRLD("/指标单价实际值.xlsx", "指标单价实际值", "targetPriceRealityServiceImpl", "1"),
    //生产数据比对
    EXPORT_PRODUCE_COMPAR_YIELD("/生产数据比对.xlsx", "生产数据比对", "produceComparServiceImpl", "1"),
    //分区列表导出
    EXPORT_PARTION("/分区列表数据.xlsx", "分区列表数据", "partionServiceImpl", "1"),
    //夜间最小流量详情导出
    EXPORT_NIGHT_DETAIL("/夜间最小流量.xlsx", "夜间最小流量详情列表数据", "nightFlowServiceImpl", "1"),
    //产销差详情列表数据导出
    EXPORT_PODDIFF_DETAIL("/产销差详情列表数据.xlsx", "产销差详情列表数据", "podDiffDetailServiceImpl", "1"),
    //异常信息数据
    EXPORT_WARNINFO("/异常信息数据.xlsx", "异常信息数据", "warnInfoServiceImpl", "1"),
    //分区计量--流量历史采集数据导出
    EXPORT_FLOWHISTORY("/流量历史采集数据.xlsx", "流量历史采集数据", "dmaDataTableFlowViewServiceImpl", "1"),
    //效果评价导出
    EXPORT_RESULT_EVAL("/效果评价数据.xlsx", "效果评价数据", "resultEvalServiceImpl", "1"),
    //压力历史采集数据
    EXPORT_PRESSHISTORY("/压力历史采集数据.xlsx", "压力历史采集数据", "dmaDataTablePressViewServiceImpl", "1"),
    //根据DMA分区ID，时间段获取月份供水量、售水量、产销差量汇总情况
    EXPORT_CLLOCT_BYDMA("/水量月汇总情况.xlsx","水量月汇总情况","cllocrByDmaServiceImpl","1"),
    //导出用户绑定分区关系表
    EXPORT_CLIENT_AREA("/分区绑定用户关系表.xlsx","分区绑定用户关系表","clientBingArea","1"),
    EXPORT_SUPPLYDAY("/观察表供水量数据(天).xlsx","观察表供水量数据(天)","exportSupplyDayService","1"),
    EXPORT_SUPPLYHOUR("/观察表供水量数据(时).xlsx","观察表供水量数据(时)","exportSupplyHourService","1"),
    //导出交接班EXCEL exportHandOverService
    EXPORT_HANDE_OVER("/交接班记录表.xlsx","交接班记录表","exportHandOverService","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;
    }
}
