package com.nantian.cloud.dbcapp.service;


import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nantian.cloud.dbcapp.entity.EnterpriseState;
import com.nantian.cloud.dbcapp.vo.*;
import com.nantian.sc.cloud.common.core.util.R;

import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description: 企业端服务层
 * @Param:
 * @return:
 * @Author: zfw
 * @Date: 2020/12/22
 * @Date: 20:16
 */
public interface EnterpriseService {

    //获取综合能耗
    Map<String,Object> getTotalZhnh(String enterpriseCode, String time) throws ParseException;

    //查询采集点
    Integer getCollection(String enterpriseCode, String time);

    //查询采集点
    Integer getInstrument(String enterpriseCode, String time);

    //能源消费结构
    JSONArray getConsumption(String enterpriseCode, String time) throws ParseException;

    //获取综合能耗
    Map<String, Object> getElectricity(String enterpriseCode, String time);

    JSONArray getProduct(String enterpriseCode);

    JSONArray getProductQuota(Integer id);

    JSONArray getUnitConsumption(String enterpriseCode, String quotaName, String time) throws ParseException;

    //计算近三年产品单耗
    List<Map<String, String>> getDhThreeYears(String enterpriseCode) throws ParseException;

    //计算产品趋势
    Map<String, Object> getProductOutput(String enterpriseCode, Integer productId, String time);


    Map<String, Object> getZhnhByMonth(String enterpriseCode, String time);

    List<ZhnhListVo> getZhnhByMonthList(String enterpriseCode, String time, String baseCode) throws ParseException;

    R getProductByMonthList(String enterpriseCode, String time);

    //获取企业物料产品信息
    R getMaterielProductByMonthList(String enterpriseCode, String time) throws ParseException;

    //得到实物量得值
    Map<String, Object> getMaterialValue(String enterpriseCode, String code, String time, String baseCode) throws ParseException;

    //获取能源实物量品种
    List<MaterialVo> getMaterial(String enterpriseCode, String time, String baseCode) throws ParseException;

    //得到各个能源的使用情况
    List<ListValueVO> getListValue(String enterpriseCode, String time, String baseCode) throws ParseException;


    //按分工序查询企业耗能情况
    List<ProcedureVO> getValueByProcedure(String enterpriseCode, String baseCode, String time, String energyType, String energyUseType, String configureName,String configureCode) throws ParseException;

    //查询采集项
    List<CollectValueVO> getCollectionValue(String enterpriseCode, String code, String time) throws ParseException;

    //查询采集项
    InstrumentVO getInstrumentById(String id, String time);


    //查询企业端近三年单位产值综合能耗
    List<OutputValueVo> getUnitEnergyConsumption(String enterpriseCode, String year);

    //查询企业端预警信息
    Map<String, Object> getExceptionInfo(String enterpriseCode, String time);

    //得到企业信息
    EnterpriseInfoVO getEnterpriseInfo(String enterpriseCode);

    List<QuotaVO> getOrderByQuota(String addressCode, String enterpriseCode, String quotaName, String time) throws ParseException;

    List<EnterpriseProcessVo> getIndexName(String enterpriseCode, String time) throws ParseException;

    List<CoalVo> getDetailByDataCodeName(String enterpriseCode, String time, String dataCode);

    List<CoalVo> getDetailMonthByDataCodeName(String enterpriseCode, String time, String dataCode);

    R isSuper(String enterpriseCode);

    R superTotal(String enterpriseCode, String time);

    R superEnergyKinds(String enterpriseCode, String time);

    R superElectricConsume(String enterpriseCode, String time);

    R superCollectData(String enterpriseCode, String time);

    R superProduct(String enterpriseCode, String time);

    R superProductValueOut(String enterpriseCode, String time);

    R superExceptionList(String enterpriseCode, String time, Page page, Integer type, String collectName, String state);


    List<CoalVo> getDetailHaveOne(String enterpriseCode, String time, String dataCode);

    List<String> getyearshavada(String enterpriseCode, String dataCode);

    List<CoalVo> sall(String enterpriseCode, String dataCode);

    String stattype(String enterpriseCode, String dataCode);

    //根据企业社会信用代码查询企业的产品的指标
    JSONArray getProductQuotaByEpc(String enterpriseCode, String productName, String time);

    //查询企业的已经配置公式的产品名称
    List<String> getProductByEpc(String enterpriseCode, String time) throws ParseException;

    Map getAccessEnergysTructure(String enterpriseCode);

    List<SuperEpcVo> getAllEpc(String[] epcByIds);

    // 返回企业新老系统的截止时间
    public Map<String, String> timeStr(String enterpriseCode) throws ParseException;

    //处理首页时间
    public HashMap<String, String> getNeedTime(String time);

    List<OldEnergyDataVo> getOldDataByEpc(String enterpriseCode,String time);

    List<String> getEpcById(String enterpriseCode);

    Map<String,Object> getEnterpriseStatusChange(String enterpriseCode);

    Object saveEnterpriseState(EnterpriseState enterpriseState);

    //获取企业物料排行前三的产品信息
    R getMaterielProductByMonthListDesc(String enterpriseCode, String time) throws ParseException;

    List<Map<String,String>> getEnergyTypeByProcedure(String enterpriseCode, String baseCode, String time, String energyUseType, String configureName,String configureCode) throws ParseException;


    int updateDianliFlag(String dianliFlag,String enterpriseCode);

}
