From 6bf42f27390ca7b75cbcf5c68fc749fafa71b483 Mon Sep 17 00:00:00 2001 From: mahao Date: Tue, 12 Sep 2023 09:04:59 +0800 Subject: [PATCH] up --- .../Entities/BQ/Dtos/BBAC_SA_DTO.cs | 37 +------------------ .../Entities/Prices/PriceListAppService.cs | 6 +-- .../Entities/Prices/PriceListAppServiceBJ.cs | 6 +-- 3 files changed, 7 insertions(+), 42 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 c6c838b2..fd220de2 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 @@ -103,7 +103,7 @@ public class BBAC_SA_DETAIL_DTO : AuditedAggregateRoot /// /// BBAC结算导入请求 /// -public class BBACSaImportRequestDto //: IValidatableObject +public class BBACSaImportRequestDto { /// /// 文件 @@ -119,42 +119,7 @@ public class BBACSaImportRequestDto //: IValidatableObject /// [Display(Name = "地点")] [Required(ErrorMessage = "{0}必须填写")] - //[ValidateSite(Sites = new string[] { "1040", "1046" }, ErrorMessage = "{0}值无效")] public string Site { get; set; } - - //public IEnumerable Validate(ValidationContext validationContext) - //{ - // if (Site != "1040" && Site != "1046") - // { - // yield return new ValidationResult( - // $"地点值无效", - // new[] { nameof(Site) }); - // } - //} -} - -public class ValidateSiteAttribute : ValidationAttribute -{ - public ValidateSiteAttribute() - { - } - - public string[] Sites { get; set; } - - protected override ValidationResult IsValid(object value, ValidationContext validationContext) - { - if (!Sites.Contains(value)) - { - return new ValidationResult(FormatErrorMessage(validationContext.DisplayName)); - } - return ValidationResult.Success; - } - - //public override bool IsValid(object value) - //{ - // return AllowEmptyStrings || value is not string stringValue || !string.IsNullOrWhiteSpace(stringValue); - // return base.IsValid(value); - //} } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index c297c05b..4403ccc7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -149,7 +149,7 @@ public class PriceListAppService : SettleAccountApplicationBase /// private List CheckPriceListContinuity(List priceList) { - var pricelist = new List(); + var result = new List(); if (priceList.Count <= 1) { return priceList; // 只有一个或零个价格条目 @@ -167,11 +167,11 @@ public class PriceListAppService : SettleAccountApplicationBase { if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginTime != sortedList[i - 1].EndTime.AddDays(1)) { - pricelist.Add(sortedList[i]); + result.Add(sortedList[i]); } } } - return pricelist; // 所有价格时间都连续 + return result; // 所有价格时间都连续 } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs index e593dd1d..f78edce6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs @@ -133,7 +133,7 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase /// private List CheckPriceListContinuity(List priceList) { - var pricelist = new List(); + var result = new List(); if (priceList.Count <= 1) { return priceList; // 只有一个或零个价格条目 @@ -151,12 +151,12 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase { if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginDate != sortedList[i - 1].EndDate.AddDays(1)) { - pricelist.Add(sortedList[i]); + result.Add(sortedList[i]); } } } - return pricelist; // 所有价格时间都连续 + return result; } ///