生成单据编号
This commit is contained in:
@@ -14,6 +14,10 @@ namespace WMS.Web.Core.Dto.OutStock
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 单据编号
|
||||||
|
/// </summary>
|
||||||
|
public string BillNo { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 单据状态
|
/// 单据状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
[Column("Id")]
|
[Column("Id")]
|
||||||
public override int Id { get; set; }
|
public override int Id { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 单据编号
|
||||||
|
/// </summary>
|
||||||
|
[Column("BillNo")]
|
||||||
|
public string BillNo { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 单据状态
|
/// 单据状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("Status")]
|
[Column("Status")]
|
||||||
@@ -59,5 +64,28 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
this.CreatorId = creatorId;
|
this.CreatorId = creatorId;
|
||||||
this.CreateTime = DateTime.Now;
|
this.CreateTime = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生成单据号
|
||||||
|
/// </summary>
|
||||||
|
public void GenerateNo()
|
||||||
|
{
|
||||||
|
//用户手动输入了 就不自动生成了
|
||||||
|
if (!string.IsNullOrEmpty(this.BillNo)) return;
|
||||||
|
|
||||||
|
if (this.Id.ToString().Length >= 8)
|
||||||
|
{
|
||||||
|
this.BillNo = "CK" + this.Id.ToString();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string idStr = this.Id.ToString();
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
idStr = "0" + idStr;
|
||||||
|
if (idStr.Length >= 8) break;
|
||||||
|
}
|
||||||
|
this.BillNo = "CK" + idStr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,29 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
/// 明细
|
/// 明细
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<OutStockTaskDetails> Details = new List<OutStockTaskDetails>();
|
public List<OutStockTaskDetails> Details = new List<OutStockTaskDetails>();
|
||||||
|
/// <summary>
|
||||||
|
/// 生成单据号
|
||||||
|
/// </summary>
|
||||||
|
public void GenerateNo()
|
||||||
|
{
|
||||||
|
//用户手动输入了 就不自动生成了
|
||||||
|
if (!string.IsNullOrEmpty(this.BillNo)) return;
|
||||||
|
|
||||||
|
if (this.Id.ToString().Length >= 8)
|
||||||
|
{
|
||||||
|
this.BillNo = "CKZL" + this.Id.ToString();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string idStr = this.Id.ToString();
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
idStr = "0" + idStr;
|
||||||
|
if (idStr.Length >= 8) break;
|
||||||
|
}
|
||||||
|
//this.Number = CNSpellTranslator.GetFirstSpell(this.Name) + idStr;
|
||||||
|
this.BillNo = "CKZL" + idStr;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 作废
|
/// 作废
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ namespace WMS.Web.Repositories
|
|||||||
await _context.OutStock.AddAsync(entity);
|
await _context.OutStock.AddAsync(entity);
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
//if (string.IsNullOrEmpty(entity.OutSourcFeedNo))
|
if (string.IsNullOrEmpty(entity.BillNo))
|
||||||
//{
|
{
|
||||||
// entity.GenerateNo();
|
entity.GenerateNo();
|
||||||
// await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
//}
|
}
|
||||||
|
|
||||||
if (_transaction != null)
|
if (_transaction != null)
|
||||||
_transaction.Commit();
|
_transaction.Commit();
|
||||||
@@ -85,6 +85,7 @@ namespace WMS.Web.Repositories
|
|||||||
{
|
{
|
||||||
#region dto组装
|
#region dto组装
|
||||||
Id = 0,
|
Id = 0,
|
||||||
|
BillNo=s.order.BillNo,
|
||||||
Status = "",
|
Status = "",
|
||||||
Type = "",
|
Type = "",
|
||||||
Creator = "",
|
Creator = "",
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ namespace WMS.Web.Repositories
|
|||||||
await _context.OutStockTask.AddAsync(entity);
|
await _context.OutStockTask.AddAsync(entity);
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
//if (string.IsNullOrEmpty(entity.OutSourcFeedNo))
|
if (string.IsNullOrEmpty(entity.BillNo))
|
||||||
//{
|
{
|
||||||
// entity.GenerateNo();
|
entity.GenerateNo();
|
||||||
// await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
//}
|
}
|
||||||
|
|
||||||
if (_transaction != null)
|
if (_transaction != null)
|
||||||
_transaction.Commit();
|
_transaction.Commit();
|
||||||
@@ -169,6 +169,7 @@ namespace WMS.Web.Repositories
|
|||||||
{
|
{
|
||||||
#region dto组装
|
#region dto组装
|
||||||
Id = 0,
|
Id = 0,
|
||||||
|
BillNo=s.order.BillNo,
|
||||||
Status = "",
|
Status = "",
|
||||||
Type = "",
|
Type = "",
|
||||||
CreateTime = s.order.OperateTime.DateToStringSeconds(),
|
CreateTime = s.order.OperateTime.DateToStringSeconds(),
|
||||||
|
|||||||
Reference in New Issue
Block a user