package com.qmth.sop.business.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.sop.common.enums.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 动态表单控件表
 * </p>
 *
 * @author wangliang
 * @since 2023-07-17
 */
@ApiModel(value = "TDFormWidget对象", description = "动态表单控件表")
public class TDFormWidget implements Serializable {

    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty(value = "编码，TEXT：文本，NUMBER：数字文本，TEXTAREA：文本域，编码，TEXT：文本，TEXTAREA：文本域，SINGLE_SELECT：单选下拉框，MULTIPLE_SELECT：多选下拉框，RADIO：单选框，CHECKBOX：复选框，DATE：日期，BUTTON：按钮，IMG：图片，VIDEO：视频，AUDIO：音频，FILE：文件，LABEL：标签，TABLE：表格，SIGN：签名，CASCADE_ADDRESS：城市选择控件，OTHER：其它，FORM_GROUP_TITLE：带虚线分割线的标题，ONLY_TITLE：普通标题，独占一行，RADIO_WITH_INPUT：带1个输入框的单选框，DEVICE_IN_TABLE：设备入库表格，DEVICE_OUT_TABLE：设备出库表格，RADIO：单选框，CHECKBOX：复选框，DATE：日期，BUTTON：按钮，IMG：图片，VIDEO：视频，AUDIO：音频，FILE：文件，LABEL：标签，TABLE：表格，SIGN：签名，CASCADE_ADDRESS：城市选择控件，OTHER：其它，FORM_GROUP_TITLE：带虚线分割线的标题，ONLE_TITLE：普通标题，独占一行，RADIO_WITH_INPUT：带1个输入框的单选框，DEVICE_IN_TABLE：设备入库表格，DEVICE_OUT_TABLE：设备出库表格")
    private WidgetCodeEnum code;

    @ApiModelProperty(value = "类型，FORM：表单，TABLE：表格，OTHER：其它")
    private WidgetTypeEnum type;

    @ApiModelProperty(value = "表单id")
    private String formId;

    @ApiModelProperty(value = "表单名称")
    private String formName;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "输入类型，STRING：字符串，INT：整型，LONG：长整型，DOUBLE：浮点型，ENUM：枚举，DATE：日期，BOOL：布尔，BIGDECIMAL：精确浮点，FILE：文件，ARRAY：数组")
    private WidgetInputTypeEnum inputType;

    @ApiModelProperty(value = "是否必填，0：非必填，1：必填")
    private Boolean required;

    @ApiModelProperty(value = "是否只读，0：非只读，1：只读")
    private Boolean readable;

    @ApiModelProperty(value = "是否可写，0：非可写，1：可写")
    private Boolean writable;

    @ApiModelProperty(value = "是否可见，0：不可见，1：可见")
    private Boolean visable;

    @ApiModelProperty(value = "保留小数点几位")
    private Integer scale;

    @ApiModelProperty(value = "长度")
    private Integer length;

    @ApiModelProperty(value = "绑定字段")
    private String binding;

    @ApiModelProperty(value = "数据来源")
    private String dataGrid;

    @ApiModelProperty(value = "提示")
    private String tips;

    @ApiModelProperty(value = "格式化")
    private String format;

    @ApiModelProperty(value = "占宽符")
    private Integer span;

    @ApiModelProperty(value = "子标题")
    private String subTitle;

    @ApiModelProperty(value = "选项值，RADIO或CHECKBOX填此值")
    private String options;

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

    @ApiModelProperty(value = "表单步骤")
    private Integer formSetup;

    @ApiModelProperty(value = "处理时限，0：不处理，1：可处理")
    private Boolean handle;

    @ApiModelProperty(value = "控件组")
    private Integer formGroup;

    @ApiModelProperty(value = "角色类型")
    private RoleTypeEnum roleType;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "创建人")
    private Long createId;

    @TableField(value = "create_time", fill = FieldFill.INSERT)//新增执行
    @ApiModelProperty(value = "创建时间")
    private Long createTime;

    public Integer getFormGroup() {
        return formGroup;
    }

    public void setFormGroup(Integer formGroup) {
        this.formGroup = formGroup;
    }

    public RoleTypeEnum getRoleType() {
        return roleType;
    }

    public void setRoleType(RoleTypeEnum roleType) {
        this.roleType = roleType;
    }

    public Long getId() {
        return id;
    }

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

    public Long getCreateId() {
        return createId;
    }

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

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public TFCustomTypeEnum getFlowType() {
        return flowType;
    }

    public void setFlowType(TFCustomTypeEnum flowType) {
        this.flowType = flowType;
    }

    public Integer getFormSetup() {
        return formSetup;
    }

    public void setFormSetup(Integer formSetup) {
        this.formSetup = formSetup;
    }

    public Boolean getHandle() {
        return handle;
    }

    public void setHandle(Boolean handle) {
        this.handle = handle;
    }

    public String getOptions() {
        return options;
    }

    public void setOptions(String options) {
        this.options = options;
    }

    public String getSubTitle() {
        return subTitle;
    }

    public void setSubTitle(String subTitle) {
        this.subTitle = subTitle;
    }

    public Integer getSpan() {
        return span;
    }

    public void setSpan(Integer span) {
        this.span = span;
    }

    public String getFormat() {
        return format;
    }

    public void setFormat(String format) {
        this.format = format;
    }

    public String getBinding() {
        return binding;
    }

    public void setBinding(String binding) {
        this.binding = binding;
    }

    public WidgetCodeEnum getCode() {
        return code;
    }

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

    public WidgetTypeEnum getType() {
        return type;
    }

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

    public String getFormId() {
        return formId;
    }

    public void setFormId(String formId) {
        this.formId = formId;
    }

    public String getFormName() {
        return formName;
    }

    public void setFormName(String formName) {
        this.formName = formName;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public WidgetInputTypeEnum getInputType() {
        return inputType;
    }

    public void setInputType(WidgetInputTypeEnum inputType) {
        this.inputType = inputType;
    }

    public Boolean getRequired() {
        return required;
    }

    public void setRequired(Boolean required) {
        this.required = required;
    }

    public Boolean getReadable() {
        return readable;
    }

    public void setReadable(Boolean readable) {
        this.readable = readable;
    }

    public Boolean getWritable() {
        return writable;
    }

    public void setWritable(Boolean writable) {
        this.writable = writable;
    }

    public Boolean getVisable() {
        return visable;
    }

    public void setVisable(Boolean visable) {
        this.visable = visable;
    }

    public Integer getScale() {
        return scale;
    }

    public void setScale(Integer scale) {
        this.scale = scale;
    }

    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    public String getDataGrid() {
        return dataGrid;
    }

    public void setDataGrid(String dataGrid) {
        this.dataGrid = dataGrid;
    }

    public String getTips() {
        return tips;
    }

    public void setTips(String tips) {
        this.tips = tips;
    }
}
