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)] [ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; } 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> /// <summary>
/// Wms发货单号 /// Wms发货单号
/// </summary> /// </summary>
@ -152,7 +331,7 @@ public class PubSaSeCompareDetailExport
public string WmsBillNum { get; set; } public string WmsBillNum { get; set; }
/// <summary> /// <summary>
/// /// 发货日期
/// </summary> /// </summary>
[Display(Name = "发货日期")] [Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
@ -235,32 +414,66 @@ public class PubSaSeCompareDetailExport
public decimal FixPrice { get; set; } public decimal FixPrice { get; set; }
/// <summary> /// <summary>
/// 日顺序号 /// WMS目标库位
/// </summary> /// </summary>
[Display(Name = "日顺序号")] [Display(Name = "WMS目标库位")]
[ExporterHeader(DisplayName = "日顺序号")] [ExporterHeader(DisplayName = "WMS目标库位")]
public string SeqNumber { get; set; } public string ToLocCode { get; set; }
/// <summary> /// <summary>
/// PJIS日顺序号 /// ERP目标库位
/// </summary> /// </summary>
[Display(Name = "PJIS日顺序号")] [Display(Name = "ERP目标库位")]
[ExporterHeader(DisplayName = "PJIS日顺序号")] [ExporterHeader(DisplayName = "ERP目标库位")]
public string PJISSeqNumber { get; set; } public string ToErpLocCode { get; set; }
} }
/// <summary> /// <summary>
/// PUB结算与发运对比汇总 /// 直供件HBPO结算与发运对比明细
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareSumExport public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExport
{ {
/// <summary> /// <summary>
/// LU /// 类别
/// 有结算有发运
/// 有结算无发运
/// 无结算有发运
/// </summary> /// </summary>
[Display(Name = "LU")] [Display(Name = "类别")]
[ExporterHeader(DisplayName = "LU")] [ExporterHeader(DisplayName = "类别")]
public string LU { get; set; } [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>
/// 物料描述 /// 物料描述
@ -269,6 +482,27 @@ public class PubSaSeCompareSumExport
[ExporterHeader(DisplayName = "物料描述")] [ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; } 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>
/// 结算数量 /// 结算数量
/// </summary> /// </summary>
@ -287,23 +521,35 @@ public class PubSaSeCompareSumExport
/// 差异数量 /// 差异数量
/// </summary> /// </summary>
[ExporterHeader(DisplayName = "差异数量")] [ExporterHeader(DisplayName = "差异数量")]
public decimal DiffQty => SAQty - SEQty; public decimal DiffQty { set; get; }
}
/// <summary> /// <summary>
/// 直供件BBAC结算与发运对比明细 /// 匹配类型
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [Display(Name = "匹配类型")]
public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExport [ExporterHeader(DisplayName = "是否完全匹配")]
{ public string MateType { get; set; }
}
/// <summary> /// <summary>
/// 直供件HBPO结算与发运对比明细 /// 定价
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [Display(Name = "定价")]
public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExport [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>
@ -312,20 +558,368 @@ public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExp
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExport public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExport
{ {
} /// <summary>
/// 类别
/// 有结算有发运
/// 有结算无发运
/// 无结算有发运
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
[ValueMapping("有结算有发运", 1)]
[ValueMapping("有结算无发运", 2)]
[ValueMapping("无结算有发运", 3)]
public EnumPubSaSeCompareCategory Category { get; set; }
/// <summary> /// <summary>
/// 备件结算与发运对比明细 /// Wms发货单号
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [Display(Name = "Wms发货单号")]
public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport [ExporterHeader(DisplayName = "交货单号")]
{ public string WmsBillNum { get; set; }
}
/// <summary> /// <summary>
/// 印度件结算与发运对比明细 /// 发货日期
/// </summary> /// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 900000)] [Display(Name = "发货日期")]
public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport [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 SELECT
A.WmsBillNum, A.WmsBillNum,
A.ShippingDate, A.ShippingDate,
'' SeqNumber, A.PartCode AS MaterialNumber,
'' PJISSeqNumber,
'' MaterialNumber,
'' MaterialDes, '' MaterialDes,
B.SettleDate CustomerOfflineTime, B.SettleDate CustomerOfflineTime,
'' AssemblyCode,
'' InjectionCode,
A.LU SeLU, A.LU SeLU,
B.LU SaLU, B.LU SaLU,
ISNULL(A.PN,B.PN) PN, ISNULL(A.PN,B.PN) PN,
A.SEQty, A.SEQty,
B.SAQty, B.SAQty,
(B.SAQty-A.SEQty) DiffQty, (B.SAQty-A.SEQty) DiffQty,
'' MateType, B.Price FixPrice,
B.Price FixPrice A.ToLocCode,
A.ToErpLocCode
FROM 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 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; 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 pubSaSeCompareDetailExports = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExport>>(pubSaSeCompareDiffs);
//结算核对汇总 var excelExporter = new ExcelExporter();
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();
#region 根据业务分类转换不同导出Dto
switch (businessType) switch (businessType)
{ {
case EnumBusinessType.ZhiGongJianBBAC: case EnumBusinessType.ZhiGongJianBBAC:
@ -278,6 +239,7 @@ namespace SettleAccount.Job.Services.Report
default: default:
break; break;
} }
#endregion
var result = excelExporter.ExportAppendDataAsByteArray(); var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull(); result.ShouldNotBeNull();

Loading…
Cancel
Save