package com.sundot.airport.system.domain.approval;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sundot.airport.common.annotation.Excel;
import com.sundot.airport.common.core.domain.BaseEntity;

/**
 * 审批节点定义对象 approval_node_definition
 *
 * @author simon lin
 * @date 2025-09-06
 */
@TableName("approval_node_definition")
public class ApprovalNodeDefinition extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 流程定义ID
     */
    @Excel(name = "流程定义ID")
    @NotNull(message = "流程定义ID不能为空")
    private Long workflowId;

    /**
     * 节点代码
     */
    @Excel(name = "节点代码")
    @NotBlank(message = "节点代码不能为空")
    @Size(min = 0, max = 50, message = "节点代码长度不能超过50个字符")
    private String nodeCode;

    /**
     * 节点名称
     */
    @Excel(name = "节点名称")
    @NotBlank(message = "节点名称不能为空")
    @Size(min = 0, max = 100, message = "节点名称长度不能超过100个字符")
    private String nodeName;

    /**
     * 节点类型(START:开始,APPROVE:审批,NOTIFY:通知,END:结束)
     */
    @Excel(name = "节点类型")
    @NotBlank(message = "节点类型不能为空")
    @Size(min = 0, max = 50, message = "节点类型长度不能超过50个字符")
    private String nodeType;

    /**
     * 节点顺序
     */
    @Excel(name = "节点顺序")
    @NotNull(message = "节点顺序不能为空")
    private Integer sortOrder;

    /**
     * 审批人类型(USER:指定用户,ROLE:角色,DEPT:部门,GROUP_LEADER:班组长,SECTION_LEADER:科长)
     */
    @Excel(name = "审批人类型")
    @Size(min = 0, max = 50, message = "审批人类型长度不能超过50个字符")
    private String approverType;

    /**
     * 审批人值
     */
    @Excel(name = "审批人值")
    @Size(min = 0, max = 200, message = "审批人值长度不能超过200个字符")
    private String approverValue;

    /**
     * 是否可驳回(0否 1是)
     */
    @Excel(name = "是否可驳回", readConverterExp = "0=否,1=是")
    private String canReject;

    /**
     * 是否必须审批(0否 1是)
     */
    @Excel(name = "是否必须审批", readConverterExp = "0=否,1=是")
    private String isRequired;

    /**
     * 超时小时数
     */
    @Excel(name = "超时小时数")
    private Integer timeoutHours;

    /**
     * 状态(0正常 1停用)
     */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    private String status;

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

    public Long getId() {
        return id;
    }

    public void setWorkflowId(Long workflowId) {
        this.workflowId = workflowId;
    }

    public Long getWorkflowId() {
        return workflowId;
    }

    public void setNodeCode(String nodeCode) {
        this.nodeCode = nodeCode;
    }

    public String getNodeCode() {
        return nodeCode;
    }

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

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeType(String nodeType) {
        this.nodeType = nodeType;
    }

    public String getNodeType() {
        return nodeType;
    }

    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }

    public Integer getSortOrder() {
        return sortOrder;
    }

    public void setApproverType(String approverType) {
        this.approverType = approverType;
    }

    public String getApproverType() {
        return approverType;
    }

    public void setApproverValue(String approverValue) {
        this.approverValue = approverValue;
    }

    public String getApproverValue() {
        return approverValue;
    }

    public void setCanReject(String canReject) {
        this.canReject = canReject;
    }

    public String getCanReject() {
        return canReject;
    }

    public void setIsRequired(String isRequired) {
        this.isRequired = isRequired;
    }

    public String getIsRequired() {
        return isRequired;
    }

    public void setTimeoutHours(Integer timeoutHours) {
        this.timeoutHours = timeoutHours;
    }

    public Integer getTimeoutHours() {
        return timeoutHours;
    }

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

    public String getStatus() {
        return status;
    }

    @Override
    public String toString() {
        return "ApprovalNodeDefinition{" +
                "id=" + id +
                ", workflowId=" + workflowId +
                ", nodeCode='" + nodeCode + '\'' +
                ", nodeName='" + nodeName + '\'' +
                ", nodeType='" + nodeType + '\'' +
                ", sortOrder=" + sortOrder +
                ", approverType='" + approverType + '\'' +
                ", approverValue='" + approverValue + '\'' +
                ", canReject='" + canReject + '\'' +
                ", isRequired='" + isRequired + '\'' +
                ", timeoutHours=" + timeoutHours +
                ", status='" + status + '\'' +
                '}';
    }
}