diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
index f0ed0977..a4534840 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
@@ -175,6 +175,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Required(ErrorMessage = "{0}不能为空")]
public string Version { get; set; }
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ [Required(ErrorMessage = "{0}不能为空")]
+ public string LU { get; set; }
+
+ ///
+ /// 通用码
+ ///
+ [Display(Name = "通用码")]
+ [Required(ErrorMessage = "{0}不能为空")]
+ public string PN { get; set; }
+
///
/// 业务类型
///
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs
index a1857ead..852b71ea 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs
@@ -108,12 +108,20 @@ public class PUB_SA_DETAIL_SERVICE : SettleAccountApplicationBase
[HttpPost]
public async Task PubSaSeCompare(PubSaSeCompareRequestDto pubSaSeCompareRequestDto)
{
+ var businessTypeDisplayName = pubSaSeCompareRequestDto.BusinessType.ToString();
+ DisplayAttribute attributeOfType = pubSaSeCompareRequestDto.BusinessType.GetAttributeOfType();
+ if (attributeOfType != null)
+ {
+ businessTypeDisplayName = attributeOfType.Name;
+ }
+ var projectName = $"{businessTypeDisplayName}结算与发运数据对比";
+
List customConditionList = new List();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = pubSaSeCompareRequestDto.Version });
- customConditionList.Add(new CustomCondition() { Name = "BusinessType", Value = pubSaSeCompareRequestDto.BusinessType.ToString() });
-
- customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "结算与发运数据对比" });
- var _taskid = await _taskJobService.ExportEnqueueAsync("Pub结算与发运核对汇总表", ExportExtentsion.Excel, pubSaSeCompareRequestDto.Version, string.Empty, CurrentUser, typeof(PubSaSeCompareExportService), customConditionList, (rs) =>
+ customConditionList.Add(new CustomCondition() { Name = "BusinessType", Value = ((int)pubSaSeCompareRequestDto.BusinessType).ToString() });
+ customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName });
+
+ var _taskid = await _taskJobService.ExportEnqueueAsync(projectName, ExportExtentsion.Excel, pubSaSeCompareRequestDto.Version, string.Empty, CurrentUser, typeof(PubSaSeCompareExportService), customConditionList, (rs) =>
{
Console.WriteLine("TaskJob 回调了");
});
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
index e502a7e8..4baeb2ea 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
@@ -1,3 +1,5 @@
+using System.ComponentModel.DataAnnotations;
+using System;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
@@ -6,6 +8,78 @@ namespace Win.Sfs.SettleAccount.Reports;
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDiff
{
+ //[Display(Name = "LU+ASN单号")]
+ //public string KeyCode { get; set; } = null!;
+
+ ///
+ /// 有结算无发货(无EDI数据)
+ ///有结算无发货(有EDI数据)
+ ///有结算有发货(无EDI数据)
+ ///有结算有发货(无价格信息)
+ ///有结算有发货(有EDI数据)
+ ///无结算有发货(有EDI数据)
+ ///无结算有发货(无EDI数据)
+ ///有结算有发货(有EDI数据)
+ ///有结算有发货(WMS多发)
+ ///
+ [Display(Name = "类别")]
+ public string Category { get; set; } = null!;
+
+ //[Display(Name = "Wms发货单号")]
+ //public string WmsBillNum { get; set; } = null!;
+
+ //[Display(Name = "发货时间")]
+ //public DateTime ShippingDate { get; set; }
+
+ //[Display(Name = "生产码")]
+ //public string PN { get; set; } = null!;
+
+ [Display(Name = "日顺序号")]
+ public string SeqNumber { get; set; } = null!;
+
+ [Display(Name = "PJIS日顺序号")]
+ public string PJISSeqNumber { get; set; } = null!;
+
+ [Display(Name = "物料号")]
+ public string MaterialNumber { get; set; } = null!;
+
+ [Display(Name = "物料描述")]
+ public string MaterialDes { get; set; } = null!;
+
+ //[Display(Name = "零件号")]
+ //public string LU { get; set; } = null!;
+
+ ///
+ /// 结算数据中的过账日期
+ ///
+ [Display(Name = "客户下线时间")]
+ public DateTime CustomerOfflineTime { get; set; }
+
+ [Display(Name = "小总成号")]
+ public string AssemblyCode { get; set; }
+
+ [Display(Name = "注塑码")]
+ public string InjectionCode { get; set; }
+
+ [Display(Name = "结算数量")]
+ public decimal SAQty { get; set; }
+
+ [Display(Name = "发货数量")]
+ public decimal SEQty { get; set; }
+
+ [Display(Name = "匹配类型")]
+ public string MateType { get; set; }
+
+ [Display(Name = "定价")]
+ public decimal FixPrice { get; set; }
+
+ [Display(Name = "期间")]
+ public int Version { get; set; }
+
+ [Display(Name = "替换零件号")]
+ public string RepLU { get; set; }
+
+
///
/// 零件号
///
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs
index 629c05d6..d953ee3e 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs
@@ -24,20 +24,32 @@ public class PubSaSeCompareDapperRepository : DapperRepository
/// 获取差异
///
- public virtual List GetDetailDiffReportList(string version, string businessType)
+ public virtual List GetDetailDiffReportList(string businessType)
{
string strSqlText = @$"
SELECT
- A.LU SeLU,
+ A.WmsBillNum,
+ A.ShippingDate,
+ '' SeqNumber,
+ '' PJISSeqNumber,
+ '' MaterialNumber,
+ '' MaterialDes,
+ B.SettleDate CustomerOfflineTime,
+ '' AssemblyCode,
+ '' InjectionCode,
+ A.LU SeLU,
A.PN SePN,
- SeQty,
B.LU SaLU,
B.PN SaPN,
- SaQty,
- (SaQty - SeQty) DiffQty
+ A.SEQty,
+ B.SAQty,
+ (B.SAQty-A.SEQty) DiffQty,
+ '' MateType,
+ B.Price FixPrice
FROM
- (SELECT SUM(QTY) SeQty, LU, PN FROM Set_PUB_SE_DETAIL WHERE GROUP BY LU, PN) A
- FULL JOIN (SELECT SUM(QTY) SaQty, LU, PN FROM Set_PUB_SA_DETAIL GROUP BY LU, PN) B ON A.LU= B.LU AND A.PN= B.PN
+ (SELECT SUM(QTY) SEQty,LU,PN,WmsBillNum,ShippingDate FROM Set_PUB_SE_DETAIL WHERE BusinessType = {businessType} GROUP BY LU,PN,WmsBillNum,ShippingDate) A
+ FULL JOIN (SELECT SUM(QTY) SAQty,LU,PN,Price,SettleDate FROM Set_PUB_SA_DETAIL WHERE BusinessType = {businessType} GROUP BY LU,PN,Price,SettleDate) B ON A.LU= B.LU AND A.PN= B.PN
+ ORDER BY B.SettleDate DESC;
";
return DbConnection.Query(strSqlText, null, null, true, 1200, null).ToList();
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
index dd79f808..d03b3722 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
@@ -11,13 +11,17 @@ using SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
using Shouldly;
using Volo.Abp.BlobStoring;
+using Win.Sfs.SettleAccount.Reports;
+using Newtonsoft.Json.Schema;
+using Win.Sfs.SettleAccount;
+using Win.Sfs.SettleAccount.Entities.Prices;
namespace SettleAccount.Job.Services.Report
{
///
/// Pub结算发运对比导出服务
///
- public class PubSaSeCompareExportService: ITransientDependency, IExportJob
+ public class PubSaSeCompareExportService : ITransientDependency, IExportJob
{
///
/// Pub结算明细仓储
@@ -29,6 +33,11 @@ namespace SettleAccount.Job.Services.Report
///
private readonly INormalEfCoreRepository _pubSeDetailRepository;
+ ///
+ /// 替换件关系仓储
+ ///
+ private readonly INormalEfCoreRepository _tbRePartsRelationshipRepository;
+
private readonly PubSaSeCompareDapperRepository _pubSaSeCompareDapperRepository;
private readonly IBlobContainer _fileContainer;
@@ -38,11 +47,13 @@ namespace SettleAccount.Job.Services.Report
///
public PubSaSeCompareExportService(INormalEfCoreRepository pubSaDetailRepository,
INormalEfCoreRepository pubSeDetailRepository,
+ INormalEfCoreRepository tbRePartsRelationshipRepository,
PubSaSeCompareDapperRepository pubSaSeCompareDapperRepository,
IBlobContainer fileContainer)
{
_pubSaDetailRepository = pubSaDetailRepository;
_pubSeDetailRepository = pubSeDetailRepository;
+ _tbRePartsRelationshipRepository = tbRePartsRelationshipRepository;
_pubSaSeCompareDapperRepository = pubSaSeCompareDapperRepository;
_fileContainer = fileContainer;
}
@@ -55,21 +66,71 @@ namespace SettleAccount.Job.Services.Report
var version = property.Where(p => p.Name == "Version").FirstOrDefault().Value;
var businessType = property.Where(t => t.Name == "BusinessType").FirstOrDefault().Value;
var filename = exportName.FirstOrDefault();
- var pubSaSeCompareDiffs = _pubSaSeCompareDapperRepository.GetDetailDiffReportList(version, businessType);
+ var pubSaSeCompareDiffs = _pubSaSeCompareDapperRepository.GetDetailDiffReportList(businessType);
+
+ //有结算有发运
+ var haveSaHaveSe = new List();
+ //有结算无发运
+ var haveSaNotHaveSe = new List();
+ //无结算有发运
+ var notHaveSaHaveSe = new List();
+
+ haveSaHaveSe = pubSaSeCompareDiffs.FindAll(t => !string.IsNullOrEmpty(t.SaLU) && !string.IsNullOrEmpty(t.SeLU));
+ haveSaNotHaveSe = pubSaSeCompareDiffs.FindAll(t => !string.IsNullOrEmpty(t.SaLU) && string.IsNullOrEmpty(t.SeLU));
+ notHaveSaHaveSe = pubSaSeCompareDiffs.FindAll(t => string.IsNullOrEmpty(t.SaLU) && !string.IsNullOrEmpty(t.SeLU));
+
+ //二次对比(替换零件号)
+ var repLUs = notHaveSaHaveSe.Select(t => t.SeLU).Distinct().ToList();
+ var tbRePartsRelationships = _tbRePartsRelationshipRepository.GetListAsync(t => repLUs.Contains(t.RepLU) && ((int)t.BusinessType).ToString() == businessType).Result;
+
+ tbRePartsRelationships.ForEach(tbRePartsRelationship =>
+ {
+ notHaveSaHaveSe.FindAll(t => t.SeLU == tbRePartsRelationship.RepLU).ForEach(t =>
+ {
+ t.RepLU = t.SeLU;
+ t.SeLU = tbRePartsRelationship.LU;
+ });
+ });
+
+
+
+ pubSaSeCompareDiffs.Join()
+
+
- ExcelExporter excelExporter = new ExcelExporter();
+
+
+
+
+
+
+
+
+
+ //var add = from item1 in haveSaNotHaveSe
+ // join item2 in notHaveSaHaveSe
+ // on new { item1.SaLU, item1.SaPN }
+ // equals new { item2.SeLU, item2.SePN }
+ // into temp
+ // from itm3 in temp.DefaultIfEmpty()
+ // where itm3 == null
+ // select item1;
+
+ //var query = BlobProviderSelectorExtensions
+
+ ExcelExporter excelExporter = new ExcelExporter();
var result = excelExporter
- .Append(pubSaSeCompareDiffs, "差异明细表")
+ .Append(pubSaSeCompareDiffs, "汇总表")
.SeparateBySheet()
- .Append(pubSaSeCompareDiffs, "数量差异汇总表")
+ .Append(haveSaHaveSe, "有结算有发运")
.SeparateBySheet()
- .Append(pubSaSeCompareDiffs, "按物料价格差异明细表")
+ .Append(haveSaNotHaveSe, "有结算无发运")
.SeparateBySheet()
- .Append(pubSaSeCompareDiffs, "差异汇总验证表")
+ .Append(notHaveSaHaveSe, "无结算有发运")
.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
- _fileContainer.SaveAsync(filename, result.Result, true);
+ //_fileContainer.SaveAsync(filename, result.Result, true);
return id.ToString();
@@ -148,141 +209,141 @@ namespace SettleAccount.Job.Services.Report
public string ExportFile333(Guid id, List exportName, List property)
{
return "";
-// var version = property.Where(p => p.Name == "Version").FirstOrDefault().Value;
-
-// var _filename = exportName.FirstOrDefault();
-
-// var _ls = _dapperRepository.GetDetailDiffReportList(version, materialCode, begin, end, cp7begin, cp7end, kenncode, chassisNumber, materialGroup);
-// var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version);
-// foreach (var itm in _ls)
-// {
-// itm.InvoiceAmt = Math.Round(itm.InvoiceQty * itm.InvoicePrice, 2);
-// itm.DiffPrice = itm.Price - itm.InvoicePrice;
-// itm.DiffSettleFisQty = itm.SettledQty;
-// }
-// _ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.KENNCode).ThenBy(p => p.SapMaterialCode).ToList();
-
-
-
-// if (!string.IsNullOrEmpty(materialGroup))
-// {
-// var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
-// if (_groupList.Count() > 0)
-// {
-// _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList();
-// }
-// }
-// if (!string.IsNullOrEmpty(kenncode))
-// {
-// var _groupList = kenncode.Split(new char[] { '\n' }).Distinct().ToList();
-// if (_groupList.Count() > 0)
-// {
-// _ls = _ls.Where(p => _groupList.Contains(p.KENNCode)).ToList();
-// }
-// }
-// if (!string.IsNullOrEmpty(chassisNumber))
-// {
-// var _groupList = chassisNumber.Split(new char[] { '\n' }).Distinct().ToList();
-// if (_groupList.Count() > 0)
-// {
-// _ls = _ls.Where(p => _groupList.Contains(p.ChassisNumber)).ToList();
-// }
-// }
-// if (!string.IsNullOrEmpty(sapCode))
-// {
-// var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();
-// if (_groupList.Count() > 0)
-// {
-// _ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
-// }
-// }
-// if (!string.IsNullOrEmpty(materialCode))
-// {
-// var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
-// if (_groupList.Count() > 0)
-// {
-// _ls = _ls.Where(p => _groupList.Contains(p.MaterialCode)).ToList();
-// }
-// }
-
-
-// var _checkList = _erpdapperRepository.GetErrorBillList();
-
-// var query = from itm in _ls
-// join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum }
-//equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
-// from tm1 in temp1.DefaultIfEmpty()
-// where tm1 == null
-// select itm;
-
-
-// _ls = query.ToList();
-
-
-
-// var _lsSum = _ls.GroupBy(p => new { p.MaterialCode, p.SapMaterialCode, p.MaterialGroup, p.InvoicePrice }).Select(p => new UnInvoiceSettledDetailSum
-// {
-// MaterialCode = p.Key.MaterialCode,
-// SapMaterailCode = p.Key.SapMaterialCode,
-// MaterialGroup = p.Key.MaterialGroup,
-// SettleQty = p.Sum(itm => itm.SettledQty),
-// FisQty = 0,
-// DiffQty = -p.Sum(itm => itm.SettledQty),
-// Price = p.Key.InvoicePrice,
-// DiffAmt = p.Sum(itm => itm.SettledQty) * p.Key.InvoicePrice
-// }).ToList();
-
-// var _sumTotal = new UnInvoiceSettledDetailSum()
-// {
-
-// SettleQty = _lsSum.Sum(p => p.SettleQty),
-// DiffQty = _lsSum.Sum(p => p.DiffQty),
-// Price = _lsSum.Sum(p => p.Price),
-// DiffAmt = _lsSum.Sum(p => p.DiffAmt)
-
-
-// };
-// _lsSum.Add(_sumTotal);
-
-
-
-// var _ls1 = DiffPrice(id, exportName, p_list);
-
-// var report1List = _ls1.Where(p => p.DiffPrice != 0).GroupBy(p => new { p.MaterialGroup, p.MaterialCode, p.MaterialDesc, p.Price, p.InvoicePrice, p.DiffPrice, p.SapMaterialCode })
-// .Select(t => new SettleDoorPanelExport { MaterialGroup = t.FirstOrDefault().MaterialGroup, MaterialCode = t.FirstOrDefault().MaterialCode, MaterialDesc = t.FirstOrDefault().MaterialDesc, Price = t.FirstOrDefault().Price, InvoicePrice = t.FirstOrDefault().InvoicePrice, InvoiceDiffPrice = t.FirstOrDefault().DiffPrice, SAPCode = t.FirstOrDefault().SapMaterialCode }).ToList();
-
-
-
-// var report2List = _ls1.Where(p => p.DiffPrice != 0).Select(p => new { p.MaterialGroup, DiffAmt = p.DiffPrice * p.Qty }).GroupBy(p => new { p.MaterialGroup }).Select(p => new SettleDoorPanelSumExport { MaterialGroup = p.Key.MaterialGroup, InvoiceDiffPrice = p.Sum(itm => itm.DiffAmt), Version = version });
-
-// var list1 = LSettleSum(id, exportName, p_list);
-
-// var report1 = report2List.ToList();
-
-// foreach (var itm in list1)
-// {
-// itm.MaterialGroup = itm.MaterialGroup + "(漏结)";
-// }
-
-// report1.AddRange(list1);
-
-// ExcelExporter _exporter = new ExcelExporter();//导出Excel
-
-// var result = _exporter
-// .Append(_ls, "差异明细表")
-// .SeparateBySheet()
-// .Append(_lsSum, "数量差异汇总表")
-// .SeparateBySheet()
-// .Append(report1List, "按物料价格差异明细表")
-// .SeparateBySheet()
-// .Append(report1, "差异汇总验证表")
-// .ExportAppendDataAsByteArray();
-// result.ShouldNotBeNull();
-// _fileContainer.SaveAsync(_filename, result.Result, true);
+ // var version = property.Where(p => p.Name == "Version").FirstOrDefault().Value;
+
+ // var _filename = exportName.FirstOrDefault();
+
+ // var _ls = _dapperRepository.GetDetailDiffReportList(version, materialCode, begin, end, cp7begin, cp7end, kenncode, chassisNumber, materialGroup);
+ // var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version);
+ // foreach (var itm in _ls)
+ // {
+ // itm.InvoiceAmt = Math.Round(itm.InvoiceQty * itm.InvoicePrice, 2);
+ // itm.DiffPrice = itm.Price - itm.InvoicePrice;
+ // itm.DiffSettleFisQty = itm.SettledQty;
+ // }
+ // _ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.KENNCode).ThenBy(p => p.SapMaterialCode).ToList();
+
+
+
+ // if (!string.IsNullOrEmpty(materialGroup))
+ // {
+ // var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
+ // if (_groupList.Count() > 0)
+ // {
+ // _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList();
+ // }
+ // }
+ // if (!string.IsNullOrEmpty(kenncode))
+ // {
+ // var _groupList = kenncode.Split(new char[] { '\n' }).Distinct().ToList();
+ // if (_groupList.Count() > 0)
+ // {
+ // _ls = _ls.Where(p => _groupList.Contains(p.KENNCode)).ToList();
+ // }
+ // }
+ // if (!string.IsNullOrEmpty(chassisNumber))
+ // {
+ // var _groupList = chassisNumber.Split(new char[] { '\n' }).Distinct().ToList();
+ // if (_groupList.Count() > 0)
+ // {
+ // _ls = _ls.Where(p => _groupList.Contains(p.ChassisNumber)).ToList();
+ // }
+ // }
+ // if (!string.IsNullOrEmpty(sapCode))
+ // {
+ // var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();
+ // if (_groupList.Count() > 0)
+ // {
+ // _ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
+ // }
+ // }
+ // if (!string.IsNullOrEmpty(materialCode))
+ // {
+ // var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
+ // if (_groupList.Count() > 0)
+ // {
+ // _ls = _ls.Where(p => _groupList.Contains(p.MaterialCode)).ToList();
+ // }
+ // }
+
+
+ // var _checkList = _erpdapperRepository.GetErrorBillList();
+
+ // var query = from itm in _ls
+ // join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum }
+ //equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1
+ // from tm1 in temp1.DefaultIfEmpty()
+ // where tm1 == null
+ // select itm;
+
+
+ // _ls = query.ToList();
+
+
+
+ // var _lsSum = _ls.GroupBy(p => new { p.MaterialCode, p.SapMaterialCode, p.MaterialGroup, p.InvoicePrice }).Select(p => new UnInvoiceSettledDetailSum
+ // {
+ // MaterialCode = p.Key.MaterialCode,
+ // SapMaterailCode = p.Key.SapMaterialCode,
+ // MaterialGroup = p.Key.MaterialGroup,
+ // SettleQty = p.Sum(itm => itm.SettledQty),
+ // FisQty = 0,
+ // DiffQty = -p.Sum(itm => itm.SettledQty),
+ // Price = p.Key.InvoicePrice,
+ // DiffAmt = p.Sum(itm => itm.SettledQty) * p.Key.InvoicePrice
+ // }).ToList();
+
+ // var _sumTotal = new UnInvoiceSettledDetailSum()
+ // {
+
+ // SettleQty = _lsSum.Sum(p => p.SettleQty),
+ // DiffQty = _lsSum.Sum(p => p.DiffQty),
+ // Price = _lsSum.Sum(p => p.Price),
+ // DiffAmt = _lsSum.Sum(p => p.DiffAmt)
+
+
+ // };
+ // _lsSum.Add(_sumTotal);
+
+
+
+ // var _ls1 = DiffPrice(id, exportName, p_list);
+
+ // var report1List = _ls1.Where(p => p.DiffPrice != 0).GroupBy(p => new { p.MaterialGroup, p.MaterialCode, p.MaterialDesc, p.Price, p.InvoicePrice, p.DiffPrice, p.SapMaterialCode })
+ // .Select(t => new SettleDoorPanelExport { MaterialGroup = t.FirstOrDefault().MaterialGroup, MaterialCode = t.FirstOrDefault().MaterialCode, MaterialDesc = t.FirstOrDefault().MaterialDesc, Price = t.FirstOrDefault().Price, InvoicePrice = t.FirstOrDefault().InvoicePrice, InvoiceDiffPrice = t.FirstOrDefault().DiffPrice, SAPCode = t.FirstOrDefault().SapMaterialCode }).ToList();
+
+
+
+ // var report2List = _ls1.Where(p => p.DiffPrice != 0).Select(p => new { p.MaterialGroup, DiffAmt = p.DiffPrice * p.Qty }).GroupBy(p => new { p.MaterialGroup }).Select(p => new SettleDoorPanelSumExport { MaterialGroup = p.Key.MaterialGroup, InvoiceDiffPrice = p.Sum(itm => itm.DiffAmt), Version = version });
+
+ // var list1 = LSettleSum(id, exportName, p_list);
+
+ // var report1 = report2List.ToList();
+
+ // foreach (var itm in list1)
+ // {
+ // itm.MaterialGroup = itm.MaterialGroup + "(漏结)";
+ // }
+
+ // report1.AddRange(list1);
+
+ // ExcelExporter _exporter = new ExcelExporter();//导出Excel
+
+ // var result = _exporter
+ // .Append(_ls, "差异明细表")
+ // .SeparateBySheet()
+ // .Append(_lsSum, "数量差异汇总表")
+ // .SeparateBySheet()
+ // .Append(report1List, "按物料价格差异明细表")
+ // .SeparateBySheet()
+ // .Append(report1, "差异汇总验证表")
+ // .ExportAppendDataAsByteArray();
+ // result.ShouldNotBeNull();
+ // _fileContainer.SaveAsync(_filename, result.Result, true);
-// //_outputService.Export(id, string.Format("大众结算未发运核对明细表_{0}.xlsx", Guid.NewGuid().ToString()), _ls);
+ // //_outputService.Export(id, string.Format("大众结算未发运核对明细表_{0}.xlsx", Guid.NewGuid().ToString()), _ls);
-// return id.ToString();
+ // return id.ToString();
}
}
}