优化
This commit is contained in:
@@ -311,17 +311,17 @@ namespace WMS.Web.Domain.Services
|
||||
//1.获取最新的erp明细信息
|
||||
var billNo_new = await _inStockRepositories.GetLastBillNo();
|
||||
//erp明细:生成批号
|
||||
int new_firstBillNo = billNo_new == null ? 0 : billNo_new.FirstBillNo;
|
||||
int new_lastBillNo = billNo_new == null ? 0 : billNo_new.LastBillNo;
|
||||
int new_firstBillNo = billNo_new == null ? 0 : (billNo_new.FirstBillNo.HasValue? billNo_new.FirstBillNo.Value:0);
|
||||
int new_lastBillNo = billNo_new == null ? 0 : (billNo_new.LastBillNo.HasValue? billNo_new.LastBillNo.Value:0);
|
||||
entity.ErpDetails.ForEach(x =>
|
||||
{
|
||||
//物料必须是启动了批号管理才生成批号
|
||||
var mat= materials.Where(m => m.MaterialNumber == x.MaterialNumber && m.OrgCode == entity.OrgCode).FirstOrDefault();
|
||||
var mat= materials.Where(m => m.MaterialNumber == x.MaterialNumber && m.OrgCode == entity.OrgCode && m.IsBatchManage==true).FirstOrDefault();
|
||||
if (mat != null)
|
||||
{
|
||||
x.GenerateBatchBillNo(new_firstBillNo, new_lastBillNo, mat.IsBatchManage);
|
||||
new_firstBillNo = x.FirstBillNo;
|
||||
new_lastBillNo = x.LastBillNo;
|
||||
new_firstBillNo = x.FirstBillNo??0;
|
||||
new_lastBillNo = x.LastBillNo??0;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user