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.
 
 
 
 
 
 

203 lines
6.2 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.PersonnelManagement;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using Learun.Application.Base.SystemModule;
  8. namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  12. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  13. /// 创 建:超级管理员
  14. /// 日 期:2020-02-03 14:37
  15. /// 描 述:疫情记录
  16. /// </summary>
  17. public class EpidemicSituationController : MvcControllerBase
  18. {
  19. private EpidemicSituationIBLL epidemicSituationIBLL = new EpidemicSituationBLL();
  20. private DataItemIBLL dataItemIbll = new DataItemBLL();
  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 Form()
  37. {
  38. return View();
  39. }
  40. /// <summary>
  41. /// 外出原因统计
  42. /// </summary>
  43. /// <returns></returns>
  44. [HttpGet]
  45. public ActionResult OutReasonReport()
  46. {
  47. return View();
  48. }
  49. /// <summary>
  50. /// 人员类别统计
  51. /// </summary>
  52. /// <returns></returns>
  53. [HttpGet]
  54. public ActionResult PersonnelCategoryReport()
  55. {
  56. return View();
  57. }
  58. /// <summary>
  59. /// 各省份人数统计
  60. /// </summary>
  61. /// <returns></returns>
  62. [HttpGet]
  63. public ActionResult ProviceReport()
  64. {
  65. return View();
  66. }
  67. /// <summary>
  68. /// 交通工具人数统计
  69. /// </summary>
  70. /// <returns></returns>
  71. [HttpGet]
  72. public ActionResult VehicleReport()
  73. {
  74. return View();
  75. }
  76. #endregion
  77. #region 获取数据
  78. public ActionResult OutReasonReportList()
  79. {
  80. var dataItemList = dataItemIbll.GetDetailList("OutReason");
  81. var data = epidemicSituationIBLL.GetList("{}");
  82. var list = data.GroupBy(a => a.OutReason).Select(a => new
  83. {
  84. name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString()).F_ItemName,
  85. value = a.Count()
  86. });
  87. return Success(list);
  88. }
  89. public ActionResult OutReasonReportData()
  90. {
  91. var dataItemList = dataItemIbll.GetDetailList("OutReason");
  92. var data = epidemicSituationIBLL.GetList("{}");
  93. var list = data.GroupBy(a => a.OutReason).Select(a => new
  94. {
  95. name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString()).F_ItemName,
  96. value = a.Count()
  97. });
  98. var rdata = new
  99. {
  100. name = list.Select(a => a.name),
  101. value = list.Select(a => a.value)
  102. };
  103. return Success(new { list, data });
  104. }
  105. /// <summary>
  106. /// 获取页面显示列表分页数据
  107. /// <summary>
  108. /// <param name="pagination">分页参数</param>
  109. /// <param name="queryJson">查询参数</param>
  110. /// <returns></returns>
  111. [HttpGet]
  112. [AjaxOnly]
  113. public ActionResult GetPageList(string pagination, string queryJson)
  114. {
  115. Pagination paginationobj = pagination.ToObject<Pagination>();
  116. var data = epidemicSituationIBLL.GetPageList(paginationobj, queryJson);
  117. var jsonData = new
  118. {
  119. rows = data,
  120. total = paginationobj.total,
  121. page = paginationobj.page,
  122. records = paginationobj.records
  123. };
  124. return Success(jsonData);
  125. }
  126. /// <summary>
  127. /// 获取页面显示列表数据
  128. /// <summary>
  129. /// <param name="queryJson">查询参数</param>
  130. /// <returns></returns>
  131. [HttpGet]
  132. [AjaxOnly]
  133. public ActionResult GetList(string queryJson)
  134. {
  135. var data = epidemicSituationIBLL.GetList(queryJson);
  136. return Success(data);
  137. }
  138. /// <summary>
  139. /// 获取表单数据
  140. /// <summary>
  141. /// <returns></returns>
  142. [HttpGet]
  143. [AjaxOnly]
  144. public ActionResult GetFormData(string keyValue)
  145. {
  146. var EpidemicSituationData = epidemicSituationIBLL.GetEpidemicSituationEntity( keyValue );
  147. var ContactsDetailsData = epidemicSituationIBLL.GetContactsDetailsList( EpidemicSituationData.ID );
  148. var jsonData = new {
  149. EpidemicSituation = EpidemicSituationData,
  150. ContactsDetails = ContactsDetailsData,
  151. };
  152. return Success(jsonData);
  153. }
  154. #endregion
  155. #region 提交数据
  156. /// <summary>
  157. /// 删除实体数据
  158. /// <param name="keyValue">主键</param>
  159. /// <summary>
  160. /// <returns></returns>
  161. [HttpPost]
  162. [AjaxOnly]
  163. public ActionResult DeleteForm(string keyValue)
  164. {
  165. epidemicSituationIBLL.DeleteEntity(keyValue);
  166. return Success("删除成功!");
  167. }
  168. /// <summary>
  169. /// 保存实体数据(新增、修改)
  170. /// <param name="keyValue">主键</param>
  171. /// <summary>
  172. /// <returns></returns>
  173. [HttpPost]
  174. [ValidateAntiForgeryToken]
  175. [AjaxOnly]
  176. public ActionResult SaveForm(string keyValue, string strEntity, string strcontactsDetailsList)
  177. {
  178. UserInfo userInfo = LoginUserInfo.Get();
  179. EpidemicSituationEntity entity = strEntity.ToObject<EpidemicSituationEntity>();
  180. List<ContactsDetailsEntity> contactsDetailsList = strcontactsDetailsList.ToObject<List<ContactsDetailsEntity>>();
  181. epidemicSituationIBLL.SaveEntity(userInfo,keyValue,entity,contactsDetailsList);
  182. return Success("保存成功!");
  183. }
  184. #endregion
  185. }
  186. }