PrimaryElective.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. using System;
  2. using System.Collections.Generic;
  3. namespace mxdemo.Mind
  4. {
  5. #region model
  6. public class ElectiveSetting
  7. {
  8. //"selectResult": {
  9. // "params": {},
  10. // "roundId": 8,
  11. // "schoolId": 1,
  12. // "year": 2021,
  13. // "name": "第三次",
  14. // "beginTime": "2022-02-16",
  15. // "endTime": "2022-02-17",
  16. // "groupIds": "1,2,3,10,11,12",
  17. public int currentGeneration; // 当前报名状态
  18. public int preferenceCount; // 选填志愿数量
  19. // "groupList": [
  20. // {
  21. // "params": {},
  22. // "groupId": 1,
  23. // "mask": 448,
  24. // "name": "物化生",
  25. // "rank": 1
  26. // },
  27. // {
  28. // "params": { },
  29. // "groupId": 2,
  30. // "mask": 416,
  31. // "name": "物化政",
  32. // "rank": 2
  33. // },
  34. // {
  35. // "params": { },
  36. // "groupId": 3,
  37. // "mask": 400,
  38. // "name": "物化地",
  39. // "rank": 3
  40. // },
  41. // {
  42. // "params": { },
  43. // "groupId": 10,
  44. // "mask": 56,
  45. // "name": "历政地",
  46. // "rank": 10
  47. // },
  48. // {
  49. // "params": { },
  50. // "groupId": 11,
  51. // "mask": 104,
  52. // "name": "历政生",
  53. // "rank": 11
  54. // },
  55. // {
  56. // "params": { },
  57. // "groupId": 12,
  58. // "mask": 88,
  59. // "name": "历生地",
  60. // "rank": 12
  61. // }
  62. // ],
  63. // "state": "1"
  64. //},
  65. //"allowSelect": false
  66. }
  67. // 评测推荐专业
  68. public class RecommendMajor
  69. {
  70. public string majorCategoryName; // 专业类别
  71. public int majorCategoryCode; // 专业编码
  72. public List<int> matchedGroupIds; // // 匹配哪几个组合?
  73. }
  74. // 学生这里无论什么时间得到的都是最终结果,不需要中间快照,以此区分校长的选科数据。
  75. // 校长的选科数据,初选时与学生相同;补录时也需要这份数据、但也需要初选与补录的差异部分;排名均衡同理
  76. public class ElectiveSelectModel
  77. {
  78. public int groupId; // 组合
  79. public string groupName; // 名称
  80. public int classCount; // 班级数
  81. public int personCount; // 人数设置
  82. public int rankInGroup; // 选科实时排名
  83. public int rankInGrade; // 选科全校排名
  84. public bool allowSelect; // 是否可以报名
  85. public string disabledReason; // 不可报名时的原因
  86. public bool selected; // 已报名
  87. public int selectedRank; // 多志愿时的排序
  88. }
  89. public class ElectiveSelectGroupStatistics {
  90. public string name; // stat column name
  91. public ElectiveGeneration.ElectiveGroupGenerationStatistic[] groupDescriptors;
  92. }
  93. ;
  94. public class ElectiveSelectModelWrapper {
  95. public ElectiveSelectModel[] models;
  96. // 动态追加字段 json 格式见 statColumn.json
  97. ElectiveSelectGroupStatistics[] statColumns;
  98. }
  99. // 自选专业
  100. public class ElectiveOptionalMajor
  101. {
  102. public int collegeId;
  103. public string collegeName;
  104. // 可能还包含院校的一些其它属性
  105. public string majorCategoryCode;
  106. public string majorCategoryName;
  107. public Dictionary<string, string> majors;
  108. public string limitationA; // 选科限制1
  109. public string limitationB; // 选科限制2
  110. public List<int> matchedGroupIds; // 匹配的组合
  111. }
  112. #endregion
  113. // 本期会涉及很多隐藏需求,前端会去back-ui按页面+按功能设置很多按钮功能,后续配置为权限组来操作
  114. // 本期后台输出数据的时候不需要按权限屏蔽数据,全量输出即可,以减少后端开发的工作量
  115. // 因为本期要控制隐藏的内容比功能入口、API入口要更精细的粒度,可能是列表的某几列,可能是某些按钮,如果严格API数据规范可能会增加海量的工作。
  116. public interface IPrimaryElectiveService
  117. {
  118. // 旧接口getStudentSelected,返回内容+preferenceCount,志愿数
  119. ElectiveSetting getStudentSelected();
  120. // 学生获取选科状态数据,得到是每个组合最终状态和结果
  121. ElectiveSelectModelWrapper getStudentElectiveModels();
  122. // 学生获取自选专业及匹配情况
  123. List<ElectiveOptionalMajor> getOptionalMajors();
  124. // 初选报名。这里简化原型里的操作,直接提交,如需排序,调sortElectiveSelected接口,并刷新getPrimaryElectivesx
  125. void submitPrimaryElective(ElectiveSelectModel model);
  126. // 调整排序。这里简化原型里的操作,并刷新getPrimaryElectives
  127. void sortPrimaryElective(ElectiveSelectModel model);
  128. // 取消报名
  129. void cancelPrimaryElective(ElectiveSelectModel model);
  130. // 返回学生测评推荐专业以及匹配情况
  131. List<RecommendMajor> getRecommendMajor();
  132. /*
  133. AI分析
  134. 需要的字段:
  135. 详细见analysis.json
  136. score 组合成绩
  137. remainingPlan 剩余计划
  138. highestScoreCount 组合成绩最高人数
  139. highestScoreRank 组合成绩最高人数排名
  140. supplyRank 补录人数排名
  141. supplyCount 补录人数
  142. */
  143. List<ElectiveSelectGroupStatistics> getAIAnalysis()
  144. }
  145. }