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