package com.qmth.sop.business.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.sop.business.bean.params.SopQuickSearchParam;
import com.qmth.sop.common.contant.SystemConstant;
import com.qmth.sop.common.enums.SopQuickSearchTypeEnum;
import com.qmth.sop.common.enums.TFCustomTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * sop快捷搜索表
 * </p>
 *
 * @author wangliang
 * @since 2024-05-21
 */
@ApiModel(value = "TBSopQuickSearch对象", description = "sop快捷搜索表")
public class TBSopQuickSearch implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "流程类型，OFFICE_SOP_FLOW：教务处SOP，CLOUD_MARK_SOP_FLOW：研究生SOP，DING_EXCEPTION_FLOW：考勤异常审核流程，PROJECT_EXCHANGE_FLOW：项目计划变更流程，QUALITY_PROBLEM_FLOW：质量问题反馈流程")
    private TFCustomTypeEnum type;

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

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

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

    @ApiModelProperty(value = "内容名称")
    private String name;

    @ApiModelProperty(value = "内容")
    private String content;

    @ApiModelProperty(value = "内容类型，VIEW：显示列表，SEARCH：快捷搜索")
    private SopQuickSearchTypeEnum contentType;

    public TBSopQuickSearch() {

    }

    public TBSopQuickSearch(SopQuickSearchParam sopQuickSearchParam, String flowDeploymentId, Integer version,
            Long userId) {
        this.id = SystemConstant.getDbUuid();
        this.type = sopQuickSearchParam.getType();
        this.name = sopQuickSearchParam.getName();
        this.content = sopQuickSearchParam.getContent();
        this.contentType = sopQuickSearchParam.getContentType();
        this.flowDeploymentId = flowDeploymentId;
        this.version = version;
        this.userId = userId;
    }

    public void updateInfo(SopQuickSearchParam sopQuickSearchParam) {
        this.type = sopQuickSearchParam.getType();
        this.name = sopQuickSearchParam.getName();
        this.content = sopQuickSearchParam.getContent();
        this.contentType = sopQuickSearchParam.getContentType();
    }

    public Long getId() {
        return id;
    }

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

    public TFCustomTypeEnum getType() {
        return type;
    }

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

    public String getFlowDeploymentId() {
        return flowDeploymentId;
    }

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

    public Integer getVersion() {
        return version;
    }

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

    public Long getUserId() {
        return userId;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public SopQuickSearchTypeEnum getContentType() {
        return contentType;
    }

    public void setContentType(SopQuickSearchTypeEnum contentType) {
        this.contentType = contentType;
    }
}
