GroupList.cs 20 KB

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