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/Entities/BQ/BBAC_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs index 51b74e00..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 @@ -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; }); @@ -331,7 +340,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase var bbacSa = new BBAC_SA() { BillNum = bbacSaBillNum, - State = "1", + State = "0", BusinessType = _businessType, Site = Site }; @@ -399,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 => @@ -409,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) { @@ -419,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) { @@ -443,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) { //结算单据 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; }); 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))); } ///