mahao 1 year ago
parent
commit
6bf42f2739
  1. 37
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
  2. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  3. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

37
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<Guid>
/// <summary>
/// BBAC结算导入请求
/// </summary>
public class BBACSaImportRequestDto //: IValidatableObject
public class BBACSaImportRequestDto
{
/// <summary>
/// 文件
@ -119,42 +119,7 @@ public class BBACSaImportRequestDto //: IValidatableObject
/// </summary>
[Display(Name = "地点")]
[Required(ErrorMessage = "{0}必须填写")]
//[ValidateSite(Sites = new string[] { "1040", "1046" }, ErrorMessage = "{0}值无效")]
public string Site { get; set; }
//public IEnumerable<ValidationResult> 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);
//}
}
/// <summary>

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -149,7 +149,7 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
/// </summary>
private List<PriceList> CheckPriceListContinuity(List<PriceList> priceList)
{
var pricelist = new List<PriceList>();
var result = new List<PriceList>();
if (priceList.Count <= 1)
{
return priceList; // 只有一个或零个价格条目
@ -167,11 +167,11 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
{
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; // 所有价格时间都连续
}
/// <summary>

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

@ -133,7 +133,7 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
/// </summary>
private List<PriceListBJ> CheckPriceListContinuity(List<PriceListBJ> priceList)
{
var pricelist = new List<PriceListBJ>();
var result = new List<PriceListBJ>();
if (priceList.Count <= 1)
{
return priceList; // 只有一个或零个价格条目
@ -151,12 +151,12 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
{
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;
}
/// <summary>

Loading…
Cancel
Save