package com.unis.reserveLayout.modular.qualityInspectionOrg.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Getter
@Setter
@TableName("business_qc_quality_inspection")
public class BusinessQcQualityInspection {

    @ApiModelProperty(value = "主键ID")
    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "创建日期")
    private Date createdate;

    @ApiModelProperty(value = "更新人")
    private String updatename;

    @ApiModelProperty(value = "更新日期")
    private Date updatedate;

    @ApiModelProperty(value = "库区id")
    private Integer orgId;

    @ApiModelProperty(value = "质检报告单号，由检验类别+检验日期（yyyyMMdd）+4位顺序号组成")
    private String zjbgdh;

    @ApiModelProperty(value = "检验类别，01：入仓验收；02：出仓检验；03：3 月末普检；04：9 月末普检；05：入仓初检；06：月度检查；07：3 月末库内普查；08：9 月末库内普查；09:定检")
    private String jylb;

    @ApiModelProperty(value = "basic_storehouse的id；仓房id")
    private Integer basicStorehouseId;

    @ApiModelProperty(value = "basic_warehouse的id；货位id")
    private Integer warehouseId;

    @ApiModelProperty(value = "粮食品种；basic_enum的id")
    private Integer grainVarietyId;

    @ApiModelProperty(value = "粮食性质；basic_enum的id")
    private Integer grainNatureId;

    @ApiModelProperty(value = "粮食等级；basic_enum的id")
    private Integer grainGradeId;

    @ApiModelProperty(value = "入库日期，格式：yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
    private Date rkrq;

    @ApiModelProperty(value = "收获年度")
    private String receiveYear;

    @ApiModelProperty(value = "产地")
    private String produceArea;

    @ApiModelProperty(value = "检验时间，格式：yyyy-MM-dd HH:mm:ss")
    private Date jysj;

    @ApiModelProperty(value = "检验结果 0：不合格；1：合格")
    private Integer checkResult;

    @ApiModelProperty(value = "检验单位")
    private String jydw;

    @ApiModelProperty(value = "检验人，检验人员姓名，若有多个保管员，则用“|”进行分隔")
    private String jyr;

    @ApiModelProperty(value = "检验依据，1：国标, 0：其他")
    private String jyyj;

    @ApiModelProperty(value = "指标类别，7602: 质量指标检验, 7603：储存品质检验, 7604：食品安全检验")
    private String zblb;

    @ApiModelProperty(value = "食品安全指标是否合格，0：不合格, 1：合格")
    private String spaqzbsfhg;

    @ApiModelProperty(value = "签发日期，格式：yyyy-MM-dd")
    private String qfrq;

    @ApiModelProperty(value = "报告出具时间，格式：yyyy-MM-dd HH:mm:ss")
    private Date bgcjsj;

    @ApiModelProperty(value = "审核人姓名")
    private String shrxm;

    @ApiModelProperty(value = "是否正常存储年限，0：否, 1：是")
    private String sfzcccnx;

    @ApiModelProperty(value = "指标结果判定，与指标类别对应，例如：达标|综合判定#宜存#合格")
    private String zbjgpd;

    @ApiModelProperty(value = "抽样日期；扦样时间，格式：yyyy-MM-dd HH:mm:ss")
    private Date qysj;

    @ApiModelProperty(value = "抽样单编号；扦样单编号")
    private String qydbh;

    @ApiModelProperty(value = "抽样人员；扦样人姓名")
    private String qyrxm;

    @ApiModelProperty(value = "扦样区域")
    private String qyqy;

    @ApiModelProperty(value = "监督人姓名")
    private String jdrxm;

    @ApiModelProperty(value = "样品编号")
    private String ypbh;

    @ApiModelProperty(value = "样品数量，单位：公斤")
    private BigDecimal ypsl;

    @ApiModelProperty(value = "代表数量，单位：公斤")
    private BigDecimal dbsl;

    @ApiModelProperty(value = "样品等级，参考LS/T 1713-2015 库存粮食识别代码 表3")
    private String ypdj;

    @ApiModelProperty(value = "样品状态")
    private String sampleStatus;

    @ApiModelProperty(value = "样品包装型号")
    private String samplePackageModel;

    @ApiModelProperty(value = "备注")
    private String bz;

    // 子表数组
    @ApiModelProperty(value = "子表数组")
    @TableField(exist = false)
    private List<BusinessQcQualityInspectionItem> items;
    /*private   Map<Integer, List<String>> maps;*/

    // 业务字段
    @ApiModelProperty(value = "库区名称")
    @TableField(exist = false)
    private String orgName;
    @ApiModelProperty(value = "仓房名称")
    @TableField(exist = false)
    private String storeHouseName;
    @ApiModelProperty(value = "货位名称")
    @TableField(exist = false)
    private String warehouseName;
    @ApiModelProperty(value = "品种名称")
    @TableField(exist = false)
    private String grainVarietyName;
    @ApiModelProperty(value = "性质名称")
    @TableField(exist = false)
    private String grainNatureName;
    @TableField(exist = false)
    private String grainGradeName;
    /*@TableField(exist = false)
    private String ajmc;
    @TableField(exist = false)
    private String producerName;
    @TableField(exist = false)
    private Integer inspectionItemId;

    @ApiModelProperty(value = "检验项目")
    private String inspectionItemName;

    @ApiModelProperty(value = "检验值")
    private String inspectionValue;*/

}