StudyStatisController.cs 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  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<GroupList> tchLists = new List<GroupList>();
  157. await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<GroupList>(queryText: $"select value(c) from c where c.type='research' ",
  158. requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"GroupList-{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<RMember> tmdInfos, List<RGroupList> classInfos) = await GroupListService.GetStutmdidListids(client, _dingDing, ids, $"{school}");
  169. // (List<TmdInfo> tmdInfos, List<ClassListInfo> classInfos) = await TriggerStuActivity.GetTchList(client, _dingDing, ids, $"{school}");
  170. //总人数
  171. int teacherCount1 = tmdInfos.Count;
  172. List<TeacherStatistic> groupMembers = new();
  173. foreach (var tmd in tmdInfos)
  174. {
  175. await foreach (var sub in client.GetContainer("TEAMModelOS", "Teacher")
  176. .GetItemQueryIterator<AbilitySub>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilitySub-{schoolitem.id}-{tmd.id}") }))
  177. {
  178. abilitySubs.Add(sub);
  179. }
  180. //总学时
  181. int alltime = 0;
  182. //已学习的能力点
  183. int allAbilityCount = 0;
  184. //获得的在线学时
  185. int onlineTime = 0;
  186. //获得的线下学时
  187. int offlinelTime = 0;
  188. //获得的作品提交,并通过学校评审的学时
  189. int schoolScoreTime = 0;
  190. //获得的课堂实录
  191. int classVideoTime = 0;
  192. //教师应提交的作品数量
  193. int tchSubmitCount = 0;
  194. //教师未提交的作品数量
  195. int tchUnSubmitCount = 0;
  196. //通过能力点自测的数量
  197. int hasAbilityExercise = 0;
  198. //教师订阅的能力点数量
  199. int thcSubCount = 0;
  200. //教师完成能力点学校的数量
  201. int thcSubDoneCount = 0;
  202. //参加校本线下研修的活动
  203. int offlineSchoolCount = 0;
  204. //参加区级线下研修的活动
  205. int offlineAreaCount = 0;
  206. //完成的校本线下研修活动
  207. int offlineSchoolDoneCount = 0;
  208. //完成的区级线下研修或的
  209. int offlineAreaDoneCount = 0;
  210. int examCount = 0;
  211. int voteCount = 0;
  212. int surveyCount = 0;
  213. int examDoneCount = 0;
  214. int voteDoneCount = 0;
  215. int surveyDoneCount = 0;
  216. int examAreaCount = 0;
  217. int voteAreaCount = 0;
  218. int surveyAreaCount = 0;
  219. int examAreaDoneCount = 0;
  220. int voteAreaDoneCount = 0;
  221. int surveyAreaDoneCount = 0;
  222. 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}") }))
  223. {
  224. if (item.taskStatus > 0)
  225. {
  226. offlinelTime += 1;
  227. }
  228. if (!string.IsNullOrEmpty(item.owner))
  229. {
  230. if (item.owner.Equals("school"))
  231. {
  232. offlineSchoolCount += 1;
  233. if (item.taskStatus > 0)
  234. {
  235. offlineSchoolDoneCount += 1;
  236. }
  237. }
  238. else if (item.owner.Equals("area"))
  239. {
  240. offlineAreaCount += 1;
  241. if (item.taskStatus > 0)
  242. {
  243. offlineAreaDoneCount += 1;
  244. }
  245. }
  246. }
  247. }
  248. 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}") }))
  249. {
  250. if (item.owner.Equals("school"))
  251. {
  252. examCount += 1;
  253. if (item.taskStatus > 0)
  254. {
  255. examDoneCount += 1;
  256. }
  257. }
  258. if (item.owner.Equals("area"))
  259. {
  260. examAreaCount += 1;
  261. if (item.taskStatus > 0)
  262. {
  263. examAreaDoneCount += 1;
  264. }
  265. }
  266. }
  267. await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher")
  268. .GetItemQueryIterator<StuActivity>(queryText: $"select c.owner, c.taskStatus from c where c.type = 'Survey' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Activity-{tmd.id}") }))
  269. {
  270. if (item.owner.Equals("school"))
  271. {
  272. surveyCount += 1;
  273. if (item.taskStatus > 0)
  274. {
  275. surveyDoneCount += 1;
  276. }
  277. }
  278. if (item.owner.Equals("area"))
  279. {
  280. surveyAreaCount += 1;
  281. if (item.taskStatus > 0)
  282. {
  283. surveyAreaDoneCount += 1;
  284. }
  285. }
  286. }
  287. 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}") }))
  288. {
  289. if (item.owner.Equals("school"))
  290. {
  291. voteCount += 1;
  292. if (item.taskStatus > 0)
  293. {
  294. voteDoneCount += 1;
  295. }
  296. }
  297. if (item.owner.Equals("area"))
  298. {
  299. voteAreaCount += 1;
  300. if (item.taskStatus > 0)
  301. {
  302. voteAreaDoneCount += 1;
  303. }
  304. }
  305. }
  306. bool isJoinVideo = false;
  307. ClassVideo classVideo = classVideos.Find(x => x.id.Equals(tmd.id));
  308. if (classVideo != null && classVideo.files.IsNotEmpty())
  309. {
  310. isJoinVideo = true;
  311. classVideo.files.ForEach(x =>
  312. {
  313. if (x.score > 0)
  314. {
  315. classVideoTime += 1;
  316. }
  317. });
  318. }
  319. List<SubStatistic> subs = new();
  320. abilitySubs.Where(x => x.code.Equals($"AbilitySub-{schoolitem.id}-{tmd.id}")).ToList().ForEach(item =>
  321. {
  322. subCount += 1;
  323. thcSubCount += 1;
  324. if (item.exerciseScore > 0)
  325. {
  326. hasAbilityExercise += 1;
  327. }
  328. if (item.uploads.IsNotEmpty())
  329. {
  330. //已经有作品提交的
  331. hasSubmitCount += 1;
  332. tchSubmitCount += 1;
  333. }
  334. else
  335. {
  336. //未提交作品的
  337. unSubmitCount += 1;
  338. tchUnSubmitCount += 1;
  339. }
  340. if (!item.done)
  341. {
  342. unDoneCount += 1;
  343. }
  344. else
  345. {
  346. thcSubDoneCount += 1;
  347. }
  348. allAbilityCount += item.abilityCount;
  349. //onlineTime += item.hour;
  350. int vtime = (int)item.videoRcds.Sum(x => x.time);
  351. videoTime += vtime;
  352. schoolVideoTime = schoolVideoTime + vtime;
  353. int lesson = vtime / setting.lessonMinutes;
  354. onlineTime += lesson;
  355. if (item.otherScore.IsNotEmpty())
  356. {
  357. var schoolScore = item.otherScore.Where(x => x.roleType.Equals("school")).FirstOrDefault();
  358. if (schoolScore != null)
  359. {
  360. if (schoolScore.score > 0)
  361. {
  362. okCount += 1;
  363. schoolScoreTime += 1;
  364. }
  365. else
  366. {
  367. hasScoreCount += 1;
  368. }
  369. }
  370. }
  371. Ability ability = abilities.Find(x => x.id.Equals(item.id));
  372. if (ability != null)
  373. {
  374. subs.Add(new SubStatistic
  375. {
  376. abilityId = item.id,
  377. code = item.code,
  378. uploadCount = item.uploads.IsNotEmpty() ? item.uploads.Count : 0,
  379. otherScoreCount = item.otherScore.IsNotEmpty() ? item.otherScore.Count : 0,
  380. comidCount = 0,
  381. self = item.self,
  382. abilityName = ability.name,
  383. no = ability.no,
  384. dimension = ability.dimension,
  385. env = ability.env
  386. });
  387. }
  388. });
  389. //处理单项 超标准 学时
  390. alltime += onlineTime >= setting.onlineTime ? setting.onlineTime : onlineTime;
  391. alltime += offlinelTime >= setting.offlineTime ? setting.offlineTime : offlinelTime;
  392. alltime += schoolScoreTime >= setting.submitTime ? setting.submitTime : schoolScoreTime;
  393. alltime += classVideoTime >= setting.classTime ? setting.classTime : classVideoTime;
  394. //人数
  395. onlineTeacherCount = onlineTime >= setting.onlineTime ? onlineTeacherCount + 1 : onlineTeacherCount;
  396. offlineTeacherCount = offlinelTime >= setting.offlineTime ? offlineTeacherCount + 1 : offlineTeacherCount;
  397. schoolScoreTeacherCount = schoolScoreTime >= setting.submitTime ? schoolScoreTeacherCount + 1 : schoolScoreTeacherCount;
  398. classVideoTeacherCount = classVideoTime >= setting.classTime ? classVideoTeacherCount + 1 : classVideoTeacherCount;
  399. //学时
  400. onlineTeacherTime = onlineTime >= setting.onlineTime ? onlineTeacherTime + setting.onlineTime : onlineTeacherTime + onlineTime;
  401. offlineTeacherTime = offlinelTime >= setting.offlineTime ? offlineTeacherTime + setting.offlineTime : offlineTeacherTime + offlinelTime;
  402. schoolScoreTeacherTime = schoolScoreTime >= setting.submitTime ? schoolScoreTeacherTime + setting.submitTime : schoolScoreTeacherTime + schoolScoreTime;
  403. classVideoTeacherTime = classVideoTime >= setting.classTime ? classVideoTeacherTime + setting.classTime : classVideoTeacherTime + classVideoTime;
  404. if (alltime >= setting.allTime)
  405. {
  406. ok50TimeCount += 1;
  407. }
  408. var classes = classInfos.Where(y => y.members.Select(z => z.id).Contains(tmd.id)).ToList();
  409. //表示有订阅,或者有线下活动参与的,或者有课堂实录视频上传的
  410. if (subs.Count > 0 || schoolScoreTime > 0 || isJoinVideo)
  411. {
  412. //参训人数表示
  413. joinCount += 1;
  414. groupMembers.Add(new TeacherStatistic
  415. {
  416. tchSubmitCount = tchSubmitCount,
  417. tchUnSubmitCount = tchUnSubmitCount,
  418. thcSubCount = thcSubCount,
  419. tmdname = tmd.name,
  420. tmdid = tmd.id,
  421. picture = tmd.picture,
  422. groups = classes.Select(x => new TeacherGroup { groupId = x.id, groupName = x.name }).ToList(),
  423. subs = subs,
  424. alltime = alltime,
  425. allAbilityCount = allAbilityCount,
  426. onlineTime = onlineTime,
  427. offlinelTime = offlinelTime,
  428. schoolScoreTime = schoolScoreTime,
  429. classVideoTime = classVideoTime,
  430. hasAbilityExercise = hasAbilityExercise,
  431. thcSubDoneCount = thcSubDoneCount,
  432. offlineSchoolCount = offlineSchoolCount,
  433. offlineAreaCount = offlineAreaCount,
  434. offlineSchoolDoneCount = offlineSchoolDoneCount,
  435. offlineAreaDoneCount = offlineAreaDoneCount,
  436. examCount = examCount,
  437. voteCount = voteCount,
  438. surveyCount = surveyCount,
  439. examDoneCount = examDoneCount,
  440. voteDoneCount = voteDoneCount,
  441. surveyDoneCount = surveyDoneCount,
  442. examAreaCount = examAreaCount,
  443. voteAreaCount = voteAreaCount,
  444. surveyAreaCount = surveyAreaCount,
  445. examAreaDoneCount = examAreaDoneCount,
  446. voteAreaDoneCount = voteAreaDoneCount,
  447. surveyAreaDoneCount = surveyAreaDoneCount,
  448. videoTime = videoTime
  449. });
  450. }
  451. }
  452. List<DimensionCount> dimensionCount = new List<DimensionCount>();
  453. foreach (var dms in dimensions)
  454. {
  455. var list = groupMembers.SelectMany(x => x.subs.Where(y => y.dimension.Equals(dms))).ToList();
  456. dimensionCount.Add(new DimensionCount { dimension = dms, count = list.IsNotEmpty() ? list.Count : 0 });
  457. }
  458. List<AbilityCount> abilityCount = new List<AbilityCount>();
  459. foreach (var abilityId in abilitie_Id)
  460. {
  461. var list = groupMembers.SelectMany(x => x.subs.Where(y => y.abilityId.Equals(abilityId))).ToList();
  462. Ability ability = abilities.Find(x => x.id.Equals(abilityId));
  463. abilityCount.Add(new AbilityCount { abilityId = abilityId, abilityName = ability.name, dimension = ability.dimension, abilityNo = ability.no, abilityEnv = ability.env, count = list.IsNotEmpty() ? list.Count : 0 });
  464. }
  465. SchoolCount schoolCountModel = new SchoolCount
  466. {
  467. name = schoolitem.name,
  468. id = schoolitem.id,
  469. picture = schoolitem.picture,
  470. doneCount = ok50TimeCount,
  471. joinCount = joinCount,
  472. teacherCount = teacherCount,
  473. onlineTeacherTime = onlineTeacherTime,
  474. offlineTeacherTime = offlineTeacherTime,
  475. schoolScoreTeacherTime = schoolScoreTeacherTime,
  476. classVideoTeacherTime = classVideoTeacherTime,
  477. onlineTeacherCount = onlineTeacherCount,
  478. offlineTeacherCount = offlineTeacherCount,
  479. schoolScoreTeacherCount = schoolScoreTeacherCount,
  480. classVideoTeacherCount = classVideoTeacherCount,
  481. videoTime = schoolVideoTime
  482. };
  483. }
  484. Dictionary<string, Study> dict = new Dictionary<string, Study>();
  485. studies.ForEach(x => {
  486. dict[x.id] = x;
  487. });
  488. var studyTypes = dict.Values.ToList().GroupBy(x => x.type).Select(y => new { type = y.Key, count = y.Count() });
  489. return Ok(new
  490. {
  491. setting,
  492. areaDimensionCount,
  493. areaAbilityCounts,
  494. teacherCount,
  495. joinCount,
  496. schoolCount,
  497. videoTime,
  498. schoolDatas,
  499. onlineTeacherCount,
  500. offlineTeacherCount,
  501. schoolScoreTeacherCount,
  502. classVideoTeacherCount,
  503. studyTypes,
  504. onlineTeacherTime,
  505. offlineTeacherTime,
  506. schoolScoreTeacherTime,
  507. classVideoTeacherTime,
  508. ok50TimeCount
  509. });
  510. }
  511. catch (Exception ex)
  512. {
  513. //await _dingDing.SendBotMsg($"OS,{_option.Location},\n{ex.Message}{ex.StackTrace}{jsonElement.ToJsonString()}{userid}{__school}", GroupNames.醍摩豆服務運維群組);
  514. return Ok(new { error = 1 });
  515. }
  516. }
  517. public record DimensionCount
  518. {
  519. public string dimension { get; set; }
  520. public int count { get; set; }
  521. }
  522. public record AbilityCount
  523. {
  524. public string abilityId { get; set; }
  525. public string abilityName { get; set; }
  526. public string dimension { get; set; }
  527. public string abilityNo { get; set; }
  528. public string abilityEnv { get; set; }
  529. public int count { get; set; }
  530. }
  531. public record SchoolCount
  532. {
  533. public string name { get; set; }
  534. public string id { get; set; }
  535. public string picture { get; set; }
  536. public int teacherCount { get; set; }
  537. public int joinCount { get; set; }
  538. public int doneCount { get; set; }
  539. public int videoTime { get; set; }
  540. //人数
  541. ///线上完成人数
  542. public int onlineTeacherCount { get; set; }
  543. ///线下完成人数
  544. public int offlineTeacherCount { get; set; }
  545. ///应用考核完成人数
  546. public int schoolScoreTeacherCount { get; set; }
  547. //课堂实录完成人数
  548. public int classVideoTeacherCount { get; set; }
  549. ///学时
  550. ///线上完成学时
  551. public int onlineTeacherTime { get; set; }
  552. ///线下完成学时
  553. public int offlineTeacherTime { get; set; }
  554. ///应用考核完成学时
  555. public int schoolScoreTeacherTime { get; set; }
  556. //课堂实录完成学时
  557. public int classVideoTeacherTime { get; set; }
  558. }
  559. public record TeacherStatistic
  560. {
  561. public List<SubStatistic> subs { get; set; }
  562. public string tmdname { get; set; }
  563. public string tmdid { get; set; }
  564. public string picture { get; set; }
  565. public List<TeacherGroup> groups { get; set; } = new List<TeacherGroup>();
  566. public int alltime { get; set; }
  567. public int allAbilityCount { get; set; }
  568. public int onlineTime { get; set; }
  569. public int offlinelTime { get; set; }
  570. public int schoolScoreTime { get; set; }
  571. public int classVideoTime { get; set; }
  572. public int tchSubmitCount { get; set; }
  573. public int tchUnSubmitCount { get; set; }
  574. public int thcSubCount { get; set; }
  575. public int thcSubDoneCount { get; set; }
  576. public int hasAbilityExercise { get; set; }
  577. public int onlineCount { get; set; }
  578. public int offlineSchoolCount { get; set; }
  579. public int offlineAreaCount { get; set; }
  580. public int offlineSchoolDoneCount { get; set; }
  581. public int offlineAreaDoneCount { get; set; }
  582. public int examCount { get; set; }
  583. public int voteCount { get; set; }
  584. public int surveyCount { get; set; }
  585. public int examDoneCount { get; set; }
  586. public int voteDoneCount { get; set; }
  587. public int surveyDoneCount { get; set; }
  588. public int examAreaCount { get; set; }
  589. public int voteAreaCount { get; set; }
  590. public int surveyAreaCount { get; set; }
  591. public int examAreaDoneCount { get; set; }
  592. public int voteAreaDoneCount { get; set; }
  593. public int surveyAreaDoneCount { get; set; }
  594. public int videoTime { get; set; }
  595. }
  596. public record SubStatistic
  597. {
  598. public string abilityId { get; set; }
  599. public string code { get; set; }
  600. public int uploadCount { get; set; }
  601. public int otherScoreCount { get; set; }
  602. public int self { get; set; }
  603. public int comidCount { get; set; }
  604. public string abilityName { get; set; }
  605. public string no { get; set; }
  606. public string dimension { get; set; }
  607. public string env { get; set; }
  608. }
  609. public record TeacherGroup
  610. {
  611. public string groupName { get; set; }
  612. public string groupId { get; set; }
  613. }
  614. }
  615. }