package com.nantian.cloud.dbcapp.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nantian.cloud.dbcapp.service.EnergyService;
import com.nantian.cloud.dbcapp.vo.*;
import com.nantian.sc.cloud.common.core.util.R;
import com.nantian.sc.cloud.common.data.datascope.DataScope;
import com.nantian.sc.cloud.common.log.annotation.SysLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;


/**
 * @Description: 综合能耗controller
 * @Param:
 * @return:
 * @Author: zfw
 * @Date: 2020/12/22
 * @Date: 20:05
 */
@CrossOrigin
@RestController
@AllArgsConstructor
@RequestMapping("/energy")
@Api(value = "energy", tags = "综合能耗")

public class EnergyController {

    private final EnergyService energyService;

    /**
     * 查询综合能耗值
     *
     * @param
     * @return R
     */
    @GetMapping("/total")
    @SysLog("综合能耗-根据条件获取综合能耗")
    @ApiOperation(value = "根据条件获取综合能耗", notes = "根据条件获取综合能耗")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getTotal(String area, String industry, String time) {
        return R.ok(energyService.getTotal(area, industry, time), "查询成功");
    }


    /**
     * 用能分布(根据州市分)
     *
     * @param
     * @return R
     */
    @GetMapping("/getCompanyByArea")
    @SysLog("综合能耗-按州市获取用能单位")
    @ApiOperation(value = "按州市获取用能单位", notes = "按州市获取用能单位")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getCompanyByArea(String area, String industry, String time) {
        return R.ok(energyService.getCompanyByArea(area, industry, time), "查询成功");
    }

    /**
     * @Description: 能源消费结构
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2020/12/26
     * @Date: 16:11
     */
    @GetMapping("/getConsumption")
    @SysLog("综合能耗-条件检索能源消费结构")
    @ApiOperation(value = "条件检索能源消费结构", notes = "条件检索能源消费结构")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getConsumption(String area, String industry, String time) throws ParseException {
        return R.ok(energyService.getConsumption(area, industry, time), "查询成功");
    }

    @GetMapping("/getEnergyWarning")
    @SysLog("综合能耗-综合能耗预警")
    @ApiOperation(value = "综合能耗预警", notes = "综合能耗预警")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getEnergyWarning(String area, String industry, String time) {
        return R.ok(energyService.getEnergyWarning(area, industry, time), "查询成功");
    }

    /**
     * @Description: 行业综合能耗
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2020/12/26
     * @Date: 16:11
     */
    @RequestMapping("/getEnergyByIndustry")
    @SysLog("综合能耗-行业综合能耗")
    @ApiOperation(value = "行业综合能耗", notes = "行业综合能耗")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getEnergyByIndustry(String area, String industry, String time) {
        return R.ok(energyService.getEnergyByIndustry(area, industry, time), "查询成功");
    }

    @RequestMapping("/getEnergyByDate")
    @SysLog("综合能耗-时间综合能耗")
    @ApiOperation(value = "时间综合能耗", notes = "时间综合能耗")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getEnergyByDate(String area, String industry, String time) {
        return R.ok(energyService.getEnergyByDate(area, industry, time), "查询成功");
    }

    @SysLog("综合能耗-获取有综合能耗的企业")
    @RequestMapping("/getEpcDetailByTce")
    @ApiOperation(value = "获取有综合能耗的企业", notes = "获取有综合能耗的企业")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期（格式yyyy-mm）", required = false, dataType = "string", paramType = "path")
    })
    public R getEpcDetailByTce(Page page, String area, String industry, String time) {
        return R.ok(energyService.getEpcDetailByTce(page, area, industry, time), "查询成功");
    }

    /**
     * @Description: 地区综合能耗
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2020/12/26
     * @Date: 16:11
     */
    @SysLog("综合能耗-地区综合能耗")
    @RequestMapping("/getEnergyByArea")
    @ApiOperation(value = "地区综合能耗", notes = "地区综合能耗")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getEnergyByArea(String area, String industry, String time) {
        return R.ok(energyService.getEnergyByArea(area, industry, time), "查询成功");
    }

    /**
     * @Description: 返回地区能耗(带企业数量)
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2021/1/14
     * @Date: 19:04
     */
    @GetMapping("/getEnergyByAreaList")
    @SysLog("综合能耗-地区综合能耗企业列表")
    @ApiOperation(value = "地区综合能耗企业列表", notes = "地区综合能耗企业列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getEnergyByAreaList(String area, String industry, String time) {
        return R.ok(energyService.getEnergyByAreaList(area, industry, time), "查询成功");
    }

    /**
     * @Description: 返回行业综合能耗(带企业数量)
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2021/1/14
     * @Date: 19:04
     */
    @GetMapping("/getEnergyByIndustryList")
    @SysLog("综合能耗-行业综合能耗企业列表")
    @ApiOperation(value = "行业综合能耗企业列表", notes = "地区综合能耗企业列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getEnergyByIndustryList(String area, String industry, String time) {
        return R.ok(energyService.getEnergyByIndustryList(area, industry, time), "查询成功");
    }


    /**
     * @Description: 煤消耗量
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2020/12/26
     * @Date: 16:11
     */
    @RequestMapping("/getCoalConsumption")
    @SysLog("综合能耗-煤消耗量")
    @ApiOperation(value = "煤消耗量", notes = "煤消耗量")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getCoalConsumption(String area, String industry, String time) throws ParseException {
        return R.ok(energyService.getCoalConsumption(area, industry, time), "查询成功");
    }


    /**
     * @Description: 工业水消耗量
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2020/12/26
     * @Date: 16:11
     */
    @RequestMapping("/getWaterConsumption")
    @SysLog("综合能耗-工业水消耗量")
    @ApiOperation(value = "工业水消耗量", notes = "工业水消耗量")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getWaterConsumption(String area, String industry, String time) {
        return R.ok(energyService.getWaterConsumption(area, industry, time), "查询成功");
    }


    /**
     * @Description: 查询异常信息
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2020/12/26
     * @Date: 16:11
     */
    @RequestMapping("/getExceptionInfo")
    @SysLog("综合能耗-查询采集数据异常信息")
    @ApiOperation(value = "查询采集数据异常信息", notes = "查询采集数据异常信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "cmpName", value = "企业名称", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "type", value = "波动类型", required = false, dataType = "Integer", paramType = "path"),
            @ApiImplicitParam(name = "isForce", value = "参与公式计算", required = false, dataType = "string", paramType = "path")
    })
    public R getExceptionInfo(String area, String industry, String time, String cmpName, String type, Integer page, Integer size, String collectItemName, String exceptionGov, String isForce) {
        return R.ok(energyService.getExceptionInfo(area, industry, time, cmpName, type, page, size, collectItemName, exceptionGov, isForce), "查询成功");
    }

    @RequestMapping("/getExceptionTotal")
    @SysLog("企业首页-查询企业首页异常数量总数")
    @ApiOperation(value = "查询企业首页异常数量总数", notes = "查询企业首页异常数量总数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "epc", value = "企业名称", required = false, dataType = "string", paramType = "path"),
    })
    public R getExceptionTotal(String epc, String time){
        return R.ok(energyService.getExceptionTotal(epc,time));
    }

    @RequestMapping("/getExceptionIndex")
    @SysLog("综合能耗-查询指标异常信息")
    @ApiOperation(value = "查询指标异常信息", notes = "查询指标异常信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "cmpName", value = "企业名称", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "type", value = "波动类型", required = false, dataType = "Integer", paramType = "path")
    })
    public R getExceptionIndex(String area, String industry, String time, String cmpName, String type, Integer page, Integer size, String collectItemName, String exceptionGov) {
        return R.ok(energyService.getExceptionIndex(area, industry, time, cmpName, type, page, size, collectItemName, exceptionGov), "查询成功");
    }

    @RequestMapping("/getExceptionNum")
    @SysLog("综合能耗-查询企业采集点对应异常数量列表")
    @ApiOperation(value = "查询企业采集点对应异常数量列表", notes = "查询异常信息列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "epc", value = "社会信用代码", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "date", value = "统计时间", required = false, dataType = "string", paramType = "path")
    })
    public R getExceptionNum(String epc, String startDate, String endDate, String dataCode, String collectItemName) {
        return R.ok(energyService.getExceptionNum(epc, startDate, endDate, dataCode, collectItemName), "查询成功");
    }

    @RequestMapping("/getExceptionClass")
    @SysLog("综合能耗-查询企业异常类型分类")
    @ApiOperation(value = "查询企业异常类型分类", notes = "查询企业异常类型分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "epc", value = "企业名称", required = false, dataType = "string", paramType = "path"),
    })
    public R getExceptionClass(String epc,String time) {
        return R.ok(energyService.getExceptionClass(epc,time), "查询成功");
    }

    @RequestMapping("/getComprehensiveExDetail")
    @SysLog("综合能耗-查询综合能耗异常")
    @ApiOperation(value = "查询综合能耗异常", notes = "查询综合能耗异常")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "epc", value = "企业名称", required = false, dataType = "string", paramType = "path"),
    })
    public R getComprehensiveExDetail(Page page, String epc,String time) {
        return R.ok(energyService.getComprehensiveExDetail(page,epc,time), "查询成功");
    }

    @RequestMapping("/getUnitComprehensiveExDetail")
    @SysLog("查询单位产品能耗异常")
    @ApiOperation(value = "查询单位产品能耗异常", notes = "查询单位产品能耗异常")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "epc", value = "企业名称", required = false, dataType = "string", paramType = "path"),
    })
    public R getUnitComprehensiveExDetail(Page page, String epc,String time) {
        return R.ok(energyService.getUnitComprehensiveExDetail(page, epc,time), "查询成功");
    }

    @RequestMapping("/getElectricExDetail")
    @SysLog("查询电力数据异常")
    @ApiOperation(value = "查询电力数据异常", notes = "查询电力数据异常")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "epc", value = "企业名称", required = false, dataType = "string", paramType = "path"),
    })
    public R getElectricExDetail(Page page,String epc,String time) {
        return R.ok(energyService.getElectricExDetail(page,epc,time), "查询成功");
    }

    @RequestMapping("/getDataCollectExDetail")
    @SysLog("采集数据传输异常")
    @ApiOperation(value = "采集数据传输异常", notes = "采集数据传输异常")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "epc", value = "企业名称", required = false, dataType = "string", paramType = "path"),
    })
    public R getDataCollectExDetail(Page page,String epc,String time) {
        return R.ok(energyService.getDataCollectExDetail(page,epc,time), "查询成功");
    }

    @RequestMapping("/getDataValueExDetail")
    @SysLog("查询采集数据波动异常")
    @ApiOperation(value = "查询采集数据波动异常", notes = "查询采集数据波动异常")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "epc", value = "企业名称", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "dataCode", value = "采集编码", required = false, dataType = "string", paramType = "path"),
    })
    public R getDataValueExDetail(Page page,String epc,String time,String dataCode) {
        return R.ok(energyService.getDataValueExDetail(page,epc,time,dataCode), "查询成功");
    }

    @RequestMapping("/getExceptionInfoList")
    @SysLog("按月分析异常信息")
    @ApiOperation(value = "按月分析异常信息", notes = "按月分析异常信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "cmpName", value = "企业名称", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "type", value = "波动类型", required = false, dataType = "Integer", paramType = "path")
    })
    public R getExceptionInfoList(String area, String industry, String time, String cmpName, String type) {
        return R.ok(energyService.getExceptionInfoList(area, industry, time, cmpName, type), "查询成功");
    }

    @RequestMapping("/getExceptionDict")
    @SysLog("异常种类字典")
    @ApiOperation(value = "异常种类字典", notes = "异常种类字典")
    public R getExceptionDict() {
        return energyService.getExceptionDict();
    }

    /**
     * 按照异常种类排序
     *
     * @param area
     * @param industry
     * @param time
     * @param cmpName
     * @param type
     * @return
     */
    @RequestMapping("/getExceptionOrder")
    @SysLog("异常种类排序")
    @ApiOperation(value = "异常种类排序", notes = "异常种类排序")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "cmpName", value = "企业名称", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "type", value = "波动类型", required = false, dataType = "Integer", paramType = "path")
    })
    public R getExceptionOrder(String area, String industry, String time, String cmpName, String type) {
        return energyService.getExceptionOrder(area, industry, time, cmpName, type);
    }


    @RequestMapping("/getExceptionEnterpriseOrder")
    @SysLog("异常公司排名")
    @ApiOperation(value = "异常公司排名", notes = "异常公司排名")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "cmpName", value = "企业社会信用代码", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "type", value = "波动类型", required = false, dataType = "Integer", paramType = "path"),
            @ApiImplicitParam(name = "orderFiled", value = "排序字段", required = false, dataType = "Integer", paramType = "path")
    })
    public R getExceptionEnterpriseOrder(String area, String industry, String time, String cmpName, String type, String orderFiled) {
        return energyService.getExceptionEnterpriseOrder(area, industry, time, cmpName, type, orderFiled);
    }

    /**
     * 按照地区查询异常总数并排序
     *
     * @param area
     * @param industry
     * @param time
     * @param cmpName
     * @param type
     * @return
     */
    @RequestMapping("/getExceptionByAreaOrder")
    @SysLog("按照地区查询异常总数并排序")
    @ApiOperation(value = "按照地区查询异常总数并排序", notes = "按照地区查询异常总数并排序")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "cmpName", value = "企业名称", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "type", value = "波动类型", required = false, dataType = "Integer", paramType = "path")
    })
    public R getExceptionByAreaOrder(String area, String industry, String time, String cmpName, String type) {
        return energyService.getExceptionByAreaOrder(area, industry, time, cmpName, type);
    }

    @RequestMapping("/getExceptionByIndustryOrder")
    @SysLog("按照地区查询异常总数并排序")
    @ApiOperation(value = "按照地区查询异常总数并排序", notes = "按照地区查询异常总数并排序")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "cmpName", value = "企业名称", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "type", value = "波动类型", required = false, dataType = "Integer", paramType = "path")
    })
    public R getExceptionByIndustryOrder(String area, String industry, String time, String cmpName, String type) {
        return energyService.getExceptionByIndustryOrder(area, industry, time, cmpName, type);
    }


    /*@PostMapping("/updateException")
    @SysLog("修改异常")
    @ApiOperation(value = "修改异常", notes = "修改异常")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "cmpName", value = "企业名称", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "type", value = "波动类型", required = false, dataType = "Integer", paramType = "path")
    })
    public R updateException(@RequestBody ArrayList<ExceptionInfoVo> data) {
        return energyService.updateException(data);
    }*/

    @PostMapping("/updateExceptionAll")
    @SysLog("修改异常（全部）")
    @ApiOperation(value = "修改异常", notes = "修改异常")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "cmpName", value = "企业名称", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "type", value = "波动类型", required = false, dataType = "Integer", paramType = "path")
    })
    public R updateExceptionAll(@RequestBody ExceptionInfoVo data) {
        return energyService.updateExceptionAll(data);
    }


    @RequestMapping("/waveExceptionList")
    @SysLog("波动异常列表")
    @ApiOperation(value = "修改异常", notes = "修改异常")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "enterpriseCode", value = "企业编码", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "dataCode", value = "采集编码", required = false, dataType = "string", paramType = "path"),
    })
    public R getExceptionByAreaOrder(String enterpriseCode, String dataCode, String time) {
        return energyService.waveExceptionList(enterpriseCode, dataCode, time);
    }

    @PostMapping("/exceptionalLog")
    @SysLog("企业异常处理日志")
    @ApiOperation(value = "企业异常处理日志", notes = "企业异常处理日志")
    public R exceptionalLog(@RequestBody TExceptionHandlingLogVo tExceptionHandlingLogVo) {
        return energyService.saveExceptionalLog(tExceptionHandlingLogVo);
    }

    @GetMapping("/getExceptionalLog")
    @SysLog("查询企业异常处理日志")
    @ApiOperation(value = "查询企业异常处理日志", notes = "查询企业异常处理日志")
    public R getExceptionalLog(Page page, String epc) {
        return R.ok(energyService.getExceptionalLog( page, epc));
    }


    /**
     * @Description: 查询计量器具个数
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2020/12/26
     * @Date: 16:11
     */
    @GetMapping("/getToolInfo")
    @SysLog("查询计量器具个数")
    @ApiOperation(value = "查询计量器具个数", notes = "查询计量器具个数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getToolInfo(String area, String industry, String time) {
        return R.ok(energyService.getToolInfo(area, industry, time), "查询成功");
    }

    /**
     * @Description: 通过地区返回州市县综合能耗
     * @Param: [area, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2021/1/4
     * @Date: 13:45
     */
    @GetMapping("/getTceByArea")
    @SysLog("综合能耗-通过地区返回州市县综合能耗")
    @ApiOperation(value = "通过地区返回州市县综合能耗", notes = "通过地区返回州市县综合能耗")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getTceByArea(String area, String time) {
        return R.ok(energyService.getTceByArea(area, time), "查询成功");
    }

    /**
     * @Description: 通过行业返回州市县综合能耗
     * @Param: [area, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2021/1/4
     * @Date: 13:45
     */
    @GetMapping("/getTceByIndustry")
    @SysLog("综合能耗-通过行业返回州市县综合能耗")
    @ApiOperation(value = "通过行业返回州市县综合能耗", notes = "通过行业返回州市县综合能耗")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "周期", required = false, dataType = "string", paramType = "path")
    })
    public R getTceByIndustry(String industry, String time) {
        return R.ok(energyService.getTceByIndustry(industry, time), "查询成功");
    }

    /**
     * @Description: 通过市级名称返回区县名称
     * @Param: [area, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2021/1/4
     * @Date: 13:45
     */
    @GetMapping("/getCountyName")
    @SysLog("通过市级名称返回区县名称")
    @ApiOperation(value = "通过行业返回州市县综合能耗", notes = "通过行业返回州市县综合能耗")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path")
    })
    public R getCountyName(String area) {
        return R.ok(energyService.getCountyName(area), "查询成功");
    }

    /**
     * @Description: 依据条件返回公司列表
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2021/1/4
     * @Date: 13:45
     */
    @GetMapping("/getCompanyListEnergyInfo")
    @SysLog("依据条件返回公司列表")
    @ApiOperation(value = "依据条件返回公司列表", notes = "依据条件返回公司列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "时间", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "cmpName", value = "公司名称", required = false, dataType = "string", paramType = "path")
    })
    public R getCountyName(String area, String industry, String time, String cmpName) {
        return R.ok(energyService.getCompanyListEnergyInfo(area, industry, time, cmpName), "查询成功");
    }


    /**
     * @Description: 模糊搜索返回公司列表
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2021/1/4
     * @Date: 13:45
     */
    @GetMapping("/getCompanyList")
    @SysLog("模糊搜索返回公司列表")
    @ApiOperation(value = "模糊搜索返回公司列表", notes = "模糊搜索返回公司列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "cmpName", value = "公司名称", required = false, dataType = "string", paramType = "path")
    })
    public R getCompanyList(String cmpName) {
        return R.ok(energyService.getCompanyList(cmpName, new DataScope()), "查询成功");
    }


    /**
     * @Description: 采集情况
     * ）
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2021/1/4
     * @Date: 13:45
     */
    @GetMapping("/getCollectAndElectricityList")
    @SysLog("数据采集情况")
    @ApiOperation(value = "数据采集情况", notes = "数据采集情况")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "cmpName", value = "公司名称", required = false, dataType = "string", paramType = "path")
    })
    public R getCollectAndElectricityList(String area, String industry, String time, String cmpName) {
        return R.ok(energyService.getCollectAndElectricityList(area, industry, time, cmpName), "查询成功");
    }

    @GetMapping("/getCollectEpcCount")
    @SysLog("获取采集企业数据")
    @ApiOperation(value = "获取采集企业数据", notes = "获取采集企业数据")
    public R getCollectEpcCount(String area, String industry, String time, String cmpName) {
        return R.ok(energyService.getCollectEpcCount(area, industry, time, cmpName), "查询成功");
    }

//============================================在线采集数据查询==================================================

    /**
     * @Description: 采集配置点详情
     * ）
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2021/1/4
     * @Date: 13:45
     */
    @GetMapping("/getCmpCollectInfo")
    @SysLog("在线采集数据查询-数据采集情况")
    @ApiOperation(value = "数据采集情况", notes = "数据采集情况")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "enterpriseCode", value = "公司编码", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "baseCode", value = "核算编码", required = false, dataType = "string", paramType = "path")
    })
    public R getCmpCollectInfo(String enterpriseCode, String baseCode) {
        return R.ok(energyService.getCmpCollectInfo(enterpriseCode, baseCode), "查询成功");
    }

    /**
     * @Description: 按地区统计采集记录
     * ）
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zs
     * @Date: 2021/3/1
     * @Date: 13:45
     */
    @SysLog("在线采集数据查询-按地区统计采集记录")
    @GetMapping("/getCollectByArea")
    @ApiOperation(value = "数据采集情况", notes = "数据采集情况")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "时间", required = false, dataType = "string", paramType = "path")
    })
    public R getCollectByArea(String area, String industry, String time) {
        return R.ok(energyService.getCollectByArea(area, industry, time), "查询成功");
    }

    @GetMapping("/getCollectByIndustry")
    @SysLog("在线采集数据查询-按行业统计采集记录")
    @ApiOperation(value = "数据采集情况", notes = "数据采集情况")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "时间", required = false, dataType = "string", paramType = "path")
    })
    public R getCollectByIndustry(String area, String industry, String time) {
        return R.ok(energyService.getCollectByIndustry(area, industry, time), "查询成功");
    }

    @GetMapping("/getCollectByMonth")
    @SysLog("在线采集数据查询-按月份统计采集记录")
    @ApiOperation(value = "数据采集情况", notes = "数据采集情况")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "时间", required = false, dataType = "string", paramType = "path")
    })
    public R getCollectByMonth(String area, String industry, String time) {
        return R.ok(energyService.getCollectByMonth(area, industry, time), "查询成功");
    }

    @GetMapping("/getCollectByDay")
    @SysLog("在线采集数据查询-按天统计采集记录")
    @ApiOperation(value = "数据采集情况", notes = "数据采集情况")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "时间", required = false, dataType = "string", paramType = "path")
    })
    public R getCollectByDay(String area, String industry, String time) {
        return R.ok(energyService.getCollectByDay(area, industry, time), "查询成功");
    }

    //=====================================上送国家数据查询明细==========================================
    @GetMapping("/getUpCollectByArea")
    @SysLog("上送国家数据查询明细-按地区查询上送国家数据明细")
    @ApiOperation(value = "数据采集情况", notes = "数据采集情况")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "时间", required = false, dataType = "string", paramType = "path")
    })
    public R getUpCollectByArea(String area, String industry, String time) {
        return R.ok(energyService.getUpCollectByArea(area, industry, time), "查询成功");
    }

    @GetMapping("/getUpCollectByIndustry")
    @SysLog("上送国家数据查询明细-按行业查询上送国家数据明细")
    @ApiOperation(value = "数据采集情况", notes = "数据采集情况")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "时间", required = false, dataType = "string", paramType = "path")
    })
    public R getUpCollectByIndustry(String area, String industry, String time) {
        return R.ok(energyService.getUpCollectByIndustry(area, industry, time), "查询成功");
    }

    @GetMapping("/getUpCollectByMonth")
    @SysLog("上送国家数据查询明细-按月份查询上送国家数据明细")
    @ApiOperation(value = "数据采集情况", notes = "数据采集情况")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "时间", required = false, dataType = "string", paramType = "path")
    })
    public R getUpCollectByMonth(String area, String industry, String time) {
        return R.ok(energyService.getUpCollectByMonth(area, industry, time), "查询成功");
    }

    @GetMapping("/getUpCollectByMonthNew")
    @SysLog("上送国家数据查询明细-按月份查询上送国家数据明细（新）")
    @ApiOperation(value = "数据采集情况", notes = "数据采集情况")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "时间", required = false, dataType = "string", paramType = "path")
    })
    public R getUpCollectByMonthNew(String area, String industry, String time) {
        return R.ok(energyService.getUpCollectByMonthNew(area, industry, time), "查询成功");
    }

    @GetMapping("/getUpCollectByDay")
    @SysLog("上送国家数据查询明细-按天查询上送国家数据明细")
    @ApiOperation(value = "数据采集情况", notes = "数据采集情况")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "时间", required = false, dataType = "string", paramType = "path")
    })
    public R getUpCollectByDay(String area, String industry, String time) {
        return R.ok(energyService.getUpCollectByDay(area, industry, time), "查询成功");
    }

    @GetMapping("/getUpCollectByDayNew")
    @SysLog("上送国家数据查询明细-按天查询上送国家数据明细（新）")
    @ApiOperation(value = "数据采集情况", notes = "数据采集情况")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "时间", required = false, dataType = "string", paramType = "path")
    })
    public R getUpCollectByDayNew(String area, String industry, String time) {
        return R.ok(energyService.getUpCollectByDayNew(area, industry, time), "查询成功");
    }

    //======================================================企业数量明细==========================================================

    /**
     * @Description: 依据条件返回公司列表
     * @Param: [area, industry, time]
     * @return: com.nantian.sc.cloud.common.core.util.R
     * @Author: zfw
     * @Date: 2021/1/4
     * @Date: 13:45
     */
    @GetMapping("/getCountyNameList")
    @SysLog("企业数量明细-依据条件返回公司列表")
    @ApiOperation(value = "依据条件返回公司列表", notes = "依据条件返回公司列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "area", value = "地区", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "industry", value = "行业", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "time", value = "时间", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "cmpName", value = "公司名称", required = false, dataType = "string", paramType = "path")
    })
    public R getCountyNameList(String area, String industry, String time, String cmpName) {
        return R.ok(energyService.getCountyNameList(area, industry), "查询成功");
    }

    @GetMapping("/getEnergyCalculateInfo")
    @SysLog("企业数量明细-结算日志")
    @ApiOperation(value = "结算日志", notes = "结算日志")
    public R getEnergyCalculateInfo(Page page, String enterpriseCode, String statDate, String state) {
        return R.ok(energyService.getEnergyCalculateInfo( page, enterpriseCode, statDate, state));
    }

    @GetMapping("/getEnergyCalculateAddInfo")
    @SysLog("企业数量明细-查询补录数据")
    @ApiOperation(value = "查询补录数据", notes = "查询补录数据")
    public R getEnergyCalculateAddInfo(Page page, String enterpriseCode, String statDate, String dataCode) {
        return R.ok(energyService.getEnergyCalculateAddInfo( page, enterpriseCode, statDate, dataCode));
    }

    //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++能报接口++++++++++++++++++++++++++++++++++++=
    @GetMapping("/getEnergyTableEpc")
    @SysLog("企业数量明细-节能报表")
    @ApiOperation(value = "节能报表", notes = "节能报表")
    public R getEnergyTableEpc(String statDate) {
        return R.ok(energyService.getEnergyTableEpc(statDate));
    }

    @GetMapping("/getEnergyTableEpcTotal")
    @SysLog("企业数量明细-节能报表综合能耗")
    @ApiOperation(value = "节能报表综合能耗", notes = "节能报表综合能耗")
    public R getEnergyTableEpcTotal(String statDate, String area, String industry) {
        return R.ok(energyService.getEnergyTableEpcTotal(statDate, area, industry));
    }

    @GetMapping("/getEnergyTableEpcKinds")
    @SysLog("企业数量明细-主要能源消费品种/结构")
    @ApiOperation(value = "主要能源消费品种/结构", notes = "主要能源消费品种")
    public R getEnergyTableEpcKinds(String statDate, String area, String industry) {
        return R.ok(energyService.getEnergyTableEpcKinds(statDate, area, industry));
    }

    @GetMapping("/getEnergyTableOutput")
    @SysLog("企业数量明细-产值能耗")
    @ApiOperation(value = "产值能耗", notes = "产值能耗")
    public R getEnergyTableOutput(String statDate, String area, String industry) {
        return R.ok(energyService.getEnergyTableOutput(statDate, area, industry));
    }

    @GetMapping("/getEnergyTableOutputOrder")
    @SysLog("企业数量明细-排序")
    @ApiOperation(value = "排序", notes = "排序")
    public R getEnergyTableOutputOrder(String statDate, String area, String industry) {
        return R.ok(energyService.getEnergyTableOutputOrder(statDate, area, industry));
    }

    @GetMapping("/getEnergyTableInfos")
    @SysLog("企业数量明细-获取在线监测月报告数据")
    @ApiOperation(value = "获取在线监测月报告数据", notes = "获取在线监测月报告数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "statDate", value = "报告时间,取值2021-09", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "epcStr", value = "停工停产企业", required = false, dataType = "string", paramType = "path")
    })
    public R getEnergyTableInfos(String statDate, String epcStr) throws ParseException {
        return energyService.getEnergyTableInfos(statDate, epcStr);
    }

    @GetMapping("/getEnergyEnterpriseCount")
    @SysLog("企业数量明细-获取在线监测月报告-监测企业数")
    @ApiOperation(value = "获取在线监测月报告-监测企业数", notes = "获取在线监测月报告-监测企业数")
    @ApiImplicitParam(name = "statDate", value = "报告时间,取值2021-09", required = false, dataType = "string", paramType = "path")
    public R getEnergyEnterpriseCount(String statDate){
        return energyService.getEnergyEnterpriseCount(statDate);
    }

    @GetMapping("/getEnergyExceptionInfos")
    @SysLog("企业数量明细-获取在线监测月报告-异常企业信息")
    @ApiOperation(value = "获取在线监测月报告-异常企业信息", notes = "获取在线监测月报告-异常企业信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "statDate", value = "报告时间,取值2021-09", required = false, dataType = "string", paramType = "path"),
            @ApiImplicitParam(name = "epcStr", value = "停工停产企业", required = false, dataType = "string", paramType = "path")
    })
    public R getEnergyExceptionInfos(String statDate, String epcStr) throws ParseException {
        return energyService.getEnergyExceptionInfos(statDate, epcStr);
    }


    @GetMapping("/getExceptionEnterpriseInfos")
    @SysLog("企业数量明细-获取每月6号报给发改委的异常企业名单")
    @ApiOperation(value = "获取每月6号报给发改委的异常企业名单", notes = "获取每月6号报给发改委的异常企业名单")
    @ApiImplicitParam(name = "ExceptionEnterpriseInfos", value = "企业名单", required = false, dataType = "json", paramType = "path")
    public R getExceptionEnterpriseInfos(ExceptionEnterpriseInfos enterpriseInfos){
        return energyService.getExceptionEnterpriseInfos(enterpriseInfos);
    }

    @PostMapping("/upExceptionEnterpriseInfos")
    @SysLog("企业数量明细-修改每月6号报给发改委的异常企业名单")
    @ApiOperation(value = "修改每月6号报给发改委的异常企业名单", notes = "修改每月6号报给发改委的异常企业名单")
    @ApiImplicitParam(name = "ExceptionEnterpriseInfos", value = "企业名单", required = false, dataType = "json", paramType = "path")
    public R upExceptionEnterpriseInfos(@RequestBody ExceptionEnterpriseInfos enterpriseInfos){
        return energyService.upExceptionEnterpriseInfos(enterpriseInfos);
    }

    //++++++++++++++++++++++++++++++++++++++++++++修改字典信息+++++++++++++++++++++++++++++++++++++++++++++
    @PutMapping("/upDateEnterpriseRegionCode")
    @SysLog("修改字典信息-修改企业所属地区编码")
    @ApiOperation(value = "修改企业所属地区编码", notes = "修改企业所属地区编码")
    public R upDateEnterpriseRegionCode(@RequestBody EpcVo epcVo) {
        return energyService.upDateEnterpriseRegionCode(epcVo.getEnterpriseCode(),epcVo.getRegionCode());
    }
    @GetMapping("/getCollectEnterpriseInfo")
    @SysLog("获取在线企业列表")
    @ApiOperation(value = "获取在线企业列表", notes = "获取在线企业列表")
    public R getCollectEnterpriseInfo(String area,String industry ,String cmpName) {
        return energyService.getCollectEnterpriseInfo(area,industry,cmpName);
    }

    @GetMapping("/getRegionTrees")
    @SysLog("获取地区树")
    @ApiOperation(value = "获取地区树", notes = "获取地区树")
    public R getRegionTrees(String regionCode) {
        return energyService.getRegionTrees(regionCode);
    }

//    @GetMapping("/getPageLogList")
//    @SysLog("结算日志")
    public R getPageLogList(Page page, QualityCalculateLogVo calculateLogVo) throws ParseException {

        String operateType = calculateLogVo.getOperateType();
        if (operateType.isEmpty()){
            return R.failed("操作类型为空，请检查参数！");
        }else {
//            String statDate = calculateLogVo.getStatDate();
//            if (!StringUtils.isNotBlank(statDate)){
//                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
//                String s = format.format(new Date());
//                calculateLogVo.setStatDate(s);
//            }
            if (operateType.equals("2")){
                if (StringUtils.isNotBlank(calculateLogVo.getUploadTime())){
                    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
                    String uploadTime = calculateLogVo.getUploadTime();
                    Date date = format.parse(uploadTime);
                    String s = format.format(date);
                    calculateLogVo.setUploadTime(s);
                }
                Calendar calendar = Calendar.getInstance();
                calculateLogVo.setOperateStartDate(new SimpleDateFormat("yyyy-MM-dd").format(calendar.getTime()));
                return R.ok(energyService.getPageInfoList(page, calculateLogVo));
            }else {
                return R.ok(energyService.getPageLogList(page,calculateLogVo));
            }
        }
    }
    @GetMapping("/getPageLogList")
    @SysLog("结算日志")
    public R getPageLogList2(Page page, QualityCalculateLogVo calculateLogVo) throws ParseException {

        String operateType = calculateLogVo.getOperateType();
        if (operateType.isEmpty()){
            return R.failed("操作类型为空，请检查参数！");
        }else {
            //1,2,3分别对应自动结算，补算，接口结算
            if (operateType.equals("1")){
                return R.ok(energyService.getPageLogListA(page,calculateLogVo));
            } else if (operateType.equals("2")){
                return R.ok(energyService.getPageLogListB(page,calculateLogVo));
            } else if (operateType.equals("3")){
                return R.ok(energyService.getPageLogListC(page,calculateLogVo));
            } else{
                return R.failed("操作类型未知，请检查参数！");
            }
        }
    }

}
