MdpFileImportEntities.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. namespace Admin.NET.Plugin.AiDOP.Entity.DataPlatform;
  2. [SugarTable("mdp_file_import_batch", "MDP Excel文件导入批次")]
  3. public class MdpFileImportBatch
  4. {
  5. [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
  6. public long Id { get; set; }
  7. [SugarColumn(ColumnName = "batch_no", Length = 64)]
  8. public string BatchNo { get; set; } = string.Empty;
  9. [SugarColumn(ColumnName = "tenant_id")]
  10. public long TenantId { get; set; }
  11. [SugarColumn(ColumnName = "factory_id")]
  12. public long FactoryId { get; set; }
  13. [SugarColumn(ColumnName = "source_id")]
  14. public long SourceId { get; set; }
  15. [SugarColumn(ColumnName = "entity_id")]
  16. public long EntityId { get; set; }
  17. [SugarColumn(ColumnName = "entity_code", Length = 100)]
  18. public string EntityCode { get; set; } = string.Empty;
  19. [SugarColumn(ColumnName = "file_name", Length = 255)]
  20. public string FileName { get; set; } = string.Empty;
  21. [SugarColumn(ColumnName = "file_sha256", Length = 64)]
  22. public string FileSha256 { get; set; } = string.Empty;
  23. [SugarColumn(ColumnName = "file_size")]
  24. public long FileSize { get; set; }
  25. [SugarColumn(ColumnName = "sheet_name", Length = 100, IsNullable = true)]
  26. public string? SheetName { get; set; }
  27. [SugarColumn(ColumnName = "import_mode", Length = 40)]
  28. public string ImportMode { get; set; } = "UPSERT";
  29. [SugarColumn(ColumnName = "status", Length = 32)]
  30. public string Status { get; set; } = "UPLOADED";
  31. [SugarColumn(ColumnName = "total_rows")]
  32. public int TotalRows { get; set; }
  33. [SugarColumn(ColumnName = "valid_rows")]
  34. public int ValidRows { get; set; }
  35. [SugarColumn(ColumnName = "error_rows")]
  36. public int ErrorRows { get; set; }
  37. [SugarColumn(ColumnName = "written_rows")]
  38. public int WrittenRows { get; set; }
  39. [SugarColumn(ColumnName = "file_object_key", Length = 500, IsNullable = true)]
  40. public string? FileObjectKey { get; set; }
  41. [SugarColumn(ColumnName = "error_report_key", Length = 500, IsNullable = true)]
  42. public string? ErrorReportKey { get; set; }
  43. [SugarColumn(ColumnName = "transform_status", Length = 32, IsNullable = true)]
  44. public string? TransformStatus { get; set; }
  45. [SugarColumn(ColumnName = "transform_time", IsNullable = true)]
  46. public DateTime? TransformTime { get; set; }
  47. [SugarColumn(ColumnName = "created_by", Length = 100, IsNullable = true)]
  48. public string? CreatedBy { get; set; }
  49. [SugarColumn(ColumnName = "create_time")]
  50. public DateTime CreateTime { get; set; }
  51. [SugarColumn(ColumnName = "commit_time", IsNullable = true)]
  52. public DateTime? CommitTime { get; set; }
  53. [SugarColumn(ColumnName = "error_message", Length = 1000, IsNullable = true)]
  54. public string? ErrorMessage { get; set; }
  55. }
  56. [SugarTable("mdp_file_import_row", "MDP Excel导入原始行")]
  57. public class MdpFileImportRow
  58. {
  59. [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
  60. public long Id { get; set; }
  61. [SugarColumn(ColumnName = "batch_id")]
  62. public long BatchId { get; set; }
  63. [SugarColumn(ColumnName = "row_no")]
  64. public int RowNo { get; set; }
  65. [SugarColumn(ColumnName = "business_key", Length = 500, IsNullable = true)]
  66. public string? BusinessKey { get; set; }
  67. [SugarColumn(ColumnName = "row_hash", Length = 64, IsNullable = true)]
  68. public string? RowHash { get; set; }
  69. [SugarColumn(ColumnName = "raw_json", ColumnDataType = "mediumtext", IsNullable = true)]
  70. public string? RawJson { get; set; }
  71. [SugarColumn(ColumnName = "mapped_json", ColumnDataType = "mediumtext", IsNullable = true)]
  72. public string? MappedJson { get; set; }
  73. [SugarColumn(ColumnName = "validation_status", Length = 32)]
  74. public string ValidationStatus { get; set; } = "OK";
  75. [SugarColumn(ColumnName = "write_status", Length = 32)]
  76. public string WriteStatus { get; set; } = "PENDING";
  77. [SugarColumn(ColumnName = "error_count")]
  78. public int ErrorCount { get; set; }
  79. }
  80. [SugarTable("mdp_file_import_error", "MDP Excel导入错误")]
  81. public class MdpFileImportError
  82. {
  83. [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
  84. public long Id { get; set; }
  85. [SugarColumn(ColumnName = "batch_id")]
  86. public long BatchId { get; set; }
  87. [SugarColumn(ColumnName = "row_no")]
  88. public int RowNo { get; set; }
  89. [SugarColumn(ColumnName = "field_name", Length = 200, IsNullable = true)]
  90. public string? FieldName { get; set; }
  91. [SugarColumn(ColumnName = "error_code", Length = 64)]
  92. public string ErrorCode { get; set; } = string.Empty;
  93. [SugarColumn(ColumnName = "error_message", Length = 1000)]
  94. public string ErrorMessage { get; set; } = string.Empty;
  95. [SugarColumn(ColumnName = "raw_value", Length = 500, IsNullable = true)]
  96. public string? RawValue { get; set; }
  97. }