Administrator 3 years ago
parent
commit
5c174e464f
  1. 13
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs
  2. 31
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs

13
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs

@ -483,14 +483,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
} }
_lst.AddRange(_lsCopy.ToArray()); _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 outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var error = from itm1 in outPutDetail var error = from itm1 in outPutDetail
join itm2 in _ls1 on join itm2 in _lst on
new { itm1.MaterialCode, itm1.OrderBillNum, itm1.WmsBillNum } new { itm1.MaterialCode }
equals equals
new { itm2.MaterialCode, itm2.OrderBillNum, itm2.WmsBillNum } new { itm2.MaterialCode }
select itm1; select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) }); 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); return await ExportErrorReportAsync(checkList);
} }
var query = from itm1 in _ls1 var query = from itm1 in _lst
join itm2 in outPutDetail on join itm2 in outPutDetail on
new { itm1.MaterialCode, itm1.OrderBillNum } new { itm1.MaterialCode }
equals equals
new { itm2.MaterialCode, itm2.OrderBillNum } into temp1 new { itm2.MaterialCode } into temp1
from tm1 in temp1.DefaultIfEmpty() from tm1 in temp1.DefaultIfEmpty()
where tm1 == null where tm1 == null
select itm1; select itm1;

31
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs

@ -499,15 +499,24 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
} }
_lst.AddRange(_lsCopy.ToArray()); _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 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 var error = from itm1 in outPutDetail
join itm2 in _ls1 on join itm2 in _lst on
new { itm1.MaterialCode, itm1.OrderBillNum,itm1.WmsBillNum } new { itm1.MaterialCode }
equals equals
new { itm2.MaterialCode, itm2.OrderBillNum,itm2.WmsBillNum } new { itm2.MaterialCode }
select itm1; select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) }); 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<ErrorExportDto>(); var checkList = new List<ErrorExportDto>();
@ -521,11 +530,19 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
return await ExportErrorReportAsync(checkList); 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 join itm2 in outPutDetail on
new { itm1.MaterialCode, itm1.OrderBillNum } new { itm1.MaterialCode }
equals equals
new { itm2.MaterialCode, itm2.OrderBillNum } into temp1 new { itm2.MaterialCode } into temp1
from tm1 in temp1.DefaultIfEmpty() from tm1 in temp1.DefaultIfEmpty()
where tm1 == null where tm1 == null
select itm1; select itm1;

Loading…
Cancel
Save