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.
 
 
 
 
 
 

204 lines
6.1 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. using Learun.Application.TwoDevelopment.EducationalAdministration;
  9. namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
  10. {
  11. /// <summary>
  12. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  13. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  14. /// 创 建:超级管理员
  15. /// 日 期:2020-02-03 14:37
  16. /// 描 述:疫情记录
  17. /// </summary>
  18. public class EpidemicReportController : MvcControllerBase
  19. {
  20. private EpidemicSituationIBLL epidemicSituationIBLL = new EpidemicSituationBLL();
  21. private DataItemIBLL dataItemIbll = new DataItemBLL();
  22. private DataSourceIBLL dataSourceIbll=new DataSourceBLL();
  23. private DIC_PROVINCEIBLL dicProvinceibll=new DIC_PROVINCEBLL();
  24. #region 视图功能
  25. /// <summary>
  26. /// 外出原因统计
  27. /// </summary>
  28. /// <returns></returns>
  29. [HttpGet]
  30. public ActionResult OutReasonReport()
  31. {
  32. return View();
  33. }
  34. /// <summary>
  35. /// 人员类别统计
  36. /// </summary>
  37. /// <returns></returns>
  38. [HttpGet]
  39. public ActionResult PersonnelCategoryReport()
  40. {
  41. return View();
  42. }
  43. /// <summary>
  44. /// 各省份人数统计
  45. /// </summary>
  46. /// <returns></returns>
  47. [HttpGet]
  48. public ActionResult ProviceReport()
  49. {
  50. return View();
  51. }
  52. /// <summary>
  53. /// 交通工具人数统计
  54. /// </summary>
  55. /// <returns></returns>
  56. [HttpGet]
  57. public ActionResult VehicleReport()
  58. {
  59. return View();
  60. }
  61. #endregion
  62. #region 获取数据
  63. public ActionResult OutReasonReportList()
  64. {
  65. var dataItemList = dataItemIbll.GetDetailList("OutReason");
  66. var data = epidemicSituationIBLL.GetList("{}");
  67. var list = data.GroupBy(a => a.OutReason).Select(a => new
  68. {
  69. name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString())?.F_ItemName,
  70. value = a.Count()
  71. });
  72. return Success(list);
  73. }
  74. public ActionResult OutReasonReportData()
  75. {
  76. var dataItemList = dataItemIbll.GetDetailList("OutReason");
  77. var data = epidemicSituationIBLL.GetList("{}");
  78. var list = data.GroupBy(a => a.OutReason).Select(a => new
  79. {
  80. name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString())?.F_ItemName,
  81. value = a.Count()
  82. });
  83. var rdata = new
  84. {
  85. name = list.Select(a => a.name),
  86. value = list.Select(a => a.value)
  87. };
  88. return Success(rdata);
  89. }
  90. public ActionResult PersonnelCategoryReportList()
  91. {
  92. var dataItemList = dataItemIbll.GetDetailList("EUserType");
  93. var data = epidemicSituationIBLL.GetList("{}");
  94. var list = data.GroupBy(a => a.Type).Select(a => new
  95. {
  96. name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString())?.F_ItemName,
  97. value = a.Count()
  98. });
  99. return Success(list);
  100. }
  101. public ActionResult PersonnelCategoryReportData()
  102. {
  103. var dataItemList = dataItemIbll.GetDetailList("EUserType");
  104. var data = epidemicSituationIBLL.GetList("{}");
  105. var list = data.GroupBy(a => a.Type).Select(a => new
  106. {
  107. name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString())?.F_ItemName,
  108. value = a.Count()
  109. });
  110. var rdata = new
  111. {
  112. name = list.Select(a => a.name),
  113. value = list.Select(a => a.value)
  114. };
  115. return Success(rdata);
  116. }
  117. public ActionResult ProviceReportList()
  118. {
  119. var data = epidemicSituationIBLL.GetList("{}");
  120. var list = data.GroupBy(a => a.Provice).Select(a => new
  121. {
  122. name = dicProvinceibll.GetDIC_PROVINCEEntityByCode(a.Key.ToString())?.PNAME,
  123. value = a.Count()
  124. });
  125. return Success(list);
  126. }
  127. public ActionResult ProviceReportData()
  128. {
  129. var data = epidemicSituationIBLL.GetList("{}");
  130. var list = data.GroupBy(a => a.Provice).Select(a => new
  131. {
  132. name = dicProvinceibll.GetDIC_PROVINCEEntityByCode(a.Key.ToString())?.PNAME,
  133. value = a.Count()
  134. });
  135. var rdata = new
  136. {
  137. name = list.Select(a => a.name),
  138. value = list.Select(a => a.value)
  139. };
  140. return Success(rdata);
  141. }
  142. public ActionResult VehicleReportList()
  143. {
  144. var dataItemList = dataItemIbll.GetDetailList("Vehicle");
  145. var data = epidemicSituationIBLL.GetList("{}");
  146. var list = data.GroupBy(a => a.Vehicle).Select(a => new
  147. {
  148. name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString())?.F_ItemName,
  149. value = a.Count()
  150. });
  151. return Success(list);
  152. }
  153. public ActionResult VehicleReportData()
  154. {
  155. var dataItemList = dataItemIbll.GetDetailList("Vehicle");
  156. var data = epidemicSituationIBLL.GetList("{}");
  157. var list = data.GroupBy(a => a.Vehicle).Select(a => new
  158. {
  159. name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString())?.F_ItemName,
  160. value = a.Count()
  161. });
  162. var rdata = new
  163. {
  164. name = list.Select(a => a.name),
  165. value = list.Select(a => a.value)
  166. };
  167. return Success(rdata);
  168. }
  169. #endregion
  170. }
  171. }