|
|
@ -55,15 +55,17 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 导出
|
|
|
|
/// 输出报表
|
|
|
|
/// 输出比对报表
|
|
|
|
/// </summary>
|
|
|
|
/// <remarks>
|
|
|
|
/// 直供件BBAC、直供件HBPO、配件、印度件输出比对报表
|
|
|
|
/// 结算核对明细输出
|
|
|
|
/// 结算核对汇总输出
|
|
|
|
/// 有结算有发货明细输出
|
|
|
|
/// 有结算有发货汇总输出
|
|
|
|
/// 有结算无发货明细输出
|
|
|
|
/// 有结算无发货汇总输出
|
|
|
|
/// </summary>
|
|
|
|
/// </remarks>
|
|
|
|
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) |
|
|
|
{ |
|
|
|
var version = int.Parse(property.Where(p => p.Name == "Version").FirstOrDefault().Value); |
|
|
@ -162,6 +164,11 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
/// <summary>
|
|
|
|
/// 获取比对数据
|
|
|
|
/// </summary>
|
|
|
|
/// <remarks>
|
|
|
|
/// 获取全量有结算无发运的数据
|
|
|
|
/// 获取全量无结算有发运的数据
|
|
|
|
/// 获取当期有结算有发运的数据
|
|
|
|
/// </remarks>
|
|
|
|
private List<SaSeCompareDiff> GetSaSeCompareData(EnumBusinessType businessType, int version) |
|
|
|
{ |
|
|
|
//印度件LU对比
|
|
|
@ -171,7 +178,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
} |
|
|
|
//结算
|
|
|
|
var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>() |
|
|
|
where sa.BusinessType == businessType && sa.MappingType == EnumMappingType.None |
|
|
|
where sa.BusinessType == businessType |
|
|
|
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem |
|
|
|
select new |
|
|
|
{ |
|
|
@ -183,6 +190,19 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
SettleDate = groupItem.Max(t => t.SettleDate), |
|
|
|
PartCode = groupItem.Max(t => t.PartCode) |
|
|
|
}; |
|
|
|
var saGroupByMappingType = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>() |
|
|
|
where sa.BusinessType == businessType && sa.MappingType == EnumMappingType.None |
|
|
|
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem |
|
|
|
select new |
|
|
|
{ |
|
|
|
groupItem.Key.PN, |
|
|
|
groupItem.Key.CustomerPartCodeNoSpace, |
|
|
|
Qty = groupItem.Sum(t => t.Qty), |
|
|
|
Version = groupItem.Max(t => t.Version), |
|
|
|
LU = groupItem.Max(t => t.LU), |
|
|
|
SettleDate = groupItem.Max(t => t.SettleDate), |
|
|
|
PartCode = groupItem.Max(t => t.PartCode) |
|
|
|
}; |
|
|
|
var saGroupByVersion = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>() |
|
|
|
where sa.BusinessType == businessType && sa.Version == version |
|
|
|
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem |
|
|
@ -214,7 +234,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
}; |
|
|
|
|
|
|
|
//有结算无发运
|
|
|
|
var haveSaNotHaveSeList = (from sa in saGroup |
|
|
|
var haveSaNotHaveSeList = (from sa in saGroupByMappingType |
|
|
|
join se in seGroup |
|
|
|
on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace } |
|
|
|
into temp |
|
|
@ -275,14 +295,16 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取比对数据
|
|
|
|
/// 印度件根据客户零件号对比
|
|
|
|
/// 获取比对数据印度件
|
|
|
|
/// </summary>
|
|
|
|
/// <remarks>
|
|
|
|
/// 印度件根据客户零件号对比
|
|
|
|
/// </remarks>
|
|
|
|
private List<SaSeCompareDiff> GetSaSeCompareDataYinDu(int version) |
|
|
|
{ |
|
|
|
//结算
|
|
|
|
var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>() |
|
|
|
where sa.BusinessType == EnumBusinessType.YinDuJian && sa.MappingType == EnumMappingType.None |
|
|
|
where sa.BusinessType == EnumBusinessType.YinDuJian |
|
|
|
group sa by new { sa.CustomerPartCodeNoSpace } into groupItem |
|
|
|
select new |
|
|
|
{ |
|
|
@ -293,6 +315,18 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
SettleDate = groupItem.Max(t => t.SettleDate), |
|
|
|
PartCode = groupItem.Max(t => t.PartCode) |
|
|
|
}; |
|
|
|
var saGroupByMappingType = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>() |
|
|
|
where sa.BusinessType == EnumBusinessType.YinDuJian && sa.MappingType == EnumMappingType.None |
|
|
|
group sa by new { sa.CustomerPartCodeNoSpace } into groupItem |
|
|
|
select new |
|
|
|
{ |
|
|
|
groupItem.Key.CustomerPartCodeNoSpace, |
|
|
|
Qty = groupItem.Sum(t => t.Qty), |
|
|
|
Version = groupItem.Max(t => t.Version), |
|
|
|
LU = groupItem.Max(t => t.LU), |
|
|
|
SettleDate = groupItem.Max(t => t.SettleDate), |
|
|
|
PartCode = groupItem.Max(t => t.PartCode) |
|
|
|
}; |
|
|
|
var saGroupByVersion = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>() |
|
|
|
where sa.BusinessType == EnumBusinessType.YinDuJian && sa.Version == version |
|
|
|
group sa by new { sa.CustomerPartCodeNoSpace } into groupItem |
|
|
@ -322,7 +356,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
}; |
|
|
|
|
|
|
|
//有结算无发运
|
|
|
|
var haveSaNotHaveSeList = (from sa in saGroup |
|
|
|
var haveSaNotHaveSeList = (from sa in saGroupByMappingType |
|
|
|
join se in seGroup |
|
|
|
on sa.CustomerPartCodeNoSpace equals se.CustomerPartCodeNoSpace |
|
|
|
into temp |
|
|
|