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

import java.io.Serializable;

/**
 * <p>
 * sop日志
 * </p>
 *
 * @author wangliang
 * @since 2024-01-23
 */
@ApiModel(value = "TBSopLog对象", description = "sop日志")
public class TBSopLog implements Serializable {

    private static final long serialVersionUID = 1L;

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

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

    @ApiModelProperty(value = "类型，EDIT：sop编辑，CHANGE_EFFECT_ENGINEER：更改实施工程师，CHANGE_ASSISTANT_ENGINEER：更改助理工程师，ADD_EFFECT_ENGINEER：新增实施工程师，ADD_ASSISTANT_ENGINEER：新增助理工程师，REMOVE_EFFECT_ENGINEER：删除实施工程师，REMOVE_ASSISTANT_ENGINEER：删除助理工程师")
    private SopLogTypeEnum type;

    @ApiModelProperty(value = "状态，START：已开始，AUDITING：审核中，REJECT：已驳回，END：已终止，FINISH：已结束")
    private FlowStatusEnum status;

    @ApiModelProperty(value = "计划步骤")
    private Integer setup;

    @ApiModelProperty(value = "更改前内容")
    private String updateBeforeObj;

    @ApiModelProperty(value = "更改后内容")
    private String updateAfterObj;

    @ApiModelProperty(value = "创建人id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long createId;

    @ApiModelProperty(value = "创建时间")
    private Long createTime;

    public TBSopLog() {

    }

    public TBSopLog(Long sopId, SopLogTypeEnum type, FlowStatusEnum status, Integer setup, String updateBeforeObj,
            String updateAfterObj, Long createId) {
        this.id = SystemConstant.getDbUuid();
        this.sopId = sopId;
        this.type = type;
        this.status = status;
        this.setup = setup;
        this.updateBeforeObj = updateBeforeObj;
        this.updateAfterObj = updateAfterObj;
        this.createId = createId;
        this.createTime = System.currentTimeMillis();
    }

    public Long getId() {
        return id;
    }

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

    public Long getSopId() {
        return sopId;
    }

    public void setSopId(Long sopId) {
        this.sopId = sopId;
    }

    public SopLogTypeEnum getType() {
        return type;
    }

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

    public FlowStatusEnum getStatus() {
        return status;
    }

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

    public Integer getSetup() {
        return setup;
    }

    public void setSetup(Integer setup) {
        this.setup = setup;
    }

    public String getUpdateBeforeObj() {
        return updateBeforeObj;
    }

    public void setUpdateBeforeObj(String updateBeforeObj) {
        this.updateBeforeObj = updateBeforeObj;
    }

    public String getUpdateAfterObj() {
        return updateAfterObj;
    }

    public void setUpdateAfterObj(String updateAfterObj) {
        this.updateAfterObj = updateAfterObj;
    }

    public Long getCreateId() {
        return createId;
    }

    public void setCreateId(Long createId) {
        this.createId = createId;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }
}
