package com.bonus.material.device.domain;

import com.bonus.common.biz.domain.BmFileInfo;
import com.bonus.common.core.annotation.Excel;
import com.bonus.common.core.web.domain.BaseEntity;
import com.bonus.material.device.domain.vo.DevInfoPropertyVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

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

/**
 * 设备信息对象 ma_dev_info
 *
 * @author syruan
 */
@EqualsAndHashCode(callSuper = false)
@Data
@ToString
@Accessors(chain = true)
public class DevInfo extends BaseEntity {

    private static final long serialVersionUID = 429270031714225761L;

    @ApiModelProperty(value = "主键id")
    private Integer id;

    /**
     * 设备id
     */
    @Excel(name = "设备id")
    @ApiModelProperty(value = "设备id")
    private Long maId;

    /**
     * 设备id数组
     */
    @ApiModelProperty(value = "设备id数组")
    private List<Long> maIds;

    /**
     * 设备编码
     */
    @Excel(name = "设备编码")
    @ApiModelProperty(value = "设备编码")
    private String code;

    /**
     * 设备唯一标识符，用户输入，比如车架号
     */
    @Excel(name = "设备唯一标识符")
    @ApiModelProperty(value = "设备唯一标识符")
    private String identifyCode;

    @ApiModelProperty(value = "装备名称")
    private String deviceName;

    @ApiModelProperty(value = "整机装备重量")
    private String deviceWeight;

    @ApiModelProperty(value = "设备管理方式： 0编码 1数量")
    private Byte deviceType;

    @Excel(name = "设备数量")
    @ApiModelProperty(value = "设备数量")
    private Integer deviceCount;

    @ApiModelProperty(value = "比率的范围,比如: x%-y%")
    private String ratioRange;

    @ApiModelProperty(value = "比率,比如: 80%")
    private BigDecimal ratio;

    @ApiModelProperty(value = "单位")
    private String unitName;

    /**
     * 装备原值-- 250913应对地市公司录入临时采用此字段(田聪聪要求)
     */
    @ApiModelProperty(value = "装备原值")
    private BigDecimal buyPrice;

    /**
     * 规格名称-- 250913应对地市公司录入临时采用此字段(田聪聪要求)
     */
    @ApiModelProperty(value = "规格名称")
    private String itemTypeModel;

    /**
     * 类型id
     */
    @Excel(name = "类型id")
    @ApiModelProperty(value = "类型id")
    private Long typeId;

    @ApiModelProperty(value = "装备类别")
    private String typeName;

    /**
     * 设备状态(自有，待上架，上架，在租，下架)考虑数据字典
     */
    @Excel(name = "设备状态(自有，待上架，上架，在租，下架)考虑数据字典")
    @ApiModelProperty(value = "设备状态(自有，待上架，上架，在租，下架)考虑数据字典")
    private Integer maStatus;

    /**
     * 设备状态(自有，待上架，上架，在租，下架)考虑数据字典
     */
    @Excel(name = "设备状态(自有，待上架，上架，在租，下架)考虑数据字典")
    @ApiModelProperty(value = "设备状态(自有，待上架，上架，在租，下架)考虑数据字典")
    private String maStatusName;

    /**
     * 租赁范围
     */
    @Excel(name = "租赁范围")
    @ApiModelProperty(value = "租赁范围")
    private Long leaseScope;

    /**
     * 设备所在地
     */
    @Excel(name = "设备所在地")
    @ApiModelProperty(value = "设备所在地")
    private String location;

    @Excel(name = "设备所在省id")
    @ApiModelProperty(value = "设备所在省id")
    private Integer provinceId;

    @Excel(name = "设备所在市id")
    @ApiModelProperty(value = "设备所在市id")
    private Integer cityId;

    @Excel(name = "设备所在区id")
    @ApiModelProperty(value = "设备所在区id")
    private Integer areaId;

    /**
     * 设备品牌
     */
    @Excel(name = "设备品牌")
    @ApiModelProperty(value = "设备品牌")
    private String brand;

    /**
     * 设备型号
     */
    @Excel(name = "设备型号")
    @ApiModelProperty(value = "设备型号")
    private String modelName;

    /**
     * 出厂日期
     */
    @Excel(name = "出厂日期")
    @ApiModelProperty(value = "出厂日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date productionDate;

    /**
     * 工作时长
     */
    @Excel(name = "工作时长")
    @ApiModelProperty(value = "工作时长")
    private String workingHours;

    /**
     * 整机序列号
     */
    @Excel(name = "整机序列号")
    @ApiModelProperty(value = "整机序列号")
    private String serialNumber;

    /**
     * 设备月租价
     */
    @Excel(name = "设备月租价")
    @ApiModelProperty(value = "设备月租价")
    private Float monthLeasePrice;

    /**
     * 设备天租价
     */
    @Excel(name = "设备天租价")
    @ApiModelProperty(value = "设备天租价")
    private Float dayLeasePrice;

    /**
     * 设备主照片
     */
    @Excel(name = "设备主照片")
    @ApiModelProperty(value = "设备主照片")
    private String picUrl;

    /**
     * 机手月租金
     */
    @Excel(name = "机手月租金")
    @ApiModelProperty(value = "机手月租金")
    private Float jsMonthPrice;

    /**
     * 机手天租金
     */
    @Excel(name = "机手天租金")
    @ApiModelProperty(value = "机手天租金")
    private Float jsDayPrice;

    /**
     * 详细描述
     */
    @Excel(name = "详细描述")
    @ApiModelProperty(value = "详细描述")
    private String description;

    /**
     * gps编号
     */
    @Excel(name = "gps编号")
    @ApiModelProperty(value = "gps编号")
    private String gpsCode;

    /**
     * 设备所属公司--废弃不用
     */
    @ApiModelProperty(value = "设备所属公司--废弃")
    private Long ownCo;

    /**
     * 创建人
     */
    @Excel(name = "创建人")
    @ApiModelProperty(value = "创建人")
    private Long creator;

    @ApiModelProperty(value = "联系人")
    private String person;

    @ApiModelProperty(value = "联系人电话")
    @Size(min = 11, max = 11, message = "手机号长度不能超过11位")
    private String personPhone;

    /**
     * 设备规格
     */
    @Excel(name = "设备规格")
    @ApiModelProperty(value = "设备规格")
    private String specification;

    /**
     * 订金
     */
    @Excel(name = "订金")
    @ApiModelProperty(value = "订金")
    private BigDecimal deposit;

    /**
     * 是否删除
     */
    @Excel(name = "是否配备机手")
    @ApiModelProperty(value = "是否配备机手")
    private String isOperator;

    /**
     * 是否删除
     */
    @Excel(name = "是否删除")
    @ApiModelProperty(value = "是否删除")
    private String isActive;

    @ApiModelProperty(value = "主展示图")
    //@NotEmpty(message = "主展示图不能为空")
    private List<BmFileInfo> mainFileList = new ArrayList<>();

    @ApiModelProperty(value = "详情页展示图")
    //@NotEmpty(message = "详情页展示图不能为空")
    private List<BmFileInfo> detailsFileList = new ArrayList<>();

    @ApiModelProperty(value = "检测证明pdf")
    private List<BmFileInfo> examinationPdf = new ArrayList<>();

    @ApiModelProperty(value = "合格证pdf")
    private List<BmFileInfo> insurancePdf = new ArrayList<>();

    private List<Table> tableList;

    /**
     * 文件附件
     */
    @ApiModelProperty(value = "文件附件")
    private List<BmFileInfo> bmFileInfoList;

    @ApiModelProperty(value = "城市")
    private String city;

    @ApiModelProperty(value = "公司Id")
    private String companyId;

    @ApiModelProperty(value = "公司名称")
    private String comName;

    @ApiModelProperty(value = "管理方式(0编号 1计数)")
    private String manageType;

    @ApiModelProperty(value = "上传人id")
    private Long ownId;

    @ApiModelProperty(value = "校验日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date checkDate;

    @ApiModelProperty(value = "校验周期")
    private Integer checkCycle;

    @ApiModelProperty(value = "是否上传质检证书（0：否  1：是）")
    private Integer isQc;

    @ApiModelProperty(value = "是否上传安全证书（0：否  1：是）")
    private Integer isSafeBook;

    @ApiModelProperty(value = "是否是专区设备（0：否  1：是）")
    private Boolean isZone;

    @ApiModelProperty(value = "专区id,取自dept表")
    private Integer zoneId;

    @ApiModelProperty(value = "自定义属性列表")
    private List<DevInfoPropertyVo> devInfoProperties;

    @ApiModelProperty(value = "上传人")
    private String nickName;

    @ApiModelProperty(value = "租赁次数")
    private Integer rentNum;

    @ApiModelProperty(value = "累计上架天数")
    private Integer totalUpDay;

    @ApiModelProperty(value = "累计租赁天数")
    private Integer totalLeaseDay;

    @ApiModelProperty(value = "下次检测日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date nextCheckDate;

    @ApiModelProperty(value = "使用率大于80")
    private Integer idle80;

    @ApiModelProperty(value = "使用率大于30小于80")
    private Integer idle3080;

    @ApiModelProperty(value = "使用率小于30")
    private Integer idle30;

    @ApiModelProperty(value = "承租方")
    private String lessee;

    @ApiModelProperty(value = "承租方联系人")
    private String lesseePerson;

    private String type;

    //0914添加字段

    // 0待审核  1审核通过  2审核驳回
    @ApiModelProperty(value = "审核状态")
    private String entryStatus;

    //标准使用到期时间(和出粗和那个日期做对比)
    @ApiModelProperty(value = "标准使用到期时间")
    private String expirationTime;

    @ApiModelProperty(value = "设备变更状态")
    private String changeStatus;

    //1上架 0下架
    @ApiModelProperty(value = "上下架")
    private String upDownStatus;


    private String orderId;

}
