package org.jeecg.modules.database.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

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

/**
 * @Description: 试验管理
 * @Author: jeecg-boot
 * @Date: 2024-08-30
 * @Version: V1.0
 */
@Data
@TableName("experiment")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "试验管理")
public class Experiment implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private String id;
    /**
     * 创建人
     */
    @Schema(description = "创建人")
    private String createBy;
    /**
     * 创建日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @Schema(description = "创建日期")
    private Date   createTime;
    /**
     * 更新人
     */
    @Schema(description = "更新人")
    private String updateBy;
    /**
     * 更新日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @Schema(description = "更新日期")
    private Date   updateTime;
    /**
     * 所属部门
     */
    @Schema(description = "所属部门")
    private String sysOrgCode;

    @Schema(description = "序号")
    @TableField("index_no")
    private Integer indexNo;
    /**
     * 试验编号
     */
    @Excel(name = "试验编号", width = 15)
    @Schema(description = "试验编号")
    @TableField("experiment_no")
    private String  experimentNo;
    /**
     * 名称
     */
    @Excel(name = "名称", width = 15)
    @Schema(description = "名称")
    private String  name;

    /**
     * 委托方名称
     */
    @Excel(name = "委托方名称", width = 15)
    @Schema(description = "委托方名称")
    @TableField("client_name")
    private String clientName;
    /**
     * 试验类型
     */
    @Excel(name = "试验类型", width = 15, replace = {"科研试验_1", "外协试验_2"})
    @Schema(description = "试验类型")
    private String type;
    /**
     * 试验日期
     */
    @Excel(name = "试验开始日期", width = 20, format = "yyyy-MM-dd")
    //@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    //@DateTimeFormat(pattern = "yyyy-MM-dd")
    @Schema(description = "试验开始日期")
    @TableField("start_date")
    private String startDate;
    /**
     * 试验日期
     */
    @Excel(name = "实验结束日期", width = 20, format = "yyyy-MM-dd")
    //@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    //@DateTimeFormat(pattern = "yyyy-MM-dd")
    @Schema(description = "试验结束日期")
    @TableField("end_date")
    private String endDate;
    /**
     * 辐射源类型
     */
    //@Excel(name = "辐射源类型", width = 15)
    @Schema(description = "辐射源类型")
    @TableField("radiation_source_type")
    private String radiationSourceType;
    /**
     * 试验负责人
     */
    @Excel(name = "试验负责人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "id")
    private String supervisor;

    /**
     * 试验负责人
     */
    @TableField(exist = false)
    private String supervisorName;
    /**
     * 状态
     */
    @Excel(name = "状态", width = 15)
    @Schema(description = "状态")
    private String status;

    @TableField(exist = false)
    private List<String>                       statusList;
    /**
     * 样品信息
     */
    //@Excel(name = "样品信息", width = 15)
    //@Schema(description = "样品信息")
    //private String                             sampleInfo;
    @TableField(exist = false)
    private List<ExperimentSampleInfo>         sampleInfoList;
    /**
     * 辐照板
     */
    //@Excel(name = "辐照板", width = 15)
    //@Schema(description = "辐照板")
    //private String                             irradiationBoard;
    @TableField(exist = false)
    private List<ExperimentIrradiationBoard>   irradiationBoardList;
    /**
     * 偏置条件
     */
    //@Excel(name = "偏置条件", width = 15)
    //@Schema(description = "偏置条件")
    //private String                             deviationCondition;
    @TableField(exist = false)
    private List<ExperimentDeviationCondition> deviationConditionList;
    /**
     * 加偏设备
     */
    //@Excel(name = "加偏设备", width = 15)
    //@Schema(description = "加偏设备")
    //private String                             deviationEquipment;
    /**
     * 加偏设备
     */
    @TableField(exist = false)
    private List<ExperimentDeviationEquipment> deviationEquipmentList;
    /**
     * 复制次数
     */
    @Schema(description = "复制次数")
    private Integer                            copyCount;
    /**
     * 试验文件
     */
    //@Excel(name = "试验文件", width = 15)
    //@Schema(description = "试验文件")
    //private String                             files;

    @TableField(exist = false)
    private List<ExperimentFile>               fileList;
    /**
     * 试验人员ID, 逗号分割多个
     */
    @TableField(exist = false)
    @Excel(name = "试验员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "id")
    private String                             experimentUser;
    /**
     * 试验人员
     */
    @TableField(exist = false)
    private List<ExperimentUser>               experimentUserList;
    @TableField(exist = false)
    private List<ExperimentReport>             experimentReportList;
    @TableField(exist = false)
    private List<ExperimentRating>             experimentRatingList;

    @TableField(exist = false)
    private String sampleType;
    @TableField(exist = false)
    private String sampleName;
    @TableField(exist = false)
    private String equipmentModel;
    @TableField("sample_model")
    private String sampleModel;

    //@TableField(exist = false)
    //@ExcelCollection(name = "辐照")
    //private List<ExperimentAnnealProcess>    experimentAnnealProcessList;
    //@TableField(exist = false)
    //private List<ExperimentRadiationProcess> experimentRadiationProcessList;
    //@TableField(exist = false)
    //private List<ExperimentTestProcess>      experimentTestProcessList;


    /**
     * 西核院统计
     */
    @Excel(name = "西核院统计", width = 15)
    @Schema(description = "西核院统计")
    private Integer totalCountXhy;
    /**
     * 理化所统计
     */
    @Excel(name = "理化所统计", width = 15)
    @Schema(description = "理化所统计")
    private Integer totalCountLhs;

    /**
     * 试验报告审核状态，给报告审核页面用，不用存库。
     */
    @Schema(description = "理化所统计")
    @TableField(exist = false)
    private String reportStatus;

}
