using Forks.EnterpriseServices.DataDictionary;
using Forks.EnterpriseServices.DomainObjects2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ButcherFactory.BO
{
  [MapToTable("Butcher_SegmentInStore")]
  [DBIndex("IDX_Butcher_SegmentProduction_Clustered", "BarCode", false, 0)]
  [DBIndexType("IDX_Butcher_SegmentProduction_Clustered", IndexType.Clustered)]
  public class SegmentInStore : SyncBill
  {
    public string BarCode { get; set; }

    [NonDmoProperty]
    public string ShortCode
    {
      get
      {
        if (string.IsNullOrEmpty(BarCode))
          return null;
        if (BarCode.Contains("260912011"))
          return BarCode.Replace("260912011", "");
        return BarCode;
      }
    }

    public long? Store_ID { get; set; }

    [NonDmoProperty]
    public int? Number { get; set; }

    public decimal? Weight { get; set; }

    public string Goods_Code { get; set; }

    public string Goods_Name { get; set; }

    public string Goods_Spec { get; set; }

    public DateTime? ProductTime { get; set; }

    public DateTime? InStoreTime { get; set; }

    public DateTime? BackStoreTime { get; set; }

    //-1 删除
    //0 已入库
    //1 正在退库
    //2 已退库
    public int State { get; set; }

    [NonDmoProperty]//同步未入库信息时用于增量查询
    public long? SID { get; set; }
  }

  [MapToTable("Butcher_SegmentCodeError")]
  [KeyField("ID", KeyGenType.identity)]
  public class SegmentCodeError
  {
    public long ID { get; set; }    

    public string BarCode { get; set; }

    public string ExceptionInfo { get; set; }
  }
}
