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;