Browse Source

更新版本

FoShanPG
Administrator 3 years ago
parent
commit
ef4b6cc5e1
  1. 2
      .vs/VSWorkspaceState.json
  2. 41
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs

2
.vs/VSWorkspaceState.json

@ -2,6 +2,6 @@
"ExpandedNodes": [ "ExpandedNodes": [
"" ""
], ],
"SelectedNode": "\\SettleAccount.sln (src\\Modules\\SettleAccount\\SettleAccount.sln)", "SelectedNode": "\\SettleAccount.sln (src\\SettleAccount.sln)",
"PreviewInSolutionExplorer": false "PreviewInSolutionExplorer": false
} }

41
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs

@ -62,14 +62,35 @@ namespace SettleAccount.Job.Services
var rangeList = _erpdapperRepository.GetSapList<InvoiceSettledDetailDiff>(_list, version, true); var rangeList = _erpdapperRepository.GetSapList<InvoiceSettledDetailDiff>(_list, version, true);
var erpPriceList = _ls.Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.ParentSapMaterialCode, p.ChassisNumber, p.KENNCode })
.Select(p => new { ParentSapMaterialCode = p.Key.ParentSapMaterialCode, ChassisNumber = p.Key.ChassisNumber, KENNCode = p.Key.KENNCode, Price = p.Sum(itm => itm.InvoicePrice) }).ToList();
// var erpPriceList= _erpdapperRepository.GetErpPartCodePriceList(version); // var erpPriceList= _erpdapperRepository.GetErpPartCodePriceList(version);
var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version); var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version);
if (_ls.Count > 0) if (_ls.Count > 0)
{ {
foreach (var itm in diffList)
{
var _first = _ls.FirstOrDefault(p => p.MaterialCode == itm.MaterialCode);
if (_first != null)
{
_first.InvoiceQty = _first.SettledQty + itm.DiffQty;
_first.DiffSettleInvQty = itm.DiffQty;
}
}
foreach (var itm in _ls)
{
itm.InvocieAmt = Math.Round(itm.InvoiceQty * itm.InvoicePrice,2);
itm.DiffPrice = itm.Price - itm.InvoicePrice;
}
var erpPriceList = _ls.Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.ParentSapMaterialCode, p.ChassisNumber, p.KENNCode })
.Select(p => new { ParentSapMaterialCode = p.Key.ParentSapMaterialCode, ChassisNumber = p.Key.ChassisNumber, KENNCode = p.Key.KENNCode, Price = p.Sum(itm => itm.InvocieAmt) }).ToList();
var rangList = from itm1 in rangeList var rangList = from itm1 in rangeList
join itm2 in erpPriceList on new { itm1.ParentSapMaterialCode, itm1.KENNCode, itm1.ChassisNumber } equals new { itm2.ParentSapMaterialCode, itm2.KENNCode, itm2.ChassisNumber } join itm2 in erpPriceList on new { itm1.ParentSapMaterialCode, itm1.KENNCode, itm1.ChassisNumber } equals new { itm2.ParentSapMaterialCode, itm2.KENNCode, itm2.ChassisNumber }
into temp1 into temp1
@ -103,21 +124,9 @@ namespace SettleAccount.Job.Services
rangeList = rangList.ToList(); rangeList = rangList.ToList();
foreach (var itm in diffList)
{
var _first = _ls.FirstOrDefault(p => p.MaterialCode == itm.MaterialCode);
if (_first != null)
{
_first.InvoiceQty = _first.SettledQty + itm.DiffQty;
_first.DiffSettleInvQty = itm.DiffQty;
}
}
foreach (var itm in _ls)
{
itm.InvocieAmt = Math.Round(itm.InvoiceQty * itm.InvoicePrice,2);
itm.DiffPrice = itm.Price - itm.InvoicePrice;
}
_ls.AddRange(rangeList); _ls.AddRange(rangeList);
//var list1 = _ls.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.SettleReadyQty }).Select(p => new { SettleQty = p.Key.SettleReadyQty, MaterialCode = p.Key.MaterialCode, ChassisNumber = p.Key.ChassisNumber, Qty = p.Sum(itm => itm.Qty) }).Where(p => p.Qty > 1).ToList(); //var list1 = _ls.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.SettleReadyQty }).Select(p => new { SettleQty = p.Key.SettleReadyQty, MaterialCode = p.Key.MaterialCode, ChassisNumber = p.Key.ChassisNumber, Qty = p.Sum(itm => itm.Qty) }).Where(p => p.Qty > 1).ToList();

Loading…
Cancel
Save