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 98f9a181..511fdf03 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 @@ -83,12 +83,6 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase /// private readonly EnumBusinessType _businessType = EnumBusinessType.JisBBAC; - /// - /// 地点 - /// - [Display(Name = "地点")] - public string Site { get; set; } - /// /// 构造 /// @@ -116,6 +110,15 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase _tbRePartsRelationshipRepository = tbRePartsRelationshipRepository; } + /// + /// 地点 + /// + public string Site { get; set; } + /// + /// 期间 + /// + public int Version { get; set; } + #region 导入、导出 /// /// 导入 @@ -124,6 +127,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase public async Task ImportAsync([FromForm] BBACSaImportRequestDto bbacSaImportRequestDto) { Site = bbacSaImportRequestDto.Site; + Version = bbacSaImportRequestDto.Version; #region 导入数据转换、数据校验 ExportImporter _exportImporter = new ExportImporter(); var importDtos = await _exportImporter.UploadExcelImport(bbacSaImportRequestDto.Files, _excelImportService).ConfigureAwait(false); @@ -149,7 +153,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase importBBACSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index); } - importBBACSaDetail.Version = bbacSaImportRequestDto.Version; + importBBACSaDetail.Version = Version; importBBACSaDetail.Site = Site; }); @@ -206,8 +210,13 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase [HttpPost] public async Task> GetListAsync(RequestDto input) { - var entities = await _bbacSaRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); - var totalCount = await _bbacSaRepository.GetCountByFilterAsync(input.Filters); + var businessTypeFilterConditions = input.Filters.FindAll(t => t.Column.ToLower() == "businesstype"); + businessTypeFilterConditions.ForEach(t => + { + t.Value = EnumBusinessType.JisBBAC.ToString(); + }); + var entities = await _bbacSaRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _bbacSaRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } @@ -307,23 +316,23 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase //删除 if (bbacSas.Any()) { - await _bbacSaRepository.DeleteManyAsync(bbacSas); + await _bbacSaRepository.DeleteManyAsync(bbacSas).ConfigureAwait(false); } if (bbacSaDetails.Any()) { - await _bbacSaDetailRepository.DbContext.BulkDeleteAsync(bbacSaDetails); + await _bbacSaDetailRepository.DbContext.BulkDeleteAsync(bbacSaDetails).ConfigureAwait(false); } if (bbacCanSas.Any()) { - await _bbacCanSaRepository.DeleteManyAsync(bbacCanSas); + await _bbacCanSaRepository.DeleteManyAsync(bbacCanSas).ConfigureAwait(false); } if (bbacCanSaDetails.Any()) { - await _bbacCanSaDetailRepository.DbContext.BulkDeleteAsync(bbacCanSaDetails); + await _bbacCanSaDetailRepository.DbContext.BulkDeleteAsync(bbacCanSaDetails).ConfigureAwait(false); } if (bbacNotSaDetails.Any()) { - await _bbacNotSaDetailRepository.DbContext.BulkDeleteAsync(bbacNotSaDetails); + await _bbacNotSaDetailRepository.DbContext.BulkDeleteAsync(bbacNotSaDetails).ConfigureAwait(false); } } #endregion @@ -342,7 +351,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase BillNum = bbacSaBillNum, State = "0", BusinessType = _businessType, - Site = Site + Site = Site, + Version = Version }; //可结算单号 var bbacCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C"); @@ -354,7 +364,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase SettleBillNum = bbacSaBillNum, State = SettleBillState.未结状态, BusinessType = _businessType, - Site = Site + Site = Site, + Version = Version }; //可结算明细 var bbacCanSaDetails = new List(); 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 f73ca271..317d971f 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 @@ -104,6 +104,11 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase _tbRePartsRelationshipRepository = tbRePartsRelationshipRepository; } + /// + /// 期间 + /// + public int Version { get; set; } + #region 导入、导出 /// /// 导入 @@ -111,6 +116,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase [HttpPost] public async Task ImportAsync([FromForm] HBPOSaImportRequestDto hbpoSaImportRequestDto) { + Version = hbpoSaImportRequestDto.Version; #region 导入数据转换、数据校验 ExportImporter _exportImporter = new ExportImporter(); var result = await _exportImporter.UploadExcelImport(hbpoSaImportRequestDto.Files, _excelImportService).ConfigureAwait(false); @@ -127,7 +133,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase var luAssemble = lus.Select(t => t.Replace(" ", "")); importHBOPSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index); } - importHBOPSaDetail.Version = hbpoSaImportRequestDto.Version; + importHBOPSaDetail.Version = Version; }); //Site包含CN1 亦庄 @@ -272,6 +278,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase State = "1", BusinessType = _businessType, Site = site, + Version = Version }; //可结算单号 var hbpoCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C"); @@ -284,6 +291,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase State = SettleBillState.未结状态, BusinessType = _businessType, Site = site, + Version = Version }; //可结算明细 var hbpoCanSaDetails = new List();