GroupList.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  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. }
  175. /// <summary>
  176. /// 活动结束后的结算接结构
  177. /// </summary>
  178. public class FMember
  179. {
  180. /// <summary>
  181. /// 账号id
  182. /// </summary>
  183. public string id { get; set; }
  184. /// <summary>
  185. /// 所在学校的学校id
  186. /// </summary>
  187. public string code { get; set; }
  188. /// <summary>
  189. /// 账户类型
  190. /// </summary>
  191. public int type { get; set; }
  192. /// <summary>
  193. /// 分组id
  194. /// </summary>
  195. public string groupId { get; set; }
  196. /// <summary>
  197. /// 分组名称
  198. /// </summary>
  199. public string groupName { get; set; }
  200. }
  201. public class RMember
  202. {
  203. /// <summary>
  204. /// 账号id
  205. /// </summary>
  206. public string id { get; set; }
  207. //学生所在的学校
  208. public string code { get; set; }
  209. //兼容HiTeach 需要的字段
  210. public string schoolId { get => code; }
  211. //学生所在的学校
  212. public string schoolName { get; set; }
  213. /// <summary>
  214. /// 名称
  215. /// </summary>
  216. public string name { get; set; }
  217. /// <summary>
  218. ///类型 1 tmdid,2 student
  219. /// </summary>
  220. public int type { get; set; }
  221. /// <summary>
  222. /// 头像
  223. /// </summary>
  224. public string picture { get; set; }
  225. /// <summary>
  226. /// 性别 M( male,男) F (female 女) N(secret 保密)
  227. /// </summary>
  228. public string gender { get; set; }
  229. /// <summary>
  230. ///座号
  231. /// </summary>
  232. public string no { get; set; }
  233. /// <summary>
  234. /// IRS WebIRS编号。
  235. /// </summary>
  236. public string irs { get; set; }
  237. public string tag { get; set; }
  238. /// <summary>
  239. /// 行政班
  240. /// </summary>
  241. public string classId { get; set; }
  242. /// <summary>
  243. /// 名单分组id
  244. /// </summary>
  245. public string groupId { get; set; }
  246. /// <summary>
  247. /// 名单分组名称
  248. /// </summary>
  249. public string groupName { get; set; }
  250. public string nickname { get; set; }
  251. //补充毕业
  252. //0在校,1毕业
  253. public int graduate { get; set; } = 0;
  254. //所在名单集合
  255. public List<string> groupListIds { get; set; } = new List<string>();
  256. public int year { get; set; }
  257. public string periodId { get; set; }
  258. }
  259. public class GroupListGrp
  260. {
  261. public GroupListGrp() { }
  262. public GroupListGrp(GroupList groupList, HashSet<string> groupName)
  263. {
  264. this.id = groupList.id;
  265. this.code = groupList.code;
  266. this.periodId = groupList.periodId;
  267. this.pk = groupList.pk;
  268. this.name = groupList.name;
  269. this.school = groupList.school;
  270. this.creatorId = groupList.creatorId;
  271. this.no = groupList.no;
  272. this.scope = groupList.scope;
  273. this.type = groupList.type;
  274. this.scount = groupList.scount;
  275. this.tcount = groupList.tcount;
  276. this.leader = groupList.leader;
  277. this.year = groupList.year;
  278. this.expire = groupList.expire;
  279. this.groupName = groupName;
  280. this.froms = groupList.froms;
  281. this.joinLock = groupList.joinLock;
  282. this.qrcodeExpire = groupList.qrcodeExpire;
  283. this.qrcodeDays = groupList.qrcodeDays;
  284. this.review=groupList.review;
  285. this.limitCount = groupList.limitCount;
  286. this.optNo=groupList.optNo;
  287. this.grades = groupList.grades;
  288. }
  289. public GroupListGrp(RGroupList groupList, HashSet<string> groupName)
  290. {
  291. this.id = groupList.id;
  292. this.code = groupList.code;
  293. this.periodId = groupList.periodId;
  294. this.pk = groupList.pk;
  295. this.name = groupList.name;
  296. this.school = groupList.school;
  297. this.creatorId = groupList.creatorId;
  298. this.no = groupList.no;
  299. this.scope = groupList.scope;
  300. this.type = groupList.type;
  301. this.scount = groupList.scount;
  302. this.tcount = groupList.tcount;
  303. this.leader = groupList.leader;
  304. this.year = groupList.year;
  305. this.expire = groupList.expire;
  306. this.groupName = groupName;
  307. this.froms = groupList.froms;
  308. this.joinLock = groupList.joinLock;
  309. this.qrcodeExpire = groupList.qrcodeExpire;
  310. this.qrcodeDays = groupList.qrcodeDays;
  311. this.review=groupList.review;
  312. this.limitCount = groupList.limitCount;
  313. this.optNo= groupList.optNo;
  314. this.grades = groupList.grades;
  315. }
  316. public string teachType { get; set; }
  317. public string pk { get; set; }
  318. public string id { get; set; }
  319. public string code { get; set; }
  320. public string name { get; set; }
  321. //标记该名单唯一code
  322. public string no { get; set; }
  323. public string periodId { get; set; }
  324. //课程id,需要标记则标记
  325. //public string courseId { get; set; }
  326. public string scope { get; set; }
  327. public string school { get; set; }
  328. public string creatorId { get; set; }
  329. /// <summary>
  330. ///教学班teach ,行政班(学生搜寻classId动态返回)class ,教研组research,学科组(学科搜寻动态返回)subject,好友friend,管理manage,群组group等
  331. /// </summary>
  332. public string type { get; set; } = "teach";
  333. public int year { get; set; }
  334. public long expire { get; set; }
  335. /// <summary>
  336. /// 醍摩豆id成员数量
  337. /// </summary>
  338. public int tcount { get; set; }
  339. /// <summary>
  340. /// 校内账号成员数量
  341. /// </summary>
  342. public int scount { get; set; }
  343. public string leader { get; set; }
  344. public HashSet<string> groupName { get; set; }
  345. public int froms { get; set; } = 0;
  346. /// <summary>
  347. /// 个人名单是否开放 加入。0 不允许,1 允许。
  348. /// </summary>
  349. public int joinLock { get; set; } =1;
  350. /// <summary>
  351. /// 是否开启审核,0未开启,1开启。
  352. /// </summary>
  353. public int review { get; set; } = 0;
  354. /// <summary>
  355. /// 加入人数200人,学生加入已满200 自动关闭加入。可手动解除限制,开启审核时,关闭人数上限设置机制
  356. /// </summary>
  357. public int limitCount { get; set; } = 200;
  358. /// <summary>
  359. /// 自选座号 0 不允许,1 运行
  360. /// </summary>
  361. public int optNo { get; set; }
  362. /// <summary>
  363. /// 二维码过期时间
  364. /// </summary>
  365. public long qrcodeExpire { get; set; }
  366. /// <summary>
  367. /// 二维码 天数
  368. /// </summary>
  369. public int qrcodeDays { get; set; }
  370. //补充毕业
  371. //0在校,1毕业
  372. public int graduate { get; set; } = 0;
  373. public HashSet<int> grades { get; set; } = new HashSet<int>();
  374. }
  375. public class GroupListDtoImpt {
  376. public List<GroupListDto> groupLists { get; set; } = new List<GroupListDto>();
  377. }
  378. public class GroupListDto
  379. {
  380. public GroupListDto() { }
  381. public GroupListDto(RGroupList groupList) {
  382. this.id = groupList.id;
  383. this.code = groupList.code;
  384. this.periodId = groupList.periodId;
  385. this.pk = groupList.pk;
  386. this.name = groupList.name;
  387. this.school = groupList.school;
  388. this.creatorId = groupList.creatorId;
  389. this.no = groupList.no;
  390. this.scope = groupList.scope;
  391. this.type = groupList.type;
  392. this.scount = groupList.scount;
  393. this.tcount = groupList.tcount;
  394. this.leader = groupList.leader;
  395. this.year = groupList.year;
  396. this.expire = groupList.expire;
  397. this.froms = groupList.froms;
  398. this.joinLock = groupList.joinLock;
  399. this.qrcodeExpire = groupList.qrcodeExpire;
  400. this.qrcodeDays = groupList.qrcodeDays;
  401. this.review=groupList.review;
  402. this.limitCount = groupList.limitCount;
  403. this.optNo= groupList.optNo;
  404. this.grades = groupList.grades;
  405. this.graduate = groupList.graduate;
  406. }
  407. public string pk { get; set; }
  408. public string id { get; set; }
  409. public string code { get; set; }
  410. [Required(ErrorMessage = "{0} 名单的名称必须填写")]
  411. public string name { get; set; }
  412. //标记该名单唯一code
  413. public string no { get; set; }
  414. [Required(ErrorMessage = "{0} 名单的学段必须填写")]
  415. public string periodId { get; set; }
  416. //课程id,需要标记则标记
  417. //public string courseId { get; set; }
  418. public string scope { get; set; }
  419. public string school { get; set; }
  420. public string creatorId { get; set; }
  421. /// <summary>
  422. ///教学班teach ,行政班(学生搜寻classId动态返回)class ,教研组research,学科组(学科搜寻动态返回)subject,好友friend,管理manage,群组group等
  423. /// </summary>
  424. public string type { get; set; } = "teach";
  425. [Range(2000, 3000)]
  426. public int year { get; set; }
  427. /// <summary>
  428. /// 醍摩豆id成员数量
  429. /// </summary>
  430. public int tcount { get; set; }
  431. /// <summary>
  432. /// 校内账号成员数量
  433. /// </summary>
  434. public int scount { get; set; }
  435. public string leader { get; set; }
  436. public int froms { get; set; } = 0;
  437. /// <summary>
  438. /// 个人名单是否开放 加入。0 不允许,1 允许。
  439. /// </summary>
  440. public int joinLock { get; set; } = 1;
  441. /// <summary>
  442. /// 是否开启审核,0未开启,1开启。
  443. /// </summary>
  444. public int review { get; set; } = 0;
  445. /// <summary>
  446. /// 加入人数200人,学生加入已满200 自动关闭加入。可手动解除限制,开启审核时,关闭人数上限设置机制
  447. /// </summary>
  448. public int limitCount { get; set; } = 200;
  449. /// <summary>
  450. /// 自选座号 0 不允许,1 运行
  451. /// </summary>
  452. public int optNo { get; set; }
  453. /// <summary>
  454. /// 二维码过期时间
  455. /// </summary>
  456. public long qrcodeExpire { get; set; }
  457. /// <summary>
  458. /// 二维码 天数
  459. /// </summary>
  460. public int qrcodeDays { get; set; }
  461. //0在校,1毕业
  462. public int graduate { get; set; } = 0;
  463. public long expire { get; set; } = 0;
  464. public HashSet<int> grades { get; set; } = new HashSet<int>();
  465. }
  466. public class CourseGroupList
  467. {
  468. public string scope { get; set; }
  469. public string subject { get; set; }
  470. public string period { get; set; }
  471. public string subjectId { get; set; }
  472. public string periodId { get; set; }
  473. public string name { get; set; }
  474. public string id { get; set; }
  475. public List<GroupListGrp> groups { get; set; } = new List<GroupListGrp>();
  476. }
  477. public class TeachCourse
  478. {
  479. public string scope { get; set; }
  480. public IdNameCode subject { get; set; }
  481. public IdNameCode period { get; set; }
  482. public string name { get; set; }
  483. public string id { get; set; }
  484. public TeachSchedule schedule { get; set; }
  485. }
  486. public class TeachSchedule
  487. {
  488. public string classId { get; set; }
  489. public string stulist { get; set; }
  490. public string teacherId { get; set; }
  491. }
  492. public record IdCodeNameCount
  493. {
  494. public string periodId { get; set; }
  495. public string periodName { get; set; }
  496. public string periodType{ get; set; }
  497. public string subjectId { get; set; }
  498. public string subjectName { get; set; }
  499. public string name { get; set; }
  500. public int count { get; set; }
  501. }
  502. public class IdNameCode
  503. {
  504. public string id { get; set; }
  505. public string name { get; set; }
  506. public string code { get; set; }
  507. public string picture { get; set; }
  508. public string nickname { get; set; }
  509. }
  510. public class GroupListSemester:CosmosEntity
  511. {
  512. //id 学年-学期-id
  513. //code GroupListSemester-hbcn
  514. public GroupListSemester()
  515. {
  516. pk = "GroupListSemester";
  517. }
  518. public string groupListId { get; set; }
  519. public string semesterId { get; set; }
  520. public int studyYear { get; set; }
  521. public string name { get; set; }
  522. //标记该名单唯一code
  523. public string no { get; set; }
  524. public string periodId { get; set; }
  525. //课程id,需要标记则标记
  526. //public string courseId { get; set; }
  527. public string scope { get; set; }
  528. public string school { get; set; }
  529. public string creatorId { get; set; }
  530. /// <summary>
  531. ///研修培训名单,yxtrain 教学班teach ,行政班(学生搜寻classId动态返回)class ,教研组research,学科组(学科搜寻动态返回)subject,好友friend,管理manage,群组group等,"activity",
  532. ///TeacherAll 全体教师,StudentAll全体学生 TchStuAll,全体师生 动态返回
  533. /// </summary>
  534. public string type { get; set; } = "teach";
  535. public int year { get; set; }
  536. /// <summary>
  537. /// 名单过期时间。
  538. /// </summary>
  539. public long expire { get; set; } = 0;
  540. /// <summary>
  541. /// 醍摩豆id成员数量
  542. /// </summary>
  543. public int tcount { get; set; }
  544. /// <summary>
  545. /// 校内账号成员数量
  546. /// </summary>
  547. public int scount { get; set; }
  548. public List<RMember> members { get; set; } = new List<RMember>();
  549. public string leader { get; set; }
  550. public int froms { get; set; } = 0;
  551. /// <summary>
  552. /// 个人名单是否开放 加入。0 不允许,1 允许。
  553. /// </summary>
  554. public int joinLock { get; set; } = 1;
  555. /// <summary>
  556. ///补充毕业0在校,1毕业
  557. /// </summary>
  558. public int graduate { get; set; } = 0;
  559. /// <summary>
  560. /// 是否开启审核,0未开启,1开启。
  561. /// </summary>
  562. public int review { get; set; } = 0;
  563. /// <summary>
  564. /// 加入人数200人,学生加入已满200 自动关闭加入。可手动解除限制,开启审核时,关闭人数上限设置机制
  565. /// </summary>
  566. public int limitCount { get; set; } = 200;
  567. /// <summary>
  568. /// 自选座号 0 不允许,1 运行
  569. /// </summary>
  570. public int optNo { get; set; }
  571. /// <summary>
  572. /// 二维码过期时间
  573. /// </summary>
  574. public long qrcodeExpire { get; set; }
  575. /// <summary>
  576. /// 二维码 天数
  577. /// </summary>
  578. public int qrcodeDays { get; set; }
  579. public HashSet<int> grades { get; set; } = new HashSet<int>();
  580. }
  581. public class GroupListWithCourseTaskId
  582. {
  583. public GroupList groupList { get; set; }
  584. public string CourseTaskId { get; set; }
  585. }
  586. }