From 9ce89afac5d9b097673c9e3a68390eedcb1ffd1a Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 25 Mar 2022 10:28:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E8=A1=8C=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/WMS/WmsUnInterface.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs index 3c5ea00c..aad3a368 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs @@ -77,7 +77,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS await _wmsRepository.DeleteAsync(p => p.State == 0 && p.Version == version,true); var _query1= _wmsRepository.Where(p => p.Version == version); var _existLst = _query1.ToList(); - var _maxLine = _existLst.Max(p => p.LineNumber); + var _diffls = from itm1 in _ls join itm2 in _existLst on new { BillNum=itm1.结算单, MaterialCode=itm1.物料号, Pric=itm1.开票单价 } @@ -88,12 +88,12 @@ namespace Win.Sfs.SettleAccount.Entities.WMS List _lst = new List(); if (_difflst != null && _difflst.Count() > 0) { - int line= _maxLine+1; + foreach (var itm in _difflst) { - line = line++; + _lst.Add(new WmsDetailReport(Guid.NewGuid(), - line, + int.Parse(itm.行号), itm.客户, itm.出库类型, itm.结算编码, @@ -299,10 +299,12 @@ namespace Win.Sfs.SettleAccount.Entities.WMS throw new BusinessException("8989", "记录中有已经完成记录!"); return false; } - + int lineNumber = 1; foreach (var itm in entities) { + itm.LineNumber = lineNumber; itm.State = 2; + lineNumber++; } await _wmsRepository.GetDbContext().BulkUpdateAsync(entities);