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);