UploadExamDataOutput.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. namespace YBEE.EQM.Application;
  2. /// <summary>
  3. /// 监测数据上报类型上传输出参数
  4. /// </summary>
  5. public class UploadExamDataOutput<T> where T : UploadExamDataBase
  6. {
  7. /// <summary>
  8. /// 表格结构是否符合要求
  9. /// </summary>
  10. public bool StructureCorrect { get; set; } = false;
  11. /// <summary>
  12. /// 错误消息
  13. /// </summary>
  14. public List<string> ErrorMessage { get; set; } = new();
  15. /// <summary>
  16. /// 总行数
  17. /// </summary>
  18. public int TotalRowCount { get; set; } = 0;
  19. /// <summary>
  20. /// 错误行数
  21. /// </summary>
  22. public int ErrorRowCount { get; set; } = 0;
  23. /// <summary>
  24. /// 成功行数
  25. /// </summary>
  26. public int SuccessRowCount => TotalRowCount - ErrorRowCount;
  27. /// <summary>
  28. /// 行数据
  29. /// </summary>
  30. public List<T> Rows { get; set; } = new();
  31. }
  32. /// <summary>
  33. /// 导入数据行基类
  34. /// </summary>
  35. public abstract class UploadExamDataBase
  36. {
  37. /// <summary>
  38. /// ID
  39. /// </summary>
  40. [Required]
  41. public int RowNumber { get; set; }
  42. /// <summary>
  43. /// 是否成功
  44. /// </summary>
  45. public bool IsSuccess { get; set; } = false;
  46. /// <summary>
  47. /// 错误消息
  48. /// </summary>
  49. public List<string> ErrorMessage { get; set; } = new();
  50. }