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.base.BaseEntity;
import com.qmth.sop.common.enums.ViolationStatusEnum;
import com.qmth.sop.common.enums.ViolationTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * sop违规登记表
 * </p>
 *
 * @author wangliang
 * @since 2023-08-01
 */
@ApiModel(value = "TBViolation对象", description = "sop违规登记表")
public class TBViolation extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty(value = "sop单号")
    private String sopNo;

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

    @ApiModelProperty(value = "编号")
//    @NotBlank(message = "编号不能为空")
    private String code;

    @ApiModelProperty(value = "负责人id")
    @JsonSerialize(using = ToStringSerializer.class)
    @NotNull(message = "负责人id不能为空")
    private Long userId;

    @ApiModelProperty(value = "类型，CONTENT_ERROR：内容错误虚假，LOGIC_ERROR：逻辑不合理，OTHER：其它")
    @NotNull(message = "类型不能为空")
    private ViolationTypeEnum type;

    @ApiModelProperty(value = "违规情况")
    @NotBlank(message = "违规情况不能为空")
    private String content;

    @ApiModelProperty(value = "状态，NOT_START：未跟进，FOLLOW：跟进，CLOSE：关闭，RESTART：重启")
    @NotNull(message = "状态不能为空")
    private ViolationStatusEnum status;

    @ApiModelProperty(value = "附件ids")
    private String attachmentIds;

    @ApiModelProperty(value = "关闭时间")
    private Long closeTime;

    public String getCrmNo() {
        return crmNo;
    }

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

    public String getSopNo() {
        return sopNo;
    }

    public void setSopNo(String sopNo) {
        this.sopNo = sopNo;
    }

    public Long getServiceId() {
        return serviceId;
    }

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

    public Long getUserId() {
        return userId;
    }

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

    public ViolationTypeEnum getType() {
        return type;
    }

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

    public String getContent() {
        return content;
    }

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

    public ViolationStatusEnum getStatus() {
        return status;
    }

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

    public String getAttachmentIds() {
        return attachmentIds;
    }

    public void setAttachmentIds(String attachmentIds) {
        this.attachmentIds = attachmentIds;
    }

    public String getCode() {
        return code;
    }

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

    public Long getCloseTime() {
        return closeTime;
    }

    public void setCloseTime(Long closeTime) {
        this.closeTime = closeTime;
    }
}
