112 lines
2.8 KiB
C#
112 lines
2.8 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_instock")]
|
|
public class InStock
|
|
{
|
|
/// <summary>
|
|
/// ID
|
|
/// </summary>
|
|
public int Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// 单据编号
|
|
/// </summary>
|
|
public string BillNo { get; set; }
|
|
/// <summary>
|
|
/// 入库类型
|
|
/// </summary>
|
|
public InstockType Type { get; set; }
|
|
/// <summary>
|
|
/// 创建人
|
|
/// </summary>
|
|
public int CreatorId { get; set; }
|
|
/// <summary>
|
|
/// 创建时间(入库时间)
|
|
/// </summary>
|
|
public DateTime CreateTime { get; set; }
|
|
/// <summary>
|
|
/// 同步成功或者失败
|
|
/// </summary>
|
|
public bool? SuccessSync { get; set; }
|
|
|
|
/// <summary>
|
|
/// 操作人
|
|
/// </summary>
|
|
public int OperateId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 同步时间
|
|
/// </summary>
|
|
public DateTime? SyncTime { get; set; }
|
|
|
|
/// <summary>
|
|
/// 备注
|
|
/// </summary>
|
|
public string Remark { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 明细
|
|
/// </summary>
|
|
public List<InStockDetails> Details = new List<InStockDetails>();
|
|
|
|
/// <summary>
|
|
/// 创建
|
|
/// </summary>
|
|
/// <param name="creatorId"></param>
|
|
public void Create(int creatorId)
|
|
{
|
|
this.CreatorId = creatorId;
|
|
this.CreateTime = DateTime.Now;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 同步金蝶
|
|
/// </summary>
|
|
/// <param name="isSuccess"></param>
|
|
/// <param name="operateId"></param>
|
|
/// <param name="remark"></param>
|
|
public void Sync(bool isSuccess, int operateId, string remark)
|
|
{
|
|
this.SuccessSync = isSuccess;
|
|
this.Remark = remark;
|
|
this.OperateId = operateId;
|
|
this.SyncTime = DateTime.Now;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 生成单据号
|
|
/// </summary>
|
|
public void GenerateNo()
|
|
{
|
|
//用户手动输入了 就不自动生成了
|
|
if (!string.IsNullOrEmpty(this.BillNo)) return;
|
|
|
|
if (this.Id.ToString().Length >= 8)
|
|
{
|
|
this.BillNo = "RK" + this.Id.ToString();
|
|
return;
|
|
}
|
|
|
|
string idStr = this.Id.ToString();
|
|
while (true)
|
|
{
|
|
idStr = "0" + idStr;
|
|
if (idStr.Length >= 8) break;
|
|
}
|
|
this.BillNo = "RK" + idStr;
|
|
}
|
|
}
|
|
}
|