package com.tofly.xrtygis.custom.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.common.core.entity.ResultRespone;
import com.tofly.xrtygis.custom.entity.dto.CustomDmausertableDto;
import com.tofly.xrtygis.custom.entity.dto.RelationshipCostDto;
import com.tofly.xrtygis.custom.entity.dto.WisdomDisplayDto;
import com.tofly.xrtygis.custom.entity.vo.DmaAllIndexVo;
import com.tofly.xrtygis.custom.entity.vo.WaterCruxIndexVo;
import com.tofly.xrtygis.custom.service.CustomDisplayService;
import com.tofly.xrtygis.custom.service.export.ExportCommonCodeService;
import com.tofly.xrtygis.entity.Densityconfig;
import com.tofly.xrtygis.entity.Layerfield;
import com.tofly.xrtygis.entity.TfDeviceArchiveManage;
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.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

/**
 * @author JF
 * @date 2022-5-9
 */
@RestController
@RequestMapping("/customDisplay")
@AllArgsConstructor
@Api(tags = "自定义智慧综合展示")
public class CustomDisplayController {

    private final CustomDisplayService customDisplayService;
    private final ExportCommonCodeService exportCommonCodeService;

    /**
     * 添加动态标注
     */
    @PostMapping("/insertDynamicLogo")
    @ApiOperation("添加动态标注")
    public ResultRespone insertDynamicLogo(@RequestBody Layerfield layerfield) {
        return ResultRespone.success(customDisplayService.insertDynamicLogo(layerfield));
    }

    /**
     * 删除动态标注
     */
    @DeleteMapping("/deleteDynamicLogo")
    @ApiOperation("删除动态标注")
    @ApiImplicitParams(
            @ApiImplicitParam(name = "id", value = "动态标注id", required = true, dataType = "long")
    )
    public ResultRespone deleteDynamicLogo(Long id) {
        return ResultRespone.success(customDisplayService.deleteDynamicLogo(id));
    }

    /**
     * 查看动态标注
     */
    @GetMapping("/viewDynamicLog")
    @ApiOperation("查看动态标注")
    public ResultRespone viewDynamicLog(Page page) {
        return ResultRespone.success(customDisplayService.viewDynamicLogo(page));
    }


    /**
     * 获取多个测站指标实时指标
     */
    @PostMapping("/getSiteInfos")
    @ApiOperation("获取多个测站指标实时指标")
    public ResultRespone getSiteInfos(String stids) {
        return ResultRespone.success(customDisplayService.getSiteInfos(stids));
    }

    /**
     * 取供水趋势
     */
    @GetMapping("/waterVolumeTrend")
    @ApiOperation("综合应用-取供水趋势")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "scid", value = "厂id", dataType = "long"),
            @ApiImplicitParam(name = "code", value = "0：按小时查看,1：按天查看，2：按月查看，3：同期对比", required = true, dataType = "string"),
    })
    public ResultRespone waterVolumeTrend(Page page, Long scid, String code, String startTime, String endTime) {
        return ResultRespone.success(customDisplayService.waterVolumeTrend(page, scid, code, startTime, endTime));
    }


    /**
     * 查询视频监控的分组名
     */
    @GetMapping("/getGroupName")
    @ApiOperation("查询视频监控的分组名")
    public ResultRespone getGroupName() {
        return ResultRespone.success(customDisplayService.getGroupName());
    }

    /**
     * 获取监控视频信息
     */
    @GetMapping("/getAllVideo")
    @ApiOperation("获取监控视频信息")
    public ResultRespone getAllVideo() {
        return ResultRespone.success(customDisplayService.getAllVideo());
    }

    /**
     * 模糊查询视频地址
     */
    @GetMapping("/likeVideo")
    @ApiOperation("模糊查询视频地址")
    @ApiImplicitParams(
            @ApiImplicitParam(name = "add", value = "视频地址信息", required = true, dataType = "string")
    )
    public ResultRespone likeVideo(String add) {
        return ResultRespone.success(customDisplayService.likeVideo(add));
    }

    /**
     * 修改视频在大屏中显示
     */
    @PutMapping("/updateVideo")
    @ApiOperation("修改视频在大屏中显示")
    @ApiImplicitParams(
            @ApiImplicitParam(name = "videoId", value = "视频监控id多个“,”分割")
    )
    public ResultRespone updateVideo(String videoId) {
        return ResultRespone.success(customDisplayService.updateVideo(videoId));
    }

    @GetMapping("/stopArea")
    @ApiOperation("营销信息-停水区域查询")
    @ApiImplicitParams(
            @ApiImplicitParam(name = "valves", value = "阀门编号，多个，分隔", required = true, dataType = "string")
    )
    public ResultRespone waterStopArea(Page page, String valves) {
        return ResultRespone.success(customDisplayService.waterStopArea(page, valves));
    }

    /**
     * 获取客户用水量
     */
    @GetMapping("/getUseWater")
    @ApiOperation("营销信息-获取客户用水量")
    @ApiImplicitParams(
            @ApiImplicitParam(name = "khbh", value = "客户编号", required = true, dataType = "string")
    )
    public ResultRespone getUseWater(Page page, String khbh) {
        return ResultRespone.success(customDisplayService.getUseWater(page, khbh));
    }

    @GetMapping("/getUserHistory")
    @ApiOperation("营销信息-查询客户历史用水量")
    @ApiImplicitParams(
            @ApiImplicitParam(name = "khbh", value = "客户编号", required = true, dataType = "string")
    )
    public ResultRespone getUserHistory(Page page, String khbh, String strTime, String endTime) {
        return ResultRespone.success(customDisplayService.getUserHistroy(page, khbh, strTime, endTime));
    }

    @GetMapping("/waterMonitoring")
    @ApiOperation("营销信息-客户水量查询")
    public ResultRespone waterMonitoring(Page page) {
        return ResultRespone.success(customDisplayService.waterMonitoring(page));
    }

    /**
     * 区域查询用水量
     */
    @GetMapping("/getTableInArea")
    @ApiOperation("营销信息-区域查询用水量")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "lon", value = "区域各顶点的横坐标数组", required = true, dataType = "Double[]"),
            @ApiImplicitParam(name = "lat", value = "区域各顶点的纵坐标数组", required = true, dataType = "Double[]"),
            @ApiImplicitParam(name = "code", value = "0:查看全部 1：同期对比", required = true, dataType = "string"),
            @ApiImplicitParam(name = "strTime", value = "开始时间yyyyMM", dataType = "string"),
            @ApiImplicitParam(name = "endTime", value = "结束时间yyyyMM", dataType = "string"),
    })
    public ResultRespone getTableInArea(Page page, Double[] lon, Double[] lat, String strTime, String endTime, String code) {
        return ResultRespone.success(customDisplayService.getTableInArea(page, lon, lat, strTime, endTime, code));
    }

    @GetMapping("/pipeToCustomers")
    @ApiOperation("根据管线查询用户信息")
    public ResultRespone pipeToCustomers(Page page, String pipes) {
        return ResultRespone.success(customDisplayService.pipeToCustomers(page, pipes));
    }

    @GetMapping("/relationChart")
    @ApiOperation("多因子成本关系图")
    public ResultRespone relationshipCost(RelationshipCostDto dto) {
        return ResultRespone.success(customDisplayService.relationshipCost(dto));
    }

    @PostMapping("/config")
    @ApiOperation("多因子--浓度配置")
    public ResultRespone concentrationConfig(@RequestBody Densityconfig config) {
        return ResultRespone.success(customDisplayService.concentrationConfig(config));
    }

    @GetMapping("/viewConfig")
    @ApiOperation("多因子--查看浓度配置")
    public ResultRespone viewConfig() {
        return ResultRespone.success(customDisplayService.viewConfig());
    }

    @GetMapping("/viewTable")
    @ApiOperation("查询客户关联水表信息")
    public ResultRespone viewTable(Page page, String khbh, String khxm, String khdz) {
        return ResultRespone.success(customDisplayService.viewTable(page, khbh, khxm, khdz));
    }

    @GetMapping("/getCodeInfo")
    @ApiOperation("获取编码表消息")
    @ApiImplicitParam(name = "pcid", value = "pcid", required = true, dataType = "string")
    public ResultRespone getCodeInfo(String pcid) {
        return ResultRespone.success(customDisplayService.getCodeInfo(pcid));
    }

    @GetMapping("/selectDmausertablePage")
    @ApiOperation("获取用户水表分页")
    public ResultRespone selectDmausertablePage(Page page, @Valid CustomDmausertableDto dmausertableDto) {
        return ResultRespone.success(customDisplayService.selectDmausertablePage(page, dmausertableDto));
    }

    @GetMapping("/useWaterHistory")
    @ApiOperation("查看用户用水历史")
    public Page useWaterHistory(Page page, @RequestParam("yhbh") String yhbh, @RequestParam("startTime")String startTime, @RequestParam("endTime")String endTime){
        return customDisplayService.useWaterHistory(page, yhbh, startTime, endTime);
    }

    @GetMapping("/getDmaTree")
    @ApiOperation(value = "获取分区树")
    public ResultRespone getDmaTree(@RequestParam(value = "dmaName",required = false) String dmaName){
        return ResultRespone.success(customDisplayService.getDmaTree(dmaName));
    }

    @GetMapping("/getDmaLevel")
    @ApiOperation(value = "获取分区级别")
    public ResultRespone getDmaLevel(){
        return ResultRespone.success(customDisplayService.getDmaLevel());
    }

    @GetMapping("/getDmaLevelAmount")
    @ApiOperation(value = "获取各分区级别数量")
    public ResultRespone getDmaLevelAmount(){
        return ResultRespone.success(customDisplayService.getDmaLevelAmount());
    }

    @GetMapping("/getDmaAllIndex/{id}")
    @ApiOperation(value = "通过dmaId查询各指标")
    public ResultRespone getDmaAllIndex(@PathVariable("id") Long id){
        try {
            DmaAllIndexVo dmaAllIndexVo = customDisplayService.getDmaAllIndex(id);
            if(dmaAllIndexVo == null){
                return ResultRespone.failed("id不能为0或不能为空");
            }
            return ResultRespone.success(dmaAllIndexVo);
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/getDmaFlowPress")
    @ApiOperation(value = "查询流量压力曲线")
    public ResultRespone getDmaFlowPress(@RequestParam("dataType") String dataType, @RequestParam("dmaId") Long dmaId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime){
        try {
            return ResultRespone.success(customDisplayService.getDmaFlowPress(dataType, dmaId, startTime, endTime));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

//    @GetMapping("/getDmaPress")
//    @ApiOperation(value = "查询压力曲线")
//    public ResultRespone getDmaAllIndex(@RequestParam("dmaId") Long dmaId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime){
//        try {
//            return ResultRespone.success(customDisplayService.getDmaPress(dmaId, startTime, endTime));
//        }catch (Exception e){
//            e.printStackTrace();
//            return ResultRespone.failed(e.getMessage());
//        }
//    }

    @GetMapping("/getDmaCensusParam")
    @ApiOperation(value = "查询DMA统计参数记录表")
    public ResultRespone getDmaCensusParam(@RequestParam("dmaId") Long dmaId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime){
        try {
            return ResultRespone.success(customDisplayService.getDmaCensusParam(dmaId, startTime, endTime));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/exportReportForm")
    @ApiOperation("导出综合报表(1年度;2季度;3月度,4天)")
    public ResultRespone exportReportForm(HttpServletResponse response, Page page, WisdomDisplayDto wisdomDisplayDto) {
        return ResultRespone.success(customDisplayService.exportReportForm(response, page, wisdomDisplayDto));
    }

    @GetMapping("/getYearReportForm")
    @ApiOperation(value = "查询年度综合报表")
    public ResultRespone getYearReportForm(Page page, WisdomDisplayDto wisdomDisplayDto){
        try {
            wisdomDisplayDto.setType("1");
            return ResultRespone.success(customDisplayService.getReportFormComm(page, wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/getQuarterReportForm")
    @ApiOperation(value = "查询季度综合报表")
    public ResultRespone getQuarterReportForm(Page page, WisdomDisplayDto wisdomDisplayDto){
        try {
            wisdomDisplayDto.setType("2");
            return ResultRespone.success(customDisplayService.getReportFormComm(page, wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/getMonthReportForm")
    @ApiOperation(value = "查询月度综合报表")
    public ResultRespone getMonthReportForm(Page page, WisdomDisplayDto wisdomDisplayDto){
        try {
            wisdomDisplayDto.setType("3");
            return ResultRespone.success(customDisplayService.getReportFormComm(page, wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/getDayReportForm")
    @ApiOperation(value = "查询天综合报表")
    public ResultRespone getDayReportForm(Page page, WisdomDisplayDto wisdomDisplayDto){
        try {
            wisdomDisplayDto.setType("4");
            return ResultRespone.success(customDisplayService.getReportFormComm(page, wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }


    @GetMapping("/getLeakageRate")
    @ApiOperation(value = "漏损率指标分析")
    public ResultRespone getLeakageRate(Page page, WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.getLeakageRate(page, wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/getLeakageRateCensus")
    @ApiOperation(value = "漏损率指标分析统计图")
    public ResultRespone getLeakageRateCensus(WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.getLeakageRateCensus(wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/getLeakRateStatus")
    @ApiOperation(value = "获取漏损率分析状态数量")
    public ResultRespone getLeakRateStatus(WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.getLeakRateStatus(wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/getNrw")
    @ApiOperation(value = "产销差指标分析")
    public ResultRespone getNrw(Page page, WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.getNrw(page, wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/getNrwStatus")
    @ApiOperation(value = "获取产销差分析状态数量")
    public ResultRespone getNrwStatus(WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.getNrwStatus(wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/getWaterBalance")
    @ApiOperation(value = "水平衡分析(type:1月,2年)")
    public ResultRespone getWaterBalance(Page page, WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.getWaterBalance(page, wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @ApiOperation(value = "水平衡分析导出(type:1月,2年)")
    @GetMapping("/exportWaterBalance")
    public void exportWaterBalance(HttpServletResponse response, Page page, WisdomDisplayDto wisdomDisplayDto){
        exportCommonCodeService.exportCode(response, "exportWaterBalanceService", customDisplayService.getWaterBalance(page, wisdomDisplayDto).getRecords());
    }

    @GetMapping("/getObserveFlow")
    @ApiOperation(value = "观察表流量分析(statisticsType:2按月,1按天,0按小时)")
    public ResultRespone getObserveFlow(Page page, WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.getObserveFlow(page, wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @ApiOperation(value = "观察表流量分析导出(statisticsType:2按月,1按天,0按小时)")
    @GetMapping("/exportObserveFlow")
    public void exportObserveFlow(HttpServletResponse response, Page page, WisdomDisplayDto wisdomDisplayDto){
        exportCommonCodeService.exportCode(response, "exportObserveFlowService", customDisplayService.getObserveFlow(page, wisdomDisplayDto).getRecords());
    }

    @GetMapping("/getLeakOverview")
    @ApiOperation(value = "漏损情况总览")
    public ResultRespone getLeakOverview(){
        try {
            return ResultRespone.success(customDisplayService.getLeakOverview());
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/getSupplyWaterYear")
    @ApiOperation(value = "近12个月供水售水量分析")
    public ResultRespone getSupplyWaterYear(){
        try {
            return ResultRespone.success(customDisplayService.getSupplyWaterYear());
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/getLeakNrwYear")
    @ApiOperation(value = "年度漏损率产销差分析")
    public ResultRespone getLeakNrwYear(WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.getLeakNrwYear(wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/getDmaStatisticalMonth")
    @ApiOperation(value = "按月分组查看DMA统计参数")
    public ResultRespone getDmaStatisticalMonth(WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.getDmaStatisticalMonth(wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/getLevelDmaLeak")
    @ApiOperation(value = "各级别分区漏损率")
    public ResultRespone getLevelDmaLeak(){
        try {
            return ResultRespone.success(customDisplayService.getLevelDmaLeak());
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/viewWaterCruxIndex")
    @ApiOperation(value = "供水关键指标展示")
    public ResultRespone<WaterCruxIndexVo> viewWaterCruxIndex(WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.viewWaterCruxIndex(wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/reportFormCensus")
    @ApiOperation(value = "报表统计（censusDateType:1年;2月;3日）")
    public ResultRespone reportFormCensus(Page page, WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.reportFormCensus(page, wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/currencyViewIndexH")
    @ApiOperation(value = "查询各指标数据通用接口")
    public ResultRespone currencyViewIndexH(WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.currencyViewIndexH(wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/currencyViewIndexAvgH")
    @ApiOperation(value = "按小时分组查询各指标平均值数据通用接口")
    public ResultRespone currencyViewIndexAvgH(WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.currencyViewIndexAvgH(wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/censusDeviceStaCount")
    @ApiOperation(value = "统计设备各状态数量")
    public ResultRespone censusDeviceStaCount(){
        try {
            return ResultRespone.success(customDisplayService.censusDeviceStaCount());
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/censusIndexStaCount")
    @ApiOperation(value = "统计指标各状态数量")
    public ResultRespone censusIndexStaCount(){
        try {
            return ResultRespone.success(customDisplayService.censusIndexStaCount());
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/viewDeviceTree")
    @ApiOperation(value = "查看设备树")
    public ResultRespone viewDeviceTree(TfDeviceArchiveManage deviceArchiveManage){
        try {
            return ResultRespone.success(customDisplayService.viewDeviceTree(deviceArchiveManage));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/pressQualityRateH")
    @ApiOperation(value = "根据小时查询指标合格率指标")
    public ResultRespone pressQualityRateH(WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.pressQualityRateH(wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/viewLossCensus")
    @ApiOperation(value = "查看能耗统计")
    public ResultRespone viewLossCensus(WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.viewLossCensus(wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

//    @GetMapping("/viewGpsCalculateByMonth")
//    @ApiOperation(value = "按月分组查看巡查统计记录")
//    public ResultRespone viewGpsCalculateByMonth(WisdomDisplayDto wisdomDisplayDto){
//        try {
//            return ResultRespone.success(customDisplayService.viewGpsCalculateByMonth(wisdomDisplayDto));
//        }catch (Exception e){
//            e.printStackTrace();
//            return ResultRespone.failed(e.getMessage());
//        }
//    }

    @GetMapping("/viewOrderByMonth")
    @ApiOperation(value = "按月分组查看工单数和完成率")
    public ResultRespone viewOrderByMonth(WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.viewOrderByMonth(wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/viewInspectNumByMonth")
    @ApiOperation(value = "按月分组查看巡检次数和巡检公里数")
    public ResultRespone viewInspectPlanByMonth(WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.viewInspectPlanByMonth(wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

    @GetMapping("/viewNewHotLineByMonth")
    @ApiOperation(value = "按月分组查看呼叫中心记录")
    public ResultRespone viewNewHotLineByMonth(WisdomDisplayDto wisdomDisplayDto){
        try {
            return ResultRespone.success(customDisplayService.viewNewHotLineByMonth(wisdomDisplayDto));
        }catch (Exception e){
            e.printStackTrace();
            return ResultRespone.failed(e.getMessage());
        }
    }

}
