package com.xinelu.manage.domain.batchsendtaskinfo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.Objects;

/**
 * 批量推送任务信息对象 batch_send_task_info
 *
 * @author zh
 * @date 2026-04-26
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "批量推送任务信息对象", description = "batch_send_task_info")
public class BatchSendTaskInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 导入数据id
     */
    private Long id;

    /**
     * 序号
     */
    @ApiModelProperty(value = "序号")
    private Long orderNum;

    /**
     * 流水号/导入编号
     */
    @ApiModelProperty(value = "流水号/导入编号")
    private String sn;

    /**
     * 导入批次名称
     */
    @ApiModelProperty(value = "导入批次名称")
    private String importName;

    /**
     * 团体名称
     */
    @ApiModelProperty(value = "团体名称")
    @Excel(name = "团体名称")
    private String teamName;

    /**
     * 所属机构ID
     */
    @ApiModelProperty(value = "所属机构ID")
    private Long hospitalAgencyId;

    /**
     * 所属医院名称
     */
    @ApiModelProperty(value = "所属医院名称")
    @Excel(name = "所属医院")
    private String hospitalAgencyName;

    /**
     * 匹配的科室ID
     */
    @ApiModelProperty(value = "匹配的科室ID")
    private Long departmentId;

    /**
     * 匹配的科室名称
     */
    @ApiModelProperty(value = "匹配的科室名称")
    @Excel(name = "所属科室")
    private String departmentName;

    /**
     * 就诊/体检时间，时间格式：yyyy-MM-dd
     */
    @ApiModelProperty(value = "就诊/出院/体检时间，时间格式：yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime visitDate;

    @Excel(name = "就诊/出院/体检时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date visitTime;

    /**
     * 体检/门诊/住院号
     */
    @ApiModelProperty(value = "体检/门诊/住院号")
    @Excel(name = "体检/门诊/住院号")
    private String inHospitalNumber;

    /**
     * 患者姓名
     */
    @ApiModelProperty(value = "患者姓名")
    @Excel(name = "姓名")
    private String patientName;

    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话")
    @Excel(name = "联系电话")
    private String patientPhone;

    /**
     * 性别
     */
    @ApiModelProperty(value = "性别")
    @Excel(name = "性别")
    private String sex;

    /**
     * 年龄
     */
    @ApiModelProperty(value = "年龄")
    @Excel(name = "年龄")
    private Long age;

    /**
     * 身份证号
     */
    @ApiModelProperty(value = "身份证号")
    @Excel(name = "身份证号")
    private String cardNo;

    /**
     * 人员类型，在院：IN_HOSPITAL，门诊：OUTPATIENT，出院：DISCHARGED，体检：PHYSICAL_EXAMINATION
     */
    @ApiModelProperty(value = "人员类型")
    @Excel(name = "人员类型")
    private String personnelType;

    /**
     * 人群id
     */
    @ApiModelProperty(value = "人群id")
    private Long crowdId;

    /**
     * 人群名称
     */
    @ApiModelProperty(value = "人群名称")
    @Excel(name = "所属人群")
    private String crowdName;

    /**
     * 体检总结/主要诊断
     */
    @ApiModelProperty(value = "体检总结/主要诊断")
    @Excel(name = "总检结论")
    private String physicalExaminationSummary;

    /**
     * 总结标签，逗号隔断
     */
    @ApiModelProperty(value = "总结标签，逗号隔断")
    private String physicalExaminationLabel;

    /**
     * 删除标识，0：未删除，1：已删除
     */
    private Integer delFlag;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        BatchSendTaskInfo that = (BatchSendTaskInfo) o;
        return Objects.equals(inHospitalNumber, that.inHospitalNumber) && Objects.equals(patientPhone, that.patientPhone);
    }

    @Override
    public int hashCode() {
        return Objects.hash(inHospitalNumber, patientPhone);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("orderNum", getOrderNum())
                .append("sn", getSn())
                .append("importName", getImportName())
                .append("teamName", getTeamName())
                .append("hospitalAgencyId", getHospitalAgencyId())
                .append("hospitalAgencyName", getHospitalAgencyName())
                .append("departmentId", getDepartmentId())
                .append("departmentName", getDepartmentName())
                .append("visitDate", getVisitDate())
                .append("inHospitalNumber", getInHospitalNumber())
                .append("patientName", getPatientName())
                .append("patientPhone", getPatientPhone())
                .append("age", getAge())
                .append("cardNo", getCardNo())
                .append("crowdId", getCrowdId())
                .append("crowdName", getCrowdName())
                .append("physicalExaminationSummary", getPhysicalExaminationSummary())
                .append("physicalExaminationLabel", getPhysicalExaminationLabel())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .toString();
    }
}