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

namespace ZR.Model.Dto.OutStore
{
    /// <summary>
    /// 查询对象
    /// </summary>
    public class SapOutTaskRecordQueryDto : PagerInfo
    {
        //    生产令号
        public string BomNo { get; set; }
        //    物料编码
        public string MaterialCode { get; set; }
        //    物料名称
        public string MaterialName { get; set; }
        //    规格型号/图号
        public string MaterialSpec { get; set; }
        //    物料类型？好像业务不关注
        public string Category { get; set; }
        //    出库任务单号
        public string OutTaskNo { get; set; }
        //    创建时间
        public DateTime? BeginTime { get; set; }
        public DateTime? EndTime { get; set; }
    }

    /// <summary>
    /// 查询对象 无分页参数
    /// </summary>
    public class SapOutTaskQueryNoPageDto
    {
        public string OutTaskNo { get; set; }
        public string BomNo { get; set; }
    }

    public class SapOutTaskDto
    {
        [Required(ErrorMessage = "出库任务单号不能为空")]
        public string OutTaskNo { get; set; }
    }

    public class SapOutTaskRecordExtDto : SapOutTaskRecordDto
    {
        public int OutNum { get; set; }
        public string BnSnCode { get; set; }
    }

    /// <summary>
    /// 输入输出对象
    /// </summary>
    public class SapOutTaskRecordDto
    {
        [Required(ErrorMessage = "主键ID不能为空")]
        public int Id { get; set; }

        public string OutTaskNo { get; set; }

        [Required(ErrorMessage = "生产令号不能为空")]
        public string BomNo { 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 = "出库需求数量不能为空")]
        public int Qty { get; set; }

        public int? OutQty { get; set; }

        [Required(ErrorMessage = "出库结果。0：未出库；99：出库完成；不能为空")]
        public int Result { get; set; }
        
        public string Unit { 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; }
    }
}