package com.docus.server.report.entity;

import com.docus.server.report.api.dto.ReportDto;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 上报记录缓冲表，用于报告信息和地址分开推送时的等待
 */
@Data
public class AfReportRecordBuffer implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    private Long id;
    /**
     * 住院号
     */
    private String inpatientNo;

    /**
     * 住院流水号，记账号
     */
    private String jzh;

    /**
     * 住院次数
     */
    private Integer admissTimes;

    /**
     * 下载地址，多个使用 | 分隔
     */
    private String downUrl;

    /**
     * 下载路径类型 1:url，2:base64，3:url base64，4:共享文件，5：本地文件base64
     */
    private Integer downType;


    /**
     * 报告唯一id
     */
    private String serialnum;

    /**
     * 报告来源 采集器标识
     */
    private String sysflag;

    /**
     * 报告所属文件分段id
     */
    private String zdAssortId;

    /**
     * 记录创建时间
     */
    private Date createTime;

    /**
     * 记录更新时间
     */
    private Date updateTime;


    /**
     * 报告名称
     */
    private String fileName;
    /**
     * 检查报告单号，用于顺德人医推送 报告信息和报告地址的关联
     */
    private String reportSn;


    /**
     * 阻塞状态 0：阻塞中 1：已通过
     */
    private Integer blocking;

    public AfReportRecordBuffer() {
    }

    public AfReportRecordBuffer(ReportDto reportDto) {
        this.jzh = reportDto.getJzh();
        this.admissTimes = reportDto.getAdmisstimes();
        this.inpatientNo = reportDto.getInpatientNo();
        this.downUrl = reportDto.getDownUrl();
        this.sysflag = reportDto.getSysFlag();
        this.zdAssortId = reportDto.getAssortId();
        this.serialnum = reportDto.getSerialnum();
        this.fileName = reportDto.getFileTitle();
        this.downType = reportDto.getDowntype();
        this.reportSn=reportDto.getReportSn();
    }

    public void setFileInfo(ReportDto reportDto) {
        this.jzh = reportDto.getJzh();
        this.admissTimes = reportDto.getAdmisstimes();
        this.inpatientNo = reportDto.getInpatientNo();
        this.sysflag = reportDto.getSysFlag();
        this.zdAssortId = reportDto.getAssortId();
        this.serialnum = reportDto.getSerialnum();
        this.fileName = reportDto.getFileTitle();
        this.reportSn=reportDto.getReportSn();
    }


    public void setFileUrl(ReportDto reportDto) {
        this.downUrl = reportDto.getDownUrl();
        this.downType = reportDto.getDowntype();
        this.reportSn=reportDto.getReportSn();
    }
}