package com.yuchen.saas.park.api.entity.property;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.thinkunion.park.service.common.entity.BasicEntity;
import com.yuchen.saas.park.api.entity.park.PmgBatParkPeople;
import com.yuchen.saas.park.api.entity.park.PmgBatPointLocationInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.nest.springwrap.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@TableName("property_houses")
@ApiModel(value = "房源信息", description = "房源信息")
public class PropertyHouses extends TenantEntity {
    /**
     * 园区id
     */
    @NotNull(message = "园区不能为空")
    @ApiModelProperty(value = "园区id")
    private Long parkId;
    /**
     * 楼栋id
     */
    @NotNull(message = "楼栋不能为空")
    @ApiModelProperty(value = "楼栋id")
    private Long buildingId;
    /**
     * 所在楼层
     */
    @NotNull(message = "所在楼层不能为空")
    @ApiModelProperty(value = "所在楼层")
    private Integer floorNum;
    /**
     * 所在单元
     */
    @ApiModelProperty(value = "所在单元")
    private String unitNum;
    /**
     * 房间名称
     */
    //@NotNull(message = "房间名称不能为空")
    @ApiModelProperty(value = "房间名称")
    private String houseName;
    /**
     * 资源代码
     */
    @ApiModelProperty(value = "资源代码")
    private String resourceCode;
    /**
     * 排序
     */
    @NotNull(message = "排序不能为空")
    @ApiModelProperty(value = "排序")
    private Integer sort;
    /**
     * 房源类型：1-底层、2-中层、3-中高层、4-高层
     * HeightTypeEnum
     */
    @NotNull(message = "房源类型不能为空")
    @ApiModelProperty(value = "房源类型：1-底层、2-中层、3-中高层、4-高层")
    private Integer heightType;
    /**
     * 用途类型：1-住宅、2-商宅、3-办公楼、4-厂房、99-其他
     * UseTypeEnum
     */
    @NotNull(message = "用途类型不能为空")
    @ApiModelProperty(value = "用途类型：1-住宅、2-商宅、3-办公楼、4-厂房、99-其他")
    private Integer useType;
    /**
     * 建筑面积 单位 平方米
     */
    @NotNull(message = "建筑面积不能为空")
    @ApiModelProperty(value = "建筑面积 单位 平方米")
    private BigDecimal constructionArea;
    /**
     * 使用面积 单位 平方米
     */
    //@NotNull(message = "使用面积不能为空")
    @ApiModelProperty(value = "使用面积 单位 平方米")
    private BigDecimal useArea;
    /**
     * 能否出租
     */
    @NotNull(message = "能否出租不能为空")
    @ApiModelProperty(value = "能否出租：0-不能，1-能")
    private Integer isRentOut;
    /**
     * 房间状态：1-未售、2-已售、3-交房、4-接房、5-空置、6-装修、7-出租、8-预订、9-入驻、10-自用
     */
    @NotNull(message = "房间状态不能为空")
    @ApiModelProperty(value = "房间状态：1-未售、2-已售、3-交房、4-接房、5-空置、6-装修、7-出租、8-预订、9-入驻、10-自用")
    private Integer houseStatus;
    /**
     * TowardTypeEnum
     * 朝向类型：1-朝南、2-朝北、3-朝西、4-朝东、5-东南、6-西南、7-东北、8-西北
     */
    @NotNull(message = "朝向类型不能为空")
    @ApiModelProperty(value = "朝向类型：1-朝南、2-朝北、3-朝西、4-朝东、5-东南、6-西南、7-东北、8-西北")
    private Integer towardType;
    /**
     * 不动产权编号
     */
    @ApiModelProperty(value = "不动产权编号")
    private String assetCode;
    /**
     * '交房日期'
     */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "交房日期")
    private Date deliveryDate;
    /**
     * 初次验收日期
     */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "初次验收日期")
    private Date firstAcceptanceDate;
    /**
     * 二次验收日期
     */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "二次验收日期")
    private Date secondAcceptanceDate;
    /**
     * 违规整改
     */
    @ApiModelProperty(value = "违规整改")
    private String rectification;
    /**
     * 备注信息
     */
    @ApiModelProperty(value = "备注信息")
    private String remark;

    @ApiModelProperty(value = "是否自动扣款0否,1是")
    private Integer isAutoDeduction;

    @ApiModelProperty(value = "自动扣款userId")
    private Long autoDeductionUserId;

    @ApiModelProperty(value = "自动扣款方式,1预存款")
    private Integer autoDeductionType;

    @ApiModelProperty(value = "自动扣款添加来源,1个人,2企业")
    private Integer autoDeductionSourceType;

    @ApiModelProperty(value = "自动扣款组织id")
    private Long autoDeductionDeptId;


    @NotNull(message = "房号不能为空")
    @ApiModelProperty(value = "房号")
    private String houseNum;
    /**
     *
     */
    @ApiModelProperty(value = "房间数字编号")
    private String houseDigitalNum;
    /**
     *
     */
    @ApiModelProperty(value = "房源管理编号")
    private String houseManageNum;


    @ApiModelProperty(value = "套内面积 单位 平方米")
    private BigDecimal internalArea;
    //@NotNull(message = "计租面积不能为空")
    @ApiModelProperty(value = "计租面积 单位 平方米")
    private BigDecimal leaseArea;

    @ApiModelProperty(value = "计费面积 单位 平方米")
    private BigDecimal feeArea;

    @ApiModelProperty(value = "虚拟资源：0-否，1-是")
    private Integer isVirtualResource;

    @ApiModelProperty(value = "房源类型：1-住宅、2-商宅、3-办公楼、4-厂房、99-其他")
    private Integer houseType;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "资源交付时间")
    private Date resourceDeliverDate;

    @TableField(exist = false)
    @ApiModelProperty(name = "pointLocations", value = "点位列表")
    private List<PmgBatPointLocationInfo> pointLocations;

    /**
     * 楼层id
     */
    @NotNull(message = "楼层不能为空")
    @ApiModelProperty(value = "楼层id")
    private Long levelId;

    @ApiModelProperty(value = "楼层名称")
    private String levelName;

    @ApiModelProperty(value = "单元名称")
    private String unitName;

    @ApiModelProperty(value = "业主id")
    private Long ownerId;

    @ApiModelProperty(value = "业主姓名")
    private String ownerName;


    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "装修开始时间")
    private Date renovateStartTime;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "拟结束时间")
    private Date renovateEndTime;

    @ApiModelProperty(value = "附件")
    private String attachments;

    @ApiModelProperty(value = "装修状态 1：待完成 2：待付款 3：已验收 4：已付款")
    private Integer renovateStatus;

    @ApiModelProperty(value = "客户名称")
    private String customerName;


    @ApiModelProperty(value = "接待人")
    private Long receptionUserId;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "入住日期")
    private Date moveinDate;


    @TableField(exist = false)
    @ApiModelProperty(name = "residents", value = "住户列表")
    private List<PmgBatParkPeople> residents;


    @TableField(exist = false)
    @ApiModelProperty(name = "parkingSpace", value = "车位列表")
    private List<ParkingPlace> parkingSpace;
    @Data
    public class ParkingPlace extends BasicEntity {

        /**
         * 停车场ID
         */
        @ApiModelProperty(name = "parkingId", value = "停车场ID")
        private Long parkingId;

        /**
         * 车位编码
         */
        @ApiModelProperty(name = "placeCode", value = "车位编码")
        private String placeCode;

        /**
         * 车位号
         */
        @ApiModelProperty(name = "placeNo", value = "车位号")
        private String placeNo;

        /**
         * 车位类型（1：无编号车位、2：固定编号车位）
         */
        @ApiModelProperty(value = "车位类型")
        private Long placeType;

        /**
         * 车位位置
         */
        @ApiModelProperty(name = "placePosition", value = "车位位置")
        private String placePosition;

        /**
         * 经度
         */
        @ApiModelProperty(name = "longitude", value = "经度(精确到6位小数点)")
        private Double longitude;
        /**
         * 纬度
         */
        @ApiModelProperty(name = "latitude", value = "纬度(精确到6位小数点)")
        private Double latitude;

        /**
         * 分配状态（0：未分配、1：已分配）
         */
        @ApiModelProperty(name = "allocatedState", value = "分配状态")
        private Integer allocatedState;

        /**
         * 标记状态（0：未标记、1：已标记）
         */
        @ApiModelProperty(name = "markerState", value = "标记状态")
        private Integer markerState;

        /**
         * 车位锁
         */
        @ApiModelProperty(name = "placeLock", value = "车位锁")
        private String placeLock;

        /**
         * 车位摄像头
         */
        @ApiModelProperty(name = "placeCamera", value = "车位摄像头")
        private String placeCamera;

        /**
         * 启用状态（0：未启用、1：已启用）
         */
        @ApiModelProperty(name = "enableState", value = "启用状态")
        private Integer enableState;

        /**
         * 备注
         */
        @ApiModelProperty(name = "remark", value = "备注")
        private String remark;

        /**
         * 备注
         */
        @ApiModelProperty(name = "placeUsedType", value = "车位使用类型")
        private String placeUsedType;

        /**
         * 长度
         */
        @ApiModelProperty(name = "length", value = "长度")
        private Integer length;
        /**
         * 宽度
         */
        @ApiModelProperty(name = "width", value = "宽度")
        private Integer width;
        /**
         * 业主类型(1:个人，2:企业)
         */
        @ApiModelProperty(name = "ownerType", value = "业主类型(1:个人，2:企业)")
        private Integer ownerType;
        /**
         * 业主名称
         */
        @ApiModelProperty(name = "ownerName", value = "业主名称")
        private String ownerName;
        /**
         * 联系人
         */
        @ApiModelProperty(name = "contactName", value = "联系人")
        private String contactName;
        /**
         * 联系人电话
         */
        @ApiModelProperty(name = "contactPhone", value = "联系人电话")
        private String contactPhone;
        /**
         * 不动产编号
         */
        @ApiModelProperty(name = "realEstateCode", value = "不动产编号")
        private String realEstateCode;
        /**
         * 车位图片(多张，逗号隔开)
         */
        @ApiModelProperty(name = "placePhotos", value = "车位图片(多张，逗号隔开)")
        private String placePhotos;
        /**
         * 地区编码
         */
        @ApiModelProperty(name = "areaCode", value = "地区编码")
        private String areaCode;
        /**
         * 地区
         */
        @ApiModelProperty(name = "area", value = "地区")
        private String area;

    }


    @TableField(exist = false)
    @ApiModelProperty(name = "cars", value = "车辆列表")
    private List<PmgBatParkCar> cars;
    @Data
    public class PmgBatParkCar extends BasicEntity {
        /**
         * 车牌号码
         */
        @ApiModelProperty(value = "车牌号码")
        private String plateNo;
        /**
         * 车场id
         */
        @ApiModelProperty(name = "parkingId",value = "车场id")
        private Long parkingId;
        /**
         * 车主姓名
         */
        @ApiModelProperty(value = "车主姓名")
        private String personName;

        /**
         * 车主所属企业ID
         */
        @ApiModelProperty(value = "车主所属企业ID")
        private Long ownerCompanyId;

        /**
         * 车主电话
         */
        @ApiModelProperty(value = "车主电话")
        private String personPhone;
        /**
         * 车牌类型
         */
        @ApiModelProperty(value = "车牌类型")
        private String plateType;
        /**
         * 车牌颜色
         */
        @ApiModelProperty(value = "车牌颜色")
        private String plateColor;
        /**
         * 车辆类型
         */
        @ApiModelProperty(value = "车辆类型")
        private String vehicleType;
        /**
         * 车辆收费类型（1：月卡车、2：错时车、3：内部车、4：产权车、5：临时车）
         */
        @ApiModelProperty(value = "车辆收费类型（1：月卡车、2：错时车、3：内部车、4：产权车、5：临时车）")
        private Integer vehicleFeeType;

        /**
         * 能源类型
         */
        @ApiModelProperty(value = "能源类型（0：其他类型、1：汽油车、2：新能源）")
        private String energyType;
        /**
         * 车辆颜色
         */
        @ApiModelProperty(value = "车辆颜色")
        private String vehicleColor;
        /**
         * 车辆描述
         */
//    @ApiModelProperty(value = "车辆描述")
//    private String description;

        /**
         * 车辆内部类型
         */
        @ApiModelProperty(value = "车辆内部类型")
        private String code;

        /**
         * 参数和返回公用
         * 固定车类别：地面停车场-vip,地下停车场-vip(以逗号隔开)
         */
//    @ApiModelProperty(value = "固定车类别")
//    @TableField(exist = false)
//    private String groupClass;

        /**
         * 参数和返回公用
         * 是否为月卡车
         */
//    @ApiModelProperty(value = "是否为月卡车")
//    @TableField(exist = false)
//    private Integer isMonthCar;
//
//    @ApiModelProperty(value = "是否是固定车")
//    @TableField(exist = false)
//    private Integer isFixed;

        @ApiModelProperty(value = "有效开始时间")
        private Date validStartTime;

        @ApiModelProperty(value = "有效结束时间")
        private Date validEndTime;

        @ApiModelProperty(value = "车位号")
        private String placeNo;

        @ApiModelProperty(value = "车位id")
        private Long placeId;

        @ApiModelProperty(value = "车辆信息来源（1：后台创建，2 系统导入, 3：系统同步（月卡，错时，固定车），")
        private Integer sourceType;

        @ApiModelProperty(value = "是否免费")
        private Boolean isFree;
        @ApiModelProperty(value = "收费标准id")
        private Long feeStandardId;
        @ApiModelProperty(value = "备注")
        private String remark;
        @ApiModelProperty(value = "车辆品牌")
        private String vehicleBrand;
        @ApiModelProperty(value = "车辆设备号")
        private String vehicleIdentificationNumber;
        @ApiModelProperty(value = "行驶证号")
        private String vehicleRegistrationNumber;
        @ApiModelProperty(value = "主品牌,为子品牌时赋值，为主品牌时为0")
        private String parentPlateNo;
        @ApiModelProperty(value = "是否一卡多车,true为父，false为子")
        private Boolean hasChildren;

        @ApiModelProperty(value = "月卡开始时间")
        private Date cardStartTime;

        @ApiModelProperty(value = "月卡结束时间")
        private Date cardEndTime;
        @ApiModelProperty(value = "是否长期有效")
        private Boolean  longTimeValid;
        @ApiModelProperty(value = "未缴费，按缴费时间")
        private Boolean  isPayment;
    }





}
