109 lines
3.2 KiB
C#
109 lines
3.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Text;
|
|
using WMS.Web.Core;
|
|
using WMS.Web.Domain.Values;
|
|
|
|
namespace WMS.Web.Domain.Entitys
|
|
{
|
|
/// <summary>
|
|
/// 序列号
|
|
/// </summary>
|
|
[Serializable]
|
|
[Table("t_wms_serialnumbers")]
|
|
public class SerialNumbers : EntityBase
|
|
{
|
|
public SerialNumbers() { }
|
|
public SerialNumbers(string serialNumber, int materialId, int boxId, int opsBoxId, string creator, DateTime? createTime)
|
|
{
|
|
this.SerialNumber = serialNumber;
|
|
this.MaterialId = materialId;
|
|
this.BoxId = boxId;
|
|
this.OpsBoxId = opsBoxId;
|
|
this.Creator = creator;
|
|
this.CreateTime = createTime == null ? DateTime.Now : (DateTime)createTime;
|
|
}
|
|
/// <summary>
|
|
/// 主键 订单编号
|
|
/// </summary>
|
|
[Column("Id")]
|
|
public override int Id { get; set; }
|
|
/// <summary>
|
|
/// 序列号
|
|
/// </summary>
|
|
[Column("SerialNumber")]
|
|
public string SerialNumber { get; set; }
|
|
/// <summary>
|
|
/// 物料ID
|
|
/// </summary>
|
|
[Column("MaterialId")]
|
|
public int MaterialId { get; set; }
|
|
/// <summary>
|
|
/// wms箱ID
|
|
/// </summary>
|
|
[Column("BoxId")]
|
|
public int BoxId { get; set; }
|
|
/// <summary>
|
|
/// 对应老OPS的箱ID
|
|
/// </summary>
|
|
[Column("OpsBoxId")]
|
|
public int OpsBoxId { get; set; }
|
|
/// <summary>
|
|
/// 创建人(老ops过来)
|
|
/// </summary>
|
|
[Column("Creator")]
|
|
public string Creator { get; set; }
|
|
/// <summary>
|
|
/// 创建时间(老ops过来)
|
|
/// </summary>
|
|
[Column("CreateTime")]
|
|
public DateTime CreateTime { get; set; } = DateTime.Now;
|
|
/// <summary>
|
|
/// 出库单号
|
|
/// </summary>
|
|
[Column("OutStockBillNo")]
|
|
public string OutStockBillNo { get; set; }
|
|
/// <summary>
|
|
/// 入库单号/采购单号
|
|
///</summary>
|
|
[Column("InStockBillNo")]
|
|
public string InStockBillNo { get; set; }
|
|
|
|
/// <summary>
|
|
/// 操作(绑定箱信息)
|
|
/// </summary>
|
|
/// <param name="destBoxId">目标箱号</param>
|
|
public void Bind(int destBoxId)
|
|
{
|
|
this.BoxId = destBoxId;
|
|
}
|
|
/// <summary>
|
|
/// 解绑
|
|
/// </summary>
|
|
public void UnBind()
|
|
{
|
|
this.BoxId = 0;
|
|
}
|
|
/// <summary>
|
|
/// 出库
|
|
/// </summary>
|
|
/// <param name="outStockBillNo">出库单号</param>
|
|
public void OutStock(string outStockBillNo, OutStockType type)
|
|
{
|
|
this.BoxId = 0;
|
|
if (type == OutStockType.Sal)
|
|
this.OutStockBillNo = outStockBillNo;
|
|
}
|
|
/// <summary>
|
|
/// 入库
|
|
/// </summary>
|
|
/// <param name="inStockBillNo">出库单号</param>
|
|
public void InStock(string inStockBillNo, OrderType type)
|
|
{
|
|
if (type == OrderType.Purchase_In)
|
|
this.InStockBillNo = inStockBillNo;
|
|
}
|
|
}
|
|
}
|