package com.yuchen.saas.park.service.controller.meifeng;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yuchen.saas.park.api.entity.device.PmgBatSmartEquipment;
import com.yuchen.saas.park.api.entity.park.*;
import com.yuchen.saas.park.api.vo.park.*;
import com.yuchen.saas.park.api.vo.park.alarm.AlarmDetailsVO;
import com.yuchen.saas.park.api.vo.park.alarm.AlarmListVO;
import com.yuchen.saas.park.api.vo.requestvo.requestparam.RequestParamBase;
import com.yuchen.saas.park.service.config.PeopleConfig;
import com.yuchen.saas.park.service.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.nest.springwrap.core.mp.support.Condition;
import org.nest.springwrap.core.mp.support.Query;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author 任业政
 * @Date 2021/9/3 15:56
 * @Description 1.首页基本信息、2.首页-设备、3.首页-人员、4.首页-环境
 */
@RestController
@RequestMapping("/screen01")
@Api(value = "美峰大屏接口01", tags = "美峰大屏接口01")
public class ScreenController01 {

    /**
     * 设备服务
     */
    @Resource
    private ParkDeviceDataService parkDeviceDataService;


    @Resource
    private PmgBatSmartEquipmentService pmgBatSmartEquipmentService;

    /**
     * 人员服务
     */
    @Resource
    private PmgBatParkPeopleService pmgBatParkPeopleService;

    /**
     * 园区入园人员统计表服务
     */
    @Resource
    private IPeopleCountService iPeopleCountService;

    @Resource
    private PmgBatParkInfoService pmgBatParkInfoService;

    @Resource
    private IWarningInfoService iWarningInfoService;

    /**
     * 视频事件
     */
    @Resource
    private PmgLogVideoEventsCountService pmgLogVideoEventsCountService;

    @Resource
    private PeopleConfig peopleConfig;



    /*********************** 首页基本信息开始 ****************************/

    /**
     * 首页大概信息统一接口
     * @param parkId
     * @return
     */
    @GetMapping("/parkInfo")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "首页所有信息统一接口",notes = "传入园区id")
    public R<Map<String,Object>> getHomeAll(Long parkId, Long buildingId, Long floorId){
        return R.data(pmgBatParkInfoService.getParkAll(parkId,buildingId,floorId));
    }

    /**
     * 详情
     */
    @GetMapping("/parkInfo/detail")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "详情", notes = "传入园区id")
    public R<PmgBatParkInfo> detail(String parkId) {
        return R.data(pmgBatParkInfoService.parkDetail(pmgBatParkInfoService.getById(parkId)));
    }

    /**
     * 分页 告警列表
     */
    @GetMapping("/info/list")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入parkCompany")
    public R<IPage<PmgBatWarningInfo>> list(PmgBatWarningInfo pmgBatWarningInfo) {
        IPage<PmgBatWarningInfo> pages = iWarningInfoService.page(Condition.getPage(new Query().setCurrent(1).setSize(30)),
                Condition.getQueryWrapper(pmgBatWarningInfo).orderByDesc("event_time"));
        return R.data(pages);
    }

    /**
     * 人员异常行为列表
     * @param
     * @return
     */
    @GetMapping("/getVideoDayPage")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "人员异常行为列表")
    public R<IPage<PmgLogVideoEventsCount>> getVideoDayPage(PmgLogVideoEventsCount pmgLogVideoEventsCount){
        IPage<PmgLogVideoEventsCount> iPage = pmgLogVideoEventsCountService.page(Condition.getPage(new Query().setCurrent(1).setSize(30)),
                Condition.getQueryWrapper(pmgLogVideoEventsCount).orderByDesc("time_stamp"));
        return R.data(iPage);
    }

    /*********************** 首页基本信息结束 ********************************/


    /*********************** 首页-设备信息开始 ****************************/


    @GetMapping("/equipmentInfo/getFacilityAll")
    @ApiOperationSupport(order = 13)
    @ApiOperation(value = "首页设备信息详情统一接口")
    public R<Map<String,Object>> getEquipmentAll(Long parkId, Long buildingId, Long floorId){
        return R.data(pmgBatSmartEquipmentService.getEquipmentAll(parkId,buildingId,floorId));
    }

    /**
     * 根据园区ID、楼栋id、楼层id 查询 设备总数、在线设备数、告警设备数
     * @param parkId 园区ID
     * @return
     */
    @GetMapping("/environInfo/deviceCount")
    @ApiOperationSupport(order = 14)
    @ApiOperation(value = "设备总数、在线设备数、告警设备数")
    public R<DeviceOnLineCountVo> getDeviceAnalysis(Long parkId, Long buildingId, Long floorId) {
        return R.data(pmgBatSmartEquipmentService.getByOnLineCount(parkId,buildingId,floorId));
    }


    /**
     * 根据园区ID、楼栋id、楼层id 查询 设备分类及数量
     * @param parkId 园区ID
     * @return
     */
    @GetMapping("/environInfo/deviceTypeCount")
    @ApiOperationSupport(order = 15)
    @ApiOperation(value = "设备分类及数量")
    public R<List<GetEnvironmentInfo>> getDeviceTypeCount(Long parkId, Long buildingId, Long floorId) {
        return R.data(pmgBatSmartEquipmentService.getGroupType(parkId,buildingId,floorId));
    }



    /**
     * 根据园区ID、楼栋id、楼层id 查询设备故障信息-今日
     * 模拟数据
     * @param parkId 园区ID
     * @return
     */
    @GetMapping("/environInfo/getToDayInfo")
    @ApiOperationSupport(order = 16)
    @ApiOperation(value = "模拟数据-设备故障信息-今日")
    public R<EnvironmentVo> getToDayInfo(Long parkId, Long buildingId, Long floorId) {
        return R.data(pmgBatSmartEquipmentService.getToDayInfo(parkId,buildingId,floorId));
    }


    /**
     * 根据园区ID、楼栋id、楼层id 查询设备故障信息-本月
     * 模拟数据
     * @param parkId 园区ID
     * @return
     */
    @GetMapping("/environInfo/getToMonthInfo")
    @ApiOperationSupport(order = 17)
    @ApiOperation(value = "模拟数据-设备故障信息-本月")
    public R<EnvironmentVo> getToMonthInfo(Long parkId, Long buildingId, Long floorId) {
        return R.data(pmgBatSmartEquipmentService.getToMonthInfo(parkId,buildingId,floorId));
    }

    /**
     * 根据园区ID、楼栋id、楼层id 查询设备故障趋势-今日
     * 模拟数据
     * @param parkId 园区ID
     * @return
     */
    @GetMapping("/environInfo/getToDayInfoTrend")
    @ApiOperationSupport(order = 18)
    @ApiOperation(value = "模拟数据-设备故障趋势-今日")
    public R<Map<String,List<GetEnvironmentInfo>>> getToDayInfoTrend(Long parkId, Long buildingId, Long floorId) {
        return R.data(pmgBatSmartEquipmentService.getToDayInfoTrend(parkId,buildingId,floorId));
    }

    /**
     * 根据园区ID、楼栋id、楼层id 查询设备故障趋势-本月
     * 模拟数据
     * @param parkId 园区ID
     * @return
     */
    @GetMapping("/environInfo/getToMonthInfoTrend")
    @ApiOperationSupport(order = 19)
    @ApiOperation(value = "模拟数据-设备故障趋势-本月")
    public R<Map<String,List<GetEnvironmentInfo>>> getToMonthInfoTrend(Long parkId, Long buildingId, Long floorId) {
        return R.data(pmgBatSmartEquipmentService.getToMonthInfoTrend(parkId,buildingId,floorId));
    }



    /**
     * 根据园区ID、楼栋id、楼层id 查询设备分布
     * (园区场景显示每栋信息、楼栋场景显示每层信息、楼层场景显示每个房间信息)
     * @param parkId 园区ID
     * @return
     */
    @GetMapping("/environInfo/devicePart")
    @ApiOperationSupport(order = 20)
    @ApiOperation(value = "设备分布")
    public R<List<GetEnvironmentInfo>> getDevicePart(Long parkId, Long buildingId, Long floorId) {
        return R.data(pmgBatSmartEquipmentService.getDevicePart(parkId,buildingId,floorId));
    }


    /**
     * 根据园区ID、楼栋id、楼层id 查询
     * 设备总数、在线设备数、离线设备数、故障设备数   (首页卡片四个指标)
     * @param parkId 园区ID
     * @return
     */
    @GetMapping("/environInfo/count")
    @ApiOperationSupport(order = 21)
    @ApiOperation(value = "设备总数、在线设备数、离线设备数、故障设备数   (首页卡片四个指标)")
    public R<DeviceOnLineCount> getDeviceCount(Long parkId, Long buildingId, Long floorId) {
        DeviceOnLineCountVo byOnLineCount = pmgBatSmartEquipmentService.getByOnLineCount(parkId, buildingId, floorId);
        //返回对象
        DeviceOnLineCount deviceOnLineCount = new DeviceOnLineCount();
        //设备总数
        deviceOnLineCount.setDeviceCount(byOnLineCount.getDeviceCount());
        //在线设备
        deviceOnLineCount.setOnlineDevice(byOnLineCount.getOnlineDevice());
        //离线设备
        deviceOnLineCount.setWarningDevice(byOnLineCount.getWarningDevice());
        //故障设备 = 离线设备
        deviceOnLineCount.setFaultDevice(byOnLineCount.getWarningDevice());

        return R.data(deviceOnLineCount);
    }

    /*********************** 首页-设备信息结束 ****************************/


    /*********************** 首页-人员信息开始 ****************************/

    /**
     * 人员入园信息(入园人次、访客人次、可疑人员) 日 24小时
     * @param paramBase
     * @return
     */
    @GetMapping("/parkPeoplesInfo/getCountTime24Info")
    @ApiOperationSupport(order = 25)
    @ApiOperation(value = "24小时人员入园信息(入园人次、访客人次、可疑人员)折线图[可疑人员后台需改动]")
    public R<GetCountTime24InfoRespVo> getCountTime24Info(RequestParamBase paramBase) {
        return R.data(iPeopleCountService.GetCountTime24InfoRespVo(paramBase));
    }

    /**
     * 人员入园信息(入园人次、访客人次、可疑人员) 月
     * @param paramBase
     * @return
     */
    @GetMapping("/parkPeoplesInfo/getCountTimeMonthInfo")
    @ApiOperationSupport(order = 26)
    @ApiOperation(value = "月人员入园信息(入园人次、访客人次、可疑人员)折线图[可疑人员后台需改动]")
    public R<GetCountTimeMonthInfoRespVo> getCountTimeMonthInfo(RequestParamBase paramBase) {
        return R.data(iPeopleCountService.getCountTimeMonthInfo(paramBase));
    }

    /**
     * 人员入园分类(可疑人员、内部人员、访客、vip) 日 24小时
     * @param paramBase
     * @return
     */
    @GetMapping("/parkPeoplesInfo/getPeopleTypeTime24")
    @ApiOperationSupport(order = 27)
    @ApiOperation(value = "24小时人员入园分类(可疑人员、内部人员、访客、vip)饼图[可疑人员后台需改动]")
    public R<HashMap<String,Long>> getPeopleTypeTime24(RequestParamBase paramBase) {
        return R.data(iPeopleCountService.getPeopleTypeTime24(paramBase));
    }

    /**
     * 人员入园分类(可疑人员、内部人员、访客、vip) 月
     * @param paramBase
     * @return
     */
    @GetMapping("/parkPeoplesInfo/getPeopleTypeTimeMonth")
    @ApiOperationSupport(order = 28)
    @ApiOperation(value = "本月人员入园分类(可疑人员、内部人员、访客、vip)饼图[可疑人员后台需改动]")
    public R<HashMap<String,Long>> getPeopleTypeTimeMonth(RequestParamBase paramBase) {
        return R.data(iPeopleCountService.getPeopleTypeTimeMonth(paramBase));
    }

    /**
     * 园区场景-访客去向信息 月
     * @param parkId
     * @return
     */
    @GetMapping("/parkPeoplesInfo/getPeopleMakeForParkMonth")
    @ApiOperationSupport(order = 29)
    @ApiOperation(value = "园区场景-访客去向信息 月")
    public R<List<Map<String,String>>> getPeopleMakeForParkMonth(String parkId) {
        return R.data(iPeopleCountService.getPeopleMakeForParkMonth(parkId));
    }

    /**
     * 园区场景-访客去向信息 24小时
     * @param parkId
     * @return
     */
    @GetMapping("/parkPeoplesInfo/getPeopleMakeForParkDay")
    @ApiOperationSupport(order = 30)
    @ApiOperation(value = "园区场景-访客去向信息 天")
    public R<List<Map<String,String>>> getPeopleMakeForParkDay(String parkId) {
        return R.data(iPeopleCountService.getPeopleMakeForParkDay(parkId));
    }

    /**
     * 楼栋场景-访客去向信息 月
     * @param buildingId
     * @return
     */
    @GetMapping("/parkPeoplesInfo/getPeopleMakeForBuildingMonth")
    @ApiOperationSupport(order = 31)
    @ApiOperation(value = "楼栋场景-访客去向信息 月")
    public R<List<Map<String,String>>> getPeopleMakeForBuildingMonth(String parkId,String buildingId) {
        return R.data(iPeopleCountService.getPeopleMakeForBuildingMonth(parkId,buildingId));
    }

    /**
     * 楼栋场景-访客去向信息 24小时
     * @param buildingId
     * @return
     */
    @GetMapping("/parkPeoplesInfo/getPeopleMakeForBuildingDay")
    @ApiOperationSupport(order = 32)
    @ApiOperation(value = "楼栋场景-访客去向信息 天")
    public R<List<Map<String,String>>> getPeopleMakeForBuildingDay(String parkId,String buildingId) {
        return R.data(iPeopleCountService.getPeopleMakeForBuildingDay(parkId,buildingId));
    }

    /**
     * 楼层场景-访客去向信息 月
     * @param floorId
     * @return
     */
    @GetMapping("/parkPeoplesInfo/getPeopleMakeForRoomMonth")
    @ApiOperationSupport(order = 33)
    @ApiOperation(value = "楼层场景-访客去向信息 月")
    public R<List<Map<String,String>>> getPeopleMakeForRoomMonth(String parkId,String buildingId,String floorId) {
        return R.data(iPeopleCountService.getPeopleMakeForRoomMonth(parkId,buildingId,floorId));
    }

    /**
     * 楼层场景-访客去向信息 24小时
     * @param floorId
     * @return
     */
    @GetMapping("/parkPeoplesInfo/getPeopleMakeForRoomDay")
    @ApiOperationSupport(order = 34)
    @ApiOperation(value = "楼层场景-访客去向信息 天")
    public R<List<Map<String,String>>> getPeopleMakeForRoomDay(String parkId,String buildingId,String floorId) {
        return R.data(iPeopleCountService.getPeopleMakeForRoomDay(parkId,buildingId,floorId));
    }

    /**
     * 首页-人员信息卡片 (访客人数、今日入园人次、今日可疑人次、昨日入园人次)
     * @param parkId
     * @return
     */
    @GetMapping("/parkPeoplesInfo/getPeopleInfo")
    @ApiOperationSupport(order = 35)
    @ApiOperation(value = "首页-人员信息卡片[可疑人员后台需改动]")
    public R<Map<String,String>> getPeopleInfo(Long parkId, Long buildingId, Long floorId) {
        return R.data(iPeopleCountService.getPeopleInfo(parkId,buildingId,floorId));
    }

    /*********************** 首页-人员信息结束 ****************************/


    /*********************** 人员模块开始 ********************************/

    /**
     * 人员列表分页
     * @param people
     * @param query
     * @return
     */
    @GetMapping("/personnel/list")
    @ApiOperationSupport(order = 36)
    @ApiOperation(value = "搜索人员分页")
    public R<IPage<PmgBatParkPeople>> list(PmgBatParkPeople people, Query query){
        IPage<PmgBatParkPeople> page = pmgBatParkPeopleService.page(Condition.getPage(query),
                Condition.getQueryWrapper(people));
        return R.data(page);
    }

    /**
     * 人员模块-VIP人员通行记录(只有园区场景、楼栋场景)
     */
    @GetMapping("/personnel/getVipThroughRecordList")
    @ApiOperationSupport(order = 41)
    @ApiOperation(value = "VIP人员通行记录")
    public R<List<PmgLogPeopleCount>> getVipThroughRecordList(PmgLogPeopleCount pmgLogPeopleCount) {
        LambdaQueryWrapper<PmgLogPeopleCount> peopleWrapper = Wrappers.lambdaQuery();
        IPage<PmgLogPeopleCount> pages = iPeopleCountService.page(Condition.getPage(new Query().setCurrent(1).setSize(30)),
                peopleWrapper
                        .and(wrapper -> wrapper.eq(PmgLogPeopleCount::getParkId, pmgLogPeopleCount.getParkId()))
                        .and(pmgLogPeopleCount.getBuildingId()!= null && pmgLogPeopleCount.getBuildingId()>0,
                                wrapper -> wrapper.eq(PmgLogPeopleCount::getBuildingId, pmgLogPeopleCount.getBuildingId()))
                        .and(wrapper -> wrapper.eq(PmgLogPeopleCount::getCode, peopleConfig.getCode10000()))
                        .orderByDesc(PmgLogPeopleCount::getTimeStamp)
        );
        return R.data(pages.getRecords());
    }

    /**
     * 人员模块-内部人员通行记录(只有园区场景、楼栋场景)
     */
    @GetMapping("/personnel/getInsideThroughRecordList")
    @ApiOperationSupport(order = 42)
    @ApiOperation(value = "内部人员通行记录")
    public R<List<PmgLogPeopleCount>> getInsideThroughRecordList(PmgLogPeopleCount pmgLogPeopleCount) {
        LambdaQueryWrapper<PmgLogPeopleCount> peopleWrapper = Wrappers.lambdaQuery();
        IPage<PmgLogPeopleCount> pages = iPeopleCountService.page(Condition.getPage(new Query().setCurrent(1).setSize(30)),
                peopleWrapper
                        .and(wrapper -> wrapper.eq(PmgLogPeopleCount::getParkId, pmgLogPeopleCount.getParkId()))
                        .and(pmgLogPeopleCount.getBuildingId()!= null && pmgLogPeopleCount.getBuildingId()>0,
                                wrapper -> wrapper.eq(PmgLogPeopleCount::getBuildingId, pmgLogPeopleCount.getBuildingId()))
                        .and(wrapper -> wrapper.eq(PmgLogPeopleCount::getCode, peopleConfig.getCode10001()))
                        .orderByDesc(PmgLogPeopleCount::getTimeStamp)
        );
        return R.data(pages.getRecords());
    }

    /**
     * 人员模块-外部访客通行记录(只有园区场景、楼栋场景)
     */
    @GetMapping("/personnel/getSansThroughRecordList")
    @ApiOperationSupport(order = 43)
    @ApiOperation(value = "外部访客通行记录")
    public R<List<PmgLogPeopleCount>> getSansThroughRecordList(PmgLogPeopleCount pmgLogPeopleCount) {
        LambdaQueryWrapper<PmgLogPeopleCount> peopleWrapper = Wrappers.lambdaQuery();
        IPage<PmgLogPeopleCount> pages = iPeopleCountService.page(Condition.getPage(new Query().setCurrent(1).setSize(30)),
                peopleWrapper
                        .and(wrapper -> wrapper.eq(PmgLogPeopleCount::getParkId, pmgLogPeopleCount.getParkId()))
                        .and(pmgLogPeopleCount.getBuildingId()!= null && pmgLogPeopleCount.getBuildingId()>0,
                                wrapper -> wrapper.eq(PmgLogPeopleCount::getBuildingId, pmgLogPeopleCount.getBuildingId()))
                        .and(wrapper -> wrapper.eq(PmgLogPeopleCount::getCode, peopleConfig.getCode10002()))
                        .orderByDesc(PmgLogPeopleCount::getTimeStamp)
        );
        return R.data(pages.getRecords());
    }


    /*********************** 人员模块结束 ********************************/


    /*********************** 设备模块开始 ********************************/

    /**
     * 设备列表分页
     * @param equipment
     * @param query
     * @return
     */
    @GetMapping("/equipment/list")
    @ApiOperationSupport(order = 44)
    @ApiOperation(value = "搜索设备分页")
    public R<IPage<PmgEquipmentPropertyVO>> equipmentList(PmgBatSmartEquipment equipment, Query query){
        return R.data(pmgBatSmartEquipmentService.searchDevice(equipment, query));
    }


    /**
     * 设备模块信息接口(设备信息、设备故障信息、设备分布)
     * @return
     */
    @GetMapping("/equipment/getFacilityInfo")
    @ApiOperationSupport(order = 45)
    @ApiOperation(value = "设备信息")
    public R<Map<String,Object>> getFacilityInfo(Long parkId, Long buildingId, Long floorId){
        return R.data(pmgBatSmartEquipmentService.getEquipmentAll(parkId,buildingId,floorId));
    }


    /**
     * 设备列表
     * @return
     */
    @GetMapping("/equipment/getEquipInfo")
    @ApiOperationSupport(order = 46)
    @ApiOperation(value = "设备列表")
    public R<List<GetEquipmentListVO>> getEquipInfo(Long parkId, Long buildingId, Long floorId){
        return R.data(pmgBatSmartEquipmentService.getEquipInfo(parkId,buildingId,floorId));
    }

    /**
     * 设备模块左下角图形(调用首页告警信息详情接口)
     */
    @GetMapping("/equipment/details")
    @ApiOperationSupport(order = 47)
    @ApiOperation(value = "设备模块左下角图形(调用首页告警信息详情接口)")
    public R<AlarmDetailsVO> alarmDetails(Long parkId, Long buildingId, Long floorId) {
        AlarmDetailsVO alarmDetailsVO =
                iWarningInfoService.getAlarmDetails(parkId, buildingId, floorId);

        return R.data(alarmDetailsVO);
    }

    /*********************** 设备模块结束 ********************************/



    /*********************** 环境模块开始 ********************************/

    /**
     * 环境设备列表分页
     * @param equipment
     * @param query
     * @return
     */
    @GetMapping("/environment/list")
    @ApiOperationSupport(order = 48)
    @ApiOperation(value = "搜索环境设备分页")
    public R<IPage<PmgEquipmentPropertyVO>> environmentList(PmgBatSmartEquipment equipment,Query query){
        equipment.setCategoryCode("3");
        return R.data(pmgBatSmartEquipmentService.searchDevice(equipment, query));
    }

    // 49."环境指标" 与首页环境信息一致(用同一接口)


    /**
     * 环境设备信息
     * 环境设备总数、在线设备数、离线设备数、故障设备数 四个指标
     * @param parkId
     * @param buildingId
     * @param floorId
     * @return
     */
    @GetMapping("/environment/DeviceCount")
    @ApiOperationSupport(order = 50)
    @ApiOperation(value = "环境设备总数、在线设备数、离线设备数、故障设备数 四个指标")
    public R<DeviceOnLineCount> getEnvironmentDeviceCount(Long parkId, Long buildingId, Long floorId) {
        return R.data(pmgBatSmartEquipmentService.getEnvironmentDeviceCount(parkId,buildingId,floorId));
    }

    /**
     * 环境设备信息
     * 环境设备分类及数量：新建表关联查的
     * @param parkId
     * @param buildingId
     * @param floorId
     * @return
     */
    @GetMapping("/environment/getEnvironmentGroupCount")
    @ApiOperationSupport(order = 51)
    @ApiOperation(value = "环境设备分类及数量")
    public R<List<GetEnvironmentInfo>> getEnvironmentGroupCount(Long parkId, Long buildingId, Long floorId) {
        return R.data(pmgBatSmartEquipmentService.getEnvironmentGroupCount(parkId,buildingId,floorId,"3"));
    }


    /**
     * 环境信息告警列表
     */
    @GetMapping("/environment/warningList")
    @ApiOperationSupport(order = 53)
    @ApiOperation(value = "环境信息告警列表")
    public R<List<AlarmListVO>> energyAlarmList(Long parkId) {
        return R.data(iWarningInfoService.getAlarmListByCategoryCode(parkId, null, null, "3"));
    }

    /**
     * 环境设备列表
     */
    @GetMapping("/environment/facilityList")
    @ApiOperationSupport(order = 54)
    @ApiOperation(value = "环境设备列表")
    public R<List<GetEnvironmentAssistVO>> EnvironmentFacilityList(Long parkId) {
        return R.data(pmgBatSmartEquipmentService.getEquipmentCountInfo(parkId,null,null,"3"));
    }

    /*********************** 环境模块结束 ********************************/

}
