package com.cool.bang.modules.approval.domain;

import com.cool.bang.common.base.BaseDomain;
import com.cool.bang.common.constant.enums.StatusType;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * 审批记录
 *
 * @author PeiZhi Guo
 * 2022-08-29 16:46
 */
public class ApprovalRecord extends BaseDomain {

    private static final long serialVersionUID = 1L;

    private Long id;

    /** 业务编号 */
    private String businessNumber;

    /** 流程编号 */
    private String flowNumber;

    /** 表主键 */
    private Long tableId;

    /** 节点主键 */
    private Long nodeId;

    /** 节点名称 */
    private String nodeName;

    /** 审核人主键 */
    private Long approverId;

    /** 审核人 */
    private String approver;

    /** 审核时间 */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date approvalTime;

     /** 审核状态 1成功  2失败*/
    private Integer approvalStatus;

    /** 审核说明 */
    private String approvalRemark;

    /** 删除标识 1正常 0删除 */
    private Integer delFlag;

    public ApprovalRecord() {}

    public ApprovalRecord(Long tableId, String flowNumber) {
        this.flowNumber = flowNumber;
        this.tableId = tableId;
    }

    @Override
    public void insertConfigure() {
        this.delFlag = StatusType.ENABLE.ordinal();
        super.insertConfigure();
    }

    public Long getId() {
        return id;
    }

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

    public String getBusinessNumber() {
        return businessNumber;
    }

    public void setBusinessNumber(String businessNumber) {
        this.businessNumber = businessNumber;
    }

    public String getFlowNumber() {
        return flowNumber;
    }

    public void setFlowNumber(String flowNumber) {
        this.flowNumber = flowNumber;
    }

    public Long getTableId() {
        return tableId;
    }

    public void setTableId(Long tableId) {
        this.tableId = tableId;
    }

    public Long getNodeId() {
        return nodeId;
    }

    public void setNodeId(Long nodeId) {
        this.nodeId = nodeId;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    public Long getApproverId() {
        return approverId;
    }

    public void setApproverId(Long approverId) {
        this.approverId = approverId;
    }

    public String getApprover() {
        return approver;
    }

    public void setApprover(String approver) {
        this.approver = approver;
    }

    public Date getApprovalTime() {
        return approvalTime;
    }

    public void setApprovalTime(Date approvalTime) {
        this.approvalTime = approvalTime;
    }

    public Integer getApprovalStatus() {
        return approvalStatus;
    }

    public void setApprovalStatus(Integer approvalStatus) {
        this.approvalStatus = approvalStatus;
    }

    public String getApprovalRemark() {
        return approvalRemark;
    }

    public void setApprovalRemark(String approvalRemark) {
        this.approvalRemark = approvalRemark;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }
}
