package com.xinelu.manage.domain.scriptInfo;

import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

/**
 * 话术信息对象 script_info
 *
 * @author xinelu
 * @date 2024-02-26
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "话术信息对象", description = "script_info")
public class ScriptInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    private Long id;

    /**
     * 所属科室id
     */
    @ApiModelProperty(value = "所属科室id")
    @Excel(name = "所属科室id")
    @NotBlank(message = "科室id不能为空")
    private Long departmentId;

    /**
     * 所属科室名称
     */
    @ApiModelProperty(value = "所属科室名称")
    @Excel(name = "所属科室名称")
    @NotBlank(message = "科室名称不能为空")
    private String departmentName;

    /**
     * 病种id
     */
    @ApiModelProperty(value = "病种id")
    @Excel(name = "病种id")
    private Long diseaseTypeId;

    /**
     * 病种名称
     */
    @ApiModelProperty(value = "病种名称")
    @Excel(name = "病种名称")
    private String diseaseTypeName;

    /**
     * 通用话术名称
     */
    @ApiModelProperty(value = "通用话术名称")
    @Excel(name = "通用话术名称")
    @NotBlank(message = "通用话术名称不能为空", groups = {Insert.class, Update.class})
    @Length(max = 100, message = "通用话术名称不能超过100个字符", groups = {Insert.class, Update.class})
    private String commonScriptName;

    /**
     * 话术名称
     */
    @ApiModelProperty(value = "话术名称")
    @Excel(name = "话术名称")
    @NotBlank(message = "话术名称不能为空", groups = {Insert.class, Update.class})
    @Length(max = 100, message = "话术名称不能超过100个字符", groups = {Insert.class, Update.class})
    private String scriptName;

    /**
     * 话术ID
     */
    @ApiModelProperty(value = "话术ID")
    @Excel(name = "话术ID")
    @NotBlank(message = "话术ID不能为空", groups = {Insert.class, Update.class})
    private String scriptId;

    /**
     * 平台ID
     */
    @ApiModelProperty(value = "平台ID")
    @Excel(name = "平台ID")
    @NotBlank(message = "平台ID不能为空", groups = {Insert.class, Update.class})
    private String platformId;

    /**
     * 话术状态，正常：NORMAL，下架：OFF_SHELF，暂停：SUSPEND
     */
    @ApiModelProperty(value = "话术状态，正常：NORMAL，下架：OFF_SHELF，暂停：SUSPEND")
    @Excel(name = "话术状态，正常：NORMAL，下架：OFF_SHELF，暂停：SUSPEND")
    @NotBlank(message = "话术状态不能为空", groups = {Insert.class, Update.class})
    private String scriptStatus;

    /**
     * 话术简介
     */
    @ApiModelProperty(value = "话术简介")
    @Excel(name = "话术简介")
    @NotBlank(message = "话术简介不能为空", groups = {Insert.class, Update.class})
    @Length(max = 100, message = "话术简介不能超过200个字符", groups = {Insert.class, Update.class})
    private String scriptIntroduction;

    /**
     * 话术排序
     */
    @ApiModelProperty(value = "话术排序")
    @Excel(name = "话术排序")
    private Integer scriptSort;

    /**
     * 话术备注
     */
    @ApiModelProperty(value = "话术备注")
    @Excel(name = "话术备注")
    private String scriptRemark;

    @ApiModelProperty(value = "话术图片文件路径")
    private String scriptFilePath;

    private String flowScheme;

	/**
	 * 公共库模板id
	 */
	private Long sourceTemplateId;

	/**
	 * 爱医声平台机器人ID
	 */
	private String robotPublishId;

	/**
	 * 话术中用到的变量，竖线隔开。来源于字段标签表的key
	 */
	private String variables;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("departmentId", getDepartmentId())
                .append("departmentName", getDepartmentName())
                .append("diseaseTypeId", getDiseaseTypeId())
                .append("diseaseTypeName", getDiseaseTypeName())
                .append("commonScriptName", getCommonScriptName())
                .append("scriptName", getScriptName())
                .append("scriptId", getScriptId())
                .append("platformId", getPlatformId())
                .append("scriptStatus", getScriptStatus())
                .append("scriptIntroduction", getScriptIntroduction())
                .append("scriptSort", getScriptSort())
                .append("scriptRemark", getScriptRemark())
                .append("scriptFilePath", getScriptFilePath())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
