From cd9312aad88ef80e0853a03988b34e5b98233000 Mon Sep 17 00:00:00 2001 From: mahao Date: Fri, 22 Sep 2023 13:11:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[37]=E6=AF=94=E5=AF=B9=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=BD=93=E6=9C=9F=E5=8F=91=E7=A5=A8=E6=A0=B8?= =?UTF-8?q?=E5=AF=B9=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9C=80=E8=A6=81=E6=89=93?= =?UTF-8?q?=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MaterialRelationshipDtoBase.cs | 4 + .../Entities/BQ/BBAC_SA_SERVICE.cs | 24 +++--- .../Entities/BQ/HBPO_SA_SERVICE.cs | 29 ++++--- .../Entities/BQ/PUB_SA_SERVICE.cs | 27 +++---- .../Entities/BQ/PUB_SE_DETAIL_SERVICE.cs | 79 ------------------- .../BQ/Syncs/JisBBACSeSyncBaseAppService.cs | 3 + .../BQ/Syncs/JisHBPOSeSyncBaseAppService.cs | 3 + .../Entities/BQ/Syncs/JitSeSyncAppService.cs | 3 + .../Entities/BQ/Syncs/SeSyncExtendManager.cs | 4 +- .../MaterialRelationshipAppService.cs | 18 ++++- ...ttleAccountApplicationAutoMapperProfile.cs | 1 + .../Reports/SaSeEdiCompareDetailReport.cs | 7 ++ .../Reports/SaSeEdiCompareDiff.cs | 9 +++ .../JisBBACSaSeEdiCompareExportService.cs | 3 + .../JisHBPOSaSeEdiCompareExportService.cs | 3 + .../MaiDanBBACSaSeCompareExportService.cs | 1 + .../MaiDanHBPOSaSeCompareExportService.cs | 1 + .../Report/SeEdiCompareExportBaseService.cs | 5 ++ 18 files changed, 99 insertions(+), 125 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs index 513cb1f6..1a49d384 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs @@ -138,6 +138,10 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships /// 文件 /// public IFormFileCollection Files { get; set; } + /// + /// 业务分类 + /// + public EnumBusinessType BusinessType { get; set; } } /// 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 8c52fef0..ba25744c 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 @@ -187,18 +187,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } } - //if (!checkList.Any()) - //{ - // //验证客户对应厂内零件号是否存在 - // if (jisSaDetails.Any()) - // { - // checkList.AddRange(await CheckAsync(jisSaDetails, EnumBusinessType.JisBBAC).ConfigureAwait(false)); - // } - // if (maiDanSaDetails.Any()) - // { - // checkList.AddRange(await CheckAsync(maiDanSaDetails, EnumBusinessType.MaiDanJianBBAC).ConfigureAwait(false)); - // } - //} + if (!checkList.Any()) + { + //验证客户对应厂内零件号是否存在 + if (jisSaDetails.Any()) + { + checkList.AddRange(await CheckAsync(jisSaDetails, EnumBusinessType.JisBBAC).ConfigureAwait(false)); + } + if (maiDanSaDetails.Any()) + { + checkList.AddRange(await CheckAsync(maiDanSaDetails, EnumBusinessType.MaiDanJianBBAC).ConfigureAwait(false)); + } + } if (checkList.Count > 0) { 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 d77c8aa2..bf254557 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 @@ -120,15 +120,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public async Task ImportAsync([FromForm] HBPOSaImportRequestDto hbpoSaImportRequestDto) { IActionResult result = new JsonResult(new { Code = 400 }); + BusinessType = hbpoSaImportRequestDto.BusinessType; Version = hbpoSaImportRequestDto.Version; - switch (hbpoSaImportRequestDto.BusinessType) + switch (BusinessType) { case EnumBusinessType.JisHBPO: - BusinessType = EnumBusinessType.JisHBPO; result = await ImportJisHBPOAsync(hbpoSaImportRequestDto.Files).ConfigureAwait(false); break; case EnumBusinessType.MaiDanJianHBPO: - BusinessType = EnumBusinessType.MaiDanJianHBPO; result = await ImportMaiDanJianHBPOAsync(hbpoSaImportRequestDto.Files).ConfigureAwait(false); break; default: @@ -515,18 +514,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ if (!checkList.Any()) { - ////验证客户对应厂内零件号是否存在 - ////导入的零件号集合 - //var importSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct(); - //var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == BusinessType && importSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); - //var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct(); - - ////不存在的客户零件号(差集) - //var noExistSettleMaterialCodes = importSaLUs.Except(materialRelationshipEntitySettleMaterialCodes); - //noExistSettleMaterialCodes.ForEach(t => - //{ - // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty)); - //}); + //验证客户对应厂内零件号是否存在 + //导入的零件号集合 + var importSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct(); + var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == BusinessType && importSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); + var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct(); + + //不存在的客户零件号(差集) + var noExistSettleMaterialCodes = importSaLUs.Except(materialRelationshipEntitySettleMaterialCodes); + noExistSettleMaterialCodes.ForEach(t => + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty)); + }); } return checkList; 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 98f1236d..dde85e06 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 @@ -403,21 +403,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ if (!checkList.Any()) { - if (businessType == EnumBusinessType.BeiJian) + //验证客户对应厂内零件号是否存在 + //导入的零件号集合 + var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct(); + var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == businessType && importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); + var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct(); + + //不存在的客户零件号(差集) + var noExistSettleMaterialCodes = importPubSaLUs.Except(materialRelationshipEntitySettleMaterialCodes); + noExistSettleMaterialCodes.ForEach(t => { - //验证客户对应厂内零件号是否存在 - //导入的零件号集合 - var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct(); - var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == businessType && importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); - var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct(); - - //不存在的客户零件号(差集) - var noExistSettleMaterialCodes = importPubSaLUs.Except(materialRelationshipEntitySettleMaterialCodes); - noExistSettleMaterialCodes.ForEach(t => - { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty)); - }); - } + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty)); + }); } return checkList; @@ -531,7 +528,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ .FirstOrDefault(); importPubSaDetail.Price = priceListEntity?.Price ?? 0; }); - } + } #endregion // 客户-厂内零件号关系 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 e6b71bc7..f27bee5f 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 @@ -78,85 +78,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); return fileName; } - - [HttpGet] - public async Task TextExportAsync() - { - var fileName = $"发运数据_{Guid.NewGuid()}.xlsx"; - var haveEdiHaveSeList = new List(); - - for (int i = 0; i < 2_000_000; i++) - { - haveEdiHaveSeList.Add(new SeEidCompareReportJisBBAC() - { - Category = "JIS", - WmsBillNum = i.ToString(), - CarModeCode = i.ToString(), - LineStationcode = i.ToString(), - SequenceNumber = i.ToString(), - ParType = i.ToString(), - MESConfigCode = i.ToString(), - ShippingDate = DateTime.Now, - PN = i.ToString(), - Seq = i.ToString(), - PjsNum = i.ToString(), - MaterialNumber = i.ToString(), - MaterialDes = i.ToString(), - SEQty = 1, - EdiQty = 1, - AssemblyDate = DateTime.Now, - MatchNumber = i.ToString(), - InjectionCode = i.ToString(), - DiffDesc = "WMS有发货EDI有订单" - }); - } - - var jisBBACEidSeCompareEexcelExporterAttribute = typeof(SeEidCompareReportJisBBAC).GetAttribute(); - var jisBBACEidSeCompareEexcelMaxRowNumberOnASheet = 9_000_000; - if (jisBBACEidSeCompareEexcelExporterAttribute != null) - { - jisBBACEidSeCompareEexcelMaxRowNumberOnASheet = jisBBACEidSeCompareEexcelExporterAttribute.MaxRowNumberOnASheet > 0 ? jisBBACEidSeCompareEexcelExporterAttribute.MaxRowNumberOnASheet : jisBBACEidSeCompareEexcelMaxRowNumberOnASheet; - } - - ExcelExporter excelExporter = new ExcelExporter(); - excelExporter.Append(haveEdiHaveSeList.Take(jisBBACEidSeCompareEexcelMaxRowNumberOnASheet).ToList(), $"BBACEDI数据和发货对比"); - - var ediSheetCount = (int)(haveEdiHaveSeList.Count / jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) + ((haveEdiHaveSeList.Count % jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) > 0 ? 1 : 0); - if (ediSheetCount > 1) - { - for (int i = 1; i < ediSheetCount; i++) - { - var sheetDataItems = haveEdiHaveSeList.Skip(i * jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) - .Take(jisBBACEidSeCompareEexcelMaxRowNumberOnASheet).ToList(); - excelExporter.SeparateBySheet(); - excelExporter.Append(sheetDataItems, $"BBACEDI数据和发货对比-{i}"); - } - } - - excelExporter.Append(haveEdiHaveSeList.Take(jisBBACEidSeCompareEexcelMaxRowNumberOnASheet).ToList(), $"BBAC发货和EDI数据对比"); - var seSheetCount = (int)(haveEdiHaveSeList.Count / jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) + ((haveEdiHaveSeList.Count % jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) > 0 ? 1 : 0); - if (seSheetCount > 1) - { - for (int i = 1; i < seSheetCount; i++) - { - var sheetDataItems = haveEdiHaveSeList.Skip(i * jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) - .Take(jisBBACEidSeCompareEexcelMaxRowNumberOnASheet).ToList(); - excelExporter.SeparateBySheet(); - excelExporter.Append(sheetDataItems, $"BBAC发货和EDI数据对比-{i}"); - } - } - - //excelExporter - // .Append(haveEdiHaveSeList, $"BBACEDI数据和发货对比"); - //.SeparateBySheet() - ////.Append(haveEdiHaveSeList, $"BBAC发货和EDI数据对比"); - - var result = excelExporter.ExportAppendDataAsByteArray(); - await result.ShouldNotBeNull().ConfigureAwait(false); - await _fileContainer.SaveAsync(fileName, result.Result, true).ConfigureAwait(false); - return fileName; - } - #endregion #region 查询 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs index 11be30ae..8b2e7ecd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs @@ -173,6 +173,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); } + var dateTimeNow = DateTime.Now; seDetails.ForEach(t => { t.SetId(GuidGenerator.Create()); @@ -183,6 +184,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); } + t.CreateTime = dateTimeNow; + t.CreationTime = dateTimeNow; }); var syncPosition = seDetails.Last().UID.ToString(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs index 6db96639..3084dcf5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs @@ -174,6 +174,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); } + var dateTimeNow = DateTime.Now; seDetails.ForEach(t => { t.SetId(GuidGenerator.Create()); @@ -184,6 +185,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); } + t.CreateTime = dateTimeNow; + t.CreationTime = dateTimeNow; }); var syncPosition = seDetails.Last().UID.ToString(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs index 0b074641..bfb66f7e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs @@ -122,6 +122,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs } } + var dateTimeNow = DateTime.Now; seDetails.ForEach(t => { t.SetId(GuidGenerator.Create()); @@ -132,6 +133,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); } + t.CreateTime = dateTimeNow; + t.CreationTime = dateTimeNow; }); var syncPosition = seDetails.Last().UID.ToString(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs index 9cc643cc..c3b31845 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs @@ -89,7 +89,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs Qty = t.Qty, ReMark = t.Remark, RealCode = t.RealCode, - RealPartCode = t.PartCode, + RealPartCode = t.RealPartCode, Seq = t.Seq, UniqueCode = isJisTable ? t.UniqueCode : t.DeliverCode, VinCode = t.VinCode, @@ -117,7 +117,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs Qty = -t.Qty, ReMark = t.Remark, RealCode = t.RealCode, - RealPartCode = t.PartCode, + RealPartCode = t.RealPartCode, Seq = t.Seq, UniqueCode = isJisTable ? t.UniqueCode : t.DeliverCode, VinCode = t.VinCode, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs index 7b2c5eb9..1eb93009 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs @@ -58,6 +58,11 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase ImportAsync([FromForm] MaterialRelationshipImportRequestDto materialRelationshipImportRequestDto) { + var businessType = materialRelationshipImportRequestDto.BusinessType; + if (businessType == EnumBusinessType.None) + { + return new JsonResult(new { Code = 400, Message = "导入成功" }); + } var exportImporter = new ExportImporter(); var inportDatas = await exportImporter.UploadExcelImport(materialRelationshipImportRequestDto.Files, _excelImportService).ConfigureAwait(false); var entitys = ObjectMapper.Map, List>(inportDatas); @@ -83,10 +88,10 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase p.ErpMaterialCode == item.ErpMaterialCode && p.BusinessType == EnumBusinessType.BeiJian && p.SettleMaterialCode == item.SettleMaterialCode); + var entity = _repository.FirstOrDefault(p => p.ErpMaterialCode == item.ErpMaterialCode && p.BusinessType == businessType && p.SettleMaterialCode == item.SettleMaterialCode); if (entity == null) { - item.BusinessType = EnumBusinessType.BeiJian; + item.BusinessType = businessType; await _repository.InsertAsync(item).ConfigureAwait(false); } } @@ -124,6 +129,15 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase, List>(entities); return new PagedResultDto(totalCount, dtos); } + + /// + /// 批量删除 + /// + [HttpPost] + public async Task DeleteListAsync(List ids) + { + return await _repository.DeleteListAsync(ids).ConfigureAwait(false); + } #endregion #region 原方法(废弃) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index 9f2d2bc8..d58fc0b1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Reflection; using AutoMapper; using SettleAccount.Domain.BQ; +using Volo.Abp.AutoMapper; using Win.Sfs.SettleAccount.Boms; using Win.Sfs.SettleAccount.BTNotConsignReports; using Win.Sfs.SettleAccount.BTSeqKBDiffReports; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs index 8d9bbf59..7cc95690 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs @@ -173,5 +173,12 @@ namespace Win.Sfs.SettleAccount.Reports [Display(Name = "WMS发货库位")] [ExporterHeader(DisplayName = "WMS发货库位")] public string ToLocCode { get; set; } + /// + /// 是否是当期 + /// + [Display(Name = "当期")] + [ValueMapping("当期数据", true)] + [ValueMapping("", false)] + public bool IsCurrent { 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 cd78ff88..88c96185 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs @@ -9,6 +9,11 @@ namespace Win.Sfs.SettleAccount.Reports /// public class SaSeEdiCompareDiff { + /// + /// 期间 + /// + [Display(Name = "期间")] + public int Version { get; set; } /// /// 类型 /// @@ -119,6 +124,10 @@ namespace Win.Sfs.SettleAccount.Reports /// [Display(Name = "替换厂内物料号")] public string ReplaceFactoryPartCode { get; set; } + /// + /// 是否是当期 + /// + public bool IsCurrent { get; set; } } /// 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 8aad5ea4..01f6dbce 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 @@ -104,6 +104,7 @@ namespace SettleAccount.Job.Services.Report { saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(p => p.PN == pn); } + saSeEdiCompareDiffs.FindAll(t => t.Version == version).ForEach(t => t.IsCurrent = true); saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList(); var excelExporter = new ExcelExporter(); @@ -133,6 +134,7 @@ namespace SettleAccount.Job.Services.Report groupItem.Key.PN, groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), + Version = groupItem.Max(t => t.Version), LU = groupItem.Max(t => t.LU), SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode), @@ -190,6 +192,7 @@ namespace SettleAccount.Job.Services.Report from seEdi in temp.DefaultIfEmpty() select new SaSeEdiCompareDiff() { + Version = sa.Version, WmsBillNum = seEdi.WmsBillNum, ShippingDate = seEdi.ShippingDate, CustomerOfflineTime = sa.SettleDate, 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 84ce98ef..2ec3fb40 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 @@ -103,6 +103,7 @@ namespace SettleAccount.Job.Services.Report { saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(p => p.PN == pn); } + saSeEdiCompareDiffs.FindAll(t => t.Version == version).ForEach(t => t.IsCurrent = true); saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList(); var excelExporter = new ExcelExporter(); @@ -132,6 +133,7 @@ namespace SettleAccount.Job.Services.Report groupItem.Key.PN, groupItem.Key.CustomerPartCodeNoSpace, Qty = groupItem.Sum(t => t.Qty), + Version = groupItem.Max(t => t.Version), LU = groupItem.Max(t => t.LU), SettleDate = groupItem.Max(t => t.SettleDate), PartCode = groupItem.Max(t => t.PartCode), @@ -189,6 +191,7 @@ namespace SettleAccount.Job.Services.Report from seEdi in temp.DefaultIfEmpty() select new SaSeEdiCompareDiff() { + Version = sa.Version, WmsBillNum = seEdi.WmsBillNum, ShippingDate = seEdi.ShippingDate, CustomerOfflineTime = sa.SettleDate, 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 66c8f827..b90d7cbf 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 @@ -104,6 +104,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(); var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); 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 a443cf23..dded713d 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 @@ -104,6 +104,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(); var items = _objectMapper.Map, List>(pubSaSeCompareDiffs); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs index f7c32932..96e2d553 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs @@ -38,6 +38,11 @@ namespace SettleAccount.Job.Services.Report /// /// 获取发运、Eid比对数据 /// + /// + /// 输出全量的无发运的Edi数据 + /// 输出全量的无Edi的发运数据 + /// 输出检索时间段内的有Edi有发运的数据 + /// public ExcelExporter GetSeEdiCompareData(DateTime seStartDateTime, DateTime seEndDateTime, EnumBusinessType businessType) where TSe : JisSeBase where TEdi : SE_EDI From fa926ad278d6429df92b23ade82aedc484f91c2e Mon Sep 17 00:00:00 2001 From: mahao Date: Fri, 22 Sep 2023 14:54:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[37]=E6=AF=94=E5=AF=B9=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=BD=93=E6=9C=9F=E5=8F=91=E7=A5=A8=E6=A0=B8?= =?UTF-8?q?=E5=AF=B9=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9C=80=E8=A6=81=E6=89=93?= =?UTF-8?q?=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MaterialRelationshipDtoBase.cs | 11 ++++++----- .../MaterialRelationshipAppService.cs | 6 ++++++ .../Reports/SaSeEdiCompareDiff.cs | 2 +- .../Report/JisBBACSaSeEdiCompareExportService.cs | 5 +++-- .../Report/JisHBPOSaSeEdiCompareExportService.cs | 5 +++-- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs index 1a49d384..ebeb30eb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs @@ -99,19 +99,16 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships /// [ExporterHeaderAttribute(DisplayName = "厂内物料号")] public string ErpMaterialCode { get; set; } - /// /// 厂内物料描述 /// [ExporterHeaderAttribute(DisplayName = "厂内物料描述")] public string MaterialDesc { get; set; } - /// /// 客户物料号 /// [ExporterHeaderAttribute(DisplayName = "客户物料号")] public string SettleMaterialCode { get; set; } - /// /// 业务类别 /// @@ -157,14 +154,12 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships [Required(ErrorMessage = "{0}是必填项")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ErpMaterialCode { get; set; } - /// /// 厂内物料描述 /// [ImporterHeader(Name = "厂内物料描述")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] public string MaterialDesc { get; set; } - /// /// 客户物料号 /// @@ -172,6 +167,12 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships [Required(ErrorMessage = "{0}是必填项")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] public string SettleMaterialCode { get; set; } + /// + /// 业务类别 + /// + [ImporterHeader(Name = "业务类别")] + [Required(ErrorMessage = "{0}是必填项")] + public EnumBusinessType BusinessType { get; set; } } public class MaterialRelationshipDetailDto : EntityDto diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs index 1eb93009..2490e945 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs @@ -71,6 +71,12 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase 0) { + var checkBusinessType = entitys.FindAll(t => t.BusinessType != businessType); + foreach (var item in checkBusinessType) + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户物料号{item.SettleMaterialCode}业务类别导入错误", string.Empty)); + } + var query = from arc in entitys group arc by new { arc.SettleMaterialCode } into g 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 88c96185..60916852 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs @@ -13,7 +13,7 @@ namespace Win.Sfs.SettleAccount.Reports /// 期间 /// [Display(Name = "期间")] - public int Version { get; set; } + public string Version { get; set; } /// /// 类型 /// 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 01f6dbce..1024e34c 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 @@ -104,7 +104,7 @@ namespace SettleAccount.Job.Services.Report { saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(p => p.PN == pn); } - saSeEdiCompareDiffs.FindAll(t => t.Version == version).ForEach(t => t.IsCurrent = true); + saSeEdiCompareDiffs.FindAll(t => t.Version == version.ToString()).ForEach(t => t.IsCurrent = true); saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList(); var excelExporter = new ExcelExporter(); @@ -192,7 +192,7 @@ namespace SettleAccount.Job.Services.Report from seEdi in temp.DefaultIfEmpty() select new SaSeEdiCompareDiff() { - Version = sa.Version, + Version = sa.Version.ToString(), WmsBillNum = seEdi.WmsBillNum, ShippingDate = seEdi.ShippingDate, CustomerOfflineTime = sa.SettleDate, @@ -216,6 +216,7 @@ namespace SettleAccount.Job.Services.Report from sa in temp.DefaultIfEmpty() select new SaSeEdiCompareDiff() { + Version = sa.Version.ToString(), WmsBillNum = seEdi.WmsBillNum, ShippingDate = seEdi.ShippingDate, CustomerOfflineTime = sa.SettleDate, 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 2ec3fb40..3c86bd10 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 @@ -103,7 +103,7 @@ namespace SettleAccount.Job.Services.Report { saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(p => p.PN == pn); } - saSeEdiCompareDiffs.FindAll(t => t.Version == version).ForEach(t => t.IsCurrent = true); + saSeEdiCompareDiffs.FindAll(t => t.Version == version.ToString()).ForEach(t => t.IsCurrent = true); saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList(); var excelExporter = new ExcelExporter(); @@ -191,7 +191,7 @@ namespace SettleAccount.Job.Services.Report from seEdi in temp.DefaultIfEmpty() select new SaSeEdiCompareDiff() { - Version = sa.Version, + Version = sa.Version.ToString(), WmsBillNum = seEdi.WmsBillNum, ShippingDate = seEdi.ShippingDate, CustomerOfflineTime = sa.SettleDate, @@ -215,6 +215,7 @@ namespace SettleAccount.Job.Services.Report from sa in temp.DefaultIfEmpty() select new SaSeEdiCompareDiff() { + Version = sa.Version.ToString(), WmsBillNum = seEdi.WmsBillNum, ShippingDate = seEdi.ShippingDate, CustomerOfflineTime = sa.SettleDate,