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

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

import java.io.Serializable;
import java.util.Objects;

/**
 * @Description: 工作台待办result
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2023/8/10
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WorkTaskResult implements Serializable {

    @ApiModelProperty(value = "待办人id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    @ApiModelProperty(value = "流程状态")
    private FlowStatusEnum status;

    @ApiModelProperty(value = "流程状态str")
    private String statusStr;

    @ApiModelProperty(value = "流程id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long flowId;

    @ApiModelProperty(value = "流程任务节点名称")
    private String taskName;

    @ApiModelProperty(value = "流程任务节点key")
    private String taskDefKey;

    @ApiModelProperty(value = "流程任务id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long taskId;

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

    @ApiModelProperty(value = "流程过程变量")
    private String flowProcessVar;

    @ApiModelProperty(value = "流程自定义id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long customFlowId;

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

    @ApiModelProperty(value = "流程实体id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long customFlowEntityid;

    @ApiModelProperty(value = "流程类型")
    private TFCustomTypeEnum type;

    @ApiModelProperty(value = "流程类型str")
    private String typeStr;

    @ApiModelProperty(value = "流程编号")
    private String code;

    @ApiModelProperty(value = "流程版本号")
    private Integer version;

    @ApiModelProperty(value = "动态表单")
    FlowTaskResult setupMap;

    @ApiModelProperty(value = "实体id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long objId;

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

    @ApiModelProperty(value = "crm名称")
    private String crmName;

    @ApiModelProperty(value = "服务单元id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long serviceId;

    @ApiModelProperty(value = "服务单元名称")
    private String serviceName;

    @ApiModelProperty(value = "服务单元类型，OFFICE：教务处，CLOUD_MARK：研究生")
    private ProductTypeEnum serviceType;

    @ApiModelProperty(value = "服务单元类型str")
    private String serviceTypeStr;

    @ApiModelProperty(value = "客户id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long customId;

    @ApiModelProperty(value = "客户名称")
    private String customName;

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

    @ApiModelProperty(value = "发起人真实姓名")
    private String createRealName;

    @ApiModelProperty(value = "超时天数")
    private Integer diffTime;

    @ApiModelProperty(value = "流转到达时间")
    private Long flowTime;

    @ApiModelProperty(value = "处理时限（小时）")
    private Integer processHour;

    @ApiModelProperty(value = "客户类型")
    private ProductTypeEnum customType;

    @ApiModelProperty(value = "客户类型str")
    private String customTypeStr;

    public ProductTypeEnum getCustomType() {
        return customType;
    }

    public void setCustomType(ProductTypeEnum customType) {
        this.customType = customType;
    }

    public String getCustomTypeStr() {
        if (Objects.nonNull(customType)) {
            return customType.getTitle();
        } else {
            return customTypeStr;
        }
    }

    public void setCustomTypeStr(String customTypeStr) {
        this.customTypeStr = customTypeStr;
    }

    public Integer getProcessHour() {
        return processHour;
    }

    public void setProcessHour(Integer processHour) {
        this.processHour = processHour;
    }

    public Long getFlowTime() {
        return flowTime;
    }

    public void setFlowTime(Long flowTime) {
        this.flowTime = flowTime;
    }

    public Integer getDiffTime() {
        return diffTime;
    }

    public void setDiffTime(Integer diffTime) {
        this.diffTime = diffTime;
    }

    public Long getObjId() {
        return objId;
    }

    public void setObjId(Long objId) {
        this.objId = objId;
    }

    public String getCrmNo() {
        return crmNo;
    }

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

    public String getCrmName() {
        return crmName;
    }

    public void setCrmName(String crmName) {
        this.crmName = crmName;
    }

    public Long getServiceId() {
        return serviceId;
    }

    public void setServiceId(Long serviceId) {
        this.serviceId = serviceId;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public ProductTypeEnum getServiceType() {
        return serviceType;
    }

    public void setServiceType(ProductTypeEnum serviceType) {
        this.serviceType = serviceType;
    }

    public String getServiceTypeStr() {
        if (Objects.nonNull(serviceType)) {
            return serviceType.getTitle();
        } else {
            return serviceTypeStr;
        }
    }

    public void setServiceTypeStr(String serviceTypeStr) {
        this.serviceTypeStr = serviceTypeStr;
    }

    public Long getCustomId() {
        return customId;
    }

    public void setCustomId(Long customId) {
        this.customId = customId;
    }

    public String getCustomName() {
        return customName;
    }

    public void setCustomName(String customName) {
        this.customName = customName;
    }

    public Long getCreateId() {
        return createId;
    }

    public void setCreateId(Long createId) {
        this.createId = createId;
    }

    public String getCreateRealName() {
        return createRealName;
    }

    public void setCreateRealName(String createRealName) {
        this.createRealName = createRealName;
    }

    public FlowTaskResult getSetupMap() {
        return setupMap;
    }

    public void setSetupMap(FlowTaskResult setupMap) {
        this.setupMap = setupMap;
    }

    public TFCustomTypeEnum getType() {
        return type;
    }

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

    public String getTypeStr() {
        if (Objects.nonNull(type)) {
            return type.getTitle();
        } else {
            return typeStr;
        }
    }

    public void setTypeStr(String typeStr) {
        this.typeStr = typeStr;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public Long getCustomFlowEntityid() {
        return customFlowEntityid;
    }

    public void setCustomFlowEntityid(Long customFlowEntityid) {
        this.customFlowEntityid = customFlowEntityid;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public FlowStatusEnum getStatus() {
        return status;
    }

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

    public String getStatusStr() {
        if (Objects.nonNull(status)) {
            return status.getTitle();
        } else {
            return statusStr;
        }
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }

    public Long getFlowId() {
        return flowId;
    }

    public void setFlowId(Long flowId) {
        this.flowId = flowId;
    }

    public String getTaskName() {
        return taskName;
    }

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

    public String getTaskDefKey() {
        return taskDefKey;
    }

    public void setTaskDefKey(String taskDefKey) {
        this.taskDefKey = taskDefKey;
    }

    public Long getTaskId() {
        return taskId;
    }

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

    public Integer getSetup() {
        return setup;
    }

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

    public String getFlowProcessVar() {
        return flowProcessVar;
    }

    public void setFlowProcessVar(String flowProcessVar) {
        this.flowProcessVar = flowProcessVar;
    }

    public Long getCustomFlowId() {
        return customFlowId;
    }

    public void setCustomFlowId(Long customFlowId) {
        this.customFlowId = customFlowId;
    }

    public String getFlowDeploymentId() {
        return flowDeploymentId;
    }

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