package com.huatek.busi.controller;

import java.net.UnknownHostException;
import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;

import com.huatek.busi.common.Md5Util;
import com.huatek.busi.entity.BusiEqmWarningPicture;
import com.huatek.busi.service.BusiEqmWarningPictureService;
import com.huatek.busi.service.arrester.LightningrodImService;
import com.huatek.busi.service.temperature.CwgTemperatureService;
import com.huatek.busi.vo.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.alibaba.dubbo.config.annotation.Reference;
import com.github.pagehelper.PageInfo;
import com.huatek.busi.common.BusiConstant;
import com.huatek.busi.common.BusiConstant.HomePagePart;
import com.huatek.busi.common.SiteConstants.*;
import com.huatek.busi.constant.ApiConstant.Tags;
import com.huatek.busi.dto.*;
import com.huatek.busi.service.*;
import com.huatek.busi.service.Other.OtherPdCacheService;
import com.huatek.busi.service.arrester.RptAretMonitorService;
import com.huatek.busi.service.capacitance.CapacitanceEquipmentImCacheService;
import com.huatek.busi.service.gis.*;
import com.huatek.busi.service.temperature.RptTermperRecordService;
import com.huatek.busi.service.transformer.*;
import com.huatek.busi.vo.monitor.BusiRptArresterMonitorVo;
import com.huatek.busi.vo.warning.*;
import com.huatek.torch.frame.tools.*;

import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;

/**
 * @ClassName: BusiHomePageController
 * @FullClassPath: com.huatek.busi.controller.BusiHomePageController
 * @Description: 主页控制器
 * @author: Arno
 * @date: Jul 25, 2019 3:44:41 PM
 * @version: 1.0
 */
@Api(tags = {Tags.BUSI_INDEX_DATA})
@Slf4j
@RestController
@RequestMapping("/api/homePage")
public class BusiHomePageController {
    @Reference(check = false)
    private BusiHomePageService busiHomePageService;
    @Reference(check = false)
    private RptTermperRecordService rptTermperRecordService;
    @Reference(check = false)
    private RptGisMonitorSf6Service rptGisMonitorSf6Service;
    @Reference(check = false)
    private TransformerPdCacheService transformerPdCacheService;
    @Reference(check = false)
    private GisPdCacheService gisPdCacheService;
    @Reference(check = false)
    private OtherPdCacheService otherPdCacheService;
    @Reference(check = false)
    private ReadTableVisualizationService readTableVisualizationService;
    @Reference(check = false)
    private TransformerRunStatusService transformerRunStatusService;
    @Reference(check = false)
    private TransformerInfraredMonitoringCacheService transformerInfraredMonitoringCacheService;
    @Reference(check = false)
    private TransformerEpaDataCacheService transformerEpaDataCacheService;
    @Reference(check = false)
    private TransformerIcgeCacheService transformerIcgeCacheService;
    @Reference(check = false)
    private RptAretMonitorService rptAretMonitorService;
    @Reference(check = false)
    private CapacitanceEquipmentImCacheService capacitanceEquipmentImCacheService;
    @Reference(check = false)
    private BusiEqmWarningPictureService busiEqmWarningPictureService;

    @Reference(check = false)
    private CwzzTemperatureService cwzzTemperatureService;

    @Reference(check = false)
    private Sf6EnvService Sf6EnvService;
    @Reference(check = false)
    private TransformerWindingTemperatureService transformerWindingTemperatureService;
    @Reference(check = false)
    private BusiGeneratorAmplService busiGeneratorAmplService;
    @Reference(check = false)
    private BusiGeneratorPressureService busiGeneratorPressureService;
    @Reference(check = false)
    private BusiGeneratorPdService busiGeneratorPdService;

    @Reference(check = false)
    private CwgTemperatureService cwgTemperatureService;

    @Reference(check = false)
    private LightningrodImService lightningrodImService;


    @ApiOperation(value = "变压器数据列表", response = BusiHomePageVo.class)
    @ApiImplicitParam(name = "type", value = "类型：YSP--油色谱 , TX--铁芯, TG--套管, RX--容性设备, BLQ--避雷器, JJ--夹件")
    @GetMapping(value = "/transfromerList")
    public Map<String, Object> transfromerList(@RequestParam("type") String type) {
        HomePagePart part = HomePagePart.from(type);
        List<BusiHomePageVo> list = Collections.emptyList();
        switch (part) {
            case BLQ:
                list = busiHomePageService.findArresterlist(ArresterTreeEnum.JY_EQM.getValue());
                break;
            case JJ:
                list = busiHomePageService.findTransfromerlist(TransfromerTreeEnum.JJ_EQM.getValue());
                break;
            case RX:
                list = busiHomePageService.findArresterlist(ArresterTreeEnum.RX_EQM.getValue());
                break;
            case TG:
                list = busiHomePageService.findTransfromerlist(TransfromerTreeEnum.TG_EQM.getValue());
                break;
            case TX:
                list = busiHomePageService.findTransfromerlist(TransfromerTreeEnum.TX_EQM.getValue());
                break;
            case YSP:
                list = busiHomePageService.findTransfromerlist(TransfromerTreeEnum.YSP_EQM.getValue());
                break;
        }
        log.debug("@@@@type: {}, list: {}", type, list);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", list);
    }

    @ApiOperation(value = "变压器数据信息", response = BusiHomeInfoVo.class)
    @ApiImplicitParams({@ApiImplicitParam(name = "mainTreeId", value = "站点树ID"),
            @ApiImplicitParam(name = "subTreeId", value = "外挂设备树ID"),
            @ApiImplicitParam(name = "subEquipmentId", value = "外挂设备ID"), @ApiImplicitParam(name = "type", value = "大类"),
            @ApiImplicitParam(name = "equipmentType", value = "外挂设备类型"),
            @ApiImplicitParam(name = "sensorId", value = "传感器ID")})
    @GetMapping(value = "/transfromerInfo")
    public Map<String, Object> transfromerInfo(@RequestParam("mainTreeId") String mainTreeId,
                                               @RequestParam("subTreeId") String subTreeId, @RequestParam("subEquipmentId") String subEquipmentId,
                                               @RequestParam("type") String type, @RequestParam("equipmentType") String equipmentType,
                                               @RequestParam("sensorId") String sensorId) {
        SiteTreeEnum siteTreeEnum = null;
        HomePagePart part = HomePagePart.from(type);
        switch (part) {
            case BLQ:
            case RX:
                siteTreeEnum = SiteTreeEnum.BLQ;
                break;
            case JJ:
            case TG:
            case TX:
            case YSP:
                siteTreeEnum = SiteTreeEnum.BYQ;
                break;
        }
        BusiHomeInfoVo info = busiHomePageService.findTransfromerInfo(mainTreeId, subTreeId, subEquipmentId,
                siteTreeEnum, equipmentType, sensorId);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", info);
    }

    /**
     * 获取最近的告警列表
     *
     * @param eqType 告警大类
     * @param gzType 告警小类
     * @param page   当前页
     * @param limit  每页大小
     * @return 告警列表
     */
    @ApiOperation(value = "获取最近的告警列表", response = BusiHomePageWarningVo.class)
    @ApiImplicitParams({@ApiImplicitParam(name = "eqType", value = "告警大类", required = false),
            @ApiImplicitParam(name = "gzType", value = "告警小类", required = false),
            @ApiImplicitParam(name = "page", value = "当前页", required = false),
            @ApiImplicitParam(name = "limit", value = "每页大小", required = false)})
    @GetMapping(value = "/getLastWarning")
    public Map<String, Object> getLastWarning(@RequestParam(value = "eqType", required = false) String eqType,
                                              @RequestParam(value = "gzType", required = false) String gzType,
                                              @RequestParam(value = "page", required = false) Integer page,
                                              @RequestParam(value = "limit", required = false) Integer limit,
                                              @RequestParam(value = "warningTime", required = false) String warningTime,
                                              @RequestParam(value = "warningTimeEnd", required = false) String warningTimeEnd) throws UnknownHostException {
        if(!busiHomePageService.verifyDongle()){
            return ResultUtil.put(Md5Util.DANGLE_CODE_FAIL, "", null);
        }
        BusiEqmWarningDto busiEqmWarningDto = new BusiEqmWarningDto();
        busiEqmWarningDto.setEqType(eqType);
        busiEqmWarningDto.setGzType(gzType);
        if (StringUtils.isNotEmpty(warningTime)) {
            busiEqmWarningDto.setWarningTime(
                    LocalDateTime.parse(warningTime + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        }
        if (StringUtils.isNotEmpty(warningTimeEnd)) {
            busiEqmWarningDto.setWarningTimeEnd(
                    LocalDateTime.parse(warningTimeEnd + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        }
        busiEqmWarningDto.setPage(page == null ? 1 : page);
        busiEqmWarningDto.setLimit(limit == null ? BusiConstant.MAX_WARNING_PAGE_SIZE : limit);
//        PageInfo<BusiHomePageWarningVo> pageInfo = busiHomePageService.findCurrentWarningList(busiEqmWarningDto);

        PageInfo<BusiHomePageWarningVo> pageInfo = busiHomePageService.findCurrentWarningBySensorCodeList(busiEqmWarningDto);

        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, pageInfo.getTotal(), "", pageInfo.getList());
    }


    /**
     * 获取最近的告警列表
     *
     * @param eqType 告警大类
     * @param gzType 告警小类
     * @param page   当前页
     * @param limit  每页大小
     * @return 告警列表
     */
    @ApiOperation(value = "获取最近的告警列表", response = BusiHomePageWarningVo.class)
    @ApiImplicitParams({@ApiImplicitParam(name = "eqType", value = "告警大类", required = false),
            @ApiImplicitParam(name = "gzType", value = "告警小类", required = false),
            @ApiImplicitParam(name = "page", value = "当前页", required = false),
            @ApiImplicitParam(name = "limit", value = "每页大小", required = false)})
    @GetMapping(value = "/getBySensorCodeLastWarning")
    public Map<String, Object> getBySensorCodeLastWarning(@RequestParam(value = "eqType", required = false) String eqType,
                                                          @RequestParam(value = "gzType", required = false) String gzType,
                                                          @RequestParam(value = "page", required = false) Integer page,
                                                          @RequestParam(value = "limit", required = false) Integer limit,
                                                          @RequestParam(value = "warningTime", required = false) String warningTime,
                                                          @RequestParam(value = "runState", required = false) String runState,
                                                          @RequestParam(value = "warningTimeEnd", required = false) String warningTimeEnd,
                                                          @RequestParam(value = "sensorCode", required = false) String sensorCode) {
        BusiEqmWarningDto busiEqmWarningDto = new BusiEqmWarningDto();
        busiEqmWarningDto.setEqType(eqType);
        busiEqmWarningDto.setGzType(gzType);
        busiEqmWarningDto.setRunState(runState);
        busiEqmWarningDto.setSensorId(sensorCode);
        if (StringUtils.isNotEmpty(warningTime)) {
            busiEqmWarningDto.setWarningTime(
                    LocalDateTime.parse(warningTime + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        }
        if (StringUtils.isNotEmpty(warningTimeEnd)) {
            busiEqmWarningDto.setWarningTimeEnd(
                    LocalDateTime.parse(warningTimeEnd + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        }
        busiEqmWarningDto.setPage(page == null ? 1 : page);
        busiEqmWarningDto.setLimit(limit == null ? BusiConstant.MAX_WARNING_PAGE_SIZE : limit);
        PageInfo<BusiHomePageWarningVo> pageInfo = busiHomePageService.findCurrentWarningList(busiEqmWarningDto);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, pageInfo.getTotal(), "", pageInfo.getList());
    }


    /**
     * 告警查看告警图片/视频
     *
     * @param busiEqmWarningDto 设备预警表Dto
     * @return map map
     */
    @ApiOperation(value = "告警查看告警图片/视频", response = BusiEqmWarningPicture.class)
    @PostMapping(value = "/getWarningPictureList", produces = {"application/json;charset=utf-8"})
    public Map<String, Object> getWarningPictureList(@RequestBody BusiEqmWarningDto busiEqmWarningDto) {
        List<BusiEqmWarningPicture> warningPictures = busiEqmWarningPictureService.findByWarningId(busiEqmWarningDto.getId());
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", warningPictures);
    }

    @ApiOperation(value = "获取最近的告警列表", response = BusiHomePageWarningVo.class)
    @PostMapping(value = "/getLastWarning")
    public Map<String, Object> getLastWarning(@RequestBody BusiEqmWarningDto param) {
        param.setPage(param.getPage() == null ? 1 : param.getPage());
        param.setLimit(param.getLimit() == null ? BusiConstant.MAX_WARNING_PAGE_SIZE : param.getLimit());
        PageInfo<BusiHomePageWarningVo> pageInfo = busiHomePageService.findCurrentWarningList(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, pageInfo.getTotal(), "", pageInfo.getList());
    }

    @ApiOperation(value = "获取气象信息", response = MeteorologicalVo.class)
    @GetMapping(value = "/queryMeteorologicalInfo/info", produces = {"application/json;charset=utf-8"})
    public Map<String, Object> queryMeteorologicalInfo() {
        MeteorologicalVo meteorologicalVo = busiHomePageService.queryMeteorologicalInfo();
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", meteorologicalVo);
    }

    @ApiOperation(value = "测温柜实时数据分页查询", response = RptTermperRecordVo.class)
    @PostMapping(value = "/cwgCurrent")
    public Map<String, Object> cwgCurrent(@RequestBody RptTermperRecordDto param) {
        PageInfo<RptTermperRecordVo> pageInfo = rptTermperRecordService.findRptTermperRecordPage(param);

        if (pageInfo != null) {
            DecimalFormat df = new DecimalFormat("0.00");
//            pageInfo.getList().stream().forEach(e -> {
//                if (e.getDailyGrowthRate() != null) {
//                    e.setDailyGrowthRate(
//                        df.format(new BigDecimal(e.getDailyGrowthRate()).multiply(BigDecimal.valueOf(100))));
//                }
//                if (e.getMonthlyGrowthRate() != null) {
//                    e.setMonthlyGrowthRate(
//                        df.format(new BigDecimal(e.getMonthlyGrowthRate()).multiply(BigDecimal.valueOf(100))));
//                }
//            });
            List<RptTermperRecordVo> collect = pageInfo.getList().stream().filter(a -> a.getTemper().intValue() != -999).collect(Collectors.toList());
            pageInfo.setList(collect);
        }
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, pageInfo.getTotal(), "", pageInfo.getList());
    }

    @ApiOperation(value = "SF6温度、压力、微水实时数据分页查询", response = RptGisMonitorSf6Vo.class)
    @PostMapping(value = "/gisSf6Current")
    public Map<String, Object> gisSf6Current(@RequestBody RptGisMonitorSf6Dto param) {
        PageInfo<RptGisMonitorSf6Vo> pageInfo = rptGisMonitorSf6Service.findRptGisMonitorSf6Page(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, pageInfo.getTotal(), "", pageInfo.getList());
    }

    @ApiOperation(value = "变压器局放实时数据分页查询", response = TransformerPdCacheVo.class)
    @PostMapping(value = "/transPdCurrent")
    public Map<String, Object> transPdCurrent(@RequestBody TransformerPdCacheDto param) {
        PageInfo<TransformerPdCacheVo> pageInfo = transformerPdCacheService.findTransformerPdCachePage(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, pageInfo.getTotal(), "", pageInfo.getList());
    }

    @ApiOperation(value = "GIS局放实时数据分页查询", response = GisPdCacheVo.class)
    @PostMapping(value = "/gisPdCurrent")
    public Map<String, Object> gisPdCurrent(@RequestBody GisPdCacheDto param) {
        PageInfo<GisPdCacheVo> pageInfo = gisPdCacheService.findGisPdCachePage(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, pageInfo.getTotal(), "", pageInfo.getList());
    }

    @ApiOperation(value = "电缆局放实时数据分页查询", response = TransformerPdCacheVo.class)
    @PostMapping(value = "/cablePdCurrent")
    public Map<String, Object> cablePdCurrent(@RequestBody OtherPdCacheDto param) {
        PageInfo<OtherPdCacheVo> pageInfo = otherPdCacheService.findOtherPdCachePage(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, pageInfo.getTotal(), "", pageInfo.getList());
    }

    @ApiOperation(value = "图像实时数据分页查询", response = ReadTableVisualizationVo.class)
    @PostMapping(value = "/pictureCurrent")
    public Map<String, Object> pictureCurrent(@RequestBody ReadTableCurrentDto param) {
        if (param.getDTimeEnd() != null) {
            param.setDTimeEnd(param.getDTimeEnd().plusDays(1));
        }
        PageInfo<ReadTableCurrentVo> pageInfo = readTableVisualizationService.findReadTableCurrentPageData(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, pageInfo.getTotal(), "", pageInfo.getList());
    }

    @ApiOperation(value = "变压器运行工况时数据分页查询", response = TransformerRunStatusVo.class)
    @PostMapping(value = "/transformerRunStatusCurrent")
    public Map<String, Object> transformerRunStatusCurrent(@RequestBody TransformerRunStatusDto param) {
        PageInfo<TransformerRunStatusVo> pageInfo = transformerRunStatusService.transformerRunStatusCurrent(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, pageInfo.getTotal(), "", pageInfo.getList());
    }

    @ApiOperation(value = "红外热成像时数据分页查询", response = TransformerInfraredMonitoringCacheVo.class)
    @PostMapping(value = "/findInfraredThermalImag")
    public Map<String, Object> findInfraredThermalImag(@RequestBody TransformerInfraredMonitoringCacheDto param) {
        PageInfo<TransformerInfraredMonitoringCacheVo> pageInfo =
                transformerInfraredMonitoringCacheService.findTransformerInfraredMonitoringCachePage(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, pageInfo.getTotal(), "", pageInfo.getList());
    }

    @ApiOperation(value = "油色谱实时数据分页查询", response = TransformerEpaDataCacheVo.class)
    @PostMapping(value = "/epaDataCacheCurrent")
    public Map<String, Object> epaDataCacheCurrent(@RequestBody TransformerEpaDataCacheDto param) {
        BusiOilVo epaInfo = transformerEpaDataCacheService.findTransformerEpaDataCacheRecordPage(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", epaInfo);
    }



    @ApiOperation(value = "铁芯、夹件实时数据分页查询", response = BusiIcgeVo.class)
    @PostMapping(value = "/coreClipDataCacheCurrent")
    public Map<String, Object> coreClipDataCacheCurrent(@RequestBody TransformerIcgeCacheDto param) {
        BusiIcgeVo epaInfo = transformerIcgeCacheService.getFirstTransformerIcgeCacheInfo(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", epaInfo);
    }

    @ApiOperation(value = "避雷器实时数据分页查询", response = BusiRptArresterMonitorVo.class)
    @PostMapping(value = "/aretMonitorDataCacheCurrent")
    public Map<String, Object> LightningrodImDataCacheCurrent(@RequestBody RptAretMonitorDto param) {
        BusiRptArresterMonitorVo epaInfo = rptAretMonitorService.getUptoDateRptAretMonitor(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", epaInfo);
    }

    @ApiOperation(value = "避雷器容性数据分页查询", response = BusiCapacitanceMonitorVo.class)
    @PostMapping(value = "/capacitanceDataCacheCurrent")
    public Map<String, Object> capacitanceDataCacheCurrent(@RequestBody CapacitanceEquipmentImCacheDto param) {
        BusiCapaVo epaInfo = capacitanceEquipmentImCacheService.getUptoDateCapacitanceMonitor(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", epaInfo);
    }

    /**
     * @param mainTreeId 主设备树id
     * @param mainEqmType 主设备类型
     */
    @ApiOperation(value = "查询不同主设备下的各装置缺失率/误报率统计数据")
    @ApiImplicitParams({@ApiImplicitParam(name = "mainTreeId", value = "主设备树id"),
            @ApiImplicitParam(name = "mainEqmType", value = "主设备类型( 变压器：byq，GIS: gis，避雷器：blq，开关柜:kgg，电缆:dl，避雷器(出线场):blq，发电机:fdj)")})
    @GetMapping(value = "/indicators")
    public Map<String, Object> indicatorsByq(@RequestParam("mainTreeId") String mainTreeId, @RequestParam("mainEqmType")String mainEqmType) {
        Map<String, List<BusiHomeInfoVo>> map = busiHomePageService.getIndicatorsMap(mainTreeId, mainEqmType);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", map);
    }

    @ApiOperation(value = "变压器测温装置查询")
    @PostMapping(value = "/findInfoCWZZ")
    public Map<String, Object> findInfoCWZZ(@RequestBody HomeSearchDto param) {
        HomeActualVo homeActualVo = cwzzTemperatureService.queryActual(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",homeActualVo);
    }

    @ApiOperation(value = "变压器绕组测温查询")
    @PostMapping(value = "/findInfoRZCW")
    public Map<String, Object> findInfoRZCW(@RequestBody HomeSearchDto param) {
        HomeActualVo homeActualVo = transformerWindingTemperatureService.queryActual(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",homeActualVo);
    }
    @ApiOperation(value = "GisSF6环境监测查询")
    @PostMapping(value = "/findInfoSf6Env")
    public Map<String, Object> findInfoSf6Env(@RequestBody HomeSearchDto param) {
        HomeActualVo homeActualVo = Sf6EnvService.queryActual(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",homeActualVo);
    }

    @ApiOperation(value = "发电机振动查询")
    @PostMapping(value = "/findInfGenzd")
    public Map<String, Object> findInfGenzd(@RequestBody HomeSearchDto param) {
        HomeActualVo homeActualVo = busiGeneratorAmplService.queryActual(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",homeActualVo);
    }

    @ApiOperation(value = "发电机压力查询")
    @PostMapping(value = "/findInfGenyl")
    public Map<String, Object> findInfGenyl(@RequestBody HomeSearchDto param) {
        HomeActualVo homeActualVo = busiGeneratorPressureService.queryActual(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",homeActualVo);
    }

    @ApiOperation(value = "发电机局放查询")
    @PostMapping(value = "/findInfGenjf")
    public Map<String, Object> findInfGenjf(@RequestBody HomeSearchDto param) {
        HomeActualVo homeActualVo = busiGeneratorPdService.queryActual(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",homeActualVo);
    }

    @ApiOperation(value = "开关柜测温查询")
    @PostMapping(value = "/findInfoCWG")
    public Map<String, Object> findInfoCWG(@RequestBody HomeSearchDto param) {
        HomeActualVo homeActualVo = cwgTemperatureService.queryActual(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",homeActualVo);
    }

    // 避雷器
    @ApiOperation(value = "避雷器绝缘监测")
    @PostMapping(value = "/findInfoBlqJyjc")
    public Map<String, Object> findInfoBlqJyjc(@RequestBody HomeSearchDto param) {
        HomeActualVo homeActualVo = lightningrodImService.queryActual(param);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "",homeActualVo);
    }
}
