package com.zd.system.api.laboratory.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zd.common.core.annotation.Excel;
import com.zd.common.core.enums.MessTypeEnum;
import com.zd.common.core.enums.MessageSendRangeEnum;
import com.zd.common.core.enums.UserMessageSendModeEnum;
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.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 消息发布对象 lab_message_content
 *
 * @author zd
 * @date 2021-09-02
 */
@ApiModel("消息内容实体")
public class LabMessageContent extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    private Long id;

    /**
     * 消息类型（参考字典表 如：文字，富文本）
     */
    @ApiModelProperty("消息类型")
    @Excel(name = "消息类型", readConverterExp = "参=考字典表,如=：文字，富文本")
    private Integer messType;



    /**
     * 消息类别
     */
    @ApiModelProperty("消息类别，1：管理消息，2：预警")
    private Integer messClass;



    /**
     * 发送方式（参考字典表）
     */
    @ApiModelProperty("发送方式")
    @Excel(name = "发送方式", readConverterExp = "参=考字典表")
    private Integer sendMode;

    /**
     * 发送范围（1是全校，2是院系，3是个人，参考MessageSendRangeEnum）
     */
    @ApiModelProperty("发送范围")
    @Excel(name = "发送范围", readConverterExp = "1=是全校，2是院系，3是个人，参考字典表")
    private Integer sendRange = 3;

    /**
     * 发送内容
     */
    @ApiModelProperty("发送内容")
    @NotBlank(groups = ValidGroup.Crud.Create.class, message = "发送内容不能为空")
    @Excel(name = "发送内容")
    private String content;

    /**
     * 部门ids
     */
    @Excel(name = "部门ids")
    @ApiModelProperty("部门ids")
    private String deptIds;

    @ApiModelProperty("实验室ids")
    private String subIds;

    @ApiModelProperty("实验室名称")
    private String subName;

    /**
     * 待发送用户ids，关联用户表id(多个用户id)
     */
    @Excel(name = "待发送用户ids，关联用户表id(多个用户id)")
    @ApiModelProperty("待发送用户ids")
    private String userIds;

    private String userNames;

    @ApiModelProperty("职位ID")
    private String postIds;

    @ApiModelProperty("职位名称")
    private String postName;

    @ApiModelProperty("过期日期（实验室消息专用）")
    private Date expirationDate;

    public Integer getMessClass() {
        return messClass;
    }

    public void setMessClass(Integer messClass) {
        this.messClass = messClass;
    }

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

    public Long getId() {
        return id;
    }

    public void setMessType(Integer messType) {
        this.messType = messType;
    }

    @JsonIgnore
    public Integer getMessType() {
        return messType;
    }

    public MessTypeEnum getMessTypeEnum() {
        return MessTypeEnum.getByCode(messType);
    }

    public void setSendMode(Integer sendMode) {
        this.sendMode = sendMode;
    }

    @JsonIgnore
    public Integer getSendMode() {
        return sendMode;
    }

    public UserMessageSendModeEnum getSendModeEnum() {
        return UserMessageSendModeEnum.getByCode(sendMode);
    }

    public void setSendRange(Integer sendRange) {
        this.sendRange = sendRange;
    }

    @JsonIgnore
    public Integer getSendRange() {
        return sendRange;
    }

    public MessageSendRangeEnum getSendRangeEnum() {
        return MessageSendRangeEnum.getByCode(sendRange);
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContent() {
        return content;
    }

    public void setDeptIds(String deptIds) {
        this.deptIds = deptIds;
    }

    public String getDeptIds() {
        return deptIds;
    }

    public void setUserIds(String userIds) {
        this.userIds = userIds;
    }

    public String getUserIds() {
        return userIds;
    }

    public String getPostName() {
        return postName;
    }

    public void setPostName(String postName) {
        this.postName = postName;
    }

    public String getUserNames() {
        return userNames;
    }

    public void setUserNames(String userNames) {
        this.userNames = userNames;
    }

    public String getSubIds() {
        return subIds;
    }

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

    public Date getExpirationDate() {
        return expirationDate;
    }

    public void setExpirationDate(Date expirationDate) {
        this.expirationDate = expirationDate;
    }

    public String getPostIds() {
        return postIds;
    }

    public void setPostIds(String postIds) {
        this.postIds = postIds;
    }

    public String getSubName() {
        return subName;
    }

    public void setSubName(String subName) {
        this.subName = subName;
    }
}
