package com.willalp.flow.domain;

import cn.hutool.json.JSONObject;
import com.alibaba.druid.sql.visitor.functions.Char;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.willalp.common.annotation.Excel;
import com.willalp.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 流程任务对象 hs_flow_task
 *
 * @author willalp
 * @date 2022-10-09
 */

@TableName("hs_flow_task")
public class HsFlowTask extends BaseEntity {
    private static final long serialVersionUID = 1L;

    public HsFlowTask() {
    }

    public HsFlowTask(String taskId, String businessId, String examplesId) {
        this.id = taskId;
        this.isEnd = "0";
        this.isCandidate = "0";
        this.msgIsRead = "0";
        this.businessId = businessId;
        this.examplesId = examplesId;

    }

    /**
     * 主键
     */
    @TableId
    private String id;

    /**
     * 任务名称
     */
    @Excel(name = "任务名称")
    private String taskName;

    /**
     * 实例ID
     */
    @Excel(name = "实例ID")
    private String examplesId;

    /**
     * 流程进程组ID
     */
    @Excel(name = "流程进程组ID")
    private String baseGroupId;

    /**
     * 当前流程进程ID
     */
    @Excel(name = "当前流程进程ID")
    private String baseId;

    /**
     * 当前流程名称
     */
    @Excel(name = "当前流程名称")
    private String baseName;

    private String isCandidate;

    /**
     * 操作人userCode
     */
    @Excel(name = "操作人userCode")
    private String operator;

    /**
     * 发起人
     */
    @Excel(name = "发起人")
    private String initiator;

    /**
     * 结束标志
     */
    @Excel(name = "结束标志")
    private String isEnd;

    /**
     * 是否已读（0：未读，1：已读）
     */
    @Excel(name = "是否已读", readConverterExp = "0=：未读，1=：已读）")
    private String msgIsRead;

    /**
     * 业务ID
     */
    @Excel(name = "业务ID")
    private String businessId;

    /**
     * 备注
     */
    private String remark;

    /**
     * 是否删除（0.未删除；1.已删除）
     */
    @Excel(name = "是否删除", readConverterExp = "0=.未删除；1.已删除")
    @TableLogic
    private Integer isDelete;

    public JSONObject getFormData() {
        return formData;
    }

    public void setFormData(JSONObject formData) {
        this.formData = formData;
    }

    @TableField(exist = false)
    private JSONObject formData;

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

    public String getId() {
        return id;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setExamplesId(String examplesId) {
        this.examplesId = examplesId;
    }

    public String getExamplesId() {
        return examplesId;
    }

    public void setBaseId(String baseId) {
        this.baseId = baseId;
    }

    public String getBaseId() {
        return baseId;
    }

    public void setInitiator(String initiator) {
        this.initiator = initiator;
    }

    public String getInitiator() {
        return initiator;
    }

    public void setBusinessId(String businessId) {
        this.businessId = businessId;
    }

    public String getBusinessId() {
        return businessId;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("taskName", getTaskName())
                .append("examplesId", getExamplesId())
                .append("baseId", getBaseId())
                .append("initiator", getInitiator())
                .append("businessId", getBusinessId())
                .append("isDelete", getIsDelete())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }

    public String getIsEnd() {
        return isEnd;
    }

    public void setIsEnd(String isEnd) {
        this.isEnd = isEnd;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public String getIsCandidate() {
        return isCandidate;
    }

    public void setIsCandidate(String isCandidate) {
        this.isCandidate = isCandidate;
    }

    public String getMsgIsRead() {
        return msgIsRead;
    }

    public void setMsgIsRead(String msgIsRead) {
        this.msgIsRead = msgIsRead;
    }

    public String getBaseName() {
        return baseName;
    }

    public void setBaseName(String baseName) {
        this.baseName = baseName;
    }

    public String getBaseGroupId() {
        return baseGroupId;
    }

    public void setBaseGroupId(String baseGroupId) {
        this.baseGroupId = baseGroupId;
    }

    @Override
    public String getRemark() {
        return remark;
    }

    @Override
    public void setRemark(String remark) {
        this.remark = remark;
    }
}
