StudyStatisController.cs 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. using Microsoft.AspNetCore.Mvc;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6. using TEAMModelOS.SDK.DI;
  7. using TEAMModelOS.Models;
  8. using TEAMModelOS.SDK.Models;
  9. using TEAMModelOS.SDK.Models.Service; //通知
  10. using Microsoft.Extensions.Configuration;
  11. using Microsoft.AspNetCore.Http;
  12. using Microsoft.Extensions.Options;
  13. using TEAMModelOS.SDK.Extension;
  14. using System.Text.Json; //获取Json数据引用
  15. using Azure.Cosmos;
  16. using TEAMModelOS.Filter;
  17. using HTEXLib.COMM.Helpers;
  18. using TEAMModelOS.SDK;
  19. namespace TEAMModeBI.Controllers.BIHome
  20. {
  21. /// <summary>
  22. /// 研修数据统计
  23. /// </summary>
  24. [ProducesResponseType(StatusCodes.Status200OK)]
  25. [ProducesResponseType(StatusCodes.Status400BadRequest)]
  26. [Route("bihome")]
  27. [ApiController]
  28. public class StudyStatisController : ControllerBase
  29. {
  30. private readonly AzureCosmosFactory _azureCosmos;
  31. private readonly IConfiguration _configuration;
  32. private readonly NotificationService _notificationService; //消息通知
  33. private readonly DingDing _dingDing; //钉钉消息通知
  34. private readonly Option _option; //记录信息
  35. public StudyStatisController(AzureCosmosFactory azureCosmos,IConfiguration configuration, NotificationService notificationService,DingDing dingDing, IOptionsSnapshot<Option> option)
  36. {
  37. _azureCosmos = azureCosmos;
  38. _configuration = configuration;
  39. _notificationService = notificationService;
  40. _dingDing = dingDing;
  41. _option = option?.Value;
  42. }
  43. [ProducesDefaultResponseType]
  44. [HttpPost("get-studyonline-statis")]
  45. //[AuthToken(Roles= "teacher,student,admin,area")]
  46. public async Task<IActionResult> GetStudyOnLine(JsonElement jsonElement)
  47. {
  48. //var (userid, _, _, __school) = HttpContext.GetAuthTokenInfo();//取得token信息
  49. try
  50. {
  51. if (!jsonElement.TryGetProperty("school", out JsonElement school)) return BadRequest();
  52. if (!jsonElement.TryGetProperty("areaID", out JsonElement areaID)) return BadRequest();
  53. var client = _azureCosmos.GetCosmosClient();
  54. AreaSetting setting = null; //统计数据
  55. //查询学校基础信息
  56. School schoolBase = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>($"{school}", new PartitionKey("Base"));
  57. //获取学校的地区ID
  58. string areadid = schoolBase.areaId;
  59. //查询区域信息
  60. Area area = await client.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<Area>($"{areaID}", new PartitionKey("Base-Area"));
  61. if (area != null)
  62. {
  63. setting = await client.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<AreaSetting>(area.id, new PartitionKey("AreaSetting"));
  64. }
  65. if (setting == null)
  66. {
  67. setting = new AreaSetting
  68. {
  69. allTime = 50,
  70. classTime = 5,
  71. submitTime = 15,
  72. onlineTime = 20,
  73. offlineTime = 10,
  74. lessonMinutes = 45,
  75. };
  76. }
  77. List<School> schoolList = new List<School>();
  78. //await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").GetItemQueryIterator<School>(queryText: $"select value(c) from c where c.areaId='{area.id}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
  79. await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<School>(queryText: $"select value(c) from c where c.areaId='{area.id}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
  80. {
  81. schoolList.Add(item);
  82. }
  83. HashSet<string> dimensions = new HashSet<string>();
  84. List<Ability> abilities = new List<Ability>();
  85. List<DimensionCount> areaDimensionCount = new List<DimensionCount>();
  86. await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select c.id,c.name,c.no,c.dimension,c.env from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{area.standard}") }))
  87. {
  88. dimensions.Add(item.dimension);
  89. abilities.Add(item);
  90. }
  91. dimensions.ToList().ForEach(x =>
  92. {
  93. areaDimensionCount.Add(new DimensionCount { dimension = x, count = 0 });
  94. });
  95. List<string> abilitie_Id = abilities.Select(x => x.id).ToList();
  96. List<AbilityCount> areaAbilityCounts = abilities.Select(x => new AbilityCount { abilityEnv = x.env, abilityId = x.id, abilityName = x.name, abilityNo = x.no, dimension = x.dimension, count = 0 }).ToList();
  97. List<SchoolCount> schoolDatas = new List<SchoolCount>();
  98. int schoolCount = 0;
  99. int teacherCount = 0;
  100. //在线时长
  101. int videoTime = 0;
  102. //参与人数
  103. int joinCount = 0;
  104. //能力点订阅数量
  105. int subCount = 0;
  106. //已完成50个学时的人数
  107. int ok50TimeCount = 0;
  108. //已完成能力点的校园评审数量
  109. int hasScoreCount = 0;
  110. //已经提交作品的数量
  111. int hasSubmitCount = 0;
  112. // 未提交的
  113. int unSubmitCount = 0;
  114. //未完成能力点学习未完成的
  115. int unDoneCount = 0;
  116. //合格的能力点作品数量
  117. int okCount = 0;
  118. int schoolVideoTime = 0;
  119. ///人数
  120. //线上完成人数
  121. int onlineTeacherCount = 0;
  122. //线下完成人数
  123. int offlineTeacherCount = 0;
  124. //应用考核完成人数
  125. int schoolScoreTeacherCount = 0;
  126. //课堂实录完成人数
  127. int classVideoTeacherCount = 0;
  128. ///学时
  129. //线上完成学时
  130. int onlineTeacherTime = 0;
  131. //线下完成学时
  132. int offlineTeacherTime = 0;
  133. //应用考核完成学时
  134. int schoolScoreTeacherTime = 0;
  135. //课堂实录完成学时
  136. int classVideoTeacherTime = 0;
  137. List<Study> studies = new List<Study>();
  138. foreach (var schoolitem in schoolList)
  139. {
  140. List<Study> study_list = new List<Study>();
  141. await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<Study>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Study-{schoolitem.id}") }))
  142. {
  143. if (item.tchLists.IsNotEmpty())
  144. {
  145. study_list.Add(item);
  146. }
  147. }
  148. HashSet<string> groups = new HashSet<string>();
  149. HashSet<string> groupNames = new HashSet<string>();
  150. List<ClassVideo> classVideos = new List<ClassVideo>();
  151. List<AbilitySub> abilitySubs = new List<AbilitySub>();
  152. await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<ClassVideo>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ClassVideo-{schoolitem.id}") }))
  153. {
  154. classVideos.Add(item);
  155. }
  156. List<TchList> tchLists = new List<TchList>();
  157. await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<TchList>(queryText: $"select value(c) from c ",
  158. requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"TchList-{schoolitem.id}") }))
  159. {
  160. groups.Add(item.name);
  161. tchLists.Add(item);
  162. }
  163. List<string> ids = tchLists.Select(x => x.id).ToList();
  164. if (!ids.IsNotEmpty())
  165. {
  166. ids.Add("default");
  167. }
  168. (List<TmdInfo> tmdInfos, List<ClassListInfo> classInfos) = await TriggerStuActivity.GetTchList(client, _dingDing, ids, $"{schoolitem.id}");
  169. //总人数
  170. int teacherCount1 = tmdInfos.Count;
  171. List<TeacherStatistic> groupMembers = new();
  172. foreach (var tmd in tmdInfos)
  173. {
  174. await foreach (var sub in client.GetContainer("TEAMModelOS", "Teacher")
  175. .GetItemQueryIterator<AbilitySub>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilitySub-{schoolitem.id}-{tmd.id}") }))
  176. {
  177. abilitySubs.Add(sub);
  178. }
  179. //总学时
  180. int alltime = 0;
  181. //已学习的能力点
  182. int allAbilityCount = 0;
  183. //获得的在线学时
  184. int onlineTime = 0;
  185. //获得的线下学时
  186. int offlinelTime = 0;
  187. //获得的作品提交,并通过学校评审的学时
  188. int schoolScoreTime = 0;
  189. //获得的课堂实录
  190. int classVideoTime = 0;
  191. //教师应提交的作品数量
  192. int tchSubmitCount = 0;
  193. //教师未提交的作品数量
  194. int tchUnSubmitCount = 0;
  195. //通过能力点自测的数量
  196. int hasAbilityExercise = 0;
  197. //教师订阅的能力点数量
  198. int thcSubCount = 0;
  199. //教师完成能力点学校的数量
  200. int thcSubDoneCount = 0;
  201. //参加校本线下研修的活动
  202. int offlineSchoolCount = 0;
  203. //参加区级线下研修的活动
  204. int offlineAreaCount = 0;
  205. //完成的校本线下研修活动
  206. int offlineSchoolDoneCount = 0;
  207. //完成的区级线下研修或的
  208. int offlineAreaDoneCount = 0;
  209. int examCount = 0;
  210. int voteCount = 0;
  211. int surveyCount = 0;
  212. int examDoneCount = 0;
  213. int voteDoneCount = 0;
  214. int surveyDoneCount = 0;
  215. int examAreaCount = 0;
  216. int voteAreaCount = 0;
  217. int surveyAreaCount = 0;
  218. int examAreaDoneCount = 0;
  219. int voteAreaDoneCount = 0;
  220. int surveyAreaDoneCount = 0;
  221. await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<StuActivity>(queryText: $"select c.owner, c.taskStatus from c where c.type = 'Study' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Activity-{tmd.id}") }))
  222. {
  223. if (item.taskStatus > 0)
  224. {
  225. offlinelTime += 1;
  226. }
  227. if (!string.IsNullOrEmpty(item.owner))
  228. {
  229. if (item.owner.Equals("school"))
  230. {
  231. offlineSchoolCount += 1;
  232. if (item.taskStatus > 0)
  233. {
  234. offlineSchoolDoneCount += 1;
  235. }
  236. }
  237. else if (item.owner.Equals("area"))
  238. {
  239. offlineAreaCount += 1;
  240. if (item.taskStatus > 0)
  241. {
  242. offlineAreaDoneCount += 1;
  243. }
  244. }
  245. }
  246. }
  247. await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher") .GetItemQueryIterator<StuActivity>(queryText: $"select c.owner, c.taskStatus from c where c.type = 'ExamLite' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Activity-{tmd.id}") }))
  248. {
  249. if (item.owner.Equals("school"))
  250. {
  251. examCount += 1;
  252. if (item.taskStatus > 0)
  253. {
  254. examDoneCount += 1;
  255. }
  256. }
  257. if (item.owner.Equals("area"))
  258. {
  259. examAreaCount += 1;
  260. if (item.taskStatus > 0)
  261. {
  262. examAreaDoneCount += 1;
  263. }
  264. }
  265. }
  266. await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher")
  267. .GetItemQueryIterator<StuActivity>(queryText: $"select c.owner, c.taskStatus from c where c.type = 'Survey' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Activity-{tmd.id}") }))
  268. {
  269. if (item.owner.Equals("school"))
  270. {
  271. surveyCount += 1;
  272. if (item.taskStatus > 0)
  273. {
  274. surveyDoneCount += 1;
  275. }
  276. }
  277. if (item.owner.Equals("area"))
  278. {
  279. surveyAreaCount += 1;
  280. if (item.taskStatus > 0)
  281. {
  282. surveyAreaDoneCount += 1;
  283. }
  284. }
  285. }
  286. await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<StuActivity>(queryText: $"select c.owner, c.taskStatus from c where c.type = 'Vote' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Activity-{tmd.id}") }))
  287. {
  288. if (item.owner.Equals("school"))
  289. {
  290. voteCount += 1;
  291. if (item.taskStatus > 0)
  292. {
  293. voteDoneCount += 1;
  294. }
  295. }
  296. if (item.owner.Equals("area"))
  297. {
  298. voteAreaCount += 1;
  299. if (item.taskStatus > 0)
  300. {
  301. voteAreaDoneCount += 1;
  302. }
  303. }
  304. }
  305. bool isJoinVideo = false;
  306. ClassVideo classVideo = classVideos.Find(x => x.id.Equals(tmd.id));
  307. if (classVideo != null && classVideo.files.IsNotEmpty())
  308. {
  309. isJoinVideo = true;
  310. classVideo.files.ForEach(x =>
  311. {
  312. if (x.score > 0)
  313. {
  314. classVideoTime += 1;
  315. }
  316. });
  317. }
  318. List<SubStatistic> subs = new();
  319. abilitySubs.Where(x => x.code.Equals($"AbilitySub-{schoolitem.id}-{tmd.id}")).ToList().ForEach(item =>
  320. {
  321. subCount += 1;
  322. thcSubCount += 1;
  323. if (item.exerciseScore > 0)
  324. {
  325. hasAbilityExercise += 1;
  326. }
  327. if (item.uploads.IsNotEmpty())
  328. {
  329. //已经有作品提交的
  330. hasSubmitCount += 1;
  331. tchSubmitCount += 1;
  332. }
  333. else
  334. {
  335. //未提交作品的
  336. unSubmitCount += 1;
  337. tchUnSubmitCount += 1;
  338. }
  339. if (!item.done)
  340. {
  341. unDoneCount += 1;
  342. }
  343. else
  344. {
  345. thcSubDoneCount += 1;
  346. }
  347. allAbilityCount += item.abilityCount;
  348. //onlineTime += item.hour;
  349. int vtime = (int)item.videoRcds.Sum(x => x.time);
  350. videoTime += vtime;
  351. schoolVideoTime = schoolVideoTime + vtime;
  352. int lesson = vtime / setting.lessonMinutes;
  353. onlineTime += lesson;
  354. if (item.otherScore.IsNotEmpty())
  355. {
  356. var schoolScore = item.otherScore.Where(x => x.roleType.Equals("school")).FirstOrDefault();
  357. if (schoolScore != null)
  358. {
  359. if (schoolScore.score > 0)
  360. {
  361. okCount += 1;
  362. schoolScoreTime += 1;
  363. }
  364. else
  365. {
  366. hasScoreCount += 1;
  367. }
  368. }
  369. }
  370. Ability ability = abilities.Find(x => x.id.Equals(item.id));
  371. if (ability != null)
  372. {
  373. subs.Add(new SubStatistic
  374. {
  375. abilityId = item.id,
  376. code = item.code,
  377. uploadCount = item.uploads.IsNotEmpty() ? item.uploads.Count : 0,
  378. otherScoreCount = item.otherScore.IsNotEmpty() ? item.otherScore.Count : 0,
  379. comidCount = 0,
  380. self = item.self,
  381. abilityName = ability.name,
  382. no = ability.no,
  383. dimension = ability.dimension,
  384. env = ability.env
  385. });
  386. }
  387. });
  388. //处理单项 超标准 学时
  389. alltime += onlineTime >= setting.onlineTime ? setting.onlineTime : onlineTime;
  390. alltime += offlinelTime >= setting.offlineTime ? setting.offlineTime : offlinelTime;
  391. alltime += schoolScoreTime >= setting.submitTime ? setting.submitTime : schoolScoreTime;
  392. alltime += classVideoTime >= setting.classTime ? setting.classTime : classVideoTime;
  393. //人数
  394. onlineTeacherCount = onlineTime >= setting.onlineTime ? onlineTeacherCount + 1 : onlineTeacherCount;
  395. offlineTeacherCount = offlinelTime >= setting.offlineTime ? offlineTeacherCount + 1 : offlineTeacherCount;
  396. schoolScoreTeacherCount = schoolScoreTime >= setting.submitTime ? schoolScoreTeacherCount + 1 : schoolScoreTeacherCount;
  397. classVideoTeacherCount = classVideoTime >= setting.classTime ? classVideoTeacherCount + 1 : classVideoTeacherCount;
  398. //学时
  399. onlineTeacherTime = onlineTime >= setting.onlineTime ? onlineTeacherTime + setting.onlineTime : onlineTeacherTime + onlineTime;
  400. offlineTeacherTime = offlinelTime >= setting.offlineTime ? offlineTeacherTime + setting.offlineTime : offlineTeacherTime + offlinelTime;
  401. schoolScoreTeacherTime = schoolScoreTime >= setting.submitTime ? schoolScoreTeacherTime + setting.submitTime : schoolScoreTeacherTime + schoolScoreTime;
  402. classVideoTeacherTime = classVideoTime >= setting.classTime ? classVideoTeacherTime + setting.classTime : classVideoTeacherTime + classVideoTime;
  403. if (alltime >= setting.allTime)
  404. {
  405. ok50TimeCount += 1;
  406. }
  407. var classes = classInfos.Where(y => y.tmdInfos.Select(z => z.id).Contains(tmd.id)).ToList();
  408. //表示有订阅,或者有线下活动参与的,或者有课堂实录视频上传的
  409. if (subs.Count > 0 || schoolScoreTime > 0 || isJoinVideo)
  410. {
  411. //参训人数表示
  412. joinCount += 1;
  413. groupMembers.Add(new TeacherStatistic
  414. {
  415. tchSubmitCount = tchSubmitCount,
  416. tchUnSubmitCount = tchUnSubmitCount,
  417. thcSubCount = thcSubCount,
  418. tmdname = tmd.name,
  419. tmdid = tmd.id,
  420. picture = tmd.picture,
  421. groups = classes.Select(x => new TeacherGroup { groupId = x.id, groupName = x.name }).ToList(),
  422. subs = subs,
  423. alltime = alltime,
  424. allAbilityCount = allAbilityCount,
  425. onlineTime = onlineTime,
  426. offlinelTime = offlinelTime,
  427. schoolScoreTime = schoolScoreTime,
  428. classVideoTime = classVideoTime,
  429. hasAbilityExercise = hasAbilityExercise,
  430. thcSubDoneCount = thcSubDoneCount,
  431. offlineSchoolCount = offlineSchoolCount,
  432. offlineAreaCount = offlineAreaCount,
  433. offlineSchoolDoneCount = offlineSchoolDoneCount,
  434. offlineAreaDoneCount = offlineAreaDoneCount,
  435. examCount = examCount,
  436. voteCount = voteCount,
  437. surveyCount = surveyCount,
  438. examDoneCount = examDoneCount,
  439. voteDoneCount = voteDoneCount,
  440. surveyDoneCount = surveyDoneCount,
  441. examAreaCount = examAreaCount,
  442. voteAreaCount = voteAreaCount,
  443. surveyAreaCount = surveyAreaCount,
  444. examAreaDoneCount = examAreaDoneCount,
  445. voteAreaDoneCount = voteAreaDoneCount,
  446. surveyAreaDoneCount = surveyAreaDoneCount,
  447. videoTime = videoTime
  448. });
  449. }
  450. }
  451. List<DimensionCount> dimensionCount = new List<DimensionCount>();
  452. foreach (var dms in dimensions)
  453. {
  454. var list = groupMembers.SelectMany(x => x.subs.Where(y => y.dimension.Equals(dms))).ToList();
  455. dimensionCount.Add(new DimensionCount { dimension = dms, count = list.IsNotEmpty() ? list.Count : 0 });
  456. }
  457. List<AbilityCount> abilityCount = new List<AbilityCount>();
  458. foreach (var abilityId in abilitie_Id)
  459. {
  460. var list = groupMembers.SelectMany(x => x.subs.Where(y => y.abilityId.Equals(abilityId))).ToList();
  461. Ability ability = abilities.Find(x => x.id.Equals(abilityId));
  462. abilityCount.Add(new AbilityCount { abilityId = abilityId, abilityName = ability.name, dimension = ability.dimension, abilityNo = ability.no, abilityEnv = ability.env, count = list.IsNotEmpty() ? list.Count : 0 });
  463. }
  464. SchoolCount schoolCountModel = new SchoolCount
  465. {
  466. name = schoolitem.name,
  467. id = schoolitem.id,
  468. picture = schoolitem.picture,
  469. doneCount = ok50TimeCount,
  470. joinCount = joinCount,
  471. teacherCount = teacherCount,
  472. onlineTeacherTime = onlineTeacherTime,
  473. offlineTeacherTime = offlineTeacherTime,
  474. schoolScoreTeacherTime = schoolScoreTeacherTime,
  475. classVideoTeacherTime = classVideoTeacherTime,
  476. onlineTeacherCount = onlineTeacherCount,
  477. offlineTeacherCount = offlineTeacherCount,
  478. schoolScoreTeacherCount = schoolScoreTeacherCount,
  479. classVideoTeacherCount = classVideoTeacherCount,
  480. videoTime = schoolVideoTime
  481. };
  482. }
  483. Dictionary<string, Study> dict = new Dictionary<string, Study>();
  484. studies.ForEach(x => {
  485. dict[x.id] = x;
  486. });
  487. var studyTypes = dict.Values.ToList().GroupBy(x => x.type).Select(y => new { type = y.Key, count = y.Count() });
  488. return Ok(new
  489. {
  490. setting,
  491. areaDimensionCount,
  492. areaAbilityCounts,
  493. teacherCount,
  494. joinCount,
  495. schoolCount,
  496. videoTime,
  497. schoolDatas,
  498. onlineTeacherCount,
  499. offlineTeacherCount,
  500. schoolScoreTeacherCount,
  501. classVideoTeacherCount,
  502. studyTypes,
  503. onlineTeacherTime,
  504. offlineTeacherTime,
  505. schoolScoreTeacherTime,
  506. classVideoTeacherTime,
  507. ok50TimeCount
  508. });
  509. }
  510. catch (Exception ex)
  511. {
  512. //await _dingDing.SendBotMsg($"OS,{_option.Location},\n{ex.Message}{ex.StackTrace}{jsonElement.ToJsonString()}{userid}{__school}", GroupNames.醍摩豆服務運維群組);
  513. return Ok(new { error = 1 });
  514. }
  515. }
  516. public record DimensionCount
  517. {
  518. public string dimension { get; set; }
  519. public int count { get; set; }
  520. }
  521. public record AbilityCount
  522. {
  523. public string abilityId { get; set; }
  524. public string abilityName { get; set; }
  525. public string dimension { get; set; }
  526. public string abilityNo { get; set; }
  527. public string abilityEnv { get; set; }
  528. public int count { get; set; }
  529. }
  530. public record SchoolCount
  531. {
  532. public string name { get; set; }
  533. public string id { get; set; }
  534. public string picture { get; set; }
  535. public int teacherCount { get; set; }
  536. public int joinCount { get; set; }
  537. public int doneCount { get; set; }
  538. public int videoTime { get; set; }
  539. //人数
  540. ///线上完成人数
  541. public int onlineTeacherCount { get; set; }
  542. ///线下完成人数
  543. public int offlineTeacherCount { get; set; }
  544. ///应用考核完成人数
  545. public int schoolScoreTeacherCount { get; set; }
  546. //课堂实录完成人数
  547. public int classVideoTeacherCount { get; set; }
  548. ///学时
  549. ///线上完成学时
  550. public int onlineTeacherTime { get; set; }
  551. ///线下完成学时
  552. public int offlineTeacherTime { get; set; }
  553. ///应用考核完成学时
  554. public int schoolScoreTeacherTime { get; set; }
  555. //课堂实录完成学时
  556. public int classVideoTeacherTime { get; set; }
  557. }
  558. public record TeacherStatistic
  559. {
  560. public List<SubStatistic> subs { get; set; }
  561. public string tmdname { get; set; }
  562. public string tmdid { get; set; }
  563. public string picture { get; set; }
  564. public List<TeacherGroup> groups { get; set; } = new List<TeacherGroup>();
  565. public int alltime { get; set; }
  566. public int allAbilityCount { get; set; }
  567. public int onlineTime { get; set; }
  568. public int offlinelTime { get; set; }
  569. public int schoolScoreTime { get; set; }
  570. public int classVideoTime { get; set; }
  571. public int tchSubmitCount { get; set; }
  572. public int tchUnSubmitCount { get; set; }
  573. public int thcSubCount { get; set; }
  574. public int thcSubDoneCount { get; set; }
  575. public int hasAbilityExercise { get; set; }
  576. public int onlineCount { get; set; }
  577. public int offlineSchoolCount { get; set; }
  578. public int offlineAreaCount { get; set; }
  579. public int offlineSchoolDoneCount { get; set; }
  580. public int offlineAreaDoneCount { get; set; }
  581. public int examCount { get; set; }
  582. public int voteCount { get; set; }
  583. public int surveyCount { get; set; }
  584. public int examDoneCount { get; set; }
  585. public int voteDoneCount { get; set; }
  586. public int surveyDoneCount { get; set; }
  587. public int examAreaCount { get; set; }
  588. public int voteAreaCount { get; set; }
  589. public int surveyAreaCount { get; set; }
  590. public int examAreaDoneCount { get; set; }
  591. public int voteAreaDoneCount { get; set; }
  592. public int surveyAreaDoneCount { get; set; }
  593. public int videoTime { get; set; }
  594. }
  595. public record SubStatistic
  596. {
  597. public string abilityId { get; set; }
  598. public string code { get; set; }
  599. public int uploadCount { get; set; }
  600. public int otherScoreCount { get; set; }
  601. public int self { get; set; }
  602. public int comidCount { get; set; }
  603. public string abilityName { get; set; }
  604. public string no { get; set; }
  605. public string dimension { get; set; }
  606. public string env { get; set; }
  607. }
  608. public record TeacherGroup
  609. {
  610. public string groupName { get; set; }
  611. public string groupId { get; set; }
  612. }
  613. }
  614. }