From 0e9183bf8b564e941593572d7c74b8be471c19ab Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Wed, 9 Feb 2022 17:40:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=B6=E8=B0=83=E6=95=B4=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/WMS/WMSSharePart90AppService.cs | 13 ++++---- .../Entities/WMS/WMSSharePartAppService.cs | 31 ++++++++++++++----- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs index faf93fa6..89e6b2bc 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs @@ -483,14 +483,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS } _lst.AddRange(_lsCopy.ToArray()); - var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList(); var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync(); var error = from itm1 in outPutDetail - join itm2 in _ls1 on - new { itm1.MaterialCode, itm1.OrderBillNum, itm1.WmsBillNum } + join itm2 in _lst on + new { itm1.MaterialCode } equals - new { itm2.MaterialCode, itm2.OrderBillNum, itm2.WmsBillNum } + new { itm2.MaterialCode } select itm1; var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) }); @@ -505,11 +504,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS return await ExportErrorReportAsync(checkList); } - var query = from itm1 in _ls1 + var query = from itm1 in _lst join itm2 in outPutDetail on - new { itm1.MaterialCode, itm1.OrderBillNum } + new { itm1.MaterialCode } equals - new { itm2.MaterialCode, itm2.OrderBillNum } into temp1 + new { itm2.MaterialCode } into temp1 from tm1 in temp1.DefaultIfEmpty() where tm1 == null select itm1; diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs index 4601266d..9509b638 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs @@ -499,15 +499,24 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts } _lst.AddRange(_lsCopy.ToArray()); - var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList(); + //var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList(); var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync(); + + //var error = from itm1 in outPutDetail + // join itm2 in _ls1 on + // new { itm1.MaterialCode, itm1.OrderBillNum,itm1.WmsBillNum } + // equals + // new { itm2.MaterialCode, itm2.OrderBillNum,itm2.WmsBillNum } + // select itm1; + var error = from itm1 in outPutDetail - join itm2 in _ls1 on - new { itm1.MaterialCode, itm1.OrderBillNum,itm1.WmsBillNum } + join itm2 in _lst on + new { itm1.MaterialCode } equals - new { itm2.MaterialCode, itm2.OrderBillNum,itm2.WmsBillNum } + new { itm2.MaterialCode } select itm1; + var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) }); var checkList = new List(); @@ -521,11 +530,19 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts return await ExportErrorReportAsync(checkList); } - var query = from itm1 in _ls1 + //var query = from itm1 in _ls1 + // join itm2 in outPutDetail on + // new { itm1.MaterialCode, itm1.OrderBillNum } + // equals + // new { itm2.MaterialCode, itm2.OrderBillNum } into temp1 + // from tm1 in temp1.DefaultIfEmpty() + // where tm1 == null + // select itm1; + var query = from itm1 in _lst join itm2 in outPutDetail on - new { itm1.MaterialCode, itm1.OrderBillNum } + new { itm1.MaterialCode } equals - new { itm2.MaterialCode, itm2.OrderBillNum } into temp1 + new { itm2.MaterialCode } into temp1 from tm1 in temp1.DefaultIfEmpty() where tm1 == null select itm1;