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.SopStatusEnum;
import com.qmth.sop.common.enums.TFCustomTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

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

/**
 * <p>
 * sop表
 * </p>
 *
 * @author wangliang
 * @since 2023-08-01
 */
@ApiModel(value = "TBSopInfo对象", description = "sop表")
public class TBSopInfo 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 customId;

    @ApiModelProperty(value = "产品id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long productId;

    @ApiModelProperty(value = "流程类型，OFFICE_SOP_FLOW：教务处SOP，CLOUD_MARK_SOP_FLOW：研究生SOP")
    @NotNull(message = "流程类型不能为空")
    private TFCustomTypeEnum type;

    @ApiModelProperty(value = "状态，DRAFT：草稿，START：提交")
    SopStatusEnum status;

    public TBSopInfo() {

    }

    public TBSopInfo(String crmNo, String sopNo, Long serviceId, Long customId, Long productId, TFCustomTypeEnum type, SopStatusEnum status, Long userId) {
        setId(SystemConstant.getDbUuid());
        this.crmNo = crmNo;
        this.sopNo = sopNo;
        this.serviceId = serviceId;
        this.customId = customId;
        this.productId = productId;
        this.type = type;
        this.status = status;
        setCreateId(userId);
        setCreateTime(System.currentTimeMillis());
    }

    public SopStatusEnum getStatus() {
        return status;
    }

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

    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 getCustomId() {
        return customId;
    }

    public void setCustomId(Long customId) {
        this.customId = customId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public TFCustomTypeEnum getType() {
        return type;
    }

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