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.contant.SystemConstant;
import com.qmth.sop.common.enums.DelayWarnStatusEnum;
import com.qmth.sop.common.enums.DelayWarnTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 延期预警跟进表
 * </p>
 *
 * @author wangliang
 * @since 2023-08-01
 */
@ApiModel(value = "TBDelayWarn对象", description = "延期预警跟进表")
public class TBDelayWarn 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 = "消息id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long messageId;

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

    @ApiModelProperty(value = "预警时间")
    private Long warnTime;

    @ApiModelProperty(value = "负责人id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    @ApiModelProperty(value = "类型，PLAN：关键信息及计划，TIME：处理时限")
    private DelayWarnTypeEnum type;

    @ApiModelProperty(value = "预警字段")
    private String fieldObj;

    @ApiModelProperty(value = "状态，NOT_START：未跟进，FOLLOW：跟进，CLOSE：关闭，RESTART：重启")
    private DelayWarnStatusEnum status;

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

    public TBDelayWarn() {

    }

    public TBDelayWarn(String crmNo, String sopNo, Long serviceId, String code, Long warnTime, Long userId, String fieldObj) {
        setId(SystemConstant.getDbUuid());
        this.crmNo = crmNo;
        this.sopNo = sopNo;
        this.serviceId = serviceId;
        this.code = code;
        this.warnTime = warnTime;
        this.type = DelayWarnTypeEnum.TIME;
        this.fieldObj = fieldObj;
        this.status = DelayWarnStatusEnum.NOT_START;
        setCreateId(userId);
        this.userId = userId;
    }

    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 getMessageId() {
        return messageId;
    }

    public void setMessageId(Long messageId) {
        this.messageId = messageId;
    }

    public String getCode() {
        return code;
    }

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

    public Long getWarnTime() {
        return warnTime;
    }

    public void setWarnTime(Long warnTime) {
        this.warnTime = warnTime;
    }

    public Long getUserId() {
        return userId;
    }

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

    public DelayWarnTypeEnum getType() {
        return type;
    }

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

    public String getFieldObj() {
        return fieldObj;
    }

    public void setFieldObj(String fieldObj) {
        this.fieldObj = fieldObj;
    }

    public DelayWarnStatusEnum getStatus() {
        return status;
    }

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

    public Long getCloseTime() {
        return closeTime;
    }

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