package com.qmth.sop.business.bean.params;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.sop.common.enums.FlowApprovePassEnum;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @Description: 流程审批param
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/4/23
 */
public class FlowApproveParam implements Serializable {

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

    @ApiModelProperty(value = "流程部署id")
    private String flowDeploymentId;

    @ApiModelProperty(value = "流程操作")
    @NotNull(message = "流程操作不能为空")
    private FlowApprovePassEnum approve;

    @ApiModelProperty(value = "流程步骤")
    private Integer setup;

    @ApiModelProperty(value = "密码")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long taskId;

    @ApiModelProperty(value = "流程表单数据")
    private String formProperties;

    @ApiModelProperty(value = "流程审批人")
    private List<String> approveUserIds;

    @ApiModelProperty(value = "流程审批意见")
    private String approveRemark;

    @ApiModelProperty(value = "流程变量")
    private Map<String, Object> var;

    public FlowApproveParam() {

    }

    public FlowApproveParam(String flowDeploymentId, FlowApprovePassEnum approve, List<String> approveUserIds, String crmNo, String formProperties) {
        this.flowDeploymentId = flowDeploymentId;
        this.approve = approve;
        this.approveUserIds = approveUserIds;
        this.crmNo = crmNo;
        this.formProperties = formProperties;
    }

    public FlowApproveParam(String flowDeploymentId, FlowApprovePassEnum approve, List<String> approveUserIds, String crmNo) {
        this.flowDeploymentId = flowDeploymentId;
        this.approve = approve;
        this.approveUserIds = approveUserIds;
        this.crmNo = crmNo;
    }

    public FlowApproveParam(String flowDeploymentId, FlowApprovePassEnum approve, String formProperties, List<String> approveUserIds, String crmNo) {
        this.flowDeploymentId = flowDeploymentId;
        this.approve = approve;
        this.formProperties = formProperties;
        this.approveUserIds = approveUserIds;
        this.crmNo = crmNo;
    }

    public FlowApproveParam(Long taskId, FlowApprovePassEnum approve, List<String> approveUserIds, String crmNo, String approveRemark) {
        this.taskId = taskId;
        this.approve = approve;
        this.approveUserIds = approveUserIds;
        this.crmNo = crmNo;
        this.approveRemark = approveRemark;
    }

    public FlowApproveParam(Long taskId, FlowApprovePassEnum approve, List<String> approveUserIds, String crmNo, String approveRemark, String formProperties) {
        this.taskId = taskId;
        this.approve = approve;
        this.approveUserIds = approveUserIds;
        this.crmNo = crmNo;
        this.approveRemark = approveRemark;
        this.formProperties = formProperties;
    }

    public Map<String, Object> getVar() {
        return var;
    }

    public void setVar(Map<String, Object> var) {
        this.var = var;
    }

    public String getCrmNo() {
        return crmNo;
    }

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

    public String getFlowDeploymentId() {
        return flowDeploymentId;
    }

    public void setFlowDeploymentId(String flowDeploymentId) {
        this.flowDeploymentId = flowDeploymentId;
    }

    public FlowApprovePassEnum getApprove() {
        return approve;
    }

    public void setApprove(FlowApprovePassEnum approve) {
        this.approve = approve;
    }

    public Integer getSetup() {
        return setup;
    }

    public void setSetup(Integer setup) {
        this.setup = setup;
    }

    public Long getTaskId() {
        return taskId;
    }

    public void setTaskId(Long taskId) {
        this.taskId = taskId;
    }

    public String getFormProperties() {
        return formProperties;
    }

    public void setFormProperties(String formProperties) {
        this.formProperties = formProperties;
    }

    public List<String> getApproveUserIds() {
        return approveUserIds;
    }

    public void setApproveUserIds(List<String> approveUserIds) {
        this.approveUserIds = approveUserIds;
    }

    public String getApproveRemark() {
        return approveRemark;
    }

    public void setApproveRemark(String approveRemark) {
        this.approveRemark = approveRemark;
    }
}
