Browse Source

直供件BBAC、HBPO、备件、印度件对比报表字段

master
mahao 1 year ago
parent
commit
3980985c43
  1. 682
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
  2. 13
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs
  3. 44
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs

682
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs

@ -144,6 +144,185 @@ public class PubSaSeCompareDetailExport
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
///// <summary>
///// Wms发货单号
///// </summary>
//[Display(Name = "Wms发货单号")]
//[ExporterHeader(DisplayName = "交货单号")]
//public string WmsBillNum { get; set; }
///// <summary>
///// 发货日期
///// </summary>
//[Display(Name = "发货日期")]
//[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
//public DateTime ShippingDate { get; set; }
///// <summary>
///// 生产码
///// </summary>
//[Display(Name = "生产码")]
//[ExporterHeader(DisplayName = "ASN发货单号")]
//public string PN { get; set; }
///// <summary>
///// 物料号
///// </summary>
//[Display(Name = "物料号")]
//[ExporterHeader(DisplayName = "厂内物料号")]
//public string MaterialNumber { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; }
///// <summary>
///// 原始LU
///// </summary>
//[Display(Name = "原始LU")]
//[ExporterHeader(DisplayName = "原始LU")]
//public string PrimitiveLU { get; set; }
/// <summary>
///替换LU
/// </summary>
[Display(Name = "替换LU")]
[ExporterHeader(DisplayName = "替换LU")]
public string ReplaceLU { get; set; }
///// <summary>
///// 结算数据中的过账日期
///// </summary>
//[Display(Name = "客户下线时间")]
//[ExporterHeader(DisplayName = "客户下线时间")]
//public DateTime CustomerOfflineTime { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; }
///// <summary>
///// 差异数量
///// </summary>
//[ExporterHeader(DisplayName = "差异数量")]
//public decimal DiffQty { set; get; }
///// <summary>
///// 匹配类型
///// </summary>
//[Display(Name = "匹配类型")]
//[ExporterHeader(DisplayName = "是否完全匹配")]
//public string MateType { get; set; }
///// <summary>
///// 定价
///// </summary>
//[Display(Name = "定价")]
//[ExporterHeader(DisplayName = "定价")]
//public decimal FixPrice { get; set; }
///// <summary>
///// 日顺序号
///// </summary>
//[Display(Name = "日顺序号")]
//[ExporterHeader(DisplayName = "日顺序号")]
//public string SeqNumber { get; set; }
///// <summary>
///// PJIS日顺序号
///// </summary>
//[Display(Name = "PJIS日顺序号")]
//[ExporterHeader(DisplayName = "PJIS日顺序号")]
//public string PJISSeqNumber { get; set; }
///// <summary>
///// WMS目标库位
///// </summary>
//[Display(Name = "WMS目标库位")]
//[ExporterHeader(DisplayName = "WMS目标库位")]
//public string ToLocCode { get; set; }
///// <summary>
///// ERP目标库位
///// </summary>
//[Display(Name = "ERP目标库位")]
//[ExporterHeader(DisplayName = "ERP目标库位")]
//public string ToErpLocCode { get; set; }
}
/// <summary>
/// PUB结算与发运对比汇总
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareSumExport
{
/// <summary>
/// LU
/// </summary>
[Display(Name = "LU")]
[ExporterHeader(DisplayName = "LU")]
public string LU { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; }
/// <summary>
/// 差异数量
/// </summary>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty => SAQty - SEQty;
}
/// <summary>
/// 直供件BBAC结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExport
{
/// <summary>
/// 类别
/// 有结算有发运
/// 有结算无发运
/// 无结算有发运
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// Wms发货单号
/// </summary>
@ -152,7 +331,7 @@ public class PubSaSeCompareDetailExport
public string WmsBillNum { get; set; }
/// <summary>
///
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
@ -235,32 +414,66 @@ public class PubSaSeCompareDetailExport
public decimal FixPrice { get; set; }
/// <summary>
/// 日顺序号
/// WMS目标库位
/// </summary>
[Display(Name = "日顺序号")]
[ExporterHeader(DisplayName = "日顺序号")]
public string SeqNumber { get; set; }
[Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// PJIS日顺序号
/// ERP目标库位
/// </summary>
[Display(Name = "PJIS日顺序号")]
[ExporterHeader(DisplayName = "PJIS日顺序号")]
public string PJISSeqNumber { get; set; }
[Display(Name = "ERP目标库位")]
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ToErpLocCode { get; set; }
}
/// <summary>
/// PUB结算与发运对比汇总
/// 直供件HBPO结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareSumExport
public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExport
{
/// <summary>
/// LU
/// 类别
/// 有结算有发运
/// 有结算无发运
/// 无结算有发运
/// </summary>
[Display(Name = "LU")]
[ExporterHeader(DisplayName = "LU")]
public string LU { get; set; }
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "ASN发货单号")]
public string PN { get; set; }
/// <summary>
/// 物料号
/// </summary>
[Display(Name = "物料号")]
[ExporterHeader(DisplayName = "厂内物料号")]
public string MaterialNumber { get; set; }
/// <summary>
/// 物料描述
@ -269,6 +482,27 @@ public class PubSaSeCompareSumExport
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; }
/// <summary>
/// 原始LU
/// </summary>
[Display(Name = "原始LU")]
[ExporterHeader(DisplayName = "原始LU")]
public string PrimitiveLU { get; set; }
/// <summary>
///替换LU
/// </summary>
[Display(Name = "替换LU")]
[ExporterHeader(DisplayName = "替换LU")]
public string ReplaceLU { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime CustomerOfflineTime { get; set; }
/// <summary>
/// 结算数量
/// </summary>
@ -287,23 +521,35 @@ public class PubSaSeCompareSumExport
/// 差异数量
/// </summary>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty => SAQty - SEQty;
}
public decimal DiffQty { set; get; }
/// <summary>
/// 直供件BBAC结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExport
{
}
/// <summary>
/// 匹配类型
/// </summary>
[Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")]
public string MateType { get; set; }
/// <summary>
/// 直供件HBPO结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExport
{
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价")]
public decimal FixPrice { get; set; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ToErpLocCode { get; set; }
}
/// <summary>
@ -312,20 +558,368 @@ public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExp
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExport
{
}
/// <summary>
/// 类别
/// 有结算有发运
/// 有结算无发运
/// 无结算有发运
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// 备件结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport
{
}
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 印度件结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport
{
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "索引号")]
public string PN { get; set; }
/// <summary>
/// 物料号
/// </summary>
[Display(Name = "物料号")]
[ExporterHeader(DisplayName = "厂内物料号")]
public string MaterialNumber { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; }
/// <summary>
/// 原始LU
/// </summary>
[Display(Name = "原始LU")]
[ExporterHeader(DisplayName = "原始LU")]
public string PrimitiveLU { get; set; }
/// <summary>
///替换LU
/// </summary>
[Display(Name = "替换LU")]
[ExporterHeader(DisplayName = "替换LU")]
public string ReplaceLU { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime CustomerOfflineTime { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; }
/// <summary>
/// 差异数量
/// </summary>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; }
/// <summary>
/// 匹配类型
/// </summary>
[Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")]
public string MateType { get; set; }
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价")]
public decimal FixPrice { get; set; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ToErpLocCode { get; set; }
}
/// <summary>
/// 备件结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport
{
/// <summary>
/// 类别
/// 有结算有发运
/// 有结算无发运
/// 无结算有发运
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "索引号")]
public string PN { get; set; }
/// <summary>
/// 物料号
/// </summary>
[Display(Name = "物料号")]
[ExporterHeader(DisplayName = "厂内物料号")]
public string MaterialNumber { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; }
/// <summary>
/// 原始LU
/// </summary>
[Display(Name = "原始LU")]
[ExporterHeader(DisplayName = "原始LU")]
public string PrimitiveLU { get; set; }
/// <summary>
///替换LU
/// </summary>
[Display(Name = "替换LU")]
[ExporterHeader(DisplayName = "替换LU")]
public string ReplaceLU { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime CustomerOfflineTime { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; }
/// <summary>
/// 差异数量
/// </summary>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; }
/// <summary>
/// 匹配类型
/// </summary>
[Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")]
public string MateType { get; set; }
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价")]
public decimal FixPrice { get; set; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ToErpLocCode { get; set; }
}
/// <summary>
/// 印度件结算与发运对比明细
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport
{
/// <summary>
/// 类别
/// 有结算有发运
/// 有结算无发运
/// 无结算有发运
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary>
/// Wms发货单号
/// </summary>
[Display(Name = "Wms发货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "ASN发货单号")]
public string PN { get; set; }
/// <summary>
/// 物料号
/// </summary>
[Display(Name = "物料号")]
[ExporterHeader(DisplayName = "厂内物料号")]
public string MaterialNumber { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; }
/// <summary>
/// 原始LU
/// </summary>
[Display(Name = "原始LU")]
[ExporterHeader(DisplayName = "原始LU")]
public string PrimitiveLU { get; set; }
/// <summary>
///替换LU
/// </summary>
[Display(Name = "替换LU")]
[ExporterHeader(DisplayName = "替换LU")]
public string ReplaceLU { get; set; }
/// <summary>
/// 结算数据中的过账日期
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime CustomerOfflineTime { get; set; }
/// <summary>
/// 结算数量
/// </summary>
[Display(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal SAQty { get; set; }
/// <summary>
/// 发货数量
/// </summary>
[Display(Name = "发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; }
/// <summary>
/// 差异数量
/// </summary>
[ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty { set; get; }
/// <summary>
/// 匹配类型
/// </summary>
[Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")]
public string MateType { get; set; }
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价")]
public decimal FixPrice { get; set; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "WMS目标库位")]
public string ToLocCode { get; set; }
/// <summary>
/// ERP目标库位
/// </summary>
[Display(Name = "ERP目标库位")]
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ToErpLocCode { get; set; }
}

13
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs

@ -37,23 +37,20 @@ public class PubSaSeCompareDapperRepository : DapperRepository<SettleAccountDbCo
SELECT
A.WmsBillNum,
A.ShippingDate,
'' SeqNumber,
'' PJISSeqNumber,
'' MaterialNumber,
A.PartCode AS MaterialNumber,
'' MaterialDes,
B.SettleDate CustomerOfflineTime,
'' AssemblyCode,
'' InjectionCode,
A.LU SeLU,
B.LU SaLU,
ISNULL(A.PN,B.PN) PN,
A.SEQty,
B.SAQty,
(B.SAQty-A.SEQty) DiffQty,
'' MateType,
B.Price FixPrice
B.Price FixPrice,
A.ToLocCode,
A.ToErpLocCode
FROM
(SELECT SUM(QTY) SEQty,LU,PN,MAX(WmsBillNum) WmsBillNum,MAX(ShippingDate) ShippingDate FROM Set_PUB_SE_DETAIL WHERE BusinessType = {businessType} {strSeWhere} GROUP BY LU,PN) A
(SELECT SUM(QTY) SEQty,LU,PN,MAX(WmsBillNum) WmsBillNum,MAX(ShippingDate) ShippingDate,MAX(PartCode) PartCode, MAX(ToLocCode) ToLocCode, MAX(ToErpLocCode) ToErpLocCode FROM Set_PUB_SE_DETAIL WHERE BusinessType = {businessType} {strSeWhere} GROUP BY LU,PN) A
FULL JOIN (SELECT SUM(QTY) SAQty,LU,PN,MAX(Price) Price,MAX(SettleDate) SettleDate FROM Set_PUB_SA_DETAIL WHERE BusinessType = {businessType} AND Version = {version} GROUP BY LU,PN) B ON A.LU= B.LU AND A.PN= B.PN
ORDER BY B.SettleDate DESC;
";

44
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs

@ -199,48 +199,9 @@ namespace SettleAccount.Job.Services.Report
}
var pubSaSeCompareDetailExports = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExport>>(pubSaSeCompareDiffs);
//结算核对汇总
var pubSaSeCompareSumExports = pubSaSeCompareDetailExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport()
{
LU = p.Key,
MaterialDes = p.FirstOrDefault().MaterialDes,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
//有结算有发运
var haveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe);
//有结算有发运汇总
var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport()
{
LU = p.Key,
MaterialDes = p.FirstOrDefault().MaterialDes,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
//有结算无发运
var haveSaNotHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe);
//有结算无发运
var haveSaNotHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport()
{
LU = p.Key,
MaterialDes = p.FirstOrDefault().MaterialDes,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
//无结算有发运
var notHaveSaHaveSeExports = pubSaSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe);
//无结算有发运
var notHaveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceLU).Select(p => new PubSaSeCompareSumExport()
{
LU = p.Key,
MaterialDes = p.FirstOrDefault().MaterialDes,
SAQty = p.Sum(t => t.SAQty),
SEQty = p.Sum(t => t.SEQty)
}).ToList();
ExcelExporter excelExporter = new ExcelExporter();
var excelExporter = new ExcelExporter();
#region 根据业务分类转换不同导出Dto
switch (businessType)
{
case EnumBusinessType.ZhiGongJianBBAC:
@ -278,6 +239,7 @@ namespace SettleAccount.Job.Services.Report
default:
break;
}
#endregion
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();

Loading…
Cancel
Save