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.
 
 
 
 
 
 

281 lines
9.3 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 EpidemicSituationCopyController : MvcControllerBase
  19. {
  20. private EpidemicSituationIBLL epidemicSituationIBLL = new EpidemicSituationBLL();
  21. private DataItemIBLL dataItemIbll = new DataItemBLL();
  22. private CdDeptIBLL cdDeptIbll = new CdDeptBLL();
  23. private CdMajorIBLL cdMajorIbll = new CdMajorBLL();
  24. private ClassInfoIBLL classInfoIbll = new ClassInfoBLL();
  25. private StuInfoBasicIBLL stuInfoBasicIbll = new StuInfoBasicBLL();
  26. private EmpInfoIBLL empInfoIBLL = new EmpInfoBLL();
  27. #region 视图功能
  28. /// <summary>
  29. /// 主页面
  30. /// <summary>
  31. /// <returns></returns>
  32. [HttpGet]
  33. public ActionResult Index()
  34. {
  35. return View();
  36. }
  37. /// <summary>
  38. /// 统计
  39. /// <summary>
  40. /// <returns></returns>
  41. [HttpGet]
  42. public ActionResult IndexReport()
  43. {
  44. return View();
  45. }
  46. /// <summary>
  47. /// 表单页
  48. /// <summary>
  49. /// <returns></returns>
  50. [HttpGet]
  51. public ActionResult Form()
  52. {
  53. return View();
  54. }
  55. /// <summary>
  56. /// 外出原因统计
  57. /// </summary>
  58. /// <returns></returns>
  59. [HttpGet]
  60. public ActionResult OutReasonReport()
  61. {
  62. return View();
  63. }
  64. /// <summary>
  65. /// 人员类别统计
  66. /// </summary>
  67. /// <returns></returns>
  68. [HttpGet]
  69. public ActionResult PersonnelCategoryReport()
  70. {
  71. return View();
  72. }
  73. /// <summary>
  74. /// 各省份人数统计
  75. /// </summary>
  76. /// <returns></returns>
  77. [HttpGet]
  78. public ActionResult ProviceReport()
  79. {
  80. return View();
  81. }
  82. /// <summary>
  83. /// 交通工具人数统计
  84. /// </summary>
  85. /// <returns></returns>
  86. [HttpGet]
  87. public ActionResult VehicleReport()
  88. {
  89. return View();
  90. }
  91. #endregion
  92. #region 获取数据
  93. public ActionResult GetStudentSource(string studentId)
  94. {
  95. var res = "";
  96. var stuEntity = stuInfoBasicIbll.GetStuInfoBasicEntityByStuNo(studentId);
  97. if (stuEntity != null)
  98. {
  99. var detptName = cdDeptIbll.GetCdDeptEntityByNo(stuEntity.DeptNo)?.DeptName;
  100. var majorName = cdMajorIbll.GetCdMajorEntityByMajorNo(stuEntity.MajorNo)?.MajorName;
  101. var className = classInfoIbll.GetClassInfoEntityByClassNo(stuEntity.ClassNo)?.ClassName;
  102. res = $"{detptName} {majorName} {className}";
  103. }
  104. return Success(new { res, Address = stuEntity?.MailAddress });
  105. }
  106. public ActionResult GetEmpSource(string empId)
  107. {
  108. var stuEntity = empInfoIBLL.GetEmpInfoEntity(empId);
  109. return Success(new { Address = stuEntity?.Homeaddress });
  110. }
  111. public ActionResult OutReasonReportList()
  112. {
  113. var dataItemList = dataItemIbll.GetDetailList("OutReason");
  114. var data = epidemicSituationIBLL.GetList("{}");
  115. var list = data.GroupBy(a => a.OutReason).Select(a => new
  116. {
  117. name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString()).F_ItemName,
  118. value = a.Count()
  119. });
  120. return Success(list);
  121. }
  122. public ActionResult OutReasonReportData()
  123. {
  124. var dataItemList = dataItemIbll.GetDetailList("OutReason");
  125. var data = epidemicSituationIBLL.GetList("{}");
  126. var list = data.GroupBy(a => a.OutReason).Select(a => new
  127. {
  128. name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString()).F_ItemName,
  129. value = a.Count()
  130. });
  131. var rdata = new
  132. {
  133. name = list.Select(a => a.name),
  134. value = list.Select(a => a.value)
  135. };
  136. return Success(new { list, data });
  137. }
  138. /// <summary>
  139. /// 获取页面显示列表分页数据
  140. /// <summary>
  141. /// <param name="pagination">分页参数</param>
  142. /// <param name="queryJson">查询参数</param>
  143. /// <returns></returns>
  144. [HttpGet]
  145. [AjaxOnly]
  146. public ActionResult GetPageList(string pagination, string queryJson)
  147. {
  148. Pagination paginationobj = pagination.ToObject<Pagination>();
  149. var data = epidemicSituationIBLL.GetPageList(paginationobj, queryJson);
  150. var jsonData = new
  151. {
  152. rows = data,
  153. total = paginationobj.total,
  154. page = paginationobj.page,
  155. records = paginationobj.records
  156. };
  157. return Success(jsonData);
  158. }
  159. /// <summary>
  160. /// 获取页面显示列表分页数据
  161. /// <summary>
  162. /// <param name="pagination">分页参数</param>
  163. /// <param name="queryJson">查询参数</param>
  164. /// <returns></returns>
  165. [HttpGet]
  166. [AjaxOnly]
  167. public ActionResult GetReportPageList(string pagination, string queryJson)
  168. {
  169. Pagination paginationobj = pagination.ToObject<Pagination>();
  170. var data = epidemicSituationIBLL.GetReportPageList(paginationobj, queryJson);
  171. var jsonData = new
  172. {
  173. rows = data,
  174. total = paginationobj.total,
  175. page = paginationobj.page,
  176. records = paginationobj.records
  177. };
  178. return Success(jsonData);
  179. }
  180. /// <summary>
  181. /// 获取页面显示列表数据
  182. /// <summary>
  183. /// <param name="queryJson">查询参数</param>
  184. /// <returns></returns>
  185. [HttpGet]
  186. [AjaxOnly]
  187. public ActionResult GetList(string queryJson)
  188. {
  189. var data = epidemicSituationIBLL.GetList(queryJson);
  190. return Success(data);
  191. }
  192. /// <summary>
  193. /// 获取表单数据
  194. /// <summary>
  195. /// <returns></returns>
  196. [HttpGet]
  197. [AjaxOnly]
  198. public ActionResult GetFormData(string keyValue)
  199. {
  200. var EpidemicSituationData = epidemicSituationIBLL.GetEpidemicSituationEntity(keyValue);
  201. var ContactsDetailsData = epidemicSituationIBLL.GetContactsDetailsList(EpidemicSituationData.ID);
  202. var PassPlaceData = epidemicSituationIBLL.GetPassPlaceList(EpidemicSituationData.ID);
  203. var PeopleDetailData = epidemicSituationIBLL.GetPeopleDetailslist(EpidemicSituationData.ID);
  204. var jsonData = new
  205. {
  206. EpidemicSituation = EpidemicSituationData,
  207. ContactsDetails = ContactsDetailsData,
  208. PassPlaces = PassPlaceData,
  209. PeopleDetails = PeopleDetailData
  210. };
  211. return Success(jsonData);
  212. }
  213. #endregion
  214. #region 提交数据
  215. /// <summary>
  216. /// 删除实体数据
  217. /// <param name="keyValue">主键</param>
  218. /// <summary>
  219. /// <returns></returns>
  220. [HttpPost]
  221. [AjaxOnly]
  222. public ActionResult DeleteForm(string keyValue)
  223. {
  224. epidemicSituationIBLL.DeleteEntity(keyValue);
  225. return Success("删除成功!");
  226. }
  227. /// <summary>
  228. /// 保存实体数据(新增、修改)
  229. /// <param name="keyValue">主键</param>
  230. /// <summary>
  231. /// <returns></returns>
  232. [HttpPost]
  233. [ValidateAntiForgeryToken]
  234. [AjaxOnly]
  235. public ActionResult SaveForm(string keyValue, string strEntity, string strcontactsDetailsList, string passPlaceDetailsList, string strpeopleDetailsList)
  236. {
  237. UserInfo userInfo = LoginUserInfo.Get();
  238. EpidemicSituationEntity entity = strEntity.ToObject<EpidemicSituationEntity>();
  239. if (string.IsNullOrEmpty(keyValue))
  240. {
  241. var userId = entity.Creater;
  242. if (epidemicSituationIBLL.HasTodayValue(userId))
  243. {
  244. return Success("不能重复提交");
  245. }
  246. }
  247. List<PassPlaceEntity> passDetailsList = passPlaceDetailsList.ToObject<List<PassPlaceEntity>>();
  248. List<ContactsDetailsEntity> contactsDetailsList = strcontactsDetailsList.ToObject<List<ContactsDetailsEntity>>();
  249. List<PeopleDetailsEntity> peopleDetailsList = strpeopleDetailsList.ToObject<List<PeopleDetailsEntity>>();
  250. epidemicSituationIBLL.SaveEntity(userInfo, keyValue, entity, contactsDetailsList, passDetailsList, peopleDetailsList);
  251. return Success("保存成功!");
  252. }
  253. #endregion
  254. }
  255. }