package org.springblade.modules.nh.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springblade.core.mp.base.BaseEntity;

import java.io.Serializable;

/**
 * 电站 实体类
 *
 * @author AlexWang
 * @since 2024-05-31
 */
@Data
@TableName("nh_power_station")
@Schema(description = "PowerStation对象")
public class PowerStationEntity extends BaseEntity {

	/**
	 * 内部电站ID
	 */
	@Schema(description = "内部电站ID")
	private String innerStationId;
	/**
	 * 外部电站ID
	 */
	@Schema(description = "外部电站ID")
	private String outStationId;
	/**
	 * 电站编号
	 */
	@Schema(description = "电站编号")
	private String stationCode;
	/**
	 * 电站名称
	 */
	@Schema(description = "电站名称")
	private String stationName;
	/**
	 * 电站图片
	 */
	@Schema(description = "电站图片")
	private String images;
	/**
	 * 资方编号
	 */
	@Schema(description = "资方编号")
	private String capitalCode;
	/**
	 * 资方名称
	 */
	@Schema(description = "资方名称")
	private String capitalName;
	/**
	 * 项目ID
	 */
	@Schema(description = "项目ID")
	private String projectId;
	/**
	 * 项目编号
	 */
	@Schema(description = "项目编号")
	private String projectCode;
	/**
	 * 项目名称
	 */
	@Schema(description = "项目名称")
	private String projectName;
	/**
	 * 项目公司ID
	 */
	@Schema(description = "项目公司ID")
	private String projectCompanyId;
	/**
	 * 项目公司名称
	 */
	@Schema(description = "项目公司名称")
	private String projectCompanyName;
	/**
	 * 安装方式
	 */
	@Schema(description = "安装方式")
	private String installType;

	/**
	 * 品牌
	 */
	@Schema(description = "逆变器品牌")
	private Integer brand;

	/**
	 * 备案方式
	 */
	@Schema(description = "备案方式")
	private Integer filingType;

	/**
	 * 客户类型
	 */
	@Schema(description = "客户类型")
	private Integer customerType;
	/**
	 * 代理商ID
	 */
	@Schema(description = "代理商ID")
	private String agentId;
	/**
	 * 代理商
	 */
	@Schema(description = "代理商")
	private String agentName;
	/**
	 * 代理商电话
	 */
	@Schema(description = "代理商电话")
	private String agentPhone;
	/**
	 * 业主编号
	 */
	@Schema(description = "业主编号")
	private Long ownerId;
	/**
	 * 业主名称
	 */
	@Schema(description = "业主名称")
	private String ownerName;
	/**
	 * 业主电话
	 */
	@Schema(description = "业主电话")
	private String ownerPhone;
	/**
	 * sn码序列号(多个用逗号拼接)
	 */
	@Schema(description = "sn码序列号(多个用逗号拼接)")
	private String sn;
	/**
	 * 省
	 */
	@Schema(description = "省")
	private String province;
	/**
	 * 市
	 */
	@Schema(description = "市")
	private String city;
	/**
	 * 区
	 */
	@Schema(description = "区")
	private String district;
	/**
	 * 详细地址
	 */
	@Schema(description = "详细地址")
	private String address;
	/**
	 * 纬度
	 */
	@Schema(description = "纬度")
	private BigDecimal latitude;
	/**
	 * 经度
	 */
	@Schema(description = "经度")
	private BigDecimal longitude;
	/**
	 * 实际安装容量
	 */
	@Schema(description = "实际安装容量")
	private BigDecimal actualCapacity;
	/**
	 * 完工日期
	 */
	@Schema(description = "完工日期")
	private Date installAcceptTime;
	/**
	 * 首日发电日期
	 */
	@Schema(description = "首日发电日期")
	private Date startGenDate;

	@Schema(description = "首日并网日期")
	private Date mergeTime;
	/**
	 * 进件序号
	 */
	@Schema(description = "进件序号")
	private String applyNo;
	/**
	 * 进件状态
	 */
	@Schema(description = "是否显示状态")
	private Integer applyStatus;
	/**
	 * 是否关注
	 */
	@Schema(description = "是否关注")
	private Integer isFollow;
	/**
	 * 运维服务商id
	 */
	@Schema(description = "运维服务商id")
	private String omProviderId;
	/**
	 * 运维服务商名称
	 */
	@Schema(description = "运维服务商名称")
	private String omProviderName;

	@Schema(description = "绑定解绑人userId")
	private Long bindingUnbindId;
	/**
	 * 当期新增发电量
	 */
	@Schema(description = "当期新增发电量")
	private BigDecimal etd;
	/**
	 * 累计发电量
	 */
	@Schema(description = "累计发电量")
	private BigDecimal eto;
	/**
	 * 当期新增发电收入
	 */
	@Schema(description = "当期新增发电收入")
	private BigDecimal etdc;
	/**
	 * 累计发电收入
	 */
	@Schema(description = "累计发电收入")
	private BigDecimal etoc;
	@Schema(description = "运维单号")
	private String orderNumber;

	private Integer lastStatus;
	private Date lastStatusStart;
	private Date lastStatusEnd;
	private Long duringSeconds;

	@JsonFormat(pattern ="yyyy-MM-dd")
	private Date paymentTime;

	@JsonFormat(pattern ="yyyy-MM-dd")
	private Date warrantyExpiresTime;

	@Schema(description = "来源 1.户用 2.友夸")
	private String source;

	public void init(){
//		this.latitude= new BigDecimal(0);
//		this.longitude = new BigDecimal(0);

		this.applyStatus = 0;
		this.isFollow = 0;

		this.etd= new BigDecimal(0);
		this.eto = new BigDecimal(0);

		this.etoc= new BigDecimal(0);
		this.etdc = new BigDecimal(0);
	}
}
