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

import java.io.Serializable;

/**
 * <p>
 * 任务日志表
 * </p>
 *
 * @author wangliang
 * @since 2023-08-16
 */
@ApiModel(value = "TSJobLog对象", description = "任务日志表")
public class TSJobLog implements Serializable {

    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty(value = "任务提醒id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long jobRemindId;

    @ApiModelProperty(value = "类型，FLOW：流程，NOTICE：公告")
    private JobQuartzTypeEnum type;

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

    @ApiModelProperty(value = "实体id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long objId;

    @ApiModelProperty(value = "实体名称")
    private String objName;

    @ApiModelProperty(value = "提醒类别，BEFORE：提前，AFTER：超时")
    private JobTypeEnum remindType;

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

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

    public TSJobLog() {

    }

    public TSJobLog(TSJobRemind tsJobRemind) {
        this.id = SystemConstant.getDbUuid();
        this.jobRemindId = tsJobRemind.getId();
        this.type = tsJobRemind.getType();
        this.code = tsJobRemind.getCode();
        this.objId = tsJobRemind.getObjId();
        this.objName = tsJobRemind.getObjName();
        this.remindType = tsJobRemind.getRemindType();
        this.createId = tsJobRemind.getCreateId();
        this.createTime = System.currentTimeMillis();
    }

    public Long getId() {
        return id;
    }

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

    public Long getJobRemindId() {
        return jobRemindId;
    }

    public void setJobRemindId(Long jobRemindId) {
        this.jobRemindId = jobRemindId;
    }

    public JobQuartzTypeEnum getType() {
        return type;
    }

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

    public String getCode() {
        return code;
    }

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

    public Long getObjId() {
        return objId;
    }

    public void setObjId(Long objId) {
        this.objId = objId;
    }

    public String getObjName() {
        return objName;
    }

    public void setObjName(String objName) {
        this.objName = objName;
    }

    public JobTypeEnum getRemindType() {
        return remindType;
    }

    public void setRemindType(JobTypeEnum remindType) {
        this.remindType = remindType;
    }

    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;
    }
}
