ExamAbsentReplace.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. using Furion.DatabaseAccessor;
  2. using Microsoft.EntityFrameworkCore;
  3. using Microsoft.EntityFrameworkCore.Metadata.Builders;
  4. using System;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.ComponentModel.DataAnnotations.Schema;
  7. namespace YBEE.EQM.Core;
  8. /// <summary>
  9. /// 监测缺测替补
  10. /// </summary>
  11. [Comment("监测缺测替补")]
  12. public class ExamAbsentReplace : DEntityBase, IEntityTypeBuilder<ExamAbsentReplace>
  13. {
  14. /// <summary>
  15. /// 监测计划ID
  16. /// </summary>
  17. [Comment("监测计划ID")]
  18. [Required]
  19. public int ExamPlanId { get; set; }
  20. /// <summary>
  21. /// 机构ID
  22. /// </summary>
  23. [Comment("机构ID")]
  24. [Required]
  25. public short SysOrgId { get; set; }
  26. /// <summary>
  27. /// 校区ID
  28. /// </summary>
  29. [Comment("校区ID")]
  30. public short? SysOrgBranchId { get; set; }
  31. /// <summary>
  32. /// 监测年级ID
  33. /// </summary>
  34. [Comment("监测年级ID")]
  35. [Required]
  36. public int ExamGradeId { get; set; }
  37. /// <summary>
  38. /// 年级ID
  39. /// </summary>
  40. [Comment("年级ID")]
  41. [Required]
  42. public short GradeId { get; set; }
  43. /// <summary>
  44. /// 班级ID
  45. /// </summary>
  46. [Comment("班级ID")]
  47. [Required]
  48. public long SchoolClassId { get; set; }
  49. /// <summary>
  50. /// 班号
  51. /// </summary>
  52. [Comment("班号")]
  53. [Required]
  54. public short ClassNumber { get; set; }
  55. /// <summary>
  56. /// 缺测学生姓名
  57. /// </summary>
  58. [Comment("缺测学生姓名")]
  59. [Required, StringLength(100)]
  60. public string AbsentName { get; set; }
  61. /// <summary>
  62. /// 缺测学生监测号
  63. /// </summary>
  64. [Comment("缺测学生监测号")]
  65. [Required, StringLength(20)]
  66. public string AbsentExamNumber { get; set; }
  67. /// <summary>
  68. /// 缺测科目
  69. /// [{"id": 1, "name": "语文", "shortName": "语"}]
  70. /// </summary>
  71. [Comment("缺测科目")]
  72. [Required, Column(TypeName = "json")]
  73. public string AbsentCourses { get; set; } = "[]";
  74. /// <summary>
  75. /// 缺测原因
  76. /// </summary>
  77. [Comment("缺测原因")]
  78. [Required, StringLength(200)]
  79. public string AbsentReason { get; set; }
  80. /// <summary>
  81. /// 是否有替补
  82. /// </summary>
  83. [Comment("是否有替补")]
  84. [Required]
  85. public bool IsReplaced { get; set; } = false;
  86. /// <summary>
  87. /// 替补学生姓名
  88. /// </summary>
  89. [Comment("替补学生姓名")]
  90. [StringLength(100)]
  91. public string ReplaceName { get; set; }
  92. /// <summary>
  93. /// 替补学生监测号
  94. /// </summary>
  95. [Comment("替补学生监测号")]
  96. [StringLength(20)]
  97. public string ReplaceExamNumber { get; set; }
  98. /// <summary>
  99. /// 家长姓名
  100. /// </summary>
  101. [StringLength(100)]
  102. public string PatriarchName { get; set; }
  103. /// <summary>
  104. /// 家长电话
  105. /// </summary>
  106. [StringLength(50)]
  107. public string PatriarchTel { get; set; }
  108. /// <summary>
  109. /// 备注
  110. /// </summary>
  111. [Comment("备注")]
  112. [StringLength(200)]
  113. public string Remark { get; set; }
  114. /// <summary>
  115. /// 状态
  116. /// </summary>
  117. [Comment("状态")]
  118. [Required, Column(TypeName = "smallint")]
  119. public AuditStatus Status { get; set; } = AuditStatus.AUDIT;
  120. /// <summary>
  121. /// 佐证材料
  122. /// </summary>
  123. [Comment("佐证材料")]
  124. [Column(TypeName = "json")]
  125. public string Attachments { get; set; } = "[]";
  126. /// <summary>
  127. /// 审核记录
  128. /// </summary>
  129. [Comment("审核记录")]
  130. [Required, Column(TypeName = "json")]
  131. public string Audits { get; set; } = "[]";
  132. /// <summary>
  133. /// 一对一引用(机构)
  134. /// </summary>
  135. public virtual SysOrg SysOrg { get; set; }
  136. /// <summary>
  137. /// 一对一引用(年级)
  138. /// </summary>
  139. public virtual Grade Grade { get; set; }
  140. /// <summary>
  141. /// 一对一引用(班级)
  142. /// </summary>
  143. public virtual SchoolClass SchoolClass { get; set; }
  144. /// <summary>
  145. /// 一对一引用(校区)
  146. /// </summary>
  147. public virtual SysOrg SysOrgBranch { get; set; }
  148. /// <summary>
  149. /// 一对一引用(监测年级)
  150. /// </summary>
  151. public virtual ExamGrade ExamGrade { get; set; }
  152. public void Configure(EntityTypeBuilder<ExamAbsentReplace> entityBuilder, DbContext dbContext, Type dbContextLocator)
  153. {
  154. entityBuilder.HasIndex(a => new { a.ExamPlanId, a.SysOrgId }).HasDatabaseName("idx_exam_absent_replace_exam_plan_id_sys_org_id");
  155. entityBuilder.HasIndex(a => new { a.ExamPlanId, a.SysOrgId, a.SchoolClassId }).HasDatabaseName("idx_exam_absent_replacet_exam_plan_id_soid_scid");
  156. }
  157. }