package com.zcxk.charge.api.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.zcxk.core.common.pojo.ProgramItem;
import com.zcxk.core.utils.converter.Double3Serializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @description
 * @author  yjy
 * @data 2020-12-2
 */
@ApiModel("监测数据集合")
@Data
public class MonitorDataCollectDto {

    private static final long serialVersionUID = -3866939316262264972L;

    /** 所属公司 */
    @ApiModelProperty(value = "所属公司")
    private Long companyOrgId;

    @ApiModelProperty("所属场景id")
    private Long sceneId;

    @ApiModelProperty("所属场景")
    private String sceneName;

    @ApiModelProperty("地址")
    private String address;

    @ApiModelProperty("经度")
    private BigDecimal pointX;

    @ApiModelProperty("维度")
    private BigDecimal pointY;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
    @ApiModelProperty(value = "采集时间")
    private Date collectDate;

    @JsonSerialize(using = Double3Serializer.class)
    @ApiModelProperty("今日供水量or今日出水量")
    private Double yieldWaterUsage;

    @JsonSerialize(using = Double3Serializer.class)
    @ApiModelProperty("今日取水量or今日进水量")
    private Double intakeWaterUsage;

    @JsonSerialize(using = Double3Serializer.class)
    @ApiModelProperty("今日耗电量")
    private Double powerUsage;

    @JsonSerialize(using = Double3Serializer.class)
    @ApiModelProperty("今日耗药量")
    private Double drugUsage;

    @ApiModelProperty("场景状态 1报警 0正常 2离线")
    private Integer sceneState;

    @ApiModelProperty("实时数据")
    private List<MonitorDataDto> monitorDataEntities;

    @ApiModelProperty(value = "场景ids" ,hidden = true )
    @JsonIgnore
    private List<Long> sceneIds;

    @ApiModelProperty(value = "租户标识",hidden = true)
    @JsonIgnore
    private String tenantId;

    @ApiModelProperty(value ="权限",hidden = true)
    @JsonIgnore
    private List<ProgramItem> programItems;

    @ApiModelProperty(value="用户权限类型",hidden = true)
    @JsonIgnore
    private Integer permissonType;

    /** 用户类型 */
    @ApiModelProperty(value = "用户类型(-9999 超管 -999普通用户 2普通用户)",hidden = true)
    @JsonIgnore
    private String userType;

    @ApiModelProperty(value ="一级场景类型名称")
    private String sceneTypeName;

    @ApiModelProperty(value ="在线监测类型 1查询需计算的属性、2查询监测列表的属性、" +
            "3查询地图悬浮属性、4查询地图参数属性、5查询App监测列表的属性",hidden = true)
    @JsonIgnore
    private Integer type;

    @ApiModelProperty("设备id")
    private Long deviceId;

    @ApiModelProperty("设备编号")
    private String deviceCode;

    @ApiModelProperty("设备名称")
    private String deviceName;

    @ApiModelProperty("设备状态 1报警 0正常 2离线")
    private Integer deviceState;

    @ApiModelProperty(value ="0或空无离线、1有离线",hidden = true)
    @JsonIgnore
    private Integer flag;
}
