|
@@ -27,8 +27,10 @@ namespace OASystem.Domain.Dtos.Statistics
|
|
|
/// <summary>
|
|
|
/// item Dto
|
|
|
/// </summary>
|
|
|
- public class CorporateProfitItemDto : CorporateProfitExcelDownloadDto
|
|
|
+ public class CorporateProfitItemDto : CorporateProfitDtos
|
|
|
{
|
|
|
+ public string BeginDt { get; set; }
|
|
|
+ public string EndDt { get; set; }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -39,12 +41,18 @@ namespace OASystem.Domain.Dtos.Statistics
|
|
|
{
|
|
|
public CorporateProfitItemDtoFoalidator()
|
|
|
{
|
|
|
- Include(new CorporateProfitExcelDownloadDtoFoalidator());
|
|
|
+ Include(new CorporateProfitDtosDtoBaseFoalidator());
|
|
|
+ RuleFor(it => it.BeginDt)
|
|
|
+ .Must(dateString => DateTime.TryParse(dateString, out _))
|
|
|
+ .WithMessage("请输入有效开始的日期");
|
|
|
+ RuleFor(it => it.EndDt)
|
|
|
+ .Must(dateString => DateTime.TryParse(dateString, out _))
|
|
|
+ .WithMessage("请输入有效结束的日期");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- public class CorporateProfitExcelDownloadDto : CorporateProfitDtos
|
|
|
+ public class CorporateProfitExcelDownloadDto : CorporateProfitItemDto
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// excel类型
|
|
@@ -59,14 +67,8 @@ namespace OASystem.Domain.Dtos.Statistics
|
|
|
{
|
|
|
public CorporateProfitExcelDownloadDtoFoalidator()
|
|
|
{
|
|
|
- Include(new CorporateProfitDtosDtoBaseFoalidator());
|
|
|
+ Include(new CorporateProfitItemDtoFoalidator());
|
|
|
RuleFor(it => it.ExcelType).InclusiveBetween(1, 5).WithMessage("请输入有效的Excel类型");
|
|
|
- RuleFor(it => it.BeginDt)
|
|
|
- .Must(dateString => DateTime.TryParse(dateString, out _))
|
|
|
- .WithMessage("请输入有效开始的日期");
|
|
|
- RuleFor(it => it.EndDt)
|
|
|
- .Must(dateString => DateTime.TryParse(dateString, out _))
|
|
|
- .WithMessage("请输入有效结束的日期");
|
|
|
|
|
|
}
|
|
|
}
|