diff --git a/src/WMS.Web.Core/Dto/OutStock/OutStockQueryInfoResponse.cs b/src/WMS.Web.Core/Dto/OutStock/OutStockQueryInfoResponse.cs
index 63ec1b6b..3ff2065a 100644
--- a/src/WMS.Web.Core/Dto/OutStock/OutStockQueryInfoResponse.cs
+++ b/src/WMS.Web.Core/Dto/OutStock/OutStockQueryInfoResponse.cs
@@ -14,6 +14,10 @@ namespace WMS.Web.Core.Dto.OutStock
///
public int Id { get; set; }
///
+ /// 单据编号
+ ///
+ public string BillNo { get; set; }
+ ///
/// 单据状态
///
public string Status { get; set; }
diff --git a/src/WMS.Web.Domain/Entitys/OutStock.cs b/src/WMS.Web.Domain/Entitys/OutStock.cs
index c9a786aa..36a133d6 100644
--- a/src/WMS.Web.Domain/Entitys/OutStock.cs
+++ b/src/WMS.Web.Domain/Entitys/OutStock.cs
@@ -21,6 +21,11 @@ namespace WMS.Web.Domain.Entitys
[Column("Id")]
public override int Id { get; set; }
///
+ /// 单据编号
+ ///
+ [Column("BillNo")]
+ public string BillNo { get; set; }
+ ///
/// 单据状态
///
[Column("Status")]
@@ -59,5 +64,28 @@ namespace WMS.Web.Domain.Entitys
this.CreatorId = creatorId;
this.CreateTime = DateTime.Now;
}
+
+ ///
+ /// 生成单据号
+ ///
+ 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;
+ }
}
}
diff --git a/src/WMS.Web.Domain/Entitys/OutStockTask.cs b/src/WMS.Web.Domain/Entitys/OutStockTask.cs
index 9a5a4cca..6a7dd729 100644
--- a/src/WMS.Web.Domain/Entitys/OutStockTask.cs
+++ b/src/WMS.Web.Domain/Entitys/OutStockTask.cs
@@ -51,6 +51,29 @@ namespace WMS.Web.Domain.Entitys
/// 明细
///
public List Details = new List();
+ ///
+ /// 生成单据号
+ ///
+ 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;
+ }
///
/// 作废
diff --git a/src/WMS.Web.Repositories/OutStockRepositories.cs b/src/WMS.Web.Repositories/OutStockRepositories.cs
index 2ab1e5c4..8331bb8e 100644
--- a/src/WMS.Web.Repositories/OutStockRepositories.cs
+++ b/src/WMS.Web.Repositories/OutStockRepositories.cs
@@ -44,11 +44,11 @@ namespace WMS.Web.Repositories
await _context.OutStock.AddAsync(entity);
await _context.SaveChangesAsync();
- //if (string.IsNullOrEmpty(entity.OutSourcFeedNo))
- //{
- // entity.GenerateNo();
- // await _context.SaveChangesAsync();
- //}
+ if (string.IsNullOrEmpty(entity.BillNo))
+ {
+ entity.GenerateNo();
+ await _context.SaveChangesAsync();
+ }
if (_transaction != null)
_transaction.Commit();
@@ -85,6 +85,7 @@ namespace WMS.Web.Repositories
{
#region dto组装
Id = 0,
+ BillNo=s.order.BillNo,
Status = "",
Type = "",
Creator = "",
diff --git a/src/WMS.Web.Repositories/OutStockTaskRepositories.cs b/src/WMS.Web.Repositories/OutStockTaskRepositories.cs
index 92a11dc2..bb5b46a9 100644
--- a/src/WMS.Web.Repositories/OutStockTaskRepositories.cs
+++ b/src/WMS.Web.Repositories/OutStockTaskRepositories.cs
@@ -44,11 +44,11 @@ namespace WMS.Web.Repositories
await _context.OutStockTask.AddAsync(entity);
await _context.SaveChangesAsync();
- //if (string.IsNullOrEmpty(entity.OutSourcFeedNo))
- //{
- // entity.GenerateNo();
- // await _context.SaveChangesAsync();
- //}
+ if (string.IsNullOrEmpty(entity.BillNo))
+ {
+ entity.GenerateNo();
+ await _context.SaveChangesAsync();
+ }
if (_transaction != null)
_transaction.Commit();
@@ -169,6 +169,7 @@ namespace WMS.Web.Repositories
{
#region dto组装
Id = 0,
+ BillNo=s.order.BillNo,
Status = "",
Type = "",
CreateTime = s.order.OperateTime.DateToStringSeconds(),