package com.zd.laboratory.domain.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.zd.common.core.enums.HazardTypeEnum;
import com.zd.laboratory.domain.LabHazard;
import com.zd.laboratory.domain.LabHazardSubjectRelation;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;

/**
 * 实验室危险源位置列表VO
 *
 * @Author: zhoupan
 * @Date: 2021/09/26/11:10
 * @Description:
 */
public class LabHazardSubVO {
    /**
     * 危险源ID
     */
    @ApiModelProperty(value = "危险源ID")
    @NotNull(message = "危险源ID不能为空")
    private Long id;

    /**
     * 危险源名称
     */
    @ApiModelProperty("危险源名称")
    private String label;

    /**
     * 危险源类型
     */
    @ApiModelProperty("危险源类型")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private HazardTypeEnum hazardType;

    /**
     * 实验室id
     */
    @ApiModelProperty("实验室id")
    private Long subjectId;


    /**
     * X坐标点
     */
    @ApiModelProperty("X坐标点")
    @NotNull(message = "X坐标点不能为空")
    private Long xPoint;

    /**
     * Y坐标点
     */
    @ApiModelProperty("Y坐标点")
    @NotNull(message = "Y坐标点不能为空")
    private Long yPoint;
    /**
     * 坐标ID
     */
    @ApiModelProperty(value = "坐标ID")
    private Long xyId;

    /**
     * 危险源别名
     */
    private String anotherName;

    /**
     * 编号别名
     */
    private String anotherCode;

    public Long getXyId() {
        return xyId;
    }

    public void setXyId(Long xyId) {
        this.xyId = xyId;
    }


    public LabHazardSubVO() {

    }

    public LabHazardSubVO(LabHazardSubjectRelation hazardSubjectRelation, LabHazard hazard) {
        this.setLabel(hazard.getChName());
        this.setHazardType(hazardSubjectRelation.getHazardType());
        this.setxPoint(hazardSubjectRelation.getxPoint());
        this.setyPoint(hazardSubjectRelation.getyPoint());
        this.setXyId(hazardSubjectRelation.getId());
        this.setId(hazard.getId());
        this.setAnotherName(hazardSubjectRelation.getAnotherName());
        this.setAnotherCode(hazardSubjectRelation.getAnotherCode());
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public HazardTypeEnum getHazardType() {
        return hazardType;
    }

    public void setHazardType(HazardTypeEnum hazardType) {
        this.hazardType = hazardType;
    }

    public Long getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(Long subjectId) {
        this.subjectId = subjectId;
    }

    public Long getxPoint() {
        return xPoint;
    }

    public void setxPoint(Long xPoint) {
        this.xPoint = xPoint;
    }

    public Long getyPoint() {
        return yPoint;
    }

    public void setyPoint(Long yPoint) {
        this.yPoint = yPoint;
    }

    public String getAnotherName() {
        return anotherName;
    }

    public void setAnotherName(String anotherName) {
        this.anotherName = anotherName;
    }

    public String getAnotherCode() {
        return anotherCode;
    }

    public void setAnotherCode(String anotherCode) {
        this.anotherCode = anotherCode;
    }
}
