diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs index c73388c1..da8c89b1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs @@ -90,11 +90,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public async Task TextExportAsync() { var fileName = $"发运数据_{Guid.NewGuid()}.xlsx"; - var haveEdiHaveSeList = new List(); + var haveEdiHaveSeList = new List(); for (int i = 0; i < 2_000_000; i++) { - haveEdiHaveSeList.Add(new JisBBACSeEidCompareReport() + haveEdiHaveSeList.Add(new SeEidCompareReportJisBBAC() { Category = "JIS", WmsBillNum = i.ToString(), @@ -119,7 +119,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ }); } - var jisBBACEidSeCompareEexcelExporterAttribute = typeof(JisBBACSeEidCompareReport).GetAttribute(); + var jisBBACEidSeCompareEexcelExporterAttribute = typeof(SeEidCompareReportJisBBAC).GetAttribute(); var jisBBACEidSeCompareEexcelMaxRowNumberOnASheet = 9_000_000; if (jisBBACEidSeCompareEexcelExporterAttribute != null) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index 238be6be..b6b67cda 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -95,6 +95,11 @@ public class PriceListAppService : SettleAccountApplicationBase { checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"导入文件中物料号:{item},时间区间存在交集", string.Empty)); } + + foreach (var item in CheckPriceListContinuity(newPrice)) + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"导入文件中物料号:{item.LU},时间区间【{item.BeginTime}至{item.EndTime}】不连续", string.Empty)); + } } if (checkList.Count > 0) { @@ -139,6 +144,29 @@ public class PriceListAppService : SettleAccountApplicationBase return new JsonResult(new { Code = 200, Message = "导入成功" }); } + /// + /// 价格表时间是否连续 + /// + private List CheckPriceListContinuity(List priceList) + { + var pricelist = new List(); + if (priceList.Count <= 1) + { + return priceList; // 只有一个或零个价格条目 + } + + var sortedList = priceList.OrderBy(t => t.LU).ThenBy(t => t.BeginTime).ToList(); + for (var i = 1; i < sortedList.Count; i++) + { + if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginTime != sortedList[i - 1].EndTime.AddDays(1)) + { + priceList.Add(sortedList[i]); + } + } + + return priceList; // 所有价格时间都连续 + } + /// /// 导出 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs index 408ce3bc..1b65a9d7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs @@ -78,6 +78,11 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase { checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"导入文件中物料号:{item},时间区间存在交集", string.Empty)); } + + foreach (var item in CheckPriceListContinuity(newPrice)) + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"导入文件中物料号:{item.LU},时间区间【{item.BeginDate}至{item.EndDate}】不连续", string.Empty)); + } } if (checkList.Count > 0) { @@ -123,6 +128,29 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase } + /// + /// 价格表时间是否连续 + /// + private List CheckPriceListContinuity(List priceList) + { + var pricelist = new List(); + if (priceList.Count <= 1) + { + return priceList; // 只有一个或零个价格条目 + } + + var sortedList = priceList.OrderBy(t => t.LU).ThenBy(t => t.BeginDate).ToList(); + for (var i = 1; i < sortedList.Count; i++) + { + if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginDate != sortedList[i - 1].EndDate.AddDays(1)) + { + priceList.Add(sortedList[i]); + } + } + + return priceList; // 所有价格时间都连续 + } + /// /// 导出 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Consts/AppConst.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Consts/AppConst.cs index 0f35ea25..e28fafae 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Consts/AppConst.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Consts/AppConst.cs @@ -9,4 +9,8 @@ public static class AppConst /// 单页Sheet默认行数 /// public const int DefaultRowNumberOnASheet = 500_000; + /// + /// Db最大获取数量 + /// + public const int DefaultPageSizeOnDb = 10_000; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs index 4a3e7adc..46309f62 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs @@ -16,5 +16,10 @@ public enum EnumMappingType /// 完全匹配 /// [Display(Name = "完全匹配")] - PerfectMatch = 1 + PerfectMatch = 1, + /// + /// 部分匹配 + /// + [Display(Name = "部分匹配")] + PartialMatch = 2 } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs deleted file mode 100644 index 73ca86fc..00000000 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs +++ /dev/null @@ -1,829 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using Win.Sfs.SettleAccount.Enums; - -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// PUB结算与发运对比 -/// -public class PubSaSeCompareDiff -{ - /// - /// 期间 - /// - [Display(Name = "期间")] - public int Version { get; set; } - /// - /// Wms发货单号 - /// - [Display(Name = "Wms发货单号")] - public string WmsBillNum { get; set; } - /// - /// 发货日期 - /// - [Display(Name = "发货日期")] - public DateTime? ShippingDate { get; set; } - /// - /// 日顺序号 - /// - [Display(Name = "日顺序号")] - public string SeqNumber { get; set; } - /// - /// PJIS日顺序号 - /// - [Display(Name = "PJIS日顺序号")] - public string PJISSeqNumber { get; set; } - /// - /// 结算数据中的过账日期 - /// - [Display(Name = "客户下线时间")] - public DateTime? CustomerOfflineTime { get; set; } - /// - /// 结算数量 - /// - [Display(Name = "结算数量")] - public decimal? SAQty { get; set; } - /// - /// 发货数量 - /// - [Display(Name = "发货数量")] - public decimal? SEQty { get; set; } - /// - /// 生产号 - /// - [Display(Name = "生产号")] - public string PN { set; get; } - /// - /// 客户物料号 - /// - [Display(Name = "客户物料号")] - public string LU { set; get; } - /// - /// WMS目标库位 - /// - [Display(Name = "WMS目标库位")] - public string ToLocCode { get; set; } - /// - /// ERP目标库位 - /// - [Display(Name = "ERP目标库位")] - public string ToErpLocCode { get; set; } - /// - /// 类型 - /// - [Display(Name = "类型")] - public EnumPubSaSeCompareCategory Category { get; set; } - /// - /// 发运客户物料号 - /// - public string SeCustomerPartCode { get; set; } - /// - /// 发运厂内物料号 - /// - public string SeFactoryPartCode { get; set; } - /// - /// 结算客户物料号 - /// - public string SaCustomerPartCode { get; set; } - /// - /// 结算厂内物料号 - /// - public string SaFactoryPartCode { get; set; } - /// - /// 客户物料号 - /// - [Display(Name = "客户物料号")] - public string CustomerPartCode { get; set; } - /// - /// 物料描述 - /// - [Display(Name = "物料描述")] - public string PartCodeDesc { get; set; } - /// - /// 厂内物料号 - /// - [Display(Name = "厂内物料号")] - public string FactoryPartCode { get; set; } - /// - /// 替换厂内物料号 - /// - [Display(Name = "替换厂内物料号")] - public string ReplaceFactoryPartCode { get; set; } - /// - /// 是否已经移除 - /// - public bool IsRemove { get; set; } -} - -/// -/// PUB结算与发运对比明细 -/// -[ExcelExporter(MaxRowNumberOnASheet = 900000)] -public class PubSaSeCompareDetailExport -{ -} - -/// -/// PUB结算与发运对比明细 -/// -public interface IPubSaSeCompareDetailExport -{ - /// - /// 类别 - /// - [Display(Name = "类别")] - [ExporterHeader(DisplayName = "类别")] - [ValueMapping("有结算有发运", 1)] - [ValueMapping("有结算无发运", 2)] - [ValueMapping("无结算有发运", 3)] - public EnumPubSaSeCompareCategory Category { get; set; } - /// - /// 零件描述 - /// - [Display(Name = "零件描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string PartCodeDesc { get; set; } - /// - /// 替换厂内零件号 - /// - [Display(Name = "替换厂内零件号")] - [ExporterHeader(DisplayName = "替换厂内零件号")] - public string ReplaceFactoryPartCode { get; set; } - /// - /// 结算数量 - /// - [Display(Name = "结算数量")] - [ExporterHeader(DisplayName = "结算数量")] - public decimal SAQty { get; set; } - - /// - /// 发货数量 - /// - [Display(Name = "发货数量")] - [ExporterHeader(DisplayName = "WMS发货数量")] - public decimal SEQty { get; set; } -} - -/// -/// PUB结算与发运对比汇总 -/// -[ExcelExporter(MaxRowNumberOnASheet = 900000)] -public class PubSaSeCompareSumExport -{ - /// - /// 厂内物料号 - /// - [Display(Name = "厂内物料号")] - [ExporterHeader(DisplayName = "LU")] - public string FactoryPartCode { get; set; } - - /// - /// 物料描述 - /// - [Display(Name = "物料描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string PartCodeDesc { 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, IPubSaSeCompareDetailExport -{ - /// - /// 类别 - /// - [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 CustomerPartCode { get; set; } - /// - /// 零件描述 - /// - [Display(Name = "零件描述")] - [ExporterHeader(DisplayName = "零件描述")] - public string PartCodeDesc { get; set; } - /// - /// 厂内零件号 - /// - [Display(Name = "厂内零件号")] - [ExporterHeader(DisplayName = "厂内零件号")] - public string FactoryPartCode { get; set; } - /// - /// 替换厂内零件号 - /// - [Display(Name = "替换厂内零件号")] - [ExporterHeader(DisplayName = "替换厂内零件号")] - public string ReplaceFactoryPartCode { 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 => SAQty - SEQty; - /// - /// 匹配类型 - /// - [Display(Name = "匹配类型")] - [ExporterHeader(DisplayName = "是否完全匹配")] - [ValueMapping("是", true)] - [ValueMapping("否", false)] - public bool MateType => DiffQty == 0; - /// - /// WMS目标库位 - /// - [Display(Name = "WMS目标库位")] - [ExporterHeader(DisplayName = "WMS目标库位")] - public string ToLocCode { get; set; } - /// - /// ERP目标库位 - /// - [Display(Name = "ERP目标库位")] - [ExporterHeader(DisplayName = "ERP目标库位")] - public string ToErpLocCode { get; set; } -} - - -/// -/// 直供件HBPO结算与发运对比明细 -/// -[ExcelExporter(MaxRowNumberOnASheet = 900000)] -public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport -{ - /// - /// 类别 - /// - [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 CustomerPartCode { get; set; } - /// - /// 零件描述 - /// - [Display(Name = "零件描述")] - [ExporterHeader(DisplayName = "零件描述")] - public string PartCodeDesc { get; set; } - /// - /// 厂内零件号 - /// - [Display(Name = "厂内零件号")] - [ExporterHeader(DisplayName = "厂内零件号")] - public string FactoryPartCode { get; set; } - /// - /// 替换厂内零件号 - /// - [Display(Name = "替换厂内零件号")] - [ExporterHeader(DisplayName = "替换厂内零件号")] - public string ReplaceFactoryPartCode { 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 => SAQty - SEQty; - /// - /// 匹配类型 - /// - [Display(Name = "匹配类型")] - [ExporterHeader(DisplayName = "是否完全匹配")] - [ValueMapping("是", true)] - [ValueMapping("否", false)] - public bool MateType => DiffQty == 0; - /// - /// WMS目标库位 - /// - [Display(Name = "WMS目标库位")] - [ExporterHeader(DisplayName = "WMS目标库位")] - public string ToLocCode { get; set; } - /// - /// ERP目标库位 - /// - [Display(Name = "ERP目标库位")] - [ExporterHeader(DisplayName = "ERP目标库位")] - public string ToErpLocCode { get; set; } -} - -/// -/// 买单件BBAC结算与发运对比明细 -/// -[ExcelExporter(MaxRowNumberOnASheet = 900000)] -public class PubSaSeCompareDetailExportMaiDanJianBBAC : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport -{ - /// - /// 类别 - /// - [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 CustomerPartCode { get; set; } - /// - /// 零件描述 - /// - [Display(Name = "零件描述")] - [ExporterHeader(DisplayName = "零件描述")] - public string PartCodeDesc { get; set; } - /// - /// 厂内零件号 - /// - [Display(Name = "厂内零件号")] - [ExporterHeader(DisplayName = "厂内零件号")] - public string FactoryPartCode { get; set; } - /// - /// 替换厂内零件号 - /// - [Display(Name = "替换厂内零件号")] - [ExporterHeader(DisplayName = "替换厂内零件号")] - public string ReplaceFactoryPartCode { 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 => SAQty - SEQty; - /// - /// 匹配类型 - /// - [Display(Name = "匹配类型")] - [ExporterHeader(DisplayName = "是否完全匹配")] - [ValueMapping("是", true)] - [ValueMapping("否", false)] - public bool MateType => DiffQty == 0; - /// - /// WMS目标库位 - /// - [Display(Name = "WMS目标库位")] - [ExporterHeader(DisplayName = "WMS目标库位")] - public string ToLocCode { get; set; } - /// - /// ERP目标库位 - /// - [Display(Name = "ERP目标库位")] - [ExporterHeader(DisplayName = "ERP目标库位")] - public string ToErpLocCode { get; set; } -} - -/// -/// 买单件HBPO结算与发运对比明细 -/// -[ExcelExporter(MaxRowNumberOnASheet = 900000)] -public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport -{ - /// - /// 类别 - /// - [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 CustomerPartCode { get; set; } - /// - /// 零件描述 - /// - [Display(Name = "零件描述")] - [ExporterHeader(DisplayName = "零件描述")] - public string PartCodeDesc { get; set; } - /// - /// 厂内零件号 - /// - [Display(Name = "厂内零件号")] - [ExporterHeader(DisplayName = "厂内零件号")] - public string FactoryPartCode { get; set; } - /// - /// 替换厂内零件号 - /// - [Display(Name = "替换厂内零件号")] - [ExporterHeader(DisplayName = "替换厂内零件号")] - public string ReplaceFactoryPartCode { 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 => SAQty - SEQty; - /// - /// 匹配类型 - /// - [Display(Name = "匹配类型")] - [ExporterHeader(DisplayName = "是否完全匹配")] - [ValueMapping("是", true)] - [ValueMapping("否", false)] - public bool MateType => DiffQty == 0; - /// - /// 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, IPubSaSeCompareDetailExport -{ - /// - /// 类别 - /// - [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 CustomerPartCode { get; set; } - /// - /// 零件描述 - /// - [Display(Name = "零件描述")] - [ExporterHeader(DisplayName = "零件描述")] - public string PartCodeDesc { get; set; } - /// - /// 厂内零件号 - /// - [Display(Name = "厂内零件号")] - [ExporterHeader(DisplayName = "厂内零件号")] - public string FactoryPartCode { get; set; } - /// - /// 替换厂内零件号 - /// - [Display(Name = "替换厂内零件号")] - [ExporterHeader(DisplayName = "替换厂内零件号")] - public string ReplaceFactoryPartCode { 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 => SAQty - SEQty; - /// - /// 匹配类型 - /// - [Display(Name = "匹配类型")] - [ExporterHeader(DisplayName = "是否完全匹配")] - [ValueMapping("是", true)] - [ValueMapping("否", false)] - public bool MateType => DiffQty == 0; - /// - /// 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, IPubSaSeCompareDetailExport -{ - /// - /// 类别 - /// - [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 CustomerPartCode { get; set; } - /// - /// 物料描述 - /// - [Display(Name = "物料描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string PartCodeDesc { get; set; } - /// - /// 厂内物料号 - /// - [Display(Name = "厂内物料号")] - [ExporterHeader(DisplayName = "厂内物料号")] - public string FactoryPartCode { get; set; } - /// - /// 替换厂内物料号 - /// - [Display(Name = "替换厂内物料号")] - [ExporterHeader(DisplayName = "替换厂内物料号")] - public string ReplaceFactoryPartCode { 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 => SAQty - SEQty; - /// - /// 匹配类型 - /// - [Display(Name = "匹配类型")] - [ExporterHeader(DisplayName = "是否完全匹配")] - [ValueMapping("是", true)] - [ValueMapping("否", false)] - public bool MateType => DiffQty == 0; - /// - /// 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.Domain/Reports/SaSeCompareDetailReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReport.cs new file mode 100644 index 00000000..78f5b1ab --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReport.cs @@ -0,0 +1,116 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; +using Win.Sfs.SettleAccount.Enums; + +namespace Win.Sfs.SettleAccount.Reports; + +/// +/// 结算、发运明细对比报告 +/// +[ExcelExporter(MaxRowNumberOnASheet = 500_000)] +public class SaSeCompareDetailReport +{ + /// + /// 类别 + /// + [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 virtual string PN { get; set; } + /// + /// 客户零件号 + /// + [Display(Name = "客户零件号")] + [ExporterHeader(DisplayName = "客户零件号")] + public string CustomerPartCode { get; set; } + /// + /// 零件描述 + /// + [Display(Name = "零件描述")] + [ExporterHeader(DisplayName = "零件描述")] + public string PartCodeDesc { get; set; } + /// + /// 厂内零件号 + /// + [Display(Name = "厂内零件号")] + [ExporterHeader(DisplayName = "厂内零件号")] + public string FactoryPartCode { get; set; } + /// + /// 替换厂内零件号 + /// + [Display(Name = "替换厂内零件号")] + [ExporterHeader(DisplayName = "替换厂内零件号")] + public string ReplaceFactoryPartCode { get; set; } + /// + /// 结算数据中的过账日期 + /// + [Display(Name = "客户下线时间")] + [ExporterHeader(DisplayName = "客户下线时间", Format = "yyyy-MM-dd")] + 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 => SAQty - SEQty; + /// + /// 匹配类型 + /// + [Display(Name = "匹配类型")] + [ExporterHeader(DisplayName = "是否完全匹配")] + [ValueMapping("是", true)] + [ValueMapping("否", false)] + public bool MateType => DiffQty == 0; + /// + /// WMS目标库位 + /// + [Display(Name = "WMS目标库位")] + [ExporterHeader(DisplayName = "WMS目标库位")] + public string ToLocCode { get; set; } + /// + /// ERP目标库位 + /// + [Display(Name = "ERP目标库位")] + [ExporterHeader(DisplayName = "ERP目标库位")] + public string ToErpLocCode { get; set; } + /// + /// 是否是当期 + /// + [Display(Name = "当期")] + [ValueMapping("当期数据", true)] + [ValueMapping("", false)] + public bool IsCurrent { get; set; } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportBeiJian.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportBeiJian.cs new file mode 100644 index 00000000..f0d5d465 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportBeiJian.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; + +namespace Win.Sfs.SettleAccount.Reports; + +/// +/// 备件结算与发运对比明细 +/// +[ExcelExporter(MaxRowNumberOnASheet = 500_000)] +public class SaSeCompareDetailReportBeiJian : SaSeCompareDetailReport +{ + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "索引号")] + public override string PN { get; set; } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianBBAC.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianBBAC.cs new file mode 100644 index 00000000..324ebf0b --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianBBAC.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; + +namespace Win.Sfs.SettleAccount.Reports; + +/// +/// 买单件BBAC结算与发运对比明细 +/// +[ExcelExporter(MaxRowNumberOnASheet = 500_000)] +public class SaSeCompareDetailReportMaiDanJianBBAC : SaSeCompareDetailReport +{ + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "索引号")] + public override string PN { get; set; } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianHBPO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianHBPO.cs new file mode 100644 index 00000000..48eef19f --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianHBPO.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; + +namespace Win.Sfs.SettleAccount.Reports; + +/// +/// 买单件HBPO结算与发运对比明细 +/// +[ExcelExporter(MaxRowNumberOnASheet = 500_000)] +public class SaSeCompareDetailReportMaiDanJianHBPO : SaSeCompareDetailReport +{ + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "索引号")] + public override string PN { get; set; } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportYinDuJian.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportYinDuJian.cs new file mode 100644 index 00000000..4e322a30 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportYinDuJian.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; + +namespace Win.Sfs.SettleAccount.Reports; + +/// +/// 印度件结算与发运对比明细 +/// +[ExcelExporter(MaxRowNumberOnASheet = 500_000)] +public class SaSeCompareDetailReportYinDuJian : SaSeCompareDetailReport +{ + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "ASN发货单号")] + public override string PN { get; set; } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianBBAC.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianBBAC.cs new file mode 100644 index 00000000..6b24cb59 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianBBAC.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; + +namespace Win.Sfs.SettleAccount.Reports; + +/// +/// 直供件BBAC结算与发运对比明细 +/// +[ExcelExporter(MaxRowNumberOnASheet = 500_000)] +public class SaSeCompareDetailReportZhiGongJianBBAC : SaSeCompareDetailReport +{ + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "ASN发货单号")] + public override string PN { get; set; } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianHBPO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianHBPO.cs new file mode 100644 index 00000000..3601344b --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianHBPO.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; + +namespace Win.Sfs.SettleAccount.Reports; + +/// +/// 直供件HBPO结算与发运对比明细 +/// +[ExcelExporter(MaxRowNumberOnASheet = 500_000)] +public class SaSeCompareDetailReportZhiGongJianHBPO : SaSeCompareDetailReport +{ + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "ASN发货单号")] + public override string PN { get; set; } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDiff.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDiff.cs new file mode 100644 index 00000000..bb658c1b --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDiff.cs @@ -0,0 +1,153 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Win.Sfs.SettleAccount.Enums; + +namespace Win.Sfs.SettleAccount.Reports; + +/// +/// 结算、发运对比 +/// +public class SaSeCompareDiff +{ + /// + /// 期间 + /// + [Display(Name = "期间")] + public int Version { get; set; } + /// + /// Wms发货单号 + /// + [Display(Name = "Wms发货单号")] + public string WmsBillNum { get; set; } + /// + /// 发货日期 + /// + [Display(Name = "发货日期")] + public DateTime? ShippingDate { get; set; } + /// + /// 日顺序号 + /// + [Display(Name = "日顺序号")] + public string SeqNumber { get; set; } + /// + /// PJIS日顺序号 + /// + [Display(Name = "PJIS日顺序号")] + public string PJISSeqNumber { get; set; } + /// + /// 结算数据中的过账日期 + /// + [Display(Name = "客户下线时间")] + public DateTime? CustomerOfflineTime { get; set; } + /// + /// 结算数量 + /// + [Display(Name = "结算数量")] + public decimal? SAQty { get; set; } + /// + /// 发货数量 + /// + [Display(Name = "发货数量")] + public decimal? SEQty { get; set; } + /// + /// 生产号 + /// + [Display(Name = "生产号")] + public string PN { set; get; } + /// + /// 客户物料号 + /// + [Display(Name = "客户物料号")] + public string LU { set; get; } + /// + /// WMS目标库位 + /// + [Display(Name = "WMS目标库位")] + public string ToLocCode { get; set; } + /// + /// ERP目标库位 + /// + [Display(Name = "ERP目标库位")] + public string ToErpLocCode { get; set; } + /// + /// 类型 + /// + [Display(Name = "类型")] + public EnumPubSaSeCompareCategory Category { get; set; } + /// + /// 发运客户物料号 + /// + public string SeCustomerPartCode { get; set; } + /// + /// 发运厂内物料号 + /// + public string SeFactoryPartCode { get; set; } + /// + /// 结算客户物料号 + /// + public string SaCustomerPartCode { get; set; } + /// + /// 结算厂内物料号 + /// + public string SaFactoryPartCode { get; set; } + /// + /// 客户物料号 + /// + [Display(Name = "客户物料号")] + public string CustomerPartCode { get; set; } + /// + /// 物料描述 + /// + [Display(Name = "物料描述")] + public string PartCodeDesc { get; set; } + /// + /// 厂内物料号 + /// + [Display(Name = "厂内物料号")] + public string FactoryPartCode { get; set; } + /// + /// 替换厂内物料号 + /// + [Display(Name = "替换厂内物料号")] + public string ReplaceFactoryPartCode { get; set; } + /// + /// 是否已经移除 + /// + public bool IsRemove { get; set; } + /// + /// 是否是当期 + /// + public bool IsCurrent { get; set; } +} + +/// +/// PUB结算与发运对比明细 +/// +public interface IPubSaSeCompareDetailExport +{ + /// + /// 类别 + /// + [Display(Name = "类别")] + public EnumPubSaSeCompareCategory Category { get; set; } + /// + /// 零件描述 + /// + [Display(Name = "零件描述")] + public string PartCodeDesc { get; set; } + /// + /// 替换厂内零件号 + /// + [Display(Name = "替换厂内零件号")] + public string ReplaceFactoryPartCode { get; set; } + /// + /// 结算数量 + /// + [Display(Name = "结算数量")] + public decimal SAQty { get; set; } + /// + /// 发货数量 + /// + [Display(Name = "发货数量")] + public decimal SEQty { get; set; } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareSumReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareSumReport.cs new file mode 100644 index 00000000..fa2a4752 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareSumReport.cs @@ -0,0 +1,46 @@ +using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; + +namespace Win.Sfs.SettleAccount.Reports; + +/// +/// 结算、发运汇总对比报告 +/// +[ExcelExporter(MaxRowNumberOnASheet = 500_000)] +public class SaSeCompareSumReport +{ + /// + /// 厂内物料号 + /// + [Display(Name = "厂内物料号")] + [ExporterHeader(DisplayName = "LU")] + public string FactoryPartCode { get; set; } + + /// + /// 物料描述 + /// + [Display(Name = "物料描述")] + [ExporterHeader(DisplayName = "物料描述")] + public string PartCodeDesc { 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; +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs index f735fb13..192db73e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs @@ -352,19 +352,6 @@ public class SaSeEdiCompareDetailExportJisBBAC : SaSeEdiCompareDetailExport, ISa public string ToLocCode { get; set; } } -/// -/// JisBBAC结算、发运、Eid对比明细物流 -/// -public class SaSeEdiCompareDetailExportJisBBACWuLiu : SaSeEdiCompareDetailExportJisBBAC -{ - /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(IsIgnore = true)] - public override decimal? FixPrice { get; set; } -} - /// /// JisHBPO结算、发运、Eid对比明细 /// @@ -533,19 +520,6 @@ public class SaSeEdiCompareDetailExportJisHBPO : SaSeEdiCompareDetailExport, ISa public string ToLocCode { get; set; } } -/// -/// JisHBPO结算、发运、Eid对比明细物流 -/// -public class SaSeEdiCompareDetailExportJisHBPOWuLiu : SaSeEdiCompareDetailExportJisHBPO -{ - /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(IsIgnore = true)] - public override decimal? FixPrice { get; set; } -} - /// /// PUB结算与发运对比汇总 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACSeEidCompareReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisBBAC.cs similarity index 77% rename from code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACSeEidCompareReport.cs rename to code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisBBAC.cs index d478adae..36a79337 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACSeEidCompareReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisBBAC.cs @@ -6,6 +6,6 @@ namespace Win.Sfs.SettleAccount.Reports; /// JisBBAC 发运、Edi与对比导出 /// [ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class JisBBACSeEidCompareReport : SeEidCompareReport +public class SeEidCompareReportJisBBAC : SeEidCompareReport { } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisHBPOSeEidCompareReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisHBPO.cs similarity index 77% rename from code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisHBPOSeEidCompareReport.cs rename to code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisHBPO.cs index 2831a987..da01018a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisHBPOSeEidCompareReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisHBPO.cs @@ -6,6 +6,6 @@ namespace Win.Sfs.SettleAccount.Reports; /// JisHBPO 发运、Edi与对比报告 /// [ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class JisHBPOSeEidCompareReport : SeEidCompareReport +public class SeEidCompareReportJisHBPO : SeEidCompareReport { } 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 67910449..519eddd5 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 @@ -22,7 +22,7 @@ public class PubSaSeCompareDapperRepository : DapperRepository /// 获取差异 /// - public virtual List GetDetailDiffReportList(string businessType, string version, string seStartDateTime, string seEndDateTime) + public virtual List GetDetailDiffReportList(string businessType, string version, string seStartDateTime, string seEndDateTime) { string strSeWhere = string.Empty; if (!string.IsNullOrWhiteSpace(seStartDateTime)) @@ -53,7 +53,7 @@ public class PubSaSeCompareDapperRepository : DapperRepository(strSqlText, null, null, true, 1200, null).ToList(); + return DbConnection.Query(strSqlText, null, null, true, 1200, null).ToList(); } public virtual List GetInvoiceSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string cp7begin, string cp7end, string kennCode, string chassisNumber, string materialGroup) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs index 343ab705..45b5fee1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs @@ -72,7 +72,6 @@ namespace SettleAccount.Job.Services.Report var seStartDateTime = DateTime.Parse(strSeStartDateTime); var seEndDateTime = DateTime.Parse(strSeEndDateTime); var filename = exportName.FirstOrDefault(); - var isWuLiu = filename.StartsWith("物流"); var saSeEdiCompareDiffs = GetEdiSeSaCompareData(version, seStartDateTime, seEndDateTime); HandleSaSeEdiCompareDiffList(saSeEdiCompareDiffs); @@ -107,16 +106,8 @@ namespace SettleAccount.Job.Services.Report saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList(); var excelExporter = new ExcelExporter(); - if (isWuLiu) - { - var items = _objectMapper.Map, List>(saSeEdiCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } - else - { - var items = _objectMapper.Map, List>(saSeEdiCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } + var items = _objectMapper.Map, List>(saSeEdiCompareDiffs); + excelExporter = BindExcelExporter(items, businessTypeDisplayName); var result = excelExporter.ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs index cc7db84f..c36a68a9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs @@ -60,7 +60,7 @@ namespace SettleAccount.Job.Services.Report var seEndDateTime = DateTime.Parse(strSeEndDateTime); var filename = exportName.FirstOrDefault(); - var excelExporter = GetSeEdiCompareData(seStartDateTime, seEndDateTime, businessTypeDisplayName); + var excelExporter = GetSeEdiCompareData(seStartDateTime, seEndDateTime, businessTypeDisplayName); var result = excelExporter.ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); _fileContainer.SaveAsync(filename, result.Result, true); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs index 045c28af..b5dc8e4c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs @@ -71,7 +71,6 @@ namespace SettleAccount.Job.Services.Report var seStartDateTime = DateTime.Parse(strSeStartDateTime); var seEndDateTime = DateTime.Parse(strSeEndDateTime); var filename = exportName.FirstOrDefault(); - var isWuLiu = filename.StartsWith("物流"); var saSeEdiCompareDiffs = GetSaSeEdiCompareData(version, seStartDateTime, seEndDateTime); HandleSaSeEdiCompareDiffList(saSeEdiCompareDiffs); @@ -106,16 +105,8 @@ namespace SettleAccount.Job.Services.Report saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList(); var excelExporter = new ExcelExporter(); - if (isWuLiu) - { - var items = _objectMapper.Map, List>(saSeEdiCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } - else - { - var items = _objectMapper.Map, List>(saSeEdiCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } + var items = _objectMapper.Map, List>(saSeEdiCompareDiffs); + excelExporter = BindExcelExporter(items, businessTypeDisplayName); var result = excelExporter.ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs index 79e7af3b..830d0589 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs @@ -54,7 +54,7 @@ namespace SettleAccount.Job.Services.Report var seEndDateTime = DateTime.Parse(strSeEndDateTime); var filename = exportName.FirstOrDefault(); - var excelExporter = GetSeEdiCompareData(seStartDateTime, seEndDateTime, businessTypeDisplayName); + var excelExporter = GetSeEdiCompareData(seStartDateTime, seEndDateTime, businessTypeDisplayName); var result = excelExporter.ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); _fileContainer.SaveAsync(filename, result.Result, true); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs index 5325b643..f3d83a47 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs @@ -83,10 +83,10 @@ namespace SettleAccount.Job.Services.Report { //二次匹配 匹配上的厂内零件号、PN var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN }); - pubSaSeCompareDiffs.RemoveAll(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); + pubSaSeCompareDiffs.RemoveAll(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes); //二次对比比对上的数据入库 - var pubSeCDetailEntitys = _objectMapper.Map, List>(secondMatchHaveSaHaveSes); + var pubSeCDetailEntitys = _objectMapper.Map, List>(secondMatchHaveSaHaveSes); _settleAccountDbContext.Set().AddRange(pubSeCDetailEntitys); } #endregion @@ -105,8 +105,8 @@ namespace SettleAccount.Job.Services.Report } pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList(); var excelExporter = new ExcelExporter(); - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); + excelExporter = BindExcelExporter(items, businessTypeDisplayName); var result = excelExporter.ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); @@ -120,7 +120,7 @@ namespace SettleAccount.Job.Services.Report /// /// 获取结算与发运比对数据 /// - public List GetSaSeCompareData(int version, DateTime seStartDateTime, DateTime seEndDateTime) + public List GetSaSeCompareData(int version, DateTime seStartDateTime, DateTime seEndDateTime) { //结算 var saGroup = from sa in _settleAccountDbContext.Set() @@ -156,7 +156,7 @@ namespace SettleAccount.Job.Services.Report on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace } into temp from se in temp.DefaultIfEmpty() - select new PubSaSeCompareDiff() + select new SaSeCompareDiff() { WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, @@ -177,7 +177,7 @@ namespace SettleAccount.Job.Services.Report on new { se.PN, se.CustomerPartCodeNoSpace } equals new { sa.PN, sa.CustomerPartCodeNoSpace } into temp from sa in temp.DefaultIfEmpty() - select new PubSaSeCompareDiff() + select new SaSeCompareDiff() { WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanHBPOSaSeCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanHBPOSaSeCompareExportService.cs index 9fc712bf..42d1f5cf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanHBPOSaSeCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanHBPOSaSeCompareExportService.cs @@ -83,10 +83,10 @@ namespace SettleAccount.Job.Services.Report { //二次匹配 匹配上的厂内零件号、PN var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN }); - pubSaSeCompareDiffs.RemoveAll(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); + pubSaSeCompareDiffs.RemoveAll(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes); //二次对比比对上的数据入库 - var pubSeCDetailEntitys = _objectMapper.Map, List>(secondMatchHaveSaHaveSes); + var pubSeCDetailEntitys = _objectMapper.Map, List>(secondMatchHaveSaHaveSes); _settleAccountDbContext.Set().AddRange(pubSeCDetailEntitys); } #endregion @@ -105,8 +105,8 @@ namespace SettleAccount.Job.Services.Report } pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList(); var excelExporter = new ExcelExporter(); - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); + excelExporter = BindExcelExporter(items, businessTypeDisplayName); var result = excelExporter.ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); @@ -120,7 +120,7 @@ namespace SettleAccount.Job.Services.Report /// /// 获取结算与发运比对数据 /// - public List GetSaSeCompareData(int version, DateTime seStartDateTime, DateTime seEndDateTime) + public List GetSaSeCompareData(int version, DateTime seStartDateTime, DateTime seEndDateTime) { //结算 var saGroup = from sa in _settleAccountDbContext.Set() @@ -156,7 +156,7 @@ namespace SettleAccount.Job.Services.Report on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace } into temp from se in temp.DefaultIfEmpty() - select new PubSaSeCompareDiff() + select new SaSeCompareDiff() { WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, @@ -177,7 +177,7 @@ namespace SettleAccount.Job.Services.Report on new { se.PN, se.LU } equals new { sa.PN, sa.LU } into temp from sa in temp.DefaultIfEmpty() - select new PubSaSeCompareDiff() + select new SaSeCompareDiff() { WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, 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 381ef95c..f2ff3796 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 @@ -113,16 +113,18 @@ namespace SettleAccount.Job.Services.Report { //二次匹配 匹配上的厂内零件号、PN var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN }); - pubSaSeCompareDiffs.RemoveAll(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); + pubSaSeCompareDiffs.RemoveAll(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); pubSaSeCompareDiffs.AddRange(secondMatchHaveSaHaveSes); //二次对比比对上的数据入库 - var pubSeCDetailEntitys = _objectMapper.Map, List>(secondMatchHaveSaHaveSes); + var pubSeCDetailEntitys = _objectMapper.Map, List>(secondMatchHaveSaHaveSes); _settleAccountDbContext.Set().AddRange(pubSeCDetailEntitys); } #endregion #region 结算数据处理 HandleSaDetails(pubSaSeCompareDiffs, businessType, version); + + HandleSaDetailsMain(pubSaSeCompareDiffs, businessType, version); #endregion if (string.IsNullOrEmpty(lu) == false) @@ -133,6 +135,7 @@ namespace SettleAccount.Job.Services.Report { pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn); } + pubSaSeCompareDiffs.FindAll(t => t.Version == version).ForEach(t => t.IsCurrent = true); pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList(); var excelExporter = new ExcelExporter(); @@ -141,26 +144,26 @@ namespace SettleAccount.Job.Services.Report { case EnumBusinessType.ZhiGongJianBBAC: { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); + excelExporter = BindExcelExporter(items, businessTypeDisplayName); } break; case EnumBusinessType.ZhiGongJianHBPO: { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); + excelExporter = BindExcelExporter(items, businessTypeDisplayName); } break; case EnumBusinessType.BeiJian: { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); + excelExporter = BindExcelExporter(items, businessTypeDisplayName); } break; case EnumBusinessType.YinDuJian: { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); + excelExporter = BindExcelExporter(items, businessTypeDisplayName); } break; default: @@ -181,7 +184,7 @@ namespace SettleAccount.Job.Services.Report /// 获取比对数据 /// [Obsolete] - private List GetSaSeCompareData(EnumBusinessType businessType, int version, DateTime seStartDateTime, DateTime seEndDateTime) + private List GetSaSeCompareDataOld(EnumBusinessType businessType, int version, DateTime seStartDateTime, DateTime seEndDateTime) { //印度件LU对比 if (businessType == EnumBusinessType.YinDuJian) @@ -222,7 +225,7 @@ namespace SettleAccount.Job.Services.Report on new { sa.PN, sa.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace } into temp from se in temp.DefaultIfEmpty() - select new PubSaSeCompareDiff() + select new SaSeCompareDiff() { WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, @@ -243,7 +246,7 @@ namespace SettleAccount.Job.Services.Report on new { se.PN, se.CustomerPartCodeNoSpace } equals new { sa.PN, sa.CustomerPartCodeNoSpace } into temp from sa in temp.DefaultIfEmpty() - select new PubSaSeCompareDiff() + select new SaSeCompareDiff() { WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, @@ -267,7 +270,7 @@ namespace SettleAccount.Job.Services.Report /// /// 获取比对数据 /// - private List GetSaSeCompareDataOld(EnumBusinessType businessType, int version, DateTime seStartDateTime, DateTime seEndDateTime) + private List GetSaSeCompareData(EnumBusinessType businessType, int version, DateTime seStartDateTime, DateTime seEndDateTime) { //印度件LU对比 if (businessType == EnumBusinessType.YinDuJian) @@ -282,7 +285,6 @@ namespace SettleAccount.Job.Services.Report { groupItem.Key.PN, groupItem.Key.CustomerPartCodeNoSpace, - Id = groupItem.Max(t => t.Id), Qty = groupItem.Sum(t => t.Qty), Version = groupItem.Max(t => t.Version), LU = groupItem.Max(t => t.LU), @@ -325,7 +327,7 @@ namespace SettleAccount.Job.Services.Report into temp from se in temp.DefaultIfEmpty() where se.PN == null - select new PubSaSeCompareDiff() + select new SaSeCompareDiff() { Version = sa.Version, CustomerOfflineTime = sa.SettleDate, @@ -342,7 +344,7 @@ namespace SettleAccount.Job.Services.Report into temp from sa in temp.DefaultIfEmpty() where sa.PN == null - select new PubSaSeCompareDiff() + select new SaSeCompareDiff() { WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, @@ -359,7 +361,7 @@ namespace SettleAccount.Job.Services.Report var haveSaHaveSeList = (from sa in saGroupByVersion from se in seGroup where sa.PN == se.PN && sa.CustomerPartCodeNoSpace == se.CustomerPartCodeNoSpace - select new PubSaSeCompareDiff() + select new SaSeCompareDiff() { Version = sa.Version, WmsBillNum = se.WmsBillNum, @@ -376,13 +378,13 @@ namespace SettleAccount.Job.Services.Report SaFactoryPartCode = sa.PartCode, CustomerPartCode = sa.LU }).ToList(); - return haveSaHaveSeList.Union(haveSaHaveSeList).Union(notHaveSaHaveSeList).ToList(); + return haveSaHaveSeList.Union(haveSaNotHaveSeList).Union(notHaveSaHaveSeList).ToList(); } /// /// 获取比对数据 /// - private List GetSaSeCompareDataYinDu(int version, DateTime seStartDateTime, DateTime seEndDateTime) + private List GetSaSeCompareDataYinDu(int version, DateTime seStartDateTime, DateTime seEndDateTime) { var saGroup = from sa in _settleAccountDbContext.Set() where sa.BusinessType == EnumBusinessType.YinDuJian && sa.Version == version @@ -415,7 +417,7 @@ namespace SettleAccount.Job.Services.Report on sa.CustomerPartCodeNoSpace equals se.CustomerPartCodeNoSpace into temp from se in temp.DefaultIfEmpty() - select new PubSaSeCompareDiff() + select new SaSeCompareDiff() { WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, @@ -435,7 +437,7 @@ namespace SettleAccount.Job.Services.Report on se.CustomerPartCodeNoSpace equals sa.CustomerPartCodeNoSpace into temp from sa in temp.DefaultIfEmpty() - select new PubSaSeCompareDiff() + select new SaSeCompareDiff() { WmsBillNum = se.WmsBillNum, ShippingDate = se.ShippingDate, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs index 6af50bd3..4ab4e2b9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs @@ -35,7 +35,7 @@ namespace SettleAccount.Job.Services.Report _settleAccountDbContext = settleAccountDbContext; } - public virtual void HandlePubSaSeCompareDiffList(List pubSaSeCompareDiffs) + public virtual void HandlePubSaSeCompareDiffList(List pubSaSeCompareDiffs) { pubSaSeCompareDiffs.ForEach(p => { @@ -77,10 +77,10 @@ namespace SettleAccount.Job.Services.Report /// /// 二次比对 /// - public virtual List HandleSecondCompare(List pubSaSeCompareDiffs, EnumBusinessType businessType) + public virtual List HandleSecondCompare(List pubSaSeCompareDiffs, EnumBusinessType businessType) { //二次匹配上的记录 - var secondMatchHaveSaHaveSes = new List(); + var secondMatchHaveSaHaveSes = new List(); //有结算无发运 和 无结算有发运 var haveSaNotHaveSeUnionNotHaveSaHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe || t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe); //有结算无发运 @@ -104,7 +104,7 @@ namespace SettleAccount.Job.Services.Report secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes join haveSaNotHaveSe in haveSaNotHaveSes on new { notHaveSaHaveSe.PN, notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.PN, haveSaNotHaveSe.ReplaceFactoryPartCode } - select new PubSaSeCompareDiff() + select new SaSeCompareDiff() { WmsBillNum = notHaveSaHaveSe.WmsBillNum, ShippingDate = notHaveSaHaveSe.ShippingDate, @@ -133,7 +133,7 @@ namespace SettleAccount.Job.Services.Report /// 结算数据处理 /// 写入库位、替换零件号 /// - public virtual void HandleSaDetails(List pubSaSeCompareDiffs, EnumBusinessType businessType, int version) + public virtual void HandleSaDetails(List pubSaSeCompareDiffs, EnumBusinessType businessType, int version) where TCanSa : SA_CAN_BASE where TNotSa : SA_NOT_BASE { @@ -177,7 +177,7 @@ namespace SettleAccount.Job.Services.Report /// 处理发运数据 /// 结算、发运对比上的数据修改结算数据状态 /// - public virtual void HandLeSaDetailsMain(List pubSaSeCompareDiffs, EnumBusinessType businessType, int version) where T : SA_BASE + public virtual void HandleSaDetailsMain(List pubSaSeCompareDiffs, EnumBusinessType businessType, int version) where T : SA_BASE { var haveSaHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe); if (haveSaHaveSes.Any()) @@ -185,6 +185,7 @@ namespace SettleAccount.Job.Services.Report //结算详情 var saDetails = _settleAccountDbContext.Set() .Where(t => t.BusinessType == businessType) + .Where(t => t.MappingType == EnumMappingType.None) .Where(t => t.Version == version) .ToList(); if (saDetails.Any()) @@ -193,9 +194,8 @@ namespace SettleAccount.Job.Services.Report { var mappingType = (i.SAQty - i.SEQty) switch { - > 0 => EnumMappingType.None, 0 => EnumMappingType.PerfectMatch, - < 0 => EnumMappingType.None, + > 0 or < 0 => EnumMappingType.PartialMatch, _ => default, }; o.MappingType = mappingType; @@ -209,7 +209,7 @@ namespace SettleAccount.Job.Services.Report /// /// 创建导出文件结构 /// - public ExcelExporter BindExcelExporter(List saSeCompareDetailExports, string businessTypeDisplayName) where T : PubSaSeCompareDetailExport, IPubSaSeCompareDetailExport, new() + public ExcelExporter BindExcelExporter(List saSeCompareDetailExports, string businessTypeDisplayName) where T : SaSeCompareDetailReport, new() { //详情Sheet行数 var detailMaxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet; @@ -221,14 +221,14 @@ namespace SettleAccount.Job.Services.Report //汇总Sheet行数 var sumMaxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet; - var sumExportExporterAttribute = typeof(PubSaSeCompareSumExport).GetAttribute(inherit: true); + var sumExportExporterAttribute = typeof(SaSeCompareSumReport).GetAttribute(inherit: true); if (sumExportExporterAttribute != null) { sumMaxRowNumberOnASheet = sumExportExporterAttribute.MaxRowNumberOnASheet > 0 ? sumExportExporterAttribute.MaxRowNumberOnASheet : sumMaxRowNumberOnASheet; } //结算核对汇总 - var saSeCompareSumExports = saSeCompareDetailExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport() + var saSeCompareSumExports = saSeCompareDetailExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeCompareSumReport() { FactoryPartCode = p.Key, PartCodeDesc = p.FirstOrDefault().PartCodeDesc, @@ -239,7 +239,7 @@ namespace SettleAccount.Job.Services.Report //有结算有发运 var haveSaHaveSeExports = saSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe); //有结算有发运汇总 - var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport() + var haveSaHaveSeSumExports = haveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeCompareSumReport() { FactoryPartCode = p.Key, PartCodeDesc = p.FirstOrDefault().PartCodeDesc, @@ -249,7 +249,7 @@ namespace SettleAccount.Job.Services.Report //有结算无发运 var haveSaNotHaveSeExports = saSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaNotHaveSe); //有结算无发运 - var haveSaNotHaveSeSumExports = haveSaNotHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport() + var haveSaNotHaveSeSumExports = haveSaNotHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeCompareSumReport() { FactoryPartCode = p.Key, PartCodeDesc = p.FirstOrDefault().PartCodeDesc, @@ -259,7 +259,7 @@ namespace SettleAccount.Job.Services.Report //无结算有发运 var notHaveSaHaveSeExports = saSeCompareDetailExports.FindAll(t => t.Category == EnumPubSaSeCompareCategory.NotHaveSaHaveSe); //无结算有发运 - var notHaveSaHaveSeSumExports = notHaveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new PubSaSeCompareSumExport() + var notHaveSaHaveSeSumExports = notHaveSaHaveSeExports.GroupBy(p => p.ReplaceFactoryPartCode).Select(p => new SaSeCompareSumReport() { FactoryPartCode = p.Key, PartCodeDesc = p.FirstOrDefault().PartCodeDesc, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs index d4a16aec..0611695b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs @@ -39,13 +39,13 @@ namespace SettleAccount.Job /// private void CreateMapSaSeCompare() { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); } } }