ExamSpecialStudent.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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 ExamSpecialStudent : DEntityBase, IEntityTypeBuilder<ExamSpecialStudent>
  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. [StringLength(100)]
  60. public string StudentNumber { get; set; } = "";
  61. /// <summary>
  62. /// 姓名
  63. /// </summary>
  64. [Comment("姓名")]
  65. [Required, StringLength(100)]
  66. public string Name { get; set; }
  67. /// <summary>
  68. /// 证件类型
  69. /// </summary>
  70. [Comment("证件类型")]
  71. [Required, Column(TypeName = "smallint")]
  72. public CertificateType CertificateType { get; set; } = CertificateType.NONE;
  73. /// <summary>
  74. /// 证件号码
  75. /// </summary>
  76. [Comment("证件号码")]
  77. [StringLength(50)]
  78. public string IdNumber { get; set; } = "";
  79. /// <summary>
  80. /// 出生日期
  81. /// </summary>
  82. [Comment("出生日期")]
  83. public DateTime? BirthDate { get; set; }
  84. /// <summary>
  85. /// 性别
  86. /// </summary>
  87. [Comment("性别")]
  88. [Required, Column(TypeName = "smallint")]
  89. public Gender Gender { get; set; } = Gender.UNKNOWN;
  90. /// <summary>
  91. /// 申请原因
  92. /// </summary>
  93. [Comment("申请原因")]
  94. [Required, StringLength(2000)]
  95. public string ApplyReason { get; set; }
  96. /// <summary>
  97. /// 家长姓名
  98. /// </summary>
  99. [Comment("家长姓名")]
  100. [StringLength(100)]
  101. public string PatriarchName { get; set; }
  102. /// <summary>
  103. /// 家长电话
  104. /// </summary>
  105. [Comment("家长电话")]
  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]
  119. public bool IsPreIdentified { get; set; } = false;
  120. /// <summary>
  121. /// 状态
  122. /// </summary>
  123. [Comment("状态")]
  124. [Required, Column(TypeName = "smallint")]
  125. public AuditStatus Status { get; set; } = AuditStatus.AUDIT;
  126. /// <summary>
  127. /// 佐证材料
  128. /// [{ fileId: '123', fileName: '医院证明文件.png', fileExtName: '.png', thumbFileId: '234' }]
  129. /// </summary>
  130. [Comment("佐证材料")]
  131. [Column(TypeName = "json")]
  132. public string Attachments { get; set; } = "[]";
  133. /// <summary>
  134. /// 审核记录
  135. /// [{ id: 1, createTime: '2023-12-25 12:56:23', sysUserId: 5, sysUserName: '张三', sysOrgId: 5, sysOrgName: '基教科', status: 3, remark: '', actionType: 3}]
  136. /// </summary>
  137. [Comment("审核记录")]
  138. [Required, Column(TypeName = "json")]
  139. public string Audits { get; set; } = "[]";
  140. /// <summary>
  141. /// 上一期总分科目数量
  142. /// </summary>
  143. [Comment("上一期总分科目数量")]
  144. public short? PreTotalCourse { get; set; }
  145. /// <summary>
  146. /// 上一期总分
  147. /// </summary>
  148. [Comment("上一期总分")]
  149. [Column(TypeName = "decimal(10, 2)")]
  150. public decimal? PreTotalScore { get; set; }
  151. /// <summary>
  152. /// 一对一引用(机构)
  153. /// </summary>
  154. public virtual SysOrg SysOrg { get; set; }
  155. /// <summary>
  156. /// 一对一引用(年级)
  157. /// </summary>
  158. public virtual Grade Grade { get; set; }
  159. /// <summary>
  160. /// 一对一引用(班级)
  161. /// </summary>
  162. public virtual SchoolClass SchoolClass { get; set; }
  163. /// <summary>
  164. /// 一对一引用(校区)
  165. /// </summary>
  166. public virtual SysOrg SysOrgBranch { get; set; }
  167. /// <summary>
  168. /// 一对一引用(监测年级)
  169. /// </summary>
  170. public virtual ExamGrade ExamGrade { get; set; }
  171. public void Configure(EntityTypeBuilder<ExamSpecialStudent> entityBuilder, DbContext dbContext, Type dbContextLocator)
  172. {
  173. entityBuilder.HasIndex(a => new { a.ExamPlanId, a.SysOrgId }).HasDatabaseName("idx_exam_special_student_exam_plan_id_sys_org_id");
  174. entityBuilder.HasIndex(a => new { a.ExamPlanId, a.SysOrgId, a.SchoolClassId }).HasDatabaseName("idx_exam_special_student_exam_plan_id_soid_scid");
  175. }
  176. }