package com.qmth.sop.business.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.sop.common.contant.SystemConstant;
import com.qmth.sop.common.enums.MessageTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 系统消息
 * </p>
 *
 * @author wangliang
 * @since 2023-08-01
 */
@ApiModel(value = "SysMessage对象", description = "系统消息")
public class SysMessage implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "crm单号")
    private String crmNo;

    @ApiModelProperty(value = "编号")
    private String code;

    @ApiModelProperty(value = "消息类型，BEFORE：提前提醒，AFTER：延期提醒，OFFICE_SOP：教务处SOP，CLOUD_MARK_SOP：研究生SOP，QUALITY：质量问题提醒，EXCEPTION_APPROVE：异常审核提醒，VIOLATION：违规提醒，SYSTEM_PLAN_CHANGE：系统计划变更提醒，SYSTEM：系统公告")
    private MessageTypeEnum type;

    @ApiModelProperty(value = "实体业务类型")
    private String objType;

    @ApiModelProperty(value = "公告id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long noticeId;

    @ApiModelProperty(value = "服务单元id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long serviceId;

    @ApiModelProperty(value = "供应商id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long supplierId;

    @ApiModelProperty(value = "发送人id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long formUserId;

    @ApiModelProperty(value = "接收人id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long receiveUserId;

    @ApiModelProperty(value = "消息内容")
    private String content;

    @ApiModelProperty(value = "发送时间")
    private Long sendTime;

    @ApiModelProperty(value = "接收时间")
    private Long receiveTime;

    @ApiModelProperty(value = "是否已阅，0：未阅，1：已阅")
    private Boolean status;

    public SysMessage() {

    }

    public SysMessage(String crmNo, String code, MessageTypeEnum type, String objType, Long serviceId, Long receiveUserId, String content,Long formUserId) {
        this.id = SystemConstant.getDbUuid();
        this.crmNo = crmNo;
        this.code = code;
        this.type = type;
        this.objType = objType;
        this.serviceId = serviceId;
        this.receiveUserId = receiveUserId;
        this.content = content;
        this.sendTime = System.currentTimeMillis();
        this.status = false;
        this.formUserId = formUserId;
    }

    public String getCode() {
        return code;
    }

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

    public String getObjType() {
        return objType;
    }

    public void setObjType(String objType) {
        this.objType = objType;
    }

    public Long getId() {
        return id;
    }

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

    public String getCrmNo() {
        return crmNo;
    }

    public void setCrmNo(String crmNo) {
        this.crmNo = crmNo;
    }

    public MessageTypeEnum getType() {
        return type;
    }

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

    public Long getNoticeId() {
        return noticeId;
    }

    public void setNoticeId(Long noticeId) {
        this.noticeId = noticeId;
    }

    public Long getServiceId() {
        return serviceId;
    }

    public void setServiceId(Long serviceId) {
        this.serviceId = serviceId;
    }

    public Long getFormUserId() {
        return formUserId;
    }

    public void setFormUserId(Long formUserId) {
        this.formUserId = formUserId;
    }

    public Long getReceiveUserId() {
        return receiveUserId;
    }

    public void setReceiveUserId(Long receiveUserId) {
        this.receiveUserId = receiveUserId;
    }

    public String getContent() {
        return content;
    }

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

    public Long getSendTime() {
        return sendTime;
    }

    public void setSendTime(Long sendTime) {
        this.sendTime = sendTime;
    }

    public Long getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(Long receiveTime) {
        this.receiveTime = receiveTime;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public Long getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Long supplierId) {
        this.supplierId = supplierId;
    }
}
