GroupList.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.Text;
  5. using TEAMModelOS.SDK.DI;
  6. namespace TEAMModelOS.SDK.Models
  7. {
  8. public class GroupList : CosmosEntity
  9. {
  10. public GroupList()
  11. {
  12. pk = "GroupList";
  13. }
  14. public string name { get; set; }
  15. //标记该名单唯一code
  16. public string no { get; set; }
  17. public string periodId { get; set; }
  18. //课程id,需要标记则标记
  19. //public string courseId { get; set; }
  20. public string scope { get; set; }
  21. public string school { get; set; }
  22. public string creatorId { get; set; }
  23. /// <summary>
  24. ///教学班teach ,行政班(学生搜寻classId动态返回)class ,教研组research,学科组(学科搜寻动态返回)subject,好友friend,管理manage,群组group等,"activity"
  25. /// </summary>
  26. public string type { get; set; } = "teach";
  27. /// <summary>
  28. /// 名单过期时间。
  29. /// </summary>
  30. public long expire { get; set; } = 0;
  31. public int year { get; set; }
  32. /// <summary>
  33. /// 醍摩豆id成员数量
  34. /// </summary>
  35. public int tcount { get; set; }
  36. /// <summary>
  37. /// 校内账号成员数量
  38. /// </summary>
  39. public int scount { get; set; }
  40. public List<Member> members { get; set; } = new List<Member>();
  41. public string leader { get; set; }
  42. /// <summary>
  43. /// 名单创建来源,0 默认,1 个人 ,2 学校,3 校内应用,4企业应用
  44. /// </summary>
  45. public int froms { get; set; } = 0;
  46. /// <summary>
  47. /// 个人名单是否开放 加入。0 不允许,1 允许。
  48. /// </summary>
  49. public int joinLock { get; set; } = 1;
  50. /// <summary>
  51. /// 是否开启审核,0未开启,1开启。
  52. /// </summary>
  53. public int review { get; set; } = 0;
  54. /// <summary>
  55. /// 加入人数200人,学生加入已满200 自动关闭加入。可手动解除限制,开启审核时,关闭人数上限设置机制
  56. /// </summary>
  57. public int limitCount { get; set; } = 200;
  58. /// <summary>
  59. /// 自选座号 0 不允许,1 允许
  60. /// </summary>
  61. public int optNo { get; set; }
  62. /// <summary>
  63. /// 二维码 天数
  64. /// </summary>
  65. public int qrcodeDays { get; set; } = 1;
  66. /// <summary>
  67. /// 二维码过期时间
  68. /// </summary>
  69. public long qrcodeExpire { get; set; }
  70. //名单中包含校内学生的入学年
  71. public HashSet<int> grades { get; set; } = new HashSet<int>();
  72. }
  73. public class RGroupList
  74. {
  75. public string id { get; set; }
  76. public string code { get; set; }
  77. public string pk { get; set; }
  78. public int? ttl { get; set; } = -1;
  79. public RGroupList()
  80. {
  81. pk = "GroupList";
  82. }
  83. public string name { get; set; }
  84. //标记该名单唯一code
  85. public string no { get; set; }
  86. public string periodId { get; set; }
  87. //课程id,需要标记则标记
  88. //public string courseId { get; set; }
  89. public string scope { get; set; }
  90. public string school { get; set; }
  91. public string creatorId { get; set; }
  92. /// <summary>
  93. ///研修培训名单,yxtrain 教学班teach ,行政班(学生搜寻classId动态返回)class ,教研组research,学科组(学科搜寻动态返回)subject,好友friend,管理manage,群组group等,"activity",
  94. ///TeacherAll 全体教师,StudentAll全体学生 TchStuAll,全体师生 动态返回
  95. /// </summary>
  96. public string type { get; set; } = "teach";
  97. public int year { get; set; }
  98. /// <summary>
  99. /// 名单过期时间。
  100. /// </summary>
  101. public long expire { get; set; } = 0;
  102. /// <summary>
  103. /// 醍摩豆id成员数量
  104. /// </summary>
  105. public int tcount { get; set; }
  106. /// <summary>
  107. /// 校内账号成员数量
  108. /// </summary>
  109. public int scount { get; set; }
  110. public List<RMember> members { get; set; } = new List<RMember>();
  111. public string leader { get; set; }
  112. public int froms { get; set; } = 0;
  113. /// <summary>
  114. /// 个人名单是否开放 加入。0 不允许,1 允许。
  115. /// </summary>
  116. public int joinLock { get; set; } = 1;
  117. /// <summary>
  118. ///补充毕业0在校,1毕业
  119. /// </summary>
  120. public int graduate { get; set; } = 0;
  121. /// <summary>
  122. /// 是否开启审核,0未开启,1开启。
  123. /// </summary>
  124. public int review { get; set; } = 0;
  125. /// <summary>
  126. /// 加入人数200人,学生加入已满200 自动关闭加入。可手动解除限制,开启审核时,关闭人数上限设置机制
  127. /// </summary>
  128. public int limitCount { get; set; } = 200;
  129. /// <summary>
  130. /// 自选座号 0 不允许,1 运行
  131. /// </summary>
  132. public int optNo { get; set; }
  133. /// <summary>
  134. /// 二维码过期时间
  135. /// </summary>
  136. public long qrcodeExpire { get; set; }
  137. /// <summary>
  138. /// 二维码 天数
  139. /// </summary>
  140. public int qrcodeDays { get; set; }
  141. public HashSet<int> grades { get; set; } = new HashSet<int>();
  142. }
  143. public class Member
  144. {
  145. /// <summary>
  146. /// 账号id
  147. /// </summary>
  148. [Required(ErrorMessage = "{0} 名单的ID 必须填写")]
  149. public string id { get; set; }
  150. //学生所在的学校
  151. public string code { get; set; }
  152. /// <summary>
  153. ///类型 1 tmdid,2 student
  154. /// </summary>
  155. [Range(1, 2)]
  156. public int type { get; set; }
  157. /// <summary>
  158. ///座号
  159. /// </summary>
  160. public string no { get; set; }
  161. /// <summary>
  162. /// IRS WebIRS编号。
  163. /// </summary>
  164. public string irs { get; set; }
  165. public string tag { get; set; }
  166. public string groupId { get; set; }
  167. public string groupName { get; set; }
  168. public string nickname { get; set; }
  169. //补充毕业
  170. //0在校,1毕业
  171. public int graduate { get; set; } = 0;
  172. public int year { get; set; }= 0;
  173. public string gender { get; set; }
  174. /// <summary>
  175. /// 0 自动的座号和irs,1 手动的irs
  176. /// </summary>
  177. public int manual { get; set; }
  178. }
  179. /// <summary>
  180. /// 活动结束后的结算接结构
  181. /// </summary>
  182. public class FMember
  183. {
  184. /// <summary>
  185. /// 账号id
  186. /// </summary>
  187. public string id { get; set; }
  188. /// <summary>
  189. /// 所在学校的学校id
  190. /// </summary>
  191. public string code { get; set; }
  192. /// <summary>
  193. /// 账户类型
  194. /// </summary>
  195. public int type { get; set; }
  196. /// <summary>
  197. /// 分组id
  198. /// </summary>
  199. public string groupId { get; set; }
  200. /// <summary>
  201. /// 分组名称
  202. /// </summary>
  203. public string groupName { get; set; }
  204. }
  205. public class RMember
  206. {
  207. /// <summary>
  208. /// 账号id
  209. /// </summary>
  210. public string id { get; set; }
  211. //学生所在的学校
  212. public string code { get; set; }
  213. //兼容HiTeach 需要的字段
  214. public string schoolId { get => code; }
  215. //学生所在的学校
  216. public string schoolName { get; set; }
  217. /// <summary>
  218. /// 名称
  219. /// </summary>
  220. public string name { get; set; }
  221. /// <summary>
  222. ///类型 1 tmdid,2 student
  223. /// </summary>
  224. public int type { get; set; }
  225. /// <summary>
  226. /// 头像
  227. /// </summary>
  228. public string picture { get; set; }
  229. /// <summary>
  230. /// 性别 M( male,男) F (female 女) N(secret 保密)
  231. /// </summary>
  232. public string gender { get; set; }
  233. /// <summary>
  234. ///座号
  235. /// </summary>
  236. public string no { get; set; }
  237. /// <summary>
  238. /// IRS WebIRS编号。
  239. /// </summary>
  240. public string irs { get; set; }
  241. public string tag { get; set; }
  242. /// <summary>
  243. /// 行政班
  244. /// </summary>
  245. public string classId { get; set; }
  246. /// <summary>
  247. /// 名单分组id
  248. /// </summary>
  249. public string groupId { get; set; }
  250. /// <summary>
  251. /// 名单分组名称
  252. /// </summary>
  253. public string groupName { get; set; }
  254. public string nickname { get; set; }
  255. //补充毕业
  256. //0在校,1毕业
  257. public int graduate { get; set; } = 0;
  258. //所在名单集合
  259. public List<string> groupListIds { get; set; } = new List<string>();
  260. public int year { get; set; }
  261. public string periodId { get; set; }
  262. }
  263. public class GroupListGrp
  264. {
  265. public GroupListGrp() { }
  266. public GroupListGrp(GroupList groupList, HashSet<string> groupName)
  267. {
  268. this.id = groupList.id;
  269. this.code = groupList.code;
  270. this.periodId = groupList.periodId;
  271. this.pk = groupList.pk;
  272. this.name = groupList.name;
  273. this.school = groupList.school;
  274. this.creatorId = groupList.creatorId;
  275. this.no = groupList.no;
  276. this.scope = groupList.scope;
  277. this.type = groupList.type;
  278. this.scount = groupList.scount;
  279. this.tcount = groupList.tcount;
  280. this.leader = groupList.leader;
  281. this.year = groupList.year;
  282. this.expire = groupList.expire;
  283. this.groupName = groupName;
  284. this.froms = groupList.froms;
  285. this.joinLock = groupList.joinLock;
  286. this.qrcodeExpire = groupList.qrcodeExpire;
  287. this.qrcodeDays = groupList.qrcodeDays;
  288. this.review=groupList.review;
  289. this.limitCount = groupList.limitCount;
  290. this.optNo=groupList.optNo;
  291. this.grades = groupList.grades;
  292. }
  293. public GroupListGrp(RGroupList groupList, HashSet<string> groupName)
  294. {
  295. this.id = groupList.id;
  296. this.code = groupList.code;
  297. this.periodId = groupList.periodId;
  298. this.pk = groupList.pk;
  299. this.name = groupList.name;
  300. this.school = groupList.school;
  301. this.creatorId = groupList.creatorId;
  302. this.no = groupList.no;
  303. this.scope = groupList.scope;
  304. this.type = groupList.type;
  305. this.scount = groupList.scount;
  306. this.tcount = groupList.tcount;
  307. this.leader = groupList.leader;
  308. this.year = groupList.year;
  309. this.expire = groupList.expire;
  310. this.groupName = groupName;
  311. this.froms = groupList.froms;
  312. this.joinLock = groupList.joinLock;
  313. this.qrcodeExpire = groupList.qrcodeExpire;
  314. this.qrcodeDays = groupList.qrcodeDays;
  315. this.review=groupList.review;
  316. this.limitCount = groupList.limitCount;
  317. this.optNo= groupList.optNo;
  318. this.grades = groupList.grades;
  319. }
  320. public string teachType { get; set; }
  321. public string pk { get; set; }
  322. public string id { get; set; }
  323. public string code { get; set; }
  324. public string name { get; set; }
  325. //标记该名单唯一code
  326. public string no { get; set; }
  327. public string periodId { get; set; }
  328. //课程id,需要标记则标记
  329. //public string courseId { get; set; }
  330. public string scope { get; set; }
  331. public string school { get; set; }
  332. public string creatorId { get; set; }
  333. /// <summary>
  334. ///教学班teach ,行政班(学生搜寻classId动态返回)class ,教研组research,学科组(学科搜寻动态返回)subject,好友friend,管理manage,群组group等
  335. /// </summary>
  336. public string type { get; set; } = "teach";
  337. public int year { get; set; }
  338. public long expire { get; set; }
  339. /// <summary>
  340. /// 醍摩豆id成员数量
  341. /// </summary>
  342. public int tcount { get; set; }
  343. /// <summary>
  344. /// 校内账号成员数量
  345. /// </summary>
  346. public int scount { get; set; }
  347. public string leader { get; set; }
  348. public HashSet<string> groupName { get; set; }
  349. public int froms { get; set; } = 0;
  350. /// <summary>
  351. /// 个人名单是否开放 加入。0 不允许,1 允许。
  352. /// </summary>
  353. public int joinLock { get; set; } =1;
  354. /// <summary>
  355. /// 是否开启审核,0未开启,1开启。
  356. /// </summary>
  357. public int review { get; set; } = 0;
  358. /// <summary>
  359. /// 加入人数200人,学生加入已满200 自动关闭加入。可手动解除限制,开启审核时,关闭人数上限设置机制
  360. /// </summary>
  361. public int limitCount { get; set; } = 200;
  362. /// <summary>
  363. /// 自选座号 0 不允许,1 运行
  364. /// </summary>
  365. public int optNo { get; set; }
  366. /// <summary>
  367. /// 二维码过期时间
  368. /// </summary>
  369. public long qrcodeExpire { get; set; }
  370. /// <summary>
  371. /// 二维码 天数
  372. /// </summary>
  373. public int qrcodeDays { get; set; }
  374. //补充毕业
  375. //0在校,1毕业
  376. public int graduate { get; set; } = 0;
  377. public HashSet<int> grades { get; set; } = new HashSet<int>();
  378. }
  379. public class GroupListDtoImpt {
  380. public List<GroupListDto> groupLists { get; set; } = new List<GroupListDto>();
  381. }
  382. public class GroupListDto
  383. {
  384. public GroupListDto() { }
  385. public GroupListDto(RGroupList groupList) {
  386. this.id = groupList.id;
  387. this.code = groupList.code;
  388. this.periodId = groupList.periodId;
  389. this.pk = groupList.pk;
  390. this.name = groupList.name;
  391. this.school = groupList.school;
  392. this.creatorId = groupList.creatorId;
  393. this.no = groupList.no;
  394. this.scope = groupList.scope;
  395. this.type = groupList.type;
  396. this.scount = groupList.scount;
  397. this.tcount = groupList.tcount;
  398. this.leader = groupList.leader;
  399. this.year = groupList.year;
  400. this.expire = groupList.expire;
  401. this.froms = groupList.froms;
  402. this.joinLock = groupList.joinLock;
  403. this.qrcodeExpire = groupList.qrcodeExpire;
  404. this.qrcodeDays = groupList.qrcodeDays;
  405. this.review=groupList.review;
  406. this.limitCount = groupList.limitCount;
  407. this.optNo= groupList.optNo;
  408. this.grades = groupList.grades;
  409. this.graduate = groupList.graduate;
  410. }
  411. public string pk { get; set; }
  412. public string id { get; set; }
  413. public string code { get; set; }
  414. [Required(ErrorMessage = "{0} 名单的名称必须填写")]
  415. public string name { get; set; }
  416. //标记该名单唯一code
  417. public string no { get; set; }
  418. [Required(ErrorMessage = "{0} 名单的学段必须填写")]
  419. public string periodId { get; set; }
  420. //课程id,需要标记则标记
  421. //public string courseId { get; set; }
  422. public string scope { get; set; }
  423. public string school { get; set; }
  424. public string creatorId { get; set; }
  425. /// <summary>
  426. ///教学班teach ,行政班(学生搜寻classId动态返回)class ,教研组research,学科组(学科搜寻动态返回)subject,好友friend,管理manage,群组group等
  427. /// </summary>
  428. public string type { get; set; } = "teach";
  429. [Range(2000, 3000)]
  430. public int year { get; set; }
  431. /// <summary>
  432. /// 醍摩豆id成员数量
  433. /// </summary>
  434. public int tcount { get; set; }
  435. /// <summary>
  436. /// 校内账号成员数量
  437. /// </summary>
  438. public int scount { get; set; }
  439. public string leader { get; set; }
  440. public int froms { get; set; } = 0;
  441. /// <summary>
  442. /// 个人名单是否开放 加入。0 不允许,1 允许。
  443. /// </summary>
  444. public int joinLock { get; set; } = 1;
  445. /// <summary>
  446. /// 是否开启审核,0未开启,1开启。
  447. /// </summary>
  448. public int review { get; set; } = 0;
  449. /// <summary>
  450. /// 加入人数200人,学生加入已满200 自动关闭加入。可手动解除限制,开启审核时,关闭人数上限设置机制
  451. /// </summary>
  452. public int limitCount { get; set; } = 200;
  453. /// <summary>
  454. /// 自选座号 0 不允许,1 运行
  455. /// </summary>
  456. public int optNo { get; set; }
  457. /// <summary>
  458. /// 二维码过期时间
  459. /// </summary>
  460. public long qrcodeExpire { get; set; }
  461. /// <summary>
  462. /// 二维码 天数
  463. /// </summary>
  464. public int qrcodeDays { get; set; }
  465. //0在校,1毕业
  466. public int graduate { get; set; } = 0;
  467. public long expire { get; set; } = 0;
  468. public HashSet<int> grades { get; set; } = new HashSet<int>();
  469. }
  470. public class CourseGroupList
  471. {
  472. public string scope { get; set; }
  473. public string subject { get; set; }
  474. public string period { get; set; }
  475. public string subjectId { get; set; }
  476. public string periodId { get; set; }
  477. public string name { get; set; }
  478. public string id { get; set; }
  479. public List<GroupListGrp> groups { get; set; } = new List<GroupListGrp>();
  480. }
  481. public class TeachCourse
  482. {
  483. public string scope { get; set; }
  484. public IdNameCode subject { get; set; }
  485. public IdNameCode period { get; set; }
  486. public string name { get; set; }
  487. public string id { get; set; }
  488. public TeachSchedule schedule { get; set; }
  489. }
  490. public class TeachSchedule
  491. {
  492. public string classId { get; set; }
  493. public string stulist { get; set; }
  494. public string teacherId { get; set; }
  495. }
  496. public record IdCodeNameCount
  497. {
  498. public string periodId { get; set; }
  499. public string periodName { get; set; }
  500. public string periodType{ get; set; }
  501. public string subjectId { get; set; }
  502. public string subjectName { get; set; }
  503. public string name { get; set; }
  504. public int count { get; set; }
  505. }
  506. public class IdNameCode
  507. {
  508. public string id { get; set; }
  509. public string name { get; set; }
  510. public string code { get; set; }
  511. public string picture { get; set; }
  512. public string nickname { get; set; }
  513. }
  514. public class GroupListSemester:CosmosEntity
  515. {
  516. //id 学年-学期-id
  517. //code GroupListSemester-hbcn
  518. public GroupListSemester()
  519. {
  520. pk = "GroupListSemester";
  521. }
  522. public string groupListId { get; set; }
  523. public string semesterId { get; set; }
  524. public int studyYear { get; set; }
  525. public string name { get; set; }
  526. //标记该名单唯一code
  527. public string no { get; set; }
  528. public string periodId { get; set; }
  529. //课程id,需要标记则标记
  530. //public string courseId { get; set; }
  531. public string scope { get; set; }
  532. public string school { get; set; }
  533. public string creatorId { get; set; }
  534. /// <summary>
  535. ///研修培训名单,yxtrain 教学班teach ,行政班(学生搜寻classId动态返回)class ,教研组research,学科组(学科搜寻动态返回)subject,好友friend,管理manage,群组group等,"activity",
  536. ///TeacherAll 全体教师,StudentAll全体学生 TchStuAll,全体师生 动态返回
  537. /// </summary>
  538. public string type { get; set; } = "teach";
  539. public int year { get; set; }
  540. /// <summary>
  541. /// 名单过期时间。
  542. /// </summary>
  543. public long expire { get; set; } = 0;
  544. /// <summary>
  545. /// 醍摩豆id成员数量
  546. /// </summary>
  547. public int tcount { get; set; }
  548. /// <summary>
  549. /// 校内账号成员数量
  550. /// </summary>
  551. public int scount { get; set; }
  552. public List<RMember> members { get; set; } = new List<RMember>();
  553. public string leader { get; set; }
  554. public int froms { get; set; } = 0;
  555. /// <summary>
  556. /// 个人名单是否开放 加入。0 不允许,1 允许。
  557. /// </summary>
  558. public int joinLock { get; set; } = 1;
  559. /// <summary>
  560. ///补充毕业0在校,1毕业
  561. /// </summary>
  562. public int graduate { get; set; } = 0;
  563. /// <summary>
  564. /// 是否开启审核,0未开启,1开启。
  565. /// </summary>
  566. public int review { get; set; } = 0;
  567. /// <summary>
  568. /// 加入人数200人,学生加入已满200 自动关闭加入。可手动解除限制,开启审核时,关闭人数上限设置机制
  569. /// </summary>
  570. public int limitCount { get; set; } = 200;
  571. /// <summary>
  572. /// 自选座号 0 不允许,1 运行
  573. /// </summary>
  574. public int optNo { get; set; }
  575. /// <summary>
  576. /// 二维码过期时间
  577. /// </summary>
  578. public long qrcodeExpire { get; set; }
  579. /// <summary>
  580. /// 二维码 天数
  581. /// </summary>
  582. public int qrcodeDays { get; set; }
  583. public HashSet<int> grades { get; set; } = new HashSet<int>();
  584. }
  585. public class GroupListWithCourseTaskId
  586. {
  587. public GroupList groupList { get; set; }
  588. public string CourseTaskId { get; set; }
  589. }
  590. }