using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
using ZR.Model.Models;

namespace ZR.Model.Dto.Inspect
{
    /// <summary>
    /// 接口管理/SAP交验单记录表查询对象
    /// </summary>
    public class SapDeliverRecordQueryDto : PagerInfo
    {
        //物料名称
        public string MaterialName { get; set; }
        //物料编码
        public string MaterialCode { get; set; }
        //物料类型
        public string Category { get; set; }
        //质检结果
        public string CheckResult { get; set; }
        //规格型号
        public string MaterialSpec { get; set; }
        //关键件标识
        public bool? KeyFlag { get; set; }
        //交验单号
        public string DeliverNo { get; set; }
        //生产令号
        public string BomNo { get; set; }
        //创建时间
        public DateTime? BeginTime { get; set; }
        public DateTime? EndTime { get; set; }
    }
    /// <summary>
    /// 查询对象 无分页参数
    /// </summary>
    public class SapDeliverQueryNoPageDto
    {
        public string DeliverNo { get; set; }
        public string BomNo { get; set; }
    }

    public class SapDeliverDto
    {
        [Required(ErrorMessage = "交验单号不能为空")]
        public string DeliverNo { get; set; }
    }
    /// <summary>
    /// 接口管理/SAP交验单记录表输入输出对象
    /// </summary>
    public class SapDeliverRecordDto
    {
        [Required(ErrorMessage = "主键ID不能为空")]
        public int Id { get; set; }

        [Required(ErrorMessage = "交验单号不能为空")]
        public string DeliverNo { get; set; }

        public string CheckName { get; set; }

        [Required(ErrorMessage = "生产令号不能为空")]
        public string BomNo { get; set; }

        [Required(ErrorMessage = "行项目不能为空")]
        public int RowNo { get; set; }

        [Required(ErrorMessage = "物料类型（外协件，外购件）不能为空")]
        public string Category { get; set; }

        [Required(ErrorMessage = "物料编码不能为空")]
        public string MaterialCode { get; set; }

        [Required(ErrorMessage = "物料名称不能为空")]
        public string MaterialName { get; set; }

        [Required(ErrorMessage = "规格型号/图号不能为空")]
        public string MaterialSpec { get; set; }

        [Required(ErrorMessage = "关键件标识（0非关键件，1关键件）不能为空")]
        public bool KeyFlag { get; set; }

        [Required(ErrorMessage = "交验单数量不能为空")]
        public int Qty { get; set; }

        [Required(ErrorMessage = "抽检数量不能为空")]
        public int SpotCheckQty { get; set; }

        public int? CheckQty { get; set; }

        [Required(ErrorMessage = "质检结果（Wait未质检，OK质检合格，NG质检不合格，PartOK部分质检通过）不能为空")]
        public string CheckResult { get; set; }

        public int? InstoreQty { get; set; }

        [Required(ErrorMessage = "入库结果（0未入库，99入库完成）不能为空")]
        public int InstoreResult { get; set; }

        public string CreateBy { get; set; }

        public DateTime? CreateTime { get; set; }

        public string UpdateBy { get; set; }

        public DateTime? UpdateTime { get; set; }

        public string Remark { get; set; }



    }
    public class SapDeliverRecordExtDto //: SapDeliverRecordDto
    {
        [Required(ErrorMessage = "交验单号不能为空")]
        public string DeliverNo { get; set; }
        [Required(ErrorMessage = "规格型号/图号不能为空")]
        public string MaterialSpec { get; set; }
        public int CheckOkQty { get; set; }
        /// <summary>
        /// BN/SN码 
        /// </summary>
        public string BnSnCode { get; set; }
    }

    public class SapDeliverRecordSumDto
    {
        [Required(ErrorMessage = "物料编码不能为空")]
        public string MaterialCode { get; set; }

        [Required(ErrorMessage = "物料名称不能为空")]
        public string MaterialName { get; set; }

        [Required(ErrorMessage = "规格型号/图号不能为空")]
        public string MaterialSpec { get; set; }

        [Required(ErrorMessage = "交验单数量不能为空")]
        public int SumQty { get; set; }

        public int? SumCheckQty { get; set; }
    }
}