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

namespace ZR.Model.Dto.Balance
{
    /// <summary>
    /// 库存管理/库存明细表查询对象
    /// </summary>
    public class StkBalanceDtlQueryDto : PagerInfo
    {
        /// 库区Id
        public int RegionId { get; set; }
        /// 库位Id
        public int BinId { get; set; }
        public string BinCode { get; set; }
        ///生产令号
        public string BomNo { get; set; }
        ///交验单号
        public string DeliverNo { get; set; }
        ///物料编码
        public string MaterialCode { get; set; }
        ///物料名称
        public string MaterialName { get; set; }
        ///规格型号/图号
        public string MaterialSpec { get; set; }
        ///库存状态
        public int? Status { get; set; }
        ///关键件标识
        public bool? KeyFlag { get; set; }
        ///BN/SN码
        public string BnSnCode { get; set; }
        ///创建时间
        public DateTime? BeginTime { get; set; }
        public DateTime? EndTime { get; set; }
    }

    public class GetOutOperateBalanceQueryDto
    {
        public string BomNo { get; set; }
        public string MaterialCode { get; set; }
        public string BnSnCode { get; set; }
        public int Qty { get; set; }
        /// <summary>
        /// true：查询可用于装配的库存数据（库存状态：88）
        /// false：查询可用于出库的库存数据（库存状态：55）
        /// </summary>
        public bool IsForAssemble { get; set; }
    }
    /// <summary>
    /// 库存管理/库存明细表输入输出对象
    /// </summary>
    public class StkBalanceDtlDto
    {
        [Required(ErrorMessage = "库存明细表ID不能为空")]
        public int BalanceId { get; set; }

        [Required(ErrorMessage = "库区ID不能为空")]
        public int RegionId { get; set; }
        public string RegionCode { get; set; }
        public string RegionName { get; set; }

        [Required(ErrorMessage = "库位ID不能为空")]
        public int BinId { get; set; }
        public string BinCode { get; set; }

        public string DeliverNo { get; set; }

        public string BomNo { 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 string Category { get; set; }

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

        [Required(ErrorMessage = "BN/SN码不能为空")]
        public string BnSnCode { get; set; }

        [Required(ErrorMessage = "库存数量不能为空")]
        public int BalanceQty { get; set; }
        public int SumQty { get; set; }

        [Required(ErrorMessage = "库存状态（0初始创建，33盘点入库占用，55在库，77盘点出库占用，99出库完成）不能为空")]
        public int Status { 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; }

    }
}