package com.zd.laboratory.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.zd.common.core.annotation.Excel;
import com.zd.common.core.valid.ValidGroup;
import com.zd.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

/**
 * 检查项选项对象 lab_check_option
 *
 * @author liubo
 * @date 2021-12-30
 */
@ApiModel("检查项选项")
public class LabCheckOption extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @ApiModelProperty(value = "${comment}")
    private Long id;
    /**
     * 编号 -- 条款号
     */
    @ApiModelProperty(value = "条款号")
    private String code;
    /**
     * 检查项名称
     */
    @Excel(name = "检查项名称")
    @NotBlank(groups = ValidGroup.Crud.Create.class, message = "检查项名称不能为空")
    @Length(message = "检查项名称长度不能超过255")
    @ApiModelProperty(value = "检查项名称")
    private String name;
    /**
     * 父级ID
     */
    @Excel(name = "父级ID 顶级传0")
    @NotNull(groups = ValidGroup.Crud.Create.class, message = "父级ID不能为空")
    @ApiModelProperty(value = "父级ID")
    private Long parentId;

    /**
     * 多级父级名称 / 分隔
     */
    private String parentNames;

    /**
     * 类型 1 正式 2 临时（检查者提交数据）
     */
    private Integer type;
    /**
     * 级别 默认-1 无效，从 1 开始
     */
    private Integer level;

    /**
     * 检查着名称
     */
    private String nickName;

    private List<LabCheckOption> children = new ArrayList<>();

    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
    private List<Long> pIds;

    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 setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Long getParentId() {
        return parentId;
    }

    public List<LabCheckOption> getChildren() {
        return children;
    }

    public void setChildren(List<LabCheckOption> children) {
        this.children = children;
    }

    public String getParentNames() {
        return parentNames;
    }

    public void setParentNames(String parentNames) {
        this.parentNames = parentNames;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public Integer getLevel() {
        return level;
    }

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

    public List<Long> getpIds() {
        return pIds;
    }

    public void setpIds(List<Long> pIds) {
        this.pIds = pIds;
    }
}
