批号添加
This commit is contained in:
@@ -55,5 +55,51 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// </summary>
|
||||
public string ErpSyncBillNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 批号
|
||||
/// </summary>
|
||||
public string BatchBillNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 箱唛编号-首位
|
||||
/// </summary>
|
||||
public int FirstBillNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 箱唛编号-末尾序号
|
||||
/// </summary>
|
||||
public int LastBillNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成批号
|
||||
/// </summary>
|
||||
/// <param name="firstBillNo"></param>
|
||||
/// <param name="lastBillNo"></param>
|
||||
public void GenerateBatchBillNo(int firstBillNo,int lastBillNo,bool isBatchManage)
|
||||
{
|
||||
if (isBatchManage)
|
||||
{
|
||||
this.FirstBillNo = Convert.ToInt32(DateTime.Now.ToString("yyMMdd"));
|
||||
if (this.FirstBillNo == firstBillNo)
|
||||
this.LastBillNo = lastBillNo + 1;
|
||||
else
|
||||
this.LastBillNo = 1;
|
||||
|
||||
if (this.LastBillNo.ToString().Length >= 6)
|
||||
{
|
||||
this.BatchBillNo = "W" + this.FirstBillNo + this.LastBillNo;
|
||||
return;
|
||||
}
|
||||
|
||||
string lastStr = this.LastBillNo.ToString();
|
||||
while (true)
|
||||
{
|
||||
lastStr = "0" + lastStr;
|
||||
if (lastStr.Length >= 6) break;
|
||||
}
|
||||
this.BatchBillNo = "W" + this.FirstBillNo + lastStr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user