You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

200 lines
6.1 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.EducationalAdministration;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System;
  8. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  12. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  13. /// 创 建:超级管理员
  14. /// 日 期:2020-04-16 15:52
  15. /// 描 述:班级自诊打卡
  16. /// </summary>
  17. public class ThermographyController : MvcControllerBase
  18. {
  19. private ThermographyIBLL thermographyIBLL = new ThermographyBLL();
  20. private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL();
  21. #region 视图功能
  22. /// <summary>
  23. /// 主页面
  24. /// <summary>
  25. /// <returns></returns>
  26. [HttpGet]
  27. public ActionResult Index()
  28. {
  29. return View();
  30. }
  31. /// <summary>
  32. /// 主页面【提交】
  33. /// <summary>
  34. /// <returns></returns>
  35. [HttpGet]
  36. public ActionResult SubmitIndex()
  37. {
  38. return View();
  39. }
  40. /// <summary>
  41. /// 表单页
  42. /// <summary>
  43. /// <returns></returns>
  44. [HttpGet]
  45. public ActionResult Form()
  46. {
  47. return View();
  48. }
  49. /// <summary>
  50. /// 班级自诊打卡统计
  51. /// <summary>
  52. /// <returns></returns>
  53. [HttpGet]
  54. public ActionResult StatisticIndex()
  55. {
  56. return View();
  57. }
  58. #endregion
  59. #region 获取数据
  60. /// <summary>
  61. /// 获取页面显示列表分页数据
  62. /// <summary>
  63. /// <param name="pagination">分页参数</param>
  64. /// <param name="queryJson">查询参数</param>
  65. /// <returns></returns>
  66. [HttpGet]
  67. [AjaxOnly]
  68. public ActionResult GetPageList(string pagination, string queryJson)
  69. {
  70. Pagination paginationobj = pagination.ToObject<Pagination>();
  71. var data = thermographyIBLL.GetPageList(paginationobj, queryJson);
  72. var jsonData = new
  73. {
  74. rows = data,
  75. total = paginationobj.total,
  76. page = paginationobj.page,
  77. records = paginationobj.records
  78. };
  79. return Success(jsonData);
  80. }
  81. /// <summary>
  82. /// 获取页面显示列表数据
  83. /// <summary>
  84. /// <param name="queryJson">查询参数</param>
  85. /// <returns></returns>
  86. [HttpGet]
  87. [AjaxOnly]
  88. public ActionResult GetList(string queryJson)
  89. {
  90. var data = thermographyIBLL.GetList(queryJson);
  91. return Success(data);
  92. }
  93. /// <summary>
  94. /// 获取表单数据
  95. /// <summary>
  96. /// <returns></returns>
  97. [HttpGet]
  98. [AjaxOnly]
  99. public ActionResult GetFormData(string keyValue)
  100. {
  101. var ThermographyData = thermographyIBLL.GetThermographyEntity(keyValue);
  102. var jsonData = new
  103. {
  104. Thermography = ThermographyData,
  105. };
  106. return Success(jsonData);
  107. }
  108. /// <summary>
  109. /// 获取页面显示列表分页数据
  110. /// <summary>
  111. /// <param name="pagination">分页参数</param>
  112. /// <param name="queryJson">查询参数</param>
  113. /// <returns></returns>
  114. [HttpGet]
  115. [AjaxOnly]
  116. public ActionResult GetPageListOfStudent(string queryJson)
  117. {
  118. var data = thermographyIBLL.GetPageListOfStudent(queryJson).OrderBy(x => x.PersonBeingMeasured);
  119. return Success(data);
  120. }
  121. /// <summary>
  122. /// 获取页面显示列表数据
  123. /// <summary>
  124. /// <param name="queryJson">查询参数</param>
  125. /// <returns></returns>
  126. [HttpGet]
  127. [AjaxOnly]
  128. public ActionResult GetListOfStatistic(string queryJson)
  129. {
  130. var data = thermographyIBLL.GetListOfStatistic(queryJson).OrderByDescending(x => x.MeasureDate).ThenByDescending(x => x.MeasureTime).ThenBy(x => x.ClassNo);
  131. return Success(data);
  132. }
  133. #endregion
  134. #region 提交数据
  135. /// <summary>
  136. /// 删除实体数据
  137. /// <param name="keyValue">主键</param>
  138. /// <summary>
  139. /// <returns></returns>
  140. [HttpPost]
  141. [AjaxOnly]
  142. public ActionResult DeleteForm(string keyValue)
  143. {
  144. thermographyIBLL.DeleteEntity(keyValue);
  145. return Success("删除成功!");
  146. }
  147. /// <summary>
  148. /// 保存实体数据(新增、修改)
  149. /// <param name="keyValue">主键</param>
  150. /// <summary>
  151. /// <returns></returns>
  152. [HttpPost]
  153. [ValidateAntiForgeryToken]
  154. [AjaxOnly]
  155. public ActionResult SaveForm(string keyValue, string strEntity)
  156. {
  157. UserInfo userInfo = LoginUserInfo.Get();
  158. ThermographyEntity entity = strEntity.ToObject<ThermographyEntity>();
  159. thermographyIBLL.SaveEntity(userInfo, keyValue, entity);
  160. return Success("保存成功!");
  161. }
  162. /// <summary>
  163. /// 生成上午批次的测量体温人员
  164. /// </summary>
  165. /// <param name="timeType"></param>
  166. /// <returns></returns>
  167. public ActionResult CreateMorningStudents(string timeType)
  168. {
  169. thermographyIBLL.CreateMorningStudents(timeType);
  170. return Success("生成成功");
  171. }
  172. /// <summary>
  173. /// 提交实体数据
  174. /// <param name="keyValue">主键</param>
  175. /// <summary>
  176. /// <returns></returns>
  177. [HttpPost]
  178. [AjaxOnly]
  179. public ActionResult DoSave(string measureTime, string rowdatas)
  180. {
  181. var userInfo = LoginUserInfo.Get();
  182. var entities = rowdatas.ToObject<List<ThermographyEntity>>();
  183. thermographyIBLL.SaveEntityList(measureTime, entities);
  184. return Success("提交成功!");
  185. }
  186. #endregion
  187. }
  188. }