From 3fc49a706365d0f3fe63d9eff103fb9938b4bdf9 Mon Sep 17 00:00:00 2001 From: mahao Date: Wed, 6 Sep 2023 09:04:04 +0800 Subject: [PATCH] up --- .../Entities/BQ/BBAC_SA_SERVICE.cs | 1 - .../Entities/BQ/HBPO_SA_SERVICE.cs | 1 - .../Entities/BQ/PUB_SA_SERVICE.cs | 1 - .../Enums/EnumMappingType.cs | 20 +++++++++++ .../Report/PubSaSeCompareExportService.cs | 2 -- .../Report/SaSeCompareExportBaseService.cs | 33 +++++++++++++++++++ 6 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs index ef620e83..ee4d2f05 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs @@ -335,7 +335,6 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase } bbacSaDetail.PN = Regex.Replace(bbacSaDetail.PN, "['‘’]", ""); }); - return GroupPnLu(bbacSaDetails); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs index 01fceaad..6e6a01c7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs @@ -297,7 +297,6 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase hbpoSaDetail.CustomerPartCodeNoSpace = hbpoSaDetail.LU.Replace(" ", ""); hbpoSaDetail.Version = Version; }); - return GroupPnLu(hbpoSaDetails); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs index 43a8b815..d01a4f99 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs @@ -406,7 +406,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase } pubSaDetail.PN = Regex.Replace(pubSaDetail.PN, "['‘’]", ""); }); - return GroupPnLu(pubSaDetails); } 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 new file mode 100644 index 00000000..4a3e7adc --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; + +namespace Win.Sfs.SettleAccount.Enums; + +/// +/// 匹配类型 +/// +public enum EnumMappingType +{ + /// + /// 未定义 + /// + [Display(Name = "未定义")] + None = 0, + /// + /// 完全匹配 + /// + [Display(Name = "完全匹配")] + PerfectMatch = 1 +} 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 4809e404..391dfad3 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 @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; -using EFCore.BulkExtensions; using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.SignalR; using Microsoft.OpenApi.Extensions; @@ -17,7 +16,6 @@ using Volo.Abp.ObjectMapping; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount.Entities.BQ; -using Win.Sfs.SettleAccount.Enums; using Win.Sfs.SettleAccount.Reports; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; using Win.Sfs.Shared.RepositoryBase; 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 a2fb9ce6..ad469c7a 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 @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.SignalR; using SettleAccount.Bases; using SettleAccount.Domain.BQ; using SettleAccount.Job.SignalR; +using Volo.Abp; using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount.Consts; using Win.Sfs.SettleAccount.Enums; @@ -173,6 +174,38 @@ namespace SettleAccount.Job.Services.Report } } + /// + /// 处理发运数据 + /// 结算、发运对比上的数据修改结算数据状态 + /// + 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()) + { + //结算详情 + var saDetails = (from sa in _settleAccountDbContext.Set() + where sa.BusinessType == businessType && sa.Version == version + select sa).ToList(); + if (saDetails.Any()) + { + var saDetailsUpdate = saDetails.Join(haveSaHaveSes, o => new { o.PN, o.LU }, i => new { i.PN, LU = i.CustomerPartCode }, (o, i) => + { + var mappingType = (i.SAQty - i.SEQty) switch + { + > 0 => EnumMappingType.None, + 0 => EnumMappingType.PerfectMatch, + < 0 => EnumMappingType.None, + _ => default, + }; + o.ExtraProperties.Add("MappingType", mappingType); + return o; + }).ToList(); + _settleAccountDbContext.BulkUpdate(saDetailsUpdate); + } + } + } + /// /// 创建导出文件结构 ///