package com.zd.laboratory.domain;

import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zd.common.core.annotation.Excel;
import com.zd.common.core.domain.qc.QCInterface;
import com.zd.common.core.web.domain.BaseEntity;
import com.zd.laboratory.domain.dto.LabHazardJoinSubDTO;
import com.zd.laboratory.domain.vo.LabHazardSubVO;
import com.zd.laboratory.interfaces.SysProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.List;

/**
 * 实验室对象 lab_subject
 *
 * @author zd
 * @date 2021-08-30
 */
@ApiModel("实验室管理类")
public class LabSubject extends BaseEntity implements QCInterface {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @ApiModelProperty(value = "${comment}")
    private Long id;

    /**
     * 实验室名称
     */
    @ApiModelProperty("实验室名称")
    @Excel(name = "实验室名称")
    private String name;

    /**
     * 实验室楼层
     */
    @ApiModelProperty("实验室楼层")
    @Excel(name = "实验室楼层")
    private Long floorId;

    /**
     * 实验室房间号
     */
    @ApiModelProperty("实验室房间号")
    @Excel(name = "实验室房间号")
    private String room = "";

    /**
     * 部门id
     */
    @ApiModelProperty("部门id")
    @Excel(name = "部门id")
    private Long deptId;

    /**
     * 部门名称
     */
    @ApiModelProperty("部门名称")
    @Excel(name = "部门名称")
    private String deptName;

    /**
     * 管理员id
     */
    @ApiModelProperty("管理员id")
    @Excel(name = "管理员id")
    private Long adminId;

    /**
     * 是否删除（0是未删除，1是删除）
     */
    @ApiModelProperty("是否删除")
    @Excel(name = "是否禁用", readConverterExp = "0是未删除，1是删除")
    private Boolean isDel;

    /**
     * 创建人（用于数据权限）
     */
    @ApiModelProperty("创建人")
    @Excel(name = "创建人", readConverterExp = "用=于数据权限")
    private Long userId;
    /**
     * 是否是实验室
     */
    private Long isSubject;

    /**
     * 实验室顺序
     */
    private Long subOrder;
    /**
     * 仅仅为了回显， 后面考虑移除
     */
    @ApiModelProperty("楼栋ID")
    private Long buildId;


    @ApiModelProperty("布局ID")
    private Long layoutId;

    @ApiModelProperty("检查项")
    private String checkOut;

    @ApiModelProperty("学科")
    private String subDept;

    @ApiModelProperty("进入检查")
    private String checkIn;

    @ApiModelProperty("安全负责人")
    private String safeUserId;

    @ApiModelProperty("安全警示标示--字典")
    private String safeSigns;

    @ApiModelProperty("主要危险类别--字典")
    private String hazardCategory;

    @ApiModelProperty("安全防控措施--字典")
    private String riskMeasure;

    @ApiModelProperty("灭火要点--字典")
    private String outfire;

    @ApiModelProperty("二维码")
    private String qrCode;

    @ApiModelProperty("穿戴检查可跳过（0 否，1 是）")
    private Integer skipped;

    @ApiModelProperty("检测上限")
    private Integer checkCount;

    //安全分类id
    private Long typeId;

    /**
     * 是否查询安全用户
     */
    @JsonIgnore
    private Boolean hasSafeUserName;


    /**
     * 分级
     */
    @ApiModelProperty("分级")
    private Long level;

    /**
     * 实验室类型ID
     */
    @ApiModelProperty(value = "实验室类型ID")
    private Long moldId;
    /**
     * 实验室类型ID
     */
    @ApiModelProperty(value = "实验室类型名称")
    private String moldName;

    /**
     * 展示排序
     */
    @ApiModelProperty("展示排序")
    private Integer diyOrder;


    @ApiModelProperty(value = "二维码地址")
    private String qrCodeUrl;
    /**
     * 多ID 查询
     */
    public String subIds;

    /**
     * 管理人名称
     */
    private String adminName;

    /**
     * 签到时间
     */
    @ApiModelProperty(value = "签到时间")
    private Integer signTime;

    @ApiModelProperty(value = "危险品关联实验室信息")
    private List<LabHazardSubjectRelation> hazardRelations;

    private String safeUserNames;

    private Integer bottleTotal;//实验室气瓶总数
    private Integer bottleUserTotal;//实验室单人气瓶总数
    private List<Long> deptIds;
    /**
     * type = 5 实验室信息和安全检查二维码
     * @param code = 实验室id + - + 实验室房间号
     */
    public void setQrCodeUrl(String code) {
        this.qrCodeUrl = StrUtil.format(SysProperties.getLabInfoQrcode(),code,5);
    }

    @Override
    public String getQrCodeUrl() {
        return qrCodeUrl;
    }

    public Long getLevel() {
        return level;
    }

    public void setLevel(Long level) {
        this.level = level;
    }

    public Boolean getHasSafeUserName() {
        return hasSafeUserName;
    }

    public void setHasSafeUserName(Boolean hasSafeUserName) {
        this.hasSafeUserName = hasSafeUserName;
    }

    public String getCheckIn() {
        return checkIn;
    }

    public void setCheckIn(String checkIn) {
        this.checkIn = checkIn;
    }

    public String getSubDept() {
        return subDept;
    }

    public void setSubDept(String subDept) {
        this.subDept = subDept;
    }

    public String getCheckOut() {
        return checkOut;
    }

    public void setCheckOut(String checkOut) {
        this.checkOut = checkOut;
    }

    public Long getBuildId() {
        return buildId;
    }

    public void setBuildId(Long buildId) {
        this.buildId = buildId;
    }

    public Long getLayoutId() {
        return layoutId;
    }

    public void setLayoutId(Long layoutId) {
        this.layoutId = layoutId;
    }

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

    public Long getId() {
        return id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setFloorId(Long floorId) {
        this.floorId = floorId;
    }

    public Long getFloorId() {
        return floorId;
    }

    public void setRoom(String room) {
        this.room = room;
    }

    public String getRoom() {
        return room;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setAdminId(Long adminId) {
        this.adminId = adminId;
    }

    public Long getAdminId() {
        return adminId;
    }

    public void setIsDel(Boolean isDel) {
        this.isDel = isDel;
    }

    public Boolean getIsDel() {
        return isDel;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getUserId() {
        return userId;
    }

    public String getSafeUserId() {
        return safeUserId;
    }

    public void setSafeUserId(String safeUserId) {
        this.safeUserId = safeUserId;
    }

    public String getSafeSigns() {
        return safeSigns;
    }

    public void setSafeSigns(String safeSigns) {
        this.safeSigns = safeSigns;
    }

    public String getHazardCategory() {
        return hazardCategory;
    }

    public void setHazardCategory(String hazardCategory) {
        this.hazardCategory = hazardCategory;
    }

    public String getRiskMeasure() {
        return riskMeasure;
    }

    public void setRiskMeasure(String riskMeasure) {
        this.riskMeasure = riskMeasure;
    }

    public String getOutfire() {
        return outfire;
    }

    public void setOutfire(String outfire) {
        this.outfire = outfire;
    }

    public String getQrCode() {
        return qrCode;
    }

    public void setQrCode(String qrCode) {
        this.qrCode = qrCode;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("name", getName())
                .append("floor", getFloorId())
                .append("room", getRoom())
                .append("deptId", getDeptId())
                .append("deptName", getDeptName())
                .append("adminId", getAdminId())
                .append("isDel", getIsDel())
                .append("createTime", getCreateTime())
                .append("userId", getUserId())
                .append("createBy", getCreateBy())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .append("remark", getRemark())
                .toString();
    }

    public Long getTypeId() {
        return typeId;
    }

    public void setTypeId(Long typeId) {
        this.typeId = typeId;
    }

    public Integer getDiyOrder() {
        return diyOrder;
    }

    public void setDiyOrder(Integer diyOrder) {
        this.diyOrder = diyOrder;
    }

    public String getSubIds() {
        return subIds;
    }

    public void setSubIds(String subIds) {
        this.subIds = subIds;
    }

    public String getAdminName() {
        return adminName;
    }

    public void setAdminName(String adminName) {
        this.adminName = adminName;
    }

    public Integer getSkipped() {
        return skipped;
    }

    public void setSkipped(Integer skipped) {
        this.skipped = skipped;
    }

    public Integer getCheckCount() {
        return checkCount;
    }

    public void setCheckCount(Integer checkCount) {
        this.checkCount = checkCount;
    }

    public List<LabHazardSubjectRelation> getHazardRelations() {
        return hazardRelations;
    }

    public void setHazardRelations(List<LabHazardSubjectRelation> hazardRelations) {
        this.hazardRelations = hazardRelations;
    }

    public Integer getSignTime() {
        return signTime;
    }

    public void setSignTime(Integer signTime) {
        this.signTime = signTime;
    }

    public Long getMoldId() {
        return moldId;
    }

    public void setMoldId(Long moldId) {
        this.moldId = moldId;
    }

    public String getMoldName() {
        return moldName;
    }

    public void setMoldName(String moldName) {
        this.moldName = moldName;
    }

    public String getSafeUserNames() {
        return safeUserNames;
    }

    public void setSafeUserNames(String safeUserNames) {
        this.safeUserNames = safeUserNames;
    }

    public Integer getBottleTotal() {        return bottleTotal;    }

    public void setBottleTotal(Integer bottleTotal) {        this.bottleTotal = bottleTotal;    }

    public Integer getBottleUserTotal() {        return bottleUserTotal;    }

    public void setBottleUserTotal(Integer bottleUserTotal) {        this.bottleUserTotal = bottleUserTotal;    }

    public List<Long> getDeptIds() {        return deptIds;    }

    public void setDeptIds(List<Long> deptIds) {        this.deptIds = deptIds;    }
}
