12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- using FluentValidation;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace OASystem.Domain.Dtos.Statistics
- {
- /// <summary>
- /// 企业利润dtos
- /// </summary>
- public class CorporateProfitDtos : UserPageFuncDtoBase
- {
- }
- public class CorporateProfitDtosDtoBaseFoalidator : AbstractValidator<CorporateProfitDtos>
- {
- public CorporateProfitDtosDtoBaseFoalidator()
- {
- RuleFor(it => it.PortType).InclusiveBetween(1, 3).WithMessage(MsgTips.Port);
- RuleFor(it => it.UserId).GreaterThan(1).WithMessage(MsgTips.UserId);
- RuleFor(it => it.PageId).GreaterThan(1).WithMessage(MsgTips.PageId);
- }
- }
- /// <summary>
- /// item Dto
- /// </summary>
- public class CorporateProfitItemDto : CorporateProfitExcelDownloadDto
- {
- }
- /// <summary>
- /// item Dto
- /// 参数验证
- /// </summary>
- public class CorporateProfitItemDtoFoalidator : AbstractValidator<CorporateProfitItemDto>
- {
- public CorporateProfitItemDtoFoalidator()
- {
- Include(new CorporateProfitExcelDownloadDtoFoalidator());
- }
- }
- public class CorporateProfitExcelDownloadDto : CorporateProfitDtos
- {
- /// <summary>
- /// excel类型
- /// 1 月报表 2 季度报表 3 年报表 4 导出 5 生成
- /// </summary>
- public int ExcelType { get; set; }
- public string BeginDt { get; set; }
- public string EndDt { get; set; }
- }
- public class CorporateProfitExcelDownloadDtoFoalidator : AbstractValidator<CorporateProfitExcelDownloadDto>
- {
- public CorporateProfitExcelDownloadDtoFoalidator()
- {
- Include(new CorporateProfitDtosDtoBaseFoalidator());
- 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("请输入有效结束的日期");
- }
- }
- }
|