From 949971a514df0010019cccc8bfd76bb75244c88a Mon Sep 17 00:00:00 2001 From: mahao Date: Thu, 7 Sep 2023 11:06:42 +0800 Subject: [PATCH] up --- .../Entities/BQ/CompareService.cs | 5 +- .../BQ/Syncs/JisBBACSeEdiCompareAppService.cs | 10 +- .../BQ/Syncs/JisHBPOSeEdiCompareAppService.cs | 72 +++++++++++ .../Entities/TaskJobs/JobAppService.cs | 4 - .../Reports/JisBBACEidSeCompareReport.cs | 15 +-- .../Reports/PubSaSeCompareDiff.cs | 118 ------------------ .../Reports/SaSeEdiCompareDiff.cs | 5 - .../JisBBACSaSeEdiCompareExportService.cs | 35 ++++-- .../JisBBACSeEdiCompareExportService.cs | 12 ++ .../JisHBPOSaSeEdiCompareExportService.cs | 3 - .../MaiDanBBACSaSeCompareExportService.cs | 16 +-- .../MaiDanHBPOSaSeCompareExportService.cs | 16 +-- .../Report/PubSaSeCompareExportService.cs | 55 ++------ .../Report/SaSeCompareExportBaseService.cs | 1 - .../Report/SaSeEdiCompareExportBaseService.cs | 1 - .../SettleAccountJobAutoMapperProfile.cs | 8 +- 16 files changed, 139 insertions(+), 237 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs index b0d38a1f..9e8a9eac 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Diagnostics; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -76,15 +75,13 @@ public class CompareService : ApplicationService [HttpPost] public async Task SaSeCompare(SaSeCompareRequestDto saSeCompareRequestDto) { - var isWuLiuRole = CurrentUser.IsInRole("物流") == true ? "物流" : ""; - var businessTypeDisplayName = saSeCompareRequestDto.BusinessType.ToString(); var attributeOfType = saSeCompareRequestDto.BusinessType.GetAttributeOfType(); if (attributeOfType != null) { businessTypeDisplayName = attributeOfType.Name; } - var projectName = $"{isWuLiuRole}{businessTypeDisplayName}结算与发运数据对比"; + var projectName = $"{businessTypeDisplayName}结算与发运数据对比"; var customConditionList = new List(); customConditionList.Add(new CustomCondition() { Name = "Version", Value = saSeCompareRequestDto.Version }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs index 9c43c708..d18e986a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs @@ -36,8 +36,14 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable await HandDelEdiDataAsync().ConfigureAwait(false); - var seDetailGroup = db.Set().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, t.Key.CustomerPartCodeNoSpace }); - var ediDetailGroup = db.Set().Where(t => t.IsDeleted == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, t.Key.CustomerPartCodeNoSpace }); + var seDetailGroup = db.Set() + .Where(t => t.IsHaveEdiData == false) + .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) + .Select(t => t.Key); + var ediDetailGroup = db.Set() + .Where(t => t.IsDeleted == false) + .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) + .Select(t => t.Key); var keyCodes = from se in seDetailGroup from edi in ediDetailGroup diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs index e7d203d5..88ec8c01 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs @@ -25,6 +25,78 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable _serviceProvider = serviceProvider; } + /// + /// 执行 + /// + public async Task InvokeOld() + { + try + { + using var serviceScope = _serviceProvider.CreateScope(); + var db = serviceScope.ServiceProvider.GetRequiredService(); + + await HandDelEdiDataAsync().ConfigureAwait(false); + + var seDetailGroup = db.Set() + .Where(t => t.IsHaveEdiData == false) + .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) + .Select(t => t.Key); + var ediDetailGroup = db.Set() + .Where(t => t.IsDeleted == false && t.IsHaveSeData == false) + .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) + .Select(t => t.Key); + + var keyCodes = (from se in seDetailGroup + from edi in ediDetailGroup + where se.PN == edi.PN && se.CustomerPartCodeNoSpace == edi.CustomerPartCodeNoSpace + select new { se.PN, se.CustomerPartCodeNoSpace } + ).Take(5000).ToList(); + if (keyCodes.Any()) + { + var pnGroup = keyCodes.GroupBy(t => t.PN).Select(t => new { t.Key, CustomerPartCodeNoSpaces = t.Select(s => s.CustomerPartCodeNoSpace).Distinct() }); + foreach (var item in pnGroup) + { + var pn = item.Key; + var lus = item.CustomerPartCodeNoSpaces; + + } + } + + + + var seDetailsQuery = from se in db.Set() + from keyCode in keyCodes + where se.PN == keyCode.PN && se.CustomerPartCodeNoSpace == keyCode.CustomerPartCodeNoSpace && se.IsHaveEdiData == false + select se; + var ediDetailsQuery = from edi in db.Set() + from keyCode in keyCodes + where edi.PN == keyCode.PN && edi.CustomerPartCodeNoSpace == keyCode.CustomerPartCodeNoSpace && edi.IsDeleted == false && edi.IsHaveSeData == false + select edi; + + var seDetails = seDetailsQuery.Take(5000).ToList(); + var ediDetails = ediDetailsQuery.Take(5000).ToList(); + seDetails.ForEach(t => t.IsHaveEdiData = true); + ediDetails.ForEach(t => t.IsHaveSeData = true); + + using var transaction = await db.Database.BeginTransactionAsync().ConfigureAwait(false); + try + { + await db.BulkUpdateAsync(seDetails).ConfigureAwait(false); + await db.BulkUpdateAsync(ediDetails).ConfigureAwait(false); + await transaction.CommitAsync().ConfigureAwait(false); + } + catch (Exception) + { + await transaction.RollbackAsync().ConfigureAwait(false); + throw; + } + } + catch (Exception) + { + throw; + } + } + /// /// 执行 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs index edf6a75c..88673265 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs @@ -43,10 +43,6 @@ public class JobAppService: ApplicationService [UnitOfWork(false)] public virtual async Task> GetListAsync(JobRequestDto input) { - if (CurrentUser.IsInRole("物流") && input.Name.Contains("对比")) - { - input.Name = "物流" + input.Name; - } var lists = await _service.GetListAsync(input).ConfigureAwait(false); return new PagedResultDto(lists.Count, lists); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs index db1370b0..d3dfe3fd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs @@ -1,7 +1,6 @@ using System; using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; namespace Win.Sfs.SettleAccount.Reports; @@ -12,10 +11,6 @@ public class JisBBACEidSeCompareReport { } -/// -/// JisBBAC Edi、发运对比导出 -/// -[ExcelExporter(MaxRowNumberOnASheet = 500_000)] public class JisBBACEidSeCompareExport { /// @@ -101,7 +96,7 @@ public class JisBBACEidSeCompareExport /// [Display(Name = "发货日期")] [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] - public DateTime? ShippingDate { get; set; } + public DateTime? ShippingDate { get; set; } /// /// 序列号 /// @@ -113,7 +108,7 @@ public class JisBBACEidSeCompareExport /// [Display(Name = "PJIS日顺序号")] [ExporterHeader(DisplayName = "PJIS日顺序号")] - public string PjsNum { get; set; } + public string PjsNum { get; set; } /// /// 客户下线时间 /// @@ -144,4 +139,10 @@ public class JisBBACEidSeCompareExport [Display(Name = "差异说明")] [ExporterHeader(DisplayName = "差异说明")] public string DiffDesc { get; set; } + /// + /// 备注 + /// + [Display(Name = "备注")] + [ExporterHeader(DisplayName = "备注")] + public string Remark { get; set; } } 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 cebbed9e..ff8f2efb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs @@ -47,11 +47,6 @@ public class PubSaSeCompareDiff [Display(Name = "发货数量")] public decimal? SEQty { get; set; } /// - /// 定价 - /// - [Display(Name = "定价")] - public decimal? FixPrice { get; set; } - /// /// 生产号 /// [Display(Name = "生产号")] @@ -299,12 +294,6 @@ public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExp [ValueMapping("否", false)] public bool MateType => DiffQty == 0; /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(DisplayName = "定价")] - public virtual decimal? FixPrice { get; set; } - /// /// WMS目标库位 /// [Display(Name = "WMS目标库位")] @@ -318,18 +307,6 @@ public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExp public string ToErpLocCode { get; set; } } -/// -/// 直供件BBAC结算与发运对比明细物流 -/// -public class PubSaSeCompareDetailExportZhiGongJianBBACWuLiu : PubSaSeCompareDetailExportZhiGongJianBBAC -{ - /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(IsIgnore = true)] - public override decimal? FixPrice { get; set; } -} /// /// 直供件HBPO结算与发运对比明细 @@ -420,12 +397,6 @@ public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExp [ValueMapping("否", false)] public bool MateType => DiffQty == 0; /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(DisplayName = "定价")] - public virtual decimal? FixPrice { get; set; } - /// /// WMS目标库位 /// [Display(Name = "WMS目标库位")] @@ -439,19 +410,6 @@ public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExp public string ToErpLocCode { get; set; } } -/// -/// 直供件HBPO结算与发运对比明细物流 -/// -public class PubSaSeCompareDetailExportZhiGongJianHBPOWuLiu : PubSaSeCompareDetailExportZhiGongJianHBPO -{ - /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(IsIgnore = true)] - public override decimal? FixPrice { get; set; } -} - /// /// 买单件BBAC结算与发运对比明细 /// @@ -543,12 +501,6 @@ public class PubSaSeCompareDetailExportMaiDanJianBBAC : PubSaSeCompareDetailExpo [ValueMapping("否", false)] public bool MateType => DiffQty == 0; /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(DisplayName = "定价")] - public virtual decimal? FixPrice { get; set; } - /// /// WMS目标库位 /// [Display(Name = "WMS目标库位")] @@ -562,19 +514,6 @@ public class PubSaSeCompareDetailExportMaiDanJianBBAC : PubSaSeCompareDetailExpo public string ToErpLocCode { get; set; } } -/// -/// 买单件BBAC结算与发运对比明细物流 -/// -public class PubSaSeCompareDetailExportMaiDanJianBBACWuLiu : PubSaSeCompareDetailExportMaiDanJianBBAC -{ - /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(IsIgnore = true)] - public override decimal? FixPrice { get; set; } -} - /// /// 买单件HBPO结算与发运对比明细 /// @@ -666,12 +605,6 @@ public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExpo [ValueMapping("否", false)] public bool MateType => DiffQty == 0; /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(DisplayName = "定价")] - public virtual decimal? FixPrice { get; set; } - /// /// WMS目标库位 /// [Display(Name = "WMS目标库位")] @@ -685,19 +618,6 @@ public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExpo public string ToErpLocCode { get; set; } } -/// -/// 买单件HBPO结算与发运对比明细物流 -/// -public class PubSaSeCompareDetailExportMaiDanJianHBPOWuLiu : PubSaSeCompareDetailExportMaiDanJianHBPO -{ - /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(IsIgnore = true)] - public override decimal? FixPrice { get; set; } -} - /// /// 备件结算与发运对比明细 /// @@ -788,12 +708,6 @@ public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport, IPu [ValueMapping("否", false)] public bool MateType => DiffQty == 0; /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(DisplayName = "定价")] - public virtual decimal? FixPrice { get; set; } - /// /// WMS目标库位 /// [Display(Name = "WMS目标库位")] @@ -807,19 +721,6 @@ public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport, IPu public string ToErpLocCode { get; set; } } -/// -/// 备件结算与发运对比明细物流 -/// -public class PubSaSeCompareDetailExportBeiJianWuLiu : PubSaSeCompareDetailExportBeiJian -{ - /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(IsIgnore = true)] - public override decimal? FixPrice { get; set; } -} - /// /// 印度件结算与发运对比明细 /// @@ -909,12 +810,6 @@ public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport, I [ValueMapping("否", false)] public bool MateType => DiffQty == 0; /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(DisplayName = "定价")] - public virtual decimal? FixPrice { get; set; } - /// /// WMS目标库位 /// [Display(Name = "WMS目标库位")] @@ -927,16 +822,3 @@ public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport, I [ExporterHeader(DisplayName = "ERP目标库位")] public string ToErpLocCode { get; set; } } - -/// -/// 印度件结算与发运对比明细物流 -/// -public class PubSaSeCompareDetailExportYinDuJianWuLiu : PubSaSeCompareDetailExportYinDuJian -{ - /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(IsIgnore = true)] - public override decimal? FixPrice { get; set; } -} 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 e1d5dd0d..f735fb13 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs @@ -67,11 +67,6 @@ public class SaSeEdiCompareDiff [Display(Name = "Eid数量")] public decimal? EdiQty { get; set; } /// - /// 定价 - /// - [Display(Name = "定价")] - public decimal? FixPrice { get; set; } - /// /// 生产号 /// [Display(Name = "生产号")] 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 f4402be1..343ab705 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 @@ -16,6 +16,7 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.ObjectMapping; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount; +using Win.Sfs.SettleAccount.Entities.BQ; using Win.Sfs.SettleAccount.Reports; namespace SettleAccount.Job.Services.Report @@ -72,33 +73,48 @@ namespace SettleAccount.Job.Services.Report var seEndDateTime = DateTime.Parse(strSeEndDateTime); var filename = exportName.FirstOrDefault(); var isWuLiu = filename.StartsWith("物流"); - var ediSeSaCompareDiffs = GetEdiSeSaCompareData(version, seStartDateTime, seEndDateTime); + var saSeEdiCompareDiffs = GetEdiSeSaCompareData(version, seStartDateTime, seEndDateTime); - HandleSaSeEdiCompareDiffList(ediSeSaCompareDiffs); + HandleSaSeEdiCompareDiffList(saSeEdiCompareDiffs); + + #region 二次对比 + //二次匹配上的记录 + var secondMatchHaveSaHaveSes = HandleSecondCompare(saSeEdiCompareDiffs, businessType); + if (secondMatchHaveSaHaveSes.Any()) + { + //二次匹配 匹配上的厂内零件号、PN + var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN }); + saSeEdiCompareDiffs.RemoveAll(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN })); + saSeEdiCompareDiffs.AddRange(secondMatchHaveSaHaveSes); + //二次对比比对上的数据入库 + var seCDetailEntitys = _objectMapper.Map, List>(secondMatchHaveSaHaveSes); + _settleAccountDbContext.Set().AddRange(seCDetailEntitys); + } + #endregion #region 结算数据处理 - HandleSaDetails(ediSeSaCompareDiffs, businessType, version); + HandleSaDetails(saSeEdiCompareDiffs, businessType, version); #endregion if (string.IsNullOrEmpty(lu) == false) { - ediSeSaCompareDiffs = ediSeSaCompareDiffs.FindAll(p => p.CustomerPartCode == lu); + saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(p => p.CustomerPartCode == lu); } if (string.IsNullOrEmpty(pn) == false) { - ediSeSaCompareDiffs = ediSeSaCompareDiffs.FindAll(p => p.PN == pn); + saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(p => p.PN == pn); } - ediSeSaCompareDiffs = ediSeSaCompareDiffs.OrderBy(t => t.Category).ToList(); + saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList(); var excelExporter = new ExcelExporter(); if (isWuLiu) { - var items = _objectMapper.Map, List>(ediSeSaCompareDiffs); + var items = _objectMapper.Map, List>(saSeEdiCompareDiffs); excelExporter = BindExcelExporter(items, businessTypeDisplayName); } else { - var items = _objectMapper.Map, List>(ediSeSaCompareDiffs); + var items = _objectMapper.Map, List>(saSeEdiCompareDiffs); excelExporter = BindExcelExporter(items, businessTypeDisplayName); } @@ -126,7 +142,6 @@ namespace SettleAccount.Job.Services.Report groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), LU = groupItem.Max(t => t.LU), - Price = groupItem.Max(t => t.Price), SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode), }; @@ -190,7 +205,6 @@ namespace SettleAccount.Job.Services.Report SAQty = sa.Qty, SEQty = seEdi.Qty, EdiQty = seEdi.EdiQty, - FixPrice = sa.Price, ToLocCode = seEdi.ToLoc, ToErpLocCode = seEdi.ErpToLoc, SeCustomerPartCode = seEdi.CustomerPartCodeNoSpace, @@ -214,7 +228,6 @@ namespace SettleAccount.Job.Services.Report SAQty = sa.Qty, SEQty = seEdi.Qty, EdiQty = seEdi.EdiQty, - FixPrice = sa.Price, ToLocCode = seEdi.ToLoc, ToErpLocCode = seEdi.ErpToLoc, SeCustomerPartCode = seEdi.CustomerPartCodeNoSpace, 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 0a6d9dac..705d5238 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 @@ -93,6 +93,11 @@ namespace SettleAccount.Job.Services.Report MateType = "否", DiffDesc = "WMS漏发货EDI有订单" }).ToList(); + haveEdiNotHaveSeList.ForEach(t => + { + t.SequenceNumber = GetSequenceNumberDate(t.SequenceNumber); + t.Remark = string.IsNullOrEmpty(t.SequenceNumber) ? "PJIS出单,AJIS未上" : ""; + }); //无EDI有发运 var notHaveEdiHaveSeList = _settleAccountDbContext.Set().Where(t => t.IsHaveEdiData == false) .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) @@ -170,6 +175,7 @@ namespace SettleAccount.Job.Services.Report MateType = se.Qty == edi.Qty ? "是" : "否", DiffDesc = "WMS有发货EDI有订单" }).ToList(); + haveEdiHaveSeList.ForEach(t => t.SequenceNumber = GetSequenceNumberDate(t.SequenceNumber)); haveEdiNotHaveSeList.AddRange(haveEdiHaveSeList); haveEdiNotHaveSeList.Reverse(); @@ -205,6 +211,12 @@ namespace SettleAccount.Job.Services.Report { this._hubContext.Clients.All.ServerToClient("SaSeCompare", "refresh", ""); } + + private string GetSequenceNumberDate(string sequenceNumber) + { + var sequenceNumberDate = sequenceNumber != null && sequenceNumber.Length >= 12 ? sequenceNumber[^12..^4] : sequenceNumber; + return sequenceNumberDate; + } #endregion } } 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 3ca8f1fd..045c28af 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 @@ -141,7 +141,6 @@ namespace SettleAccount.Job.Services.Report groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), LU = groupItem.Max(t => t.LU), - Price = groupItem.Max(t => t.Price), SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode), }; @@ -205,7 +204,6 @@ namespace SettleAccount.Job.Services.Report SAQty = sa.Qty, SEQty = seEdi.Qty, EdiQty = seEdi.EdiQty, - FixPrice = sa.Price, ToLocCode = seEdi.ToLoc, ToErpLocCode = seEdi.ErpToLoc, SeCustomerPartCode = seEdi.CustomerPartCodeNoSpace, @@ -229,7 +227,6 @@ namespace SettleAccount.Job.Services.Report SAQty = sa.Qty, SEQty = seEdi.Qty, EdiQty = seEdi.EdiQty, - FixPrice = sa.Price, ToLocCode = seEdi.ToLoc, ToErpLocCode = seEdi.ErpToLoc, SeCustomerPartCode = seEdi.CustomerPartCodeNoSpace, 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 34e71e1f..5325b643 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 @@ -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 pubSaSeCompareDiffs = GetSaSeCompareData(version, seStartDateTime, seEndDateTime); HandlePubSaSeCompareDiffList(pubSaSeCompareDiffs); @@ -106,16 +105,8 @@ namespace SettleAccount.Job.Services.Report } pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList(); var excelExporter = new ExcelExporter(); - if (isWuLiu) - { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } - else - { - 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(); @@ -141,7 +132,6 @@ namespace SettleAccount.Job.Services.Report groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), LU = groupItem.Max(t => t.LU), - Price = groupItem.Max(t => t.Price), SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode), }; @@ -174,7 +164,6 @@ namespace SettleAccount.Job.Services.Report PN = sa.PN, SAQty = sa.Qty, SEQty = se.Qty, - FixPrice = sa.Price, ToLocCode = se.ToLoc, ToErpLocCode = se.ErpToLoc, SeCustomerPartCode = se.CustomerPartCodeNoSpace, @@ -196,7 +185,6 @@ namespace SettleAccount.Job.Services.Report PN = se.PN, SAQty = sa.Qty, SEQty = se.Qty, - FixPrice = sa.Price, ToLocCode = se.ToLoc, ToErpLocCode = se.ErpToLoc, SeCustomerPartCode = se.CustomerPartCodeNoSpace, 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 e0fb6b2a..9fc712bf 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 @@ -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 pubSaSeCompareDiffs = GetSaSeCompareData(version, seStartDateTime, seEndDateTime); HandlePubSaSeCompareDiffList(pubSaSeCompareDiffs); @@ -106,16 +105,8 @@ namespace SettleAccount.Job.Services.Report } pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList(); var excelExporter = new ExcelExporter(); - if (isWuLiu) - { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } - else - { - 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(); @@ -141,7 +132,6 @@ namespace SettleAccount.Job.Services.Report groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), LU = groupItem.Max(t => t.LU), - Price = groupItem.Max(t => t.Price), SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode), }; @@ -174,7 +164,6 @@ namespace SettleAccount.Job.Services.Report PN = sa.PN, SAQty = sa.Qty, SEQty = se.Qty, - FixPrice = sa.Price, ToLocCode = se.ToLoc, ToErpLocCode = se.ErpToLoc, SeCustomerPartCode = se.CustomerPartCodeNoSpace, @@ -196,7 +185,6 @@ namespace SettleAccount.Job.Services.Report PN = se.PN, SAQty = sa.Qty, SEQty = se.Qty, - FixPrice = sa.Price, ToLocCode = se.ToLoc, ToErpLocCode = se.ErpToLoc, SeCustomerPartCode = se.CustomerPartCodeNoSpace, 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 391dfad3..8c216f39 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 @@ -99,7 +99,6 @@ namespace SettleAccount.Job.Services.Report businessTypeDisplayName = attributeOfType.Name; } var filename = exportName.FirstOrDefault(); - var isWuLiu = filename.StartsWith("物流"); //var pubSaSeCompareDiffs = _pubSaSeCompareDapperRepository.GetDetailDiffReportList(strBusinessType, version, seStartDateTime, seEndDateTime); var pubSaSeCompareDiffs = GetSaSeCompareData(businessType, version, DateTime.Parse(seStartDateTime), DateTime.Parse(seEndDateTime)); @@ -140,58 +139,26 @@ namespace SettleAccount.Job.Services.Report { case EnumBusinessType.ZhiGongJianBBAC: { - if (isWuLiu) - { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } - else - { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); + excelExporter = BindExcelExporter(items, businessTypeDisplayName); } break; case EnumBusinessType.ZhiGongJianHBPO: { - if (isWuLiu) - { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } - else - { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); + excelExporter = BindExcelExporter(items, businessTypeDisplayName); } break; case EnumBusinessType.BeiJian: { - if (isWuLiu) - { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } - else - { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); + excelExporter = BindExcelExporter(items, businessTypeDisplayName); } break; case EnumBusinessType.YinDuJian: { - if (isWuLiu) - { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } - else - { - var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); - excelExporter = BindExcelExporter(items, businessTypeDisplayName); - } + var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); + excelExporter = BindExcelExporter(items, businessTypeDisplayName); } break; default: @@ -228,7 +195,6 @@ namespace SettleAccount.Job.Services.Report groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), LU = groupItem.Max(t => t.LU), - Price = groupItem.Max(t => t.Price), SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode), }; @@ -261,7 +227,6 @@ namespace SettleAccount.Job.Services.Report PN = sa.PN, SAQty = sa.Qty, SEQty = se.Qty, - FixPrice = sa.Price, ToLocCode = se.ToLocCode, ToErpLocCode = se.ToErpLocCode, SeCustomerPartCode = se.CustomerPartCodeNoSpace, @@ -283,7 +248,6 @@ namespace SettleAccount.Job.Services.Report PN = se.PN, SAQty = sa.Qty, SEQty = se.Qty, - FixPrice = sa.Price, ToLocCode = se.ToLocCode, ToErpLocCode = se.ToErpLocCode, SeCustomerPartCode = se.CustomerPartCodeNoSpace, @@ -310,7 +274,6 @@ namespace SettleAccount.Job.Services.Report groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), LU = groupItem.Max(t => t.LU), - Price = groupItem.Max(t => t.Price), SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode), }; @@ -341,7 +304,6 @@ namespace SettleAccount.Job.Services.Report CustomerOfflineTime = sa.SettleDate, SAQty = sa.Qty, SEQty = se.Qty, - FixPrice = sa.Price, ToLocCode = se.ToLocCode, ToErpLocCode = se.ToErpLocCode, SeCustomerPartCode = se.CustomerPartCodeNoSpace, @@ -362,7 +324,6 @@ namespace SettleAccount.Job.Services.Report CustomerOfflineTime = sa.SettleDate, SAQty = sa.Qty, SEQty = se.Qty, - FixPrice = sa.Price, ToLocCode = se.ToLocCode, ToErpLocCode = se.ToErpLocCode, SeCustomerPartCode = se.CustomerPartCodeNoSpace, 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 84dc1bf8..fb9fd5a2 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 @@ -113,7 +113,6 @@ namespace SettleAccount.Job.Services.Report CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime, SAQty = haveSaNotHaveSe.SAQty, SEQty = notHaveSaHaveSe.SEQty, - FixPrice = haveSaNotHaveSe.FixPrice, PN = haveSaNotHaveSe.PN, ToLocCode = notHaveSaHaveSe.ToLocCode, ToErpLocCode = notHaveSaHaveSe.ToErpLocCode, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs index be05e1a7..f3f240a6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs @@ -116,7 +116,6 @@ namespace SettleAccount.Job.Services.Report SAQty = haveSaNotHaveSe.SAQty, SEQty = notHaveSaHaveSe.SEQty, EdiQty = notHaveSaHaveSe.EdiQty, - FixPrice = haveSaNotHaveSe.FixPrice, PN = haveSaNotHaveSe.PN, ToLocCode = notHaveSaHaveSe.ToLocCode, ToErpLocCode = notHaveSaHaveSe.ToErpLocCode, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs index fbec0db1..d4a16aec 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs @@ -30,6 +30,8 @@ namespace SettleAccount.Job { CreateMap(); CreateMap(); + CreateMap(); + CreateMap(); } /// @@ -38,17 +40,11 @@ namespace SettleAccount.Job private void CreateMapSaSeCompare() { CreateMap(); - CreateMap(); CreateMap(); - CreateMap(); CreateMap(); - CreateMap(); CreateMap(); - CreateMap(); CreateMap(); - CreateMap(); CreateMap(); - CreateMap(); CreateMap(); } }