package com.casic.missiles.model.business;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.casic.missiles.annotation.DictCodeField;
import com.casic.missiles.constants.MeterDictCode;
import com.casic.missiles.model.customer.CustomerSampleInfo;
import com.casic.missiles.model.equipment.EquipmentFixedAssets;
import com.casic.missiles.model.meter.MeterFile;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

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

/**
 * <p>
 *
 * </p>
 *
 * @author zt
 * @since 2023-02-02
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@TableName("business_original_record")
public class BusinessOriginalRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId("id")
    private Long id;

    /**
     * 原始记录编号
     */
    @TableField("original_record_code")
    @ApiModelProperty(value = "原始记录编号", dataType = "String")
    private String originalRecordCode;

    /**
     * 原始记录名称
     */
    @TableField("original_record_name")
    @ApiModelProperty(value = "原始记录名称", dataType = "String")
    private String originalRecordName;

    /**
     * 检校类别（字典code）
     */
    @TableField("measure_category")
    @ApiModelProperty(value = "检校类别", dataType = "String")
    @DictCodeField(message = "检校类别不合法", cacheName = MeterDictCode.MEASURE_CATEGORY)
    private String measureCategory;

    /**
     * 检校时间
     */
    @TableField("calibration_time")
    @ApiModelProperty(value = "检校时间", dataType = "String")
    private String calibrationTime;

    /**
     * 环境记录单id
     */
    @TableField("environment_id")
    @ApiModelProperty(value = "环境记录单id", dataType = "Long")
    private Long environmentId;

    /**
     * 环境记录单为空时取这里的手填温湿度
     */
    @ApiModelProperty(value = "温度", dataType = "String")
    @TableField("temperature")
    private String temperature;

    @ApiModelProperty(value = "湿度", dataType = "String")
    @TableField("humidity")
    private String humidity;

    /**
     * 检校地点
     */
    @TableField("calibration_place")
    @ApiModelProperty(value = "检校地点", dataType = "String")
    private String calibrationPlace;

    /**
     * 委托书id
     */
    @TableField("order_id")
    @ApiModelProperty(value = "委托书id", dataType = "Long")
    private Long orderId;

    /**
     * 样品id
     */
    @TableField("sample_id")
    @ApiModelProperty(value = "样品id", dataType = "Long")
    private Long sampleId;

    /**
     * 原始记录模板id
     */
    @TableField("template_id")
    @ApiModelProperty(value = "原始记录模板id", dataType = "Long")
    private Long templateId;

    /**
     * 原始记录附件（minio存储文件名）
     */
    @TableField("original_record_file")
    @ApiModelProperty(value = "原始记录附件", dataType = "String")
    private String originalRecordFile;

    /**
     * 备注
     */
    @TableField("remark")
    @ApiModelProperty(value = "备注", dataType = "String")
    private String remark;

    @TableField("is_del")
    private Boolean isDel;

    @TableField("create_user")
    private Long createUser;

    @TableField("create_time")
    private String createTime;

    @TableField("update_time")
    private String updateTime;

    /**
     * 委托单信息
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "委托单信息", dataType = "Object")
    private BusinessOrder businessOrder = new BusinessOrder();
    /**
     * 环境记录单信息
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "环境记录单信息", dataType = "Object")
    private BusinessEnvironmentRecord businessEnvironmentRecord = new BusinessEnvironmentRecord();
    /**
     * 样品信息
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "样品信息", dataType = "Object")
    private CustomerSampleInfo customerSampleInfo = new CustomerSampleInfo();

    @TableField(exist = false)
    @ApiModelProperty(value = "监测设备", dataType = "List")
    private List<EquipmentFixedAssets> equipmentInfoList = new ArrayList<>();
    /**
     * 技术文件
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "技术文件", dataType = "List")
    private List<MeterFile> fileList = new ArrayList<>();

    @TableField(exist = false)
    @ApiModelProperty(value = "检校类别名称", dataType = "String")
    private String measureCategoryName;

    @TableField(exist = false)
    @ApiModelProperty(value = "原始记录模板名称", dataType = "String")
    private String templateName;

    @TableField(exist = false)
    @ApiModelProperty(value = "创建人名称", dataType = "String")
    private String createUserName;

}
