From 3e57f464b40384e549bbf58264d049b64a8aed76 Mon Sep 17 00:00:00 2001 From: mahao Date: Wed, 23 Aug 2023 15:31:54 +0800 Subject: [PATCH 1/4] q --- .../Entities/BQ/Dtos/BBAC_SA_DTO.cs | 2 +- .../SettleAccountApplicationAutoMapperProfile.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs index 0381c8bd..9c94a1fc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs @@ -130,7 +130,7 @@ public class BBAC_SA_DETAIL_IMPORT_DTO /// [Display(Name = "Posting Date")] [ImporterHeader(Name = "Posting Date")] - public DateTime SettleDate { set; get; } + public string SettleDate { set; get; } /// /// 结算分组号 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index 23e97577..db713adb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -1025,7 +1025,8 @@ namespace Win.Sfs.SettleAccount .ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum)); CreateMap(); - CreateMap(); + CreateMap() + .ForMember(x => x.SettleDate, y => y.MapFrom(y => DateTime.ParseExact(y.SettleDate, "dd.MM.yyyy", System.Globalization.CultureInfo.CurrentCulture))); } /// From 61b874053198f763b68eba2799ae0e41dbb37aac Mon Sep 17 00:00:00 2001 From: mahao Date: Wed, 23 Aug 2023 16:07:41 +0800 Subject: [PATCH 2/4] 1 --- .../Entities/BQ/BBAC_SA_SERVICE.cs | 9 +++++++++ 1 file changed, 9 insertions(+) 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 51b74e00..64b353b1 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 @@ -140,6 +140,15 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase importBBACSaDetails.ForEach(importBBACSaDetail => { + List lus = importBBACSaDetail.LU.Split(" ").ToList(); + importBBACSaDetail.LU = lus[0].Replace(" ", ""); + if (lus.Count > 1) + { + lus.RemoveAt(0); + var luAssemble = lus.Select(t => t.Replace(" ", "")); + importBBACSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index); + } + importBBACSaDetail.Version = bbacSaImportRequestDto.Version; importBBACSaDetail.Site = Site; }); From 88554f8921f5b41f9b492c122228e41f257a2ed8 Mon Sep 17 00:00:00 2001 From: mahao Date: Wed, 23 Aug 2023 16:17:49 +0800 Subject: [PATCH 3/4] 1 --- .../Entities/BQ/BBAC_SA_SERVICE.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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 64b353b1..98f9a181 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 @@ -340,7 +340,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase var bbacSa = new BBAC_SA() { BillNum = bbacSaBillNum, - State = "1", + State = "0", BusinessType = _businessType, Site = Site }; @@ -408,8 +408,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase #endregion #region 添加入库 - await _bbacSaRepository.InsertAsync(bbacSa); - await _bbacSaDetailRepository.DbContext.BulkInsertAsync(bbacSaDetails); + await _bbacSaRepository.InsertAsync(bbacSa).ConfigureAwait(false); + await _bbacSaDetailRepository.DbContext.BulkInsertAsync(bbacSaDetails).ConfigureAwait(false); if (bbacCanSaDetails.Count > 0) { bbacCanSaDetails.ForEach(bbacCanSaDetail => @@ -418,8 +418,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase bbacCanSaDetail.BusinessType = _businessType; }); - await _bbacCanSaRepository.InsertAsync(bbacCanSa); - await _bbacCanSaDetailRepository.DbContext.BulkInsertAsync(bbacCanSaDetails); + await _bbacCanSaRepository.InsertAsync(bbacCanSa).ConfigureAwait(false); + await _bbacCanSaDetailRepository.DbContext.BulkInsertAsync(bbacCanSaDetails).ConfigureAwait(false); } if (bbacNotSaDetails.Count > 0) { @@ -428,7 +428,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase bbacNotSaDetail.BusinessType = _businessType; }); - await _bbacNotSaDetailRepository.InsertManyAsync(bbacNotSaDetails); + await _bbacNotSaDetailRepository.DbContext.BulkInsertAsync(bbacNotSaDetails).ConfigureAwait(false); } if (materialRelationships.Count > 0) { @@ -452,8 +452,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase List bbacCanSaDetails = new List(); //不可结算 List bbacNotSaDetails = new List(); - var bbacSaEntity = await _bbacSaRepository.FirstOrDefaultAsync(t => t.Id.Equals(id)).ConfigureAwait(false); - //var bbacSaEntity = await _bbacSaRepository.FindAsync(id).ConfigureAwait(false); + var bbacSaEntity = await _bbacSaRepository.FindAsync(id).ConfigureAwait(false); if (bbacSaEntity != null) { //结算单据 From a371eb47dffda8b10c8b8685139125bfa9bdf50e Mon Sep 17 00:00:00 2001 From: mahao Date: Wed, 23 Aug 2023 16:20:13 +0800 Subject: [PATCH 4/4] 1 --- .../Entities/BQ/HBPO_SA_SERVICE.cs | 9 +++++++++ 1 file changed, 9 insertions(+) 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 049a53e3..f73ca271 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 @@ -118,6 +118,15 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase importHBOPSaDetails.ForEach(importHBOPSaDetail => { + importHBOPSaDetail.SetId(GuidGenerator.Create()); + var lus = importHBOPSaDetail.LU.Split(" ").ToList(); + importHBOPSaDetail.LU = lus[0].Replace(" ", ""); + if (lus.Count > 1) + { + lus.RemoveAt(0); + var luAssemble = lus.Select(t => t.Replace(" ", "")); + importHBOPSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index); + } importHBOPSaDetail.Version = hbpoSaImportRequestDto.Version; });