76 lines
1.9 KiB
C#
76 lines
1.9 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.ComponentModel.DataAnnotations.Schema;
|
||
using System.Text;
|
||
using WMS.Web.Domain.Values;
|
||
|
||
namespace WMS.Web.Domain.Entitys
|
||
{
|
||
/// <summary>
|
||
/// wms出入库回退记录表
|
||
/// </summary>
|
||
[Serializable]
|
||
[Table("t_wms_back_record")]
|
||
public class BackRecord
|
||
{
|
||
/// <summary>
|
||
/// ID
|
||
/// </summary>
|
||
public int Id { get; set; }
|
||
/// <summary>
|
||
/// 单据编号
|
||
/// </summary>
|
||
public string BillNo { get; set; }
|
||
/// <summary>
|
||
/// 类型:1为入库回退下架,2为出库回退上架
|
||
/// </summary>
|
||
public BackRecordType Type { get; set; }
|
||
/// <summary>
|
||
/// 操作人
|
||
/// </summary>
|
||
public int CreatorId { get; set; }
|
||
/// <summary>
|
||
/// 操作时间
|
||
/// </summary>
|
||
public DateTime CreateTime { get; set; }
|
||
|
||
/// <summary>
|
||
/// 明细
|
||
/// </summary>
|
||
public List<BackRecordDetails> Details = new List<BackRecordDetails>();
|
||
|
||
/// <summary>
|
||
/// 创建
|
||
/// </summary>
|
||
/// <param name="creatorId"></param>
|
||
public void Create(int creatorId)
|
||
{
|
||
this.CreatorId = creatorId;
|
||
this.CreateTime = DateTime.Now;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 生成单据号
|
||
/// </summary>
|
||
public void GenerateNo()
|
||
{
|
||
//用户手动输入了 就不自动生成了
|
||
if (!string.IsNullOrEmpty(this.BillNo)) return;
|
||
|
||
if (this.Id.ToString().Length >= 8)
|
||
{
|
||
this.BillNo = "CR" + this.Id.ToString();
|
||
return;
|
||
}
|
||
|
||
string idStr = this.Id.ToString();
|
||
while (true)
|
||
{
|
||
idStr = "0" + idStr;
|
||
if (idStr.Length >= 8) break;
|
||
}
|
||
this.BillNo = "CR" + idStr;
|
||
}
|
||
}
|
||
}
|