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.FlowApproveOperationEnum;
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 = "TSJobRemind对象", description = "任务提醒表")
public class TSJobRemind implements Serializable {

    private static final long serialVersionUID = 1L;

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

    @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 = "执行时间")
    private Long execTime;

    @ApiModelProperty(value = "执行字段")
    private String execField;

    @ApiModelProperty(value = "接收人id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long receiveUserId;

    @ApiModelProperty(value = "审批操作，START：提交，DRAFT：草稿，APPROVE：审批，REJECT：驳回，END：终止，CANCEL：撤销，EXCHANGE：转他人审批，FINISH：结束")
    private FlowApproveOperationEnum approveOperation;

    @ApiModelProperty(value = "是否启用，false：停用，true：启用")
    private Boolean enable;

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

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

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

    public TSJobRemind() {

    }

    public TSJobRemind(JobQuartzTypeEnum type, Long objId, String objName, JobTypeEnum remindType, Long userId, String crmNo) {
        this.id = SystemConstant.getDbUuid();
        this.type = type;
        this.objId = objId;
        this.objName = objName;
        this.remindType = remindType;
        this.createId = userId;
        this.createTime = System.currentTimeMillis();
        this.enable = true;
        this.crmNo = crmNo;
    }

    public TSJobRemind(JobQuartzTypeEnum type, String code, Long objId, String objName, JobTypeEnum remindType, Long receiveUserId, FlowApproveOperationEnum approveOperation, Long userId, String crmNo) {
        this.id = SystemConstant.getDbUuid();
        this.type = type;
        this.code = code;
        this.objId = objId;
        this.objName = objName;
        this.remindType = remindType;
        this.receiveUserId = receiveUserId;
        this.approveOperation = approveOperation;
        this.createId = userId;
        this.createTime = System.currentTimeMillis();
        this.enable = true;
        this.crmNo = crmNo;
    }


    public TSJobRemind(JobQuartzTypeEnum type, String code, Long objId, String objName, JobTypeEnum remindType, Long receiveUserId, FlowApproveOperationEnum approveOperation, Long createTime, String execField, Long userId, String crmNo) {
        this.id = SystemConstant.getDbUuid();
        this.type = type;
        this.code = code;
        this.objId = objId;
        this.objName = objName;
        this.remindType = remindType;
        this.receiveUserId = receiveUserId;
        this.approveOperation = approveOperation;
        this.createId = userId;
        this.createTime = createTime;
        this.execField = execField;
        this.enable = true;
        this.crmNo = crmNo;
    }

    public String getCrmNo() {
        return crmNo;
    }

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

    public JobQuartzTypeEnum getType() {
        return type;
    }

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

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public Long getReceiveUserId() {
        return receiveUserId;
    }

    public void setReceiveUserId(Long receiveUserId) {
        this.receiveUserId = receiveUserId;
    }

    public FlowApproveOperationEnum getApproveOperation() {
        return approveOperation;
    }

    public void setApproveOperation(FlowApproveOperationEnum approveOperation) {
        this.approveOperation = approveOperation;
    }

    public Long getId() {
        return id;
    }

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

    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 getExecTime() {
        return execTime;
    }

    public void setExecTime(Long execTime) {
        this.execTime = execTime;
    }

    public String getExecField() {
        return execField;
    }

    public void setExecField(String execField) {
        this.execField = execField;
    }

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